Skip to content

Commit 529e739

Browse files
committed
chore: use new nx workspace layout with project.json files
1 parent ed6f61a commit 529e739

16 files changed

+10324
-11037
lines changed

angular.json

+6-214
Original file line numberDiff line numberDiff line change
@@ -1,218 +1,10 @@
11
{
2-
"version": 1,
2+
"$schema": "./node_modules/nx/schemas/workspace-schema.json",
3+
"version": 2,
34
"projects": {
4-
"dev-server": {
5-
"root": "apps/dev-server",
6-
"sourceRoot": "apps/dev-server/src",
7-
"projectType": "application",
8-
"architect": {
9-
"build": {
10-
"builder": "@nrwl/node:webpack",
11-
"outputs": ["{options.outputPath}"],
12-
"options": {
13-
"outputPath": "dist/apps/dev-server",
14-
"main": "apps/dev-server/src/main.ts",
15-
"tsConfig": "apps/dev-server/tsconfig.app.json",
16-
"assets": [
17-
"apps/dev-server/src/assets",
18-
{
19-
"glob": "**/*",
20-
"input": "dist/apps/web",
21-
"output": "web"
22-
}
23-
]
24-
},
25-
"configurations": {
26-
"production": {
27-
"optimization": true,
28-
"extractLicenses": true,
29-
"inspect": false,
30-
"fileReplacements": [
31-
{
32-
"replace": "apps/dev-server/src/environments/environment.ts",
33-
"with": "apps/dev-server/src/environments/environment.prod.ts"
34-
}
35-
]
36-
}
37-
}
38-
},
39-
"serve": {
40-
"builder": "@nrwl/node:node",
41-
"options": {
42-
"buildTarget": "dev-server:build"
43-
}
44-
},
45-
"lint": {
46-
"builder": "@nrwl/linter:eslint",
47-
"outputs": ["{options.outputFile}"],
48-
"options": {
49-
"lintFilePatterns": ["apps/dev-server/**/*.ts"]
50-
}
51-
},
52-
"test": {
53-
"builder": "@nrwl/jest:jest",
54-
"outputs": ["coverage/apps/dev-server"],
55-
"options": {
56-
"jestConfig": "apps/dev-server/jest.config.js",
57-
"passWithNoTests": true
58-
}
59-
}
60-
},
61-
"implicitDependencies": ["web"]
62-
},
63-
"nodeplotlib": {
64-
"root": "libs/nodeplotlib",
65-
"sourceRoot": "libs/nodeplotlib/src",
66-
"projectType": "library",
67-
"architect": {
68-
"build": {
69-
"builder": "@nrwl/node:webpack",
70-
"outputs": ["{options.outputPath}"],
71-
"options": {
72-
"main": "libs/nodeplotlib/src/index.ts",
73-
"outputPath": "dist/libs/nodeplotlib",
74-
"tsConfig": "libs/nodeplotlib/tsconfig.lib.json",
75-
"generatePackageJson": true,
76-
"extractLicenses": true
77-
}
78-
},
79-
"lint": {
80-
"builder": "@nrwl/linter:eslint",
81-
"outputs": ["{options.outputFile}"],
82-
"options": {
83-
"lintFilePatterns": ["libs/nodeplotlib/**/*.ts"]
84-
}
85-
},
86-
"test": {
87-
"builder": "@nrwl/jest:jest",
88-
"outputs": ["coverage/libs/nodeplotlib"],
89-
"options": {
90-
"jestConfig": "libs/nodeplotlib/jest.config.js",
91-
"passWithNoTests": true
92-
}
93-
}
94-
},
95-
"tags": []
96-
},
97-
"web": {
98-
"projectType": "application",
99-
"root": "apps/web",
100-
"sourceRoot": "apps/web/src",
101-
"prefix": "npl",
102-
"architect": {
103-
"build": {
104-
"builder": "@angular-devkit/build-angular:browser",
105-
"outputs": ["{options.outputPath}"],
106-
"options": {
107-
"outputPath": "dist/apps/web",
108-
"index": "apps/web/src/index.html",
109-
"main": "apps/web/src/main.ts",
110-
"polyfills": "apps/web/src/polyfills.ts",
111-
"tsConfig": "apps/web/tsconfig.app.json",
112-
"assets": ["apps/web/src/favicon.ico", "apps/web/src/assets"],
113-
"styles": [
114-
"apps/web/src/custom-theme.scss",
115-
"apps/web/src/styles.css"
116-
],
117-
"scripts": []
118-
},
119-
"configurations": {
120-
"production": {
121-
"budgets": [
122-
{
123-
"type": "initial",
124-
"maximumWarning": "500kb",
125-
"maximumError": "1mb"
126-
},
127-
{
128-
"type": "anyComponentStyle",
129-
"maximumWarning": "2kb",
130-
"maximumError": "4kb"
131-
}
132-
],
133-
"fileReplacements": [
134-
{
135-
"replace": "apps/web/src/environments/environment.ts",
136-
"with": "apps/web/src/environments/environment.prod.ts"
137-
}
138-
],
139-
"outputHashing": "none"
140-
},
141-
"development": {
142-
"buildOptimizer": false,
143-
"optimization": false,
144-
"vendorChunk": true,
145-
"extractLicenses": false,
146-
"sourceMap": true,
147-
"namedChunks": true
148-
}
149-
},
150-
"defaultConfiguration": "production"
151-
},
152-
"serve": {
153-
"builder": "@angular-devkit/build-angular:dev-server",
154-
"configurations": {
155-
"production": {
156-
"browserTarget": "web:build:production"
157-
},
158-
"development": {
159-
"browserTarget": "web:build:development"
160-
}
161-
},
162-
"defaultConfiguration": "development"
163-
},
164-
"extract-i18n": {
165-
"builder": "@angular-devkit/build-angular:extract-i18n",
166-
"options": {
167-
"browserTarget": "web:build"
168-
}
169-
},
170-
"lint": {
171-
"builder": "@nrwl/linter:eslint",
172-
"options": {
173-
"lintFilePatterns": [
174-
"apps/web/src/**/*.ts",
175-
"apps/web/src/**/*.html"
176-
]
177-
}
178-
},
179-
"test": {
180-
"builder": "@nrwl/jest:jest",
181-
"outputs": ["coverage/apps/web"],
182-
"options": {
183-
"jestConfig": "apps/web/jest.config.js",
184-
"passWithNoTests": true
185-
}
186-
}
187-
}
188-
},
189-
"web-e2e": {
190-
"root": "apps/web-e2e",
191-
"sourceRoot": "apps/web-e2e/src",
192-
"projectType": "application",
193-
"architect": {
194-
"e2e": {
195-
"builder": "@nrwl/cypress:cypress",
196-
"options": {
197-
"cypressConfig": "apps/web-e2e/cypress.json",
198-
"devServerTarget": "web:serve:development",
199-
"tsConfig": "apps/web-e2e/tsconfig.json"
200-
},
201-
"configurations": {
202-
"production": {
203-
"devServerTarget": "web:serve:production"
204-
}
205-
}
206-
},
207-
"lint": {
208-
"builder": "@nrwl/linter:eslint",
209-
"outputs": ["{options.outputFile}"],
210-
"options": {
211-
"lintFilePatterns": ["apps/web-e2e/**/*.{js,ts}"]
212-
}
213-
}
214-
},
215-
"implicitDependencies": ["web"]
216-
}
5+
"dev-server": "apps/dev-server",
6+
"nodeplotlib": "libs/nodeplotlib",
7+
"web": "apps/web",
8+
"web-e2e": "apps/web-e2e"
2179
}
21810
}

apps/dev-server/project.json

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
3+
"sourceRoot": "apps/dev-server/src",
4+
"projectType": "application",
5+
"architect": {
6+
"build": {
7+
"executor": "@nrwl/node:webpack",
8+
"outputs": ["{options.outputPath}"],
9+
"options": {
10+
"outputPath": "dist/apps/dev-server",
11+
"main": "apps/dev-server/src/main.ts",
12+
"tsConfig": "apps/dev-server/tsconfig.app.json",
13+
"assets": [
14+
"apps/dev-server/src/assets",
15+
{
16+
"glob": "**/*",
17+
"input": "dist/apps/web",
18+
"output": "web"
19+
}
20+
]
21+
},
22+
"configurations": {
23+
"production": {
24+
"optimization": true,
25+
"extractLicenses": true,
26+
"inspect": false,
27+
"fileReplacements": [
28+
{
29+
"replace": "apps/dev-server/src/environments/environment.ts",
30+
"with": "apps/dev-server/src/environments/environment.prod.ts"
31+
}
32+
]
33+
}
34+
}
35+
},
36+
"serve": {
37+
"executor": "@nrwl/node:node",
38+
"options": {
39+
"buildTarget": "dev-server:build"
40+
}
41+
},
42+
"lint": {
43+
"executor": "@nrwl/linter:eslint",
44+
"outputs": ["{options.outputFile}"],
45+
"options": {
46+
"lintFilePatterns": ["apps/dev-server/**/*.ts"]
47+
}
48+
},
49+
"test": {
50+
"executor": "@nrwl/jest:jest",
51+
"outputs": ["coverage/apps/dev-server"],
52+
"options": {
53+
"jestConfig": "apps/dev-server/jest.config.ts",
54+
"passWithNoTests": true
55+
}
56+
}
57+
},
58+
"implicitDependencies": ["web"]
59+
}

apps/web-e2e/project.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
3+
"sourceRoot": "apps/web-e2e/src",
4+
"projectType": "application",
5+
"architect": {
6+
"e2e": {
7+
"executor": "@nrwl/cypress:cypress",
8+
"options": {
9+
"cypressConfig": "apps/web-e2e/cypress.json",
10+
"devServerTarget": "web:serve:development",
11+
"tsConfig": "apps/web-e2e/tsconfig.json"
12+
},
13+
"configurations": {
14+
"production": {
15+
"devServerTarget": "web:serve:production"
16+
}
17+
}
18+
},
19+
"lint": {
20+
"executor": "@nrwl/linter:eslint",
21+
"outputs": ["{options.outputFile}"],
22+
"options": {
23+
"lintFilePatterns": ["apps/web-e2e/**/*.{js,ts}"]
24+
}
25+
}
26+
},
27+
"tags": [],
28+
"implicitDependencies": ["web"]
29+
}

apps/web/jest.config.js apps/web/jest.config.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
module.exports = {
1+
/* eslint-disable */
2+
export default {
23
displayName: 'web',
34
preset: '../../jest.preset.js',
45
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
@@ -10,9 +11,9 @@ module.exports = {
1011
},
1112
coverageDirectory: '../../coverage/apps/web',
1213
transform: {
13-
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
14+
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular',
1415
},
15-
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
16+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
1617
snapshotSerializers: [
1718
'jest-preset-angular/build/serializers/no-ng-attributes',
1819
'jest-preset-angular/build/serializers/ng-snapshot',

0 commit comments

Comments
 (0)