Skip to content

Commit

Permalink
refactor(angular): rework angular-cli preset
Browse files Browse the repository at this point in the history
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
ThibaudAV committed Apr 18, 2021
1 parent 62c344e commit a91d9f9
Show file tree
Hide file tree
Showing 29 changed files with 780 additions and 508 deletions.
@@ -1 +1,4 @@
{ "projects": {} }
{
"version": 1,
"projects": {}
}
@@ -0,0 +1,2 @@
// To avoid "No inputs were found in config file" tsc error
export const not = 'empty';
@@ -1,5 +1,5 @@
{
"extends": "tsconfig.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": "./",
"module": "es2015",
Expand Down
17 changes: 17 additions & 0 deletions app/angular/src/server/__mocks-ng-workspace__/with-nx/angular.json
@@ -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 app/angular/src/server/__mocks-ng-workspace__/with-nx/nx.json
@@ -0,0 +1,3 @@
{
"npmScope": "nx-example"
}
@@ -0,0 +1,2 @@
// To avoid "No inputs were found in config file" tsc error
export const not = 'empty';
@@ -0,0 +1,2 @@
.class {
}
@@ -0,0 +1,2 @@
.class {
}
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": "./",
"module": "es2015",
"types": ["node"]
}
}
@@ -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,4 +1,5 @@
{
"version": 1,
"projects": {
"foo-project": {
"root": "",
Expand Down
@@ -0,0 +1,2 @@
// To avoid "No inputs were found in config file" tsc error
export const not = 'empty';
@@ -1,5 +1,5 @@
{
"extends": "tsconfig.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": "./",
"module": "es2015",
Expand Down
@@ -1,4 +1,5 @@
{
"version": 1,
"projects": {
"foo-project": {
"architect": {
Expand Down
@@ -1,4 +1,5 @@
{
"version": 1,
"projects": { "foo-project": {} },
"defaultProject": "foo-project"
}
@@ -0,0 +1,7 @@
{
"version": 1,
"projects": {
"noop-project": {}
},
"defaultProject": "missing-project"
}
@@ -1 +1,3 @@
{}
{
"version": 1
}
82 changes: 0 additions & 82 deletions app/angular/src/server/__tests__/angular-cli_config.test.ts

This file was deleted.

0 comments on commit a91d9f9

Please sign in to comment.