Skip to content

Commit

Permalink
build: fix path resolution with library dependencies (#2554)
Browse files Browse the repository at this point in the history
Updating to use ng-packagr builder to correctly resolve
external dependencies for built packages
  • Loading branch information
brandonroberts authored Jun 2, 2020
1 parent f892cc8 commit d7958e7
Show file tree
Hide file tree
Showing 20 changed files with 61 additions and 51 deletions.
50 changes: 34 additions & 16 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"prefix": "ngrx",
"architect": {
"build": {
"builder": "@nrwl/angular:package",
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "modules/store/tsconfig-build.json",
"project": "modules/store/ng-package.json"
Expand All @@ -136,10 +136,16 @@
"parallel": false,
"commands": [
{
"command": "nx build store"
"command": "ng build store"
},
{
"command": "yarn tsc -p modules/store/tsconfig.schematics.json"
},
{
"command": "yarn mkdirp node_modules/@ngrx/store"
},
{
"command": "ncp dist/modules/store node_modules/@ngrx/store"
}
]
}
Expand Down Expand Up @@ -173,7 +179,7 @@
"prefix": "ngrx",
"architect": {
"build": {
"builder": "@nrwl/angular:package",
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "modules/effects/tsconfig-build.json",
"project": "modules/effects/ng-package.json"
Expand All @@ -185,10 +191,16 @@
"parallel": false,
"commands": [
{
"command": "nx build effects"
"command": "ng build effects"
},
{
"command": "yarn tsc -p modules/effects/tsconfig.schematics.json"
},
{
"command": "yarn mkdirp node_modules/@ngrx/effects"
},
{
"command": "ncp dist/modules/effects node_modules/@ngrx/effects"
}
]
}
Expand Down Expand Up @@ -222,7 +234,7 @@
"prefix": "ngrx",
"architect": {
"build": {
"builder": "@nrwl/angular:package",
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "modules/data/tsconfig-build.json",
"project": "modules/data/ng-package.json"
Expand All @@ -234,7 +246,7 @@
"parallel": false,
"commands": [
{
"command": "nx build data"
"command": "ng build data"
},
{
"command": "yarn tsc -p modules/data/tsconfig.schematics.json"
Expand Down Expand Up @@ -271,7 +283,7 @@
"prefix": "ngrx",
"architect": {
"build": {
"builder": "@nrwl/angular:package",
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "modules/entity/tsconfig-build.json",
"project": "modules/entity/ng-package.json"
Expand All @@ -283,10 +295,16 @@
"parallel": false,
"commands": [
{
"command": "nx build entity"
"command": "ng build entity"
},
{
"command": "yarn tsc -p modules/entity/tsconfig.schematics.json"
},
{
"command": "yarn mkdirp node_modules/@ngrx/entity"
},
{
"command": "ncp dist/modules/entity node_modules/@ngrx/entity"
}
]
}
Expand Down Expand Up @@ -320,7 +338,7 @@
"prefix": "ngrx",
"architect": {
"build": {
"builder": "@nrwl/angular:package",
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "modules/store-devtools/tsconfig-build.json",
"project": "modules/store-devtools/ng-package.json"
Expand All @@ -332,7 +350,7 @@
"parallel": false,
"commands": [
{
"command": "nx build store-devtools"
"command": "ng build store-devtools"
},
{
"command": "yarn tsc -p modules/store-devtools/tsconfig.schematics.json"
Expand Down Expand Up @@ -369,7 +387,7 @@
"prefix": "ngrx",
"architect": {
"build": {
"builder": "@nrwl/angular:package",
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "modules/router-store/tsconfig-build.json",
"project": "modules/router-store/ng-package.json"
Expand All @@ -381,7 +399,7 @@
"parallel": false,
"commands": [
{
"command": "nx build router-store"
"command": "ng build router-store"
},
{
"command": "yarn tsc -p modules/router-store/tsconfig.schematics.json"
Expand Down Expand Up @@ -502,7 +520,7 @@
"prefix": "ngrx",
"architect": {
"build": {
"builder": "@nrwl/angular:package",
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "modules/component/tsconfig-build.json",
"project": "modules/component/ng-package.json"
Expand All @@ -514,7 +532,7 @@
"parallel": false,
"commands": [
{
"command": "nx build component"
"command": "ng build component"
}
]
}
Expand Down Expand Up @@ -548,7 +566,7 @@
"prefix": "ngrx",
"architect": {
"build": {
"builder": "@nrwl/angular:package",
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "modules/component-store/tsconfig-build.json",
"project": "modules/component-store/ng-package.json"
Expand All @@ -560,7 +578,7 @@
"parallel": false,
"commands": [
{
"command": "nx build component-store"
"command": "ng build component-store"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion modules/component-store/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"lib": ["es2015", "dom"],
"lib": ["es2018", "dom"],
"target": "es2015",
"skipLibCheck": true
},
Expand Down
2 changes: 1 addition & 1 deletion modules/component-store/tsconfig.schematics.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"paths": {},
"sourceMap": true,
"inlineSources": true,
"lib": ["es2017", "dom"],
"lib": ["es2018", "dom"],
"skipLibCheck": true,
"strict": true
},
Expand Down
2 changes: 1 addition & 1 deletion modules/component/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"lib": ["es2015", "dom"],
"lib": ["es2018", "dom"],
"target": "es2015",
"skipLibCheck": true
},
Expand Down
8 changes: 2 additions & 6 deletions modules/data/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@
"noImplicitReturns": true,
"downlevelIteration": true,
"outDir": "../../dist/modules/data",
"paths": {
"@ngrx/store": ["../../dist/modules/store"],
"@ngrx/effects": ["../../dist/modules/effects"],
"@ngrx/entity": ["../../dist/modules/entity"]
},
"paths": {},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"lib": ["es2015", "dom"],
"lib": ["es2018", "dom"],
"target": "es2015",
"skipLibCheck": true
},
Expand Down
2 changes: 1 addition & 1 deletion modules/data/tsconfig.schematics.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"sourceMap": true,
"inlineSources": true,
"lib": ["es2017", "dom"],
"lib": ["es2018", "dom"],
"skipLibCheck": true,
"strict": true
},
Expand Down
6 changes: 2 additions & 4 deletions modules/effects/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
"noImplicitReturns": true,
"downlevelIteration": true,
"outDir": "../../dist/modules/effects",
"paths": {
"@ngrx/store": ["../../dist/modules/store"]
},
"paths": {},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"lib": ["es2015", "dom"],
"lib": ["es2018", "dom"],
"target": "es2015",
"skipLibCheck": true
},
Expand Down
2 changes: 1 addition & 1 deletion modules/effects/tsconfig.schematics.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"sourceMap": true,
"inlineSources": true,
"lib": ["es2017", "dom"],
"lib": ["es2018", "dom"],
"skipLibCheck": true,
"strict": true
},
Expand Down
6 changes: 2 additions & 4 deletions modules/entity/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
"noImplicitReturns": true,
"downlevelIteration": true,
"outDir": "../../dist/modules/entity",
"paths": {
"@ngrx/store": ["../../dist/modules/store"]
},
"paths": {},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"lib": ["es2015", "dom"],
"lib": ["es2018", "dom"],
"target": "es2015",
"skipLibCheck": true
},
Expand Down
2 changes: 1 addition & 1 deletion modules/entity/tsconfig.schematics.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"sourceMap": true,
"inlineSources": true,
"lib": ["es2017", "dom"],
"lib": ["es2018", "dom"],
"skipLibCheck": true,
"strict": true
},
Expand Down
6 changes: 2 additions & 4 deletions modules/router-store/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
"noImplicitReturns": true,
"downlevelIteration": true,
"outDir": "../../dist/modules/router-store",
"paths": {
"@ngrx/store": ["../../dist/modules/store"]
},
"paths": {},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"lib": ["es2015", "dom"],
"lib": ["es2018", "dom"],
"target": "es2015",
"skipLibCheck": true
},
Expand Down
2 changes: 1 addition & 1 deletion modules/router-store/tsconfig.schematics.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"sourceMap": true,
"inlineSources": true,
"lib": ["es2017", "dom"],
"lib": ["es2018", "dom"],
"skipLibCheck": true,
"strict": true
},
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/tsconfig-bazel-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"sourceMap": true,
"inlineSources": true,
"lib": ["es2017", "dom"],
"lib": ["es2018", "dom"],
"skipLibCheck": true,
"strict": true
},
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"sourceMap": true,
"inlineSources": true,
"lib": ["es2017", "dom"],
"lib": ["es2018", "dom"],
"skipLibCheck": true,
"strict": true
},
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/tsconfig.schematics.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"sourceMap": true,
"inlineSources": true,
"lib": ["es2017", "dom"],
"lib": ["es2018", "dom"],
"skipLibCheck": true,
"strict": true
},
Expand Down
6 changes: 2 additions & 4 deletions modules/store-devtools/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
"noImplicitReturns": true,
"downlevelIteration": true,
"outDir": "../../dist/modules/store-devtools",
"paths": {
"@ngrx/store": ["../../dist/modules/store"]
},
"paths": {},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"lib": ["es2015", "dom"],
"lib": ["es2018", "dom"],
"target": "es2015",
"skipLibCheck": true
},
Expand Down
2 changes: 1 addition & 1 deletion modules/store-devtools/tsconfig.schematics.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"sourceMap": true,
"inlineSources": true,
"lib": ["es2017", "dom"],
"lib": ["es2018", "dom"],
"skipLibCheck": true,
"strict": true
},
Expand Down
2 changes: 1 addition & 1 deletion modules/store/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sourceMap": true,
"inlineSources": true,
"target": "es2015",
"lib": ["es2015", "dom"],
"lib": ["es2018", "dom"],
"skipLibCheck": true,
"strict": true
},
Expand Down
2 changes: 1 addition & 1 deletion modules/store/tsconfig.schematics.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"sourceMap": true,
"inlineSources": true,
"lib": ["es2017", "dom"],
"lib": ["es2018", "dom"],
"skipLibCheck": true,
"strict": true
},
Expand Down
4 changes: 4 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"tslint.json": "*",
"nx.json": "*"
},
"workspaceLayout": {
"appsDir": "projects",
"libsDir": "modules"
},
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/workspace/tasks-runners/default",
Expand Down

0 comments on commit d7958e7

Please sign in to comment.