-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(angular): rework angular-cli preset
Rework the code of angular-cli_config and angular-cli_utils to add future features Improvement: - Add test for NX - Use angular core to read the workspace instead of doing it by hand - Use angular-cli to read the tsconfig - Redesigned the code to get out the main steps + added error handling - Express more clearly the webpack config from angular-cli - Clarification of the logs - Improvement of the types with those of angular-cli
- Loading branch information
Showing
29 changed files
with
717 additions
and
508 deletions.
There are no files selected for viewing
5 changes: 4 additions & 1 deletion
5
app/angular/src/server/__mocks-ng-workspace__/empty-projects-entry/angular.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
{ "projects": {} } | ||
{ | ||
"version": 1, | ||
"projects": {} | ||
} |
2 changes: 2 additions & 0 deletions
2
app/angular/src/server/__mocks-ng-workspace__/minimal-config/src/main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// To avoid "No inputs were found in config file" tsc error | ||
export const not = 'empty'; |
2 changes: 1 addition & 1 deletion
2
app/angular/src/server/__mocks-ng-workspace__/minimal-config/src/tsconfig.app.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
app/angular/src/server/__mocks-ng-workspace__/with-nx/angular.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"version": 1, | ||
"projects": { | ||
"foo-project": { | ||
"root": "", | ||
"architect": { | ||
"build": { | ||
"options": { | ||
"tsConfig": "src/tsconfig.app.json", | ||
"styles": ["src/styles.css", "src/styles.scss"] | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"defaultProject": "foo-project" | ||
} |
3 changes: 3 additions & 0 deletions
3
app/angular/src/server/__mocks-ng-workspace__/with-nx/nx.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"npmScope": "nx-example" | ||
} |
2 changes: 2 additions & 0 deletions
2
app/angular/src/server/__mocks-ng-workspace__/with-nx/src/main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// To avoid "No inputs were found in config file" tsc error | ||
export const not = 'empty'; |
2 changes: 2 additions & 0 deletions
2
app/angular/src/server/__mocks-ng-workspace__/with-nx/src/styles.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.class { | ||
} |
2 changes: 2 additions & 0 deletions
2
app/angular/src/server/__mocks-ng-workspace__/with-nx/src/styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.class { | ||
} |
8 changes: 8 additions & 0 deletions
8
app/angular/src/server/__mocks-ng-workspace__/with-nx/src/tsconfig.app.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"baseUrl": "./", | ||
"module": "es2015", | ||
"types": ["node"] | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
app/angular/src/server/__mocks-ng-workspace__/with-nx/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"include": ["./src"], | ||
"compilerOptions": { | ||
"sourceMap": true, | ||
"moduleResolution": "node", | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"target": "es5", | ||
"lib": ["es2017", "dom"] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
app/angular/src/server/__mocks-ng-workspace__/with-options-styles/angular.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"version": 1, | ||
"projects": { | ||
"foo-project": { | ||
"root": "", | ||
|
2 changes: 2 additions & 0 deletions
2
app/angular/src/server/__mocks-ng-workspace__/with-options-styles/src/main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// To avoid "No inputs were found in config file" tsc error | ||
export const not = 'empty'; |
2 changes: 1 addition & 1 deletion
2
app/angular/src/server/__mocks-ng-workspace__/with-options-styles/src/tsconfig.app.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...chitect-build-options-assets/angular.json → ...hout-architect-build-options/angular.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"version": 1, | ||
"projects": { | ||
"foo-project": { | ||
"architect": { | ||
|
1 change: 1 addition & 0 deletions
1
app/angular/src/server/__mocks-ng-workspace__/without-architect-build/angular.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"version": 1, | ||
"projects": { "foo-project": {} }, | ||
"defaultProject": "foo-project" | ||
} |
7 changes: 7 additions & 0 deletions
7
app/angular/src/server/__mocks-ng-workspace__/without-compatible-projects/angular.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"version": 1, | ||
"projects": { | ||
"noop-project": {} | ||
}, | ||
"defaultProject": "missing-project" | ||
} |
4 changes: 3 additions & 1 deletion
4
app/angular/src/server/__mocks-ng-workspace__/without-projects-entry/angular.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
{} | ||
{ | ||
"version": 1 | ||
} |
82 changes: 0 additions & 82 deletions
82
app/angular/src/server/__tests__/angular-cli_config.test.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.