Skip to content

Commit bde73dc

Browse files
authored
feat: update dependencies and fix build
1 parent d88bcd2 commit bde73dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+18411
-11413
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
This is an example using Nx and the Angular CLI to create Angular Elements. NX is used to scaffold the React and Angular apps in a monorepo using the same commands to run the app.
44

55
**Init Project**
6-
* Build Elements `ng build core --prod --single-bundle true --keep-polyfills true`
7-
* Serve app `ng serve <appname>` e.g `ng serve angularapp`
6+
* Build Elements `nx build core --prod --single-bundle true --keep-polyfills true`
7+
* Serve app `nx serve <appname>` e.g `nx serve angularapp`
88

99
**Slides**
1010
https://speakerdeck.com/mahcr/angular-elements-7ae5e518-6675-4e17-a7f2-7a0e891eb16e
@@ -34,4 +34,4 @@ https://speakerdeck.com/mahcr/angular-elements-7ae5e518-6675-4e17-a7f2-7a0e891eb
3434
**Pueden seguirme:** [Twitter](https://twitter.com/malvarezcr) | [Medium](https://medium.com/@mahcr) | [Linkedin](https://www.linkedin.com/in/mahcr/)
3535

3636
**Sigan** la comunidad de Angular en Costa Rica:
37-
[Facebook](https://www.facebook.com/angularcostarica/) | [Twitter](https://twitter.com/AngularCR) | [Medium](https://medium.com/angularcostarica) | [YouTube](https://www.youtube.com/channel/UC4vCnqA5s8IR2zCcSXp63_w)
37+
[Facebook](https://www.facebook.com/angularcostarica/) | [Twitter](https://twitter.com/AngularCR) | [Medium](https://medium.com/angularcostarica) | [YouTube](https://www.youtube.com/channel/UC4vCnqA5s8IR2zCcSXp63_w)

angular.json

Lines changed: 129 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,64 @@
11
{
2-
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
32
"version": 1,
4-
"newProjectRoot": "",
53
"projects": {
4+
"core": {
5+
"projectType": "library",
6+
"root": "libs/core",
7+
"sourceRoot": "libs/core/src",
8+
"prefix": "ui",
9+
"architect": {
10+
"build": {
11+
"builder": "ngx-build-plus:build",
12+
"options": {
13+
"outputPath": "dist/ui",
14+
"index": "libs/core/src/lib/index.html",
15+
"main": "libs/core/src/lib/elements.ts",
16+
"polyfills": "libs/core/src/lib/polyfills.ts",
17+
"tsConfig": "libs/core/tsconfig.lib.json",
18+
"styles": [
19+
{
20+
"input": "libs/core/src/lib/theme.scss",
21+
"bundleName": "theme"
22+
}
23+
]
24+
},
25+
"configurations": {
26+
"production": {
27+
"optimization": true,
28+
"outputHashing": "none",
29+
"sourceMap": false,
30+
"extractCss": true
31+
}
32+
}
33+
},
34+
"lint": {
35+
"builder": "@angular-devkit/build-angular:tslint",
36+
"options": {
37+
"tsConfig": [
38+
"libs/core/tsconfig.lib.json",
39+
"libs/core/tsconfig.spec.json"
40+
],
41+
"exclude": ["**/node_modules/**", "!libs/core/**/*"]
42+
}
43+
},
44+
"test": {
45+
"builder": "@nrwl/jest:jest",
46+
"options": {
47+
"jestConfig": "libs/core/jest.config.js",
48+
"passWithNoTests": true
49+
}
50+
}
51+
},
52+
"schematics": {
53+
"@nrwl/angular:component": {
54+
"styleext": "scss"
55+
}
56+
}
57+
},
658
"angularapp": {
759
"projectType": "application",
860
"schematics": {
9-
"@nrwl/workspace:component": {
61+
"@schematics/angular:component": {
1062
"style": "scss"
1163
}
1264
},
@@ -22,20 +74,13 @@
2274
"main": "apps/angularapp/src/main.ts",
2375
"polyfills": "apps/angularapp/src/polyfills.ts",
2476
"tsConfig": "apps/angularapp/tsconfig.app.json",
77+
"aot": true,
2578
"assets": [
2679
"apps/angularapp/src/favicon.ico",
2780
"apps/angularapp/src/assets"
2881
],
29-
"styles": [
30-
"apps/angularapp/src/styles.scss",
31-
"dist/ngelements/theme.css"
32-
],
33-
"scripts": [
34-
{
35-
"input": "node_modules/document-register-element/build/document-register-element.js"
36-
},
37-
"dist/ngelements/main.js"
38-
]
82+
"styles": ["apps/angularapp/src/styles.scss", "dist/ui/theme.css"],
83+
"scripts": ["dist/ui/polyfills.js", "dist/ui/main.js"]
3984
},
4085
"configurations": {
4186
"production": {
@@ -50,7 +95,6 @@
5095
"sourceMap": false,
5196
"extractCss": true,
5297
"namedChunks": false,
53-
"aot": true,
5498
"extractLicenses": true,
5599
"vendorChunk": false,
56100
"buildOptimizer": true,
@@ -59,6 +103,11 @@
59103
"type": "initial",
60104
"maximumWarning": "2mb",
61105
"maximumError": "5mb"
106+
},
107+
{
108+
"type": "anyComponentStyle",
109+
"maximumWarning": "6kb",
110+
"maximumError": "10kb"
62111
}
63112
]
64113
}
@@ -88,18 +137,14 @@
88137
"apps/angularapp/tsconfig.app.json",
89138
"apps/angularapp/tsconfig.spec.json"
90139
],
91-
"exclude": [
92-
"**/node_modules/**",
93-
"!apps/angularapp/**"
94-
]
140+
"exclude": ["**/node_modules/**", "!apps/angularapp/**/*"]
95141
}
96142
},
97143
"test": {
98144
"builder": "@nrwl/jest:jest",
99145
"options": {
100146
"jestConfig": "apps/angularapp/jest.config.js",
101-
"tsConfig": "apps/angularapp/tsconfig.spec.json",
102-
"setupFile": "apps/angularapp/src/test-setup.ts"
147+
"passWithNoTests": true
103148
}
104149
}
105150
}
@@ -125,11 +170,8 @@
125170
"lint": {
126171
"builder": "@angular-devkit/build-angular:tslint",
127172
"options": {
128-
"tsConfig": "apps/angularapp-e2e/tsconfig.e2e.json",
129-
"exclude": [
130-
"**/node_modules/**",
131-
"!apps/angularapp-e2e/**"
132-
]
173+
"tsConfig": ["apps/angularapp-e2e/tsconfig.e2e.json"],
174+
"exclude": ["**/node_modules/**", "!apps/angularapp-e2e/**/*"]
133175
}
134176
}
135177
}
@@ -152,14 +194,9 @@
152194
"apps/reactapp/src/favicon.ico",
153195
"apps/reactapp/src/assets"
154196
],
155-
"styles": [
156-
"apps/reactapp/src/styles.scss",
157-
"dist/ngelements/theme.css"
158-
],
159-
"scripts": [
160-
"dist/ngelements/polyfills.js",
161-
"dist/ngelements/main.js"
162-
]
197+
"styles": ["apps/reactapp/src/styles.scss", "dist/ui/theme.css"],
198+
"scripts": ["dist/ui/polyfills.js", "dist/ui/main.js"],
199+
"webpackConfig": "@nrwl/react/plugins/webpack"
163200
},
164201
"configurations": {
165202
"production": {
@@ -198,23 +235,21 @@
198235
}
199236
},
200237
"lint": {
201-
"builder": "@angular-devkit/build-angular:tslint",
238+
"builder": "@nrwl/linter:lint",
202239
"options": {
240+
"linter": "eslint",
203241
"tsConfig": [
204242
"apps/reactapp/tsconfig.app.json",
205243
"apps/reactapp/tsconfig.spec.json"
206244
],
207-
"exclude": [
208-
"**/node_modules/**",
209-
"!apps/reactapp/**"
210-
]
245+
"exclude": ["**/node_modules/**", "!apps/reactapp/**/*"]
211246
}
212247
},
213248
"test": {
214249
"builder": "@nrwl/jest:jest",
215250
"options": {
216251
"jestConfig": "apps/reactapp/jest.config.js",
217-
"tsConfig": "apps/reactapp/tsconfig.spec.json"
252+
"passWithNoTests": true
218253
}
219254
}
220255
}
@@ -238,91 +273,76 @@
238273
}
239274
},
240275
"lint": {
241-
"builder": "@angular-devkit/build-angular:tslint",
276+
"builder": "@nrwl/linter:lint",
242277
"options": {
243-
"tsConfig": "apps/reactapp-e2e/tsconfig.e2e.json",
244-
"exclude": [
245-
"**/node_modules/**",
246-
"!apps/reactapp-e2e/**"
247-
]
278+
"linter": "eslint",
279+
"tsConfig": ["apps/reactapp-e2e/tsconfig.e2e.json"],
280+
"exclude": ["**/node_modules/**", "!apps/reactapp-e2e/**/*"]
248281
}
249282
}
250283
}
251-
},
252-
"core": {
253-
"projectType": "library",
254-
"root": "libs/core",
255-
"sourceRoot": "libs/core/src",
256-
"prefix": "ui",
257-
"architect": {
258-
"build": {
259-
"builder": "ngx-build-plus:build",
260-
"options": {
261-
"outputPath": "dist/ngelements",
262-
"index": "libs/core/src/lib/index.html",
263-
"main": "libs/core/src/lib/elements.ts",
264-
"polyfills": "libs/core/src/lib/polyfills.ts",
265-
"tsConfig": "libs/core/tsconfig.lib.json",
266-
"styles": [
267-
{
268-
"input": "libs/core/src/lib/theme.scss",
269-
"lazy": true
270-
}
271-
]
272-
},
273-
"configurations": {
274-
"production": {
275-
"optimization": true,
276-
"outputHashing": "none",
277-
"sourceMap": false,
278-
"extractCss": true
279-
}
280-
}
281-
},
282-
"lint": {
283-
"builder": "@angular-devkit/build-angular:tslint",
284-
"options": {
285-
"tsConfig": [
286-
"libs/core/tsconfig.lib.json",
287-
"libs/core/tsconfig.spec.json"
288-
],
289-
"exclude": [
290-
"**/node_modules/**",
291-
"!libs/core/**"
292-
]
293-
}
294-
},
295-
"test": {
296-
"builder": "@nrwl/jest:jest",
297-
"options": {
298-
"jestConfig": "libs/core/jest.config.js",
299-
"tsConfig": "libs/core/tsconfig.spec.json",
300-
"setupFile": "libs/core/src/test-setup.ts"
301-
}
302-
}
303-
},
304-
"schematics": {
305-
"@nrwl/angular:component": {
306-
"styleext": "scss"
307-
}
308-
}
309284
}
310285
},
311286
"cli": {
312-
"warnings": {
313-
"typescriptMismatch": false,
314-
"versionMismatch": false
315-
},
316-
"defaultCollection": "@nrwl/angular"
287+
"defaultCollection": "@nrwl/angular",
288+
"analytics": "bb35317c-f379-408a-95da-5e2b78f74c78"
317289
},
318290
"schematics": {
291+
"@nrwl/workspace": {
292+
"library": {
293+
"linter": "tslint"
294+
}
295+
},
296+
"@nrwl/cypress": {
297+
"cypress-project": {
298+
"linter": "tslint"
299+
}
300+
},
301+
"@nrwl/node": {
302+
"application": {
303+
"linter": "tslint"
304+
},
305+
"library": {
306+
"linter": "tslint"
307+
}
308+
},
309+
"@nrwl/nest": {
310+
"application": {
311+
"linter": "tslint"
312+
},
313+
"library": {
314+
"linter": "tslint"
315+
}
316+
},
317+
"@nrwl/express": {
318+
"application": {
319+
"linter": "tslint"
320+
},
321+
"library": {
322+
"linter": "tslint"
323+
}
324+
},
319325
"@nrwl/angular:application": {
320326
"unitTestRunner": "jest",
321327
"e2eTestRunner": "cypress"
322328
},
323329
"@nrwl/angular:library": {
324330
"unitTestRunner": "jest"
331+
},
332+
"@nrwl/react": {
333+
"application": {
334+
"style": "scss",
335+
"linter": "eslint",
336+
"babel": true
337+
},
338+
"component": {
339+
"style": "scss"
340+
},
341+
"library": {
342+
"style": "scss",
343+
"linter": "eslint"
344+
}
325345
}
326346
},
327-
"defaultProject": "angularapp"
347+
"defaultProject": "reactapp"
328348
}

apps/angularapp-e2e/cypress.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
"fileServerFolder": ".",
33
"fixturesFolder": "./src/fixtures",
44
"integrationFolder": "./src/integration",
5+
"modifyObstructiveCode": false,
56
"pluginsFile": "./src/plugins/index",
6-
"supportFile": false,
7+
"supportFile": "./src/support/index.ts",
78
"video": true,
89
"videosFolder": "../../dist/cypress/apps/angularapp-e2e/videos",
910
"screenshotsFolder": "../../dist/cypress/apps/angularapp-e2e/screenshots",

apps/angularapp-e2e/src/integration/app.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ describe('angularapp', () => {
44
beforeEach(() => cy.visit('/'));
55

66
it('should display welcome message', () => {
7+
// Custom command example, see `../support/commands.ts` file
8+
cy.login('[email protected]', 'myPassword');
9+
10+
// Function helper example, see `../support/app.po.ts` file
711
getGreeting().contains('Welcome to angularapp!');
812
});
913
});

apps/angularapp-e2e/src/plugins/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ module.exports = (on, config) => {
1717
// `on` is used to hook into various events Cypress emits
1818
// `config` is the resolved Cypress config
1919

20-
// Preprocess Typescript
20+
// Preprocess Typescript file using Nx helper
2121
on('file:preprocessor', preprocessTypescript(config));
2222
};

0 commit comments

Comments
 (0)