Skip to content

Commit

Permalink
refactor: refresh version (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Jun 28, 2020
1 parent a47be6e commit e2da843
Show file tree
Hide file tree
Showing 20 changed files with 641 additions and 464 deletions.
17 changes: 17 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major version
last 2 iOS major versions
Firefox ESR
not IE 9-11 # For IE 9-11 support, remove 'not'.
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Ci

on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- name: install
run: npm install

- name: run
run: |
npm run build
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- name: install
run: npm install

- name: run
run: |
npm run test
cat ./coverage/lcov.info | ./node_modules/.bin/codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

lint:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- name: install
run: npm install

- name: run
run: |
npm run lint
site:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- name: install
run: npm install

- name: build
run: |
node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build --prod --base-href /ngx-highlight-js/
cp ./dist/index.html ./dist/404.html
ls ./dist
- name: deploy-to-gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

68 changes: 37 additions & 31 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
dir: require('path').join(__dirname, 'coverage'), reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
dir: require('path').join(__dirname, 'coverage'), reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
},
singleRun: false
});
};
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './public_api';
export * from './public_api';
9 changes: 9 additions & 0 deletions lib/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../publish",
"deleteDestPath": true,
"lib": {
"entryFile": "public_api.ts"
},
"whitelistedNonPeerDependencies": ["tslib", "angular"]
}
26 changes: 26 additions & 0 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "ngx-highlight-js",
"version": "10.0.0",
"description": "Simple, easy and performance countdown for angular",
"keywords": [
"ngx-highlight-js",
"ng-countdown",
"angular-countdown",
"angular countdown",
"countdown",
"count down"
],
"author": "cipchk <[email protected]>",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/cipchk/ngx-highlight-js"
},
"bugs": {
"url": "https://github.com/cipchk/ngx-highlight-js/issues"
},
"homepage": "https://cipchk.github.io/ngx-highlight-js/",
"peerDependencies": {
"@angular/core": "~10.0.0"
}
}
4 changes: 2 additions & 2 deletions lib/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { HighlightJsDirective } from './src/highlight-js.directive';
export * from './src/highlight-js.module';
export { HighlightJsDirective } from './src/highlight-js.directive';
export * from './src/highlight-js.module';
73 changes: 36 additions & 37 deletions lib/spec/directive.spec.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { HighlightJsModule } from '../src/highlight-js.module';

const html = ``;

describe('Component: ngx-highlight-js', () => {
let fixture:ComponentFixture<any>;
let context:TestNGComponent;
let element:any;
let clean:any;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [TestNGComponent],
imports: [HighlightJsModule]
});
TestBed.overrideComponent(TestNGComponent, {set: {template: html}});
fixture = TestBed.createComponent(TestNGComponent);
context = fixture.componentInstance;
element = fixture.nativeElement.querySelector('#c1');
clean = fixture.nativeElement.querySelector('#c2');
fixture.detectChanges();
});

it('fixture should not be null', () => {
expect(fixture).not.toBeNull();
});
});

@Component({
selector: 'ngx-highlight-js-test',
template: ''
})
class TestNGComponent {
}
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { HighlightJsModule } from '../src/highlight-js.module';

const html = ``;

describe('Component: ngx-highlight-js', () => {
let fixture: ComponentFixture<any>;
let context: TestNGComponent;
let element: any;
let clean: any;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [TestNGComponent],
imports: [HighlightJsModule],
});
TestBed.overrideComponent(TestNGComponent, { set: { template: html } });
fixture = TestBed.createComponent(TestNGComponent);
context = fixture.componentInstance;
element = fixture.nativeElement.querySelector('#c1');
clean = fixture.nativeElement.querySelector('#c2');
fixture.detectChanges();
});

it('fixture should not be null', () => {
expect(fixture).not.toBeNull();
});
});

@Component({
selector: 'ngx-highlight-js-test',
template: '',
})
class TestNGComponent {}
Loading

0 comments on commit e2da843

Please sign in to comment.