Skip to content

Commit a5fdf2e

Browse files
committed
feat: support Angular 6 l-lin#1235
1 parent 388c43c commit a5fdf2e

26 files changed

+13281
-9859
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ dist: trusty
22
sudo: required
33
language: node_js
44
node_js:
5-
- "6"
5+
- "8.11.1"
66
os:
77
- linux
88
env:

DEVELOPER.md

+18-5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ We recommend [nvm](https://github.com/creationix/nvm) or [n](https://github.com/
1515
## Clone this project
1616

1717
Clone this repo into new project folder (e.g., `my-proj`).
18+
1819
```bash
1920
git clone https://github.com/l-lin/angular-datatables
2021
cd angular-datatables
@@ -39,11 +40,21 @@ The `npm run build` command compiles the library,
3940

4041
We've captured many of the most useful commands in npm scripts defined in the `package.json`:
4142

42-
* `npm run tsc` - runs the TypeScript compiler once.
43-
* `npm run tsc:w` - runs the TypeScript compiler in watch mode; the process keeps running, awaiting changes to TypeScript files and re-compiling when it sees them.
43+
- `npm run tsc` - runs the TypeScript compiler once.
44+
- `npm run tsc:w` - runs the TypeScript compiler in watch mode; the process keeps running, awaiting changes to TypeScript files and re-compiling when it sees them.
4445
with excellent support for Angular apps that use routing.
45-
* `npm test` - compiles, runs and watches the karma unit tests
46-
* `npm build` - compiles and generate the JS files
46+
- `npm test` - compiles, runs and watches the karma unit tests
47+
- `npm build` - compiles and generate the JS files
48+
49+
### Updating dependencies version
50+
51+
We use [npm-check-updates](https://www.npmjs.org/package/npm-check-updates) to update automatically the dependencies:
52+
53+
```bash
54+
npm i -g npm-check-updates
55+
ncu -u
56+
rm -rf node_modules && npm install
57+
```
4758

4859
## Testing
4960

@@ -53,6 +64,7 @@ These tools are configured for specific conventions described below.
5364
We recommend that you shut down one before starting another.*
5465

5566
### Unit Tests
67+
5668
TypeScript unit-tests are usually in the `src` folder. Their filenames must end in `.spec`.
5769

5870
Look for the example `src/angular-datatables.directive.spec.ts`.
@@ -77,9 +89,10 @@ The `HTML-Reporter` is also wired in. That produces a prettier output; look for
7789
Run `deploy-doc.sh` to deploy the documentation to the Github Pages
7890

7991
You may need to have the following:
92+
8093
- git
8194
- have the basic commands in your OS
8295

83-
```
96+
```bash
8497
./deploy-doc.sh <version>
8598
```

demo/.angular-cli.json

-80
This file was deleted.

demo/angular.json

+172
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"angular-datatables-demo": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"architect": {
11+
"build": {
12+
"builder": "@angular-devkit/build-angular:browser",
13+
"options": {
14+
"outputPath": "dist",
15+
"index": "src/index.html",
16+
"main": "src/main.ts",
17+
"tsConfig": "src/tsconfig.app.json",
18+
"polyfills": "src/polyfills.ts",
19+
"assets": [
20+
"src/assets",
21+
"src/archives",
22+
"src/data",
23+
"src/favicon.png"
24+
],
25+
"styles": [
26+
"node_modules/datatables.net-dt/css/jquery.dataTables.css",
27+
"node_modules/datatables.net-buttons-dt/css/buttons.dataTables.css",
28+
"node_modules/datatables.net-colreorder-dt/css/colReorder.dataTables.css",
29+
"node_modules/datatables.net-responsive-dt/css/responsive.dataTables.css",
30+
"node_modules/datatables.net-select-dt/css/select.dataTables.css",
31+
"node_modules/materialize-css/dist/css/materialize.css",
32+
"src/styles.css"
33+
],
34+
"scripts": [
35+
"node_modules/jquery/dist/jquery.js",
36+
"node_modules/tether/dist/js/tether.js",
37+
"node_modules/datatables.net/js/jquery.dataTables.js",
38+
"node_modules/datatables.net-buttons/js/dataTables.buttons.js",
39+
"node_modules/datatables.net-buttons/js/buttons.colVis.js",
40+
"node_modules/datatables.net-buttons/js/buttons.flash.js",
41+
"node_modules/datatables.net-buttons/js/buttons.html5.js",
42+
"node_modules/datatables.net-buttons/js/buttons.print.js",
43+
"node_modules/datatables.net-colreorder/js/dataTables.colReorder.js",
44+
"node_modules/datatables.net-responsive/js/dataTables.responsive.js",
45+
"node_modules/datatables.net-select/js/dataTables.select.js"
46+
]
47+
},
48+
"configurations": {
49+
"production": {
50+
"optimization": true,
51+
"outputHashing": "all",
52+
"sourceMap": false,
53+
"extractCss": true,
54+
"namedChunks": false,
55+
"aot": true,
56+
"extractLicenses": true,
57+
"vendorChunk": false,
58+
"buildOptimizer": true,
59+
"fileReplacements": [
60+
{
61+
"replace": "src/environments/environment.ts",
62+
"with": "src/environments/environment.prod.ts"
63+
}
64+
]
65+
}
66+
}
67+
},
68+
"serve": {
69+
"builder": "@angular-devkit/build-angular:dev-server",
70+
"options": {
71+
"browserTarget": "angular-datatables-demo:build"
72+
},
73+
"configurations": {
74+
"production": {
75+
"browserTarget": "angular-datatables-demo:build:production"
76+
}
77+
}
78+
},
79+
"extract-i18n": {
80+
"builder": "@angular-devkit/build-angular:extract-i18n",
81+
"options": {
82+
"browserTarget": "angular-datatables-demo:build"
83+
}
84+
},
85+
"test": {
86+
"builder": "@angular-devkit/build-angular:karma",
87+
"options": {
88+
"main": "src/test.ts",
89+
"karmaConfig": "./karma.conf.js",
90+
"polyfills": "src/polyfills.ts",
91+
"tsConfig": "src/tsconfig.spec.json",
92+
"scripts": [
93+
"node_modules/jquery/dist/jquery.js",
94+
"node_modules/tether/dist/js/tether.js",
95+
"node_modules/datatables.net/js/jquery.dataTables.js",
96+
"node_modules/datatables.net-buttons/js/dataTables.buttons.js",
97+
"node_modules/datatables.net-buttons/js/buttons.colVis.js",
98+
"node_modules/datatables.net-buttons/js/buttons.flash.js",
99+
"node_modules/datatables.net-buttons/js/buttons.html5.js",
100+
"node_modules/datatables.net-buttons/js/buttons.print.js",
101+
"node_modules/datatables.net-colreorder/js/dataTables.colReorder.js",
102+
"node_modules/datatables.net-responsive/js/dataTables.responsive.js",
103+
"node_modules/datatables.net-select/js/dataTables.select.js"
104+
],
105+
"styles": [
106+
"node_modules/datatables.net-dt/css/jquery.dataTables.css",
107+
"node_modules/datatables.net-buttons-dt/css/buttons.dataTables.css",
108+
"node_modules/datatables.net-colreorder-dt/css/colReorder.dataTables.css",
109+
"node_modules/datatables.net-responsive-dt/css/responsive.dataTables.css",
110+
"node_modules/datatables.net-select-dt/css/select.dataTables.css",
111+
"node_modules/materialize-css/dist/css/materialize.css",
112+
"src/styles.css"
113+
],
114+
"assets": [
115+
"src/assets",
116+
"src/archives",
117+
"src/data",
118+
"src/favicon.png"
119+
]
120+
}
121+
},
122+
"lint": {
123+
"builder": "@angular-devkit/build-angular:tslint",
124+
"options": {
125+
"tsConfig": [
126+
"src/tsconfig.app.json",
127+
"src/tsconfig.spec.json"
128+
],
129+
"exclude": [
130+
"**/node_modules/**"
131+
]
132+
}
133+
}
134+
}
135+
},
136+
"angular-datatables-demo-e2e": {
137+
"root": "",
138+
"sourceRoot": "",
139+
"projectType": "application",
140+
"architect": {
141+
"e2e": {
142+
"builder": "@angular-devkit/build-angular:protractor",
143+
"options": {
144+
"protractorConfig": "./protractor.conf.js",
145+
"devServerTarget": "angular-datatables-demo:serve"
146+
}
147+
},
148+
"lint": {
149+
"builder": "@angular-devkit/build-angular:tslint",
150+
"options": {
151+
"tsConfig": [
152+
"e2e/tsconfig.e2e.json"
153+
],
154+
"exclude": [
155+
"**/node_modules/**"
156+
]
157+
}
158+
}
159+
}
160+
}
161+
},
162+
"defaultProject": "angular-datatables-demo",
163+
"schematics": {
164+
"@schematics/angular:component": {
165+
"prefix": "app",
166+
"styleext": "css"
167+
},
168+
"@schematics/angular:directive": {
169+
"prefix": "app"
170+
}
171+
}
172+
}

demo/karma.conf.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
module.exports = function (config) {
55
config.set({
66
basePath: '',
7-
frameworks: ['jasmine', '@angular/cli'],
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
88
plugins: [
99
require('karma-jasmine'),
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
1212
require('karma-coverage-istanbul-reporter'),
13-
require('@angular/cli/plugins/karma')
13+
require('@angular-devkit/build-angular/plugins/karma')
1414
],
1515
client:{
1616
clearContext: false // leave Jasmine Spec Runner output visible in browser
1717
},
1818
coverageIstanbulReporter: {
19-
reports: [ 'html', 'lcovonly' ],
19+
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
2020
fixWebpackSourcePaths: true
2121
},
2222
angularCli: {

0 commit comments

Comments
 (0)