Skip to content
This repository was archived by the owner on Jun 22, 2020. It is now read-only.

Commit cbd2493

Browse files
m.ivanov4m.ivanov4
authored andcommitted
build: use ng-packagr 9
1 parent 26729e5 commit cbd2493

File tree

8 files changed

+734
-1165
lines changed

8 files changed

+734
-1165
lines changed

angular.json

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -87,39 +87,6 @@
8787
}
8888
}
8989
}
90-
},
91-
"table-builder": {
92-
"root": "projects/table-builder",
93-
"sourceRoot": "projects/table-builder/src",
94-
"projectType": "library",
95-
"prefix": "",
96-
"architect": {
97-
"build": {
98-
"builder": "@angular-devkit/build-ng-packagr:build",
99-
"options": {
100-
"tsConfig": "projects/table-builder/tsconfig.lib.json",
101-
"project": "projects/table-builder/ng-package.json"
102-
}
103-
},
104-
"test": {
105-
"builder": "@angular-devkit/build-angular:karma",
106-
"options": {
107-
"main": "projects/table-builder/src/test.ts",
108-
"tsConfig": "projects/table-builder/tsconfig.spec.json",
109-
"karmaConfig": "projects/table-builder/karma.conf.js"
110-
}
111-
},
112-
"lint": {
113-
"builder": "@angular-devkit/build-angular:tslint",
114-
"options": {
115-
"tsConfig": [
116-
"projects/table-builder/tsconfig.lib.json",
117-
"projects/table-builder/tsconfig.spec.json"
118-
],
119-
"exclude": ["**/node_modules/**"]
120-
}
121-
}
122-
}
12390
}
12491
},
12592
"defaultProject": "ng-table-builder"

package.json

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
{
2-
"name": "table-builder",
2+
"name": "ng-table-builder",
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
66
"build:app": "ng build --prod",
7-
"build:lib": "ng build table-builder && ts-node --project tsconfig.tools.json ./tools/copy-readme",
7+
"build:lib": "ts-node --project tools/tsconfig.tools.json tools/build && ts-node --project tools/tsconfig.tools.json ./tools/copy-readme",
88
"format": "npx sort-package-json && prettier --write \"**/*.{js,ts,html,css,scss,md,json,yml}\"",
99
"preinstall": "node -e \"if(process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('You must use Yarn to install, not NPM')\"",
1010
"lint": "eslint \"**/*.ts\"",
1111
"start": "ng serve --open --aot=false --port 4300",
1212
"test": "jest --config ./jest.config.js"
1313
},
1414
"devDependencies": {
15-
"@angular-devkit/build-angular": "0.803.5",
16-
"@angular-devkit/build-ng-packagr": "0.803.5",
15+
"@angular-devkit/build-angular": "0.803.25",
1716
"@angular-ru/eslint-config": "10.6.0",
18-
"@angular/animations": "8.2.7",
19-
"@angular/cdk": "8.2.0",
20-
"@angular/cli": "8.3.5",
21-
"@angular/common": "8.2.7",
22-
"@angular/compiler": "8.2.7",
23-
"@angular/compiler-cli": "8.2.7",
24-
"@angular/core": "8.2.7",
25-
"@angular/forms": "8.2.7",
26-
"@angular/language-service": "8.2.7",
27-
"@angular/material": "8.2.0",
28-
"@angular/platform-browser": "8.2.7",
29-
"@angular/platform-browser-dynamic": "8.2.7",
30-
"@angular/router": "8.2.7",
17+
"@angular/animations": "8.2.14",
18+
"@angular/cdk": "8.2.3",
19+
"@angular/cli": "8.3.25",
20+
"@angular/common": "8.2.14",
21+
"@angular/compiler": "8.2.14",
22+
"@angular/compiler-cli": "8.2.14",
23+
"@angular/core": "8.2.14",
24+
"@angular/forms": "8.2.14",
25+
"@angular/language-service": "8.2.14",
26+
"@angular/material": "8.2.3",
27+
"@angular/platform-browser": "8.2.14",
28+
"@angular/platform-browser-dynamic": "8.2.14",
29+
"@angular/router": "8.2.14",
3130
"@types/jest": "24.0.13",
3231
"@types/node": "12.7.5",
3332
"acorn": "6.1.1",
@@ -41,11 +40,10 @@
4140
"jest": "24.8.0",
4241
"jest-cli": "24.8.0",
4342
"jest-preset-angular": "7.1.0",
44-
"ng-packagr": "5.2.0",
43+
"ng-packagr": "9.0.3",
4544
"ngx-toastr": "10.0.4",
4645
"prettier": "1.17.1",
4746
"pretty": "2.0.0",
48-
"protractor": "5.4.0",
4947
"rxjs": "6.5.2",
5048
"sort-package-json": "1.40.0",
5149
"ts-node": "7.0.0",
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3-
"dest": "../../dist/table-builder",
43
"lib": {
54
"entryFile": "./src/public-api",
6-
"flatModuleFile": "table-builder",
7-
"umdModuleIds": {}
8-
}
5+
"flatModuleFile": "table-builder"
6+
},
7+
"dest": "../../dist/ng-table-builder"
98
}

tools/build.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { ngPackagr } from 'ng-packagr';
2+
import { join } from 'path';
3+
4+
async function buildPackage(): Promise<void> {
5+
try {
6+
await ngPackagr()
7+
.forProject(join(__dirname, '../projects/table-builder/ng-package.json'))
8+
.withTsConfig(join(__dirname, './tsconfig.lib.json'))
9+
.build();
10+
} catch {
11+
process.exit(1);
12+
}
13+
}
14+
15+
buildPackage().then(
16+
(): void => {
17+
// eslint-disable-next-line no-console
18+
console.log('done');
19+
}
20+
);

tools/tsconfig.lib.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../../out-tsc/lib",
5+
"target": "es2015",
6+
"declaration": true,
7+
"inlineSources": true,
8+
"types": [],
9+
"lib": ["dom", "es2018"]
10+
},
11+
"angularCompilerOptions": {
12+
"annotateForClosureCompiler": true,
13+
"skipTemplateCodegen": true,
14+
"strictMetadataEmit": true,
15+
"fullTemplateTypeCheck": true,
16+
"strictInjectionParameters": true,
17+
"enableResourceInlining": true
18+
},
19+
"exclude": ["**/*.spec.ts"]
20+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "./tsconfig.json",
2+
"extends": "../tsconfig.json",
33
"compilerOptions": {
44
"resolveJsonModule": true,
55
"allowJs": true,

tsconfig.worker.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)