@nrwl/angular 15.9.0-beta.4 → 15.9.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/migrations.json +6 -0
- package/package.json +9 -9
- package/src/generators/application/application.js +3 -47
- package/src/generators/application/application.js.map +1 -1
- package/src/generators/application/files/base/src/assets/.gitkeep__tpl__ +0 -0
- package/src/generators/application/files/base/src/index.html__tpl__ +13 -0
- package/src/generators/application/files/base/src/styles.__style__ +1 -0
- package/src/generators/application/files/base/tsconfig.app.json__tpl__ +10 -0
- package/src/generators/application/files/base/tsconfig.editor.json__tpl__ +5 -0
- package/src/generators/application/files/base/tsconfig.json__tpl__ +20 -0
- package/src/generators/application/files/base/tsconfig.spec.json__tpl__ +15 -0
- package/src/generators/application/files/ng-module/src/app/app.component.__style__ +0 -0
- package/src/generators/application/files/ng-module/src/app/app.component.html__tpl__ +1 -0
- package/src/generators/application/files/ng-module/src/app/app.component.spec.ts__tpl__ +26 -0
- package/src/generators/application/files/ng-module/src/app/app.component.ts__tpl__ +13 -0
- package/src/generators/application/files/ng-module/src/app/app.module.ts__tpl__ +17 -0
- package/src/generators/application/files/{src → ng-module/src}/app/app.routes.ts__tpl__ +1 -1
- package/src/generators/application/{lib/nrwl-home-tpl.js → files/ng-module/src/app/nx-welcome.component.ts__tpl__} +11 -29
- package/src/generators/application/files/ng-module/src/main.ts__tpl__ +6 -0
- package/src/generators/application/files/standalone-components/src/app/app.component.__style__ +0 -0
- package/src/generators/application/files/standalone-components/src/app/app.component.html__tpl__ +1 -0
- package/src/generators/application/files/standalone-components/src/app/app.component.spec.ts__tpl__ +25 -0
- package/src/generators/application/files/standalone-components/src/app/app.component.ts__tpl__ +17 -0
- package/src/generators/application/files/standalone-components/src/app/app.routes.ts__tpl__ +3 -0
- package/src/generators/application/files/standalone-components/src/app/nx-welcome.component.ts__tpl__ +808 -0
- package/src/generators/application/files/standalone-components/src/main.ts__tpl__ +11 -0
- package/src/generators/application/lib/create-files.d.ts +1 -1
- package/src/generators/application/lib/create-files.js +74 -5
- package/src/generators/application/lib/create-files.js.map +1 -1
- package/src/generators/application/lib/create-project.d.ts +3 -0
- package/src/generators/application/lib/create-project.js +85 -0
- package/src/generators/application/lib/create-project.js.map +1 -0
- package/src/generators/application/lib/index.d.ts +1 -7
- package/src/generators/application/lib/index.js +1 -7
- package/src/generators/application/lib/index.js.map +1 -1
- package/src/migrations/update-15-9-0/update-testing-tsconfig.d.ts +3 -0
- package/src/migrations/update-15-9-0/update-testing-tsconfig.js +38 -0
- package/src/migrations/update-15-9-0/update-testing-tsconfig.js.map +1 -0
- package/src/generators/application/lib/convert-to-standalone-app.d.ts +0 -3
- package/src/generators/application/lib/convert-to-standalone-app.js +0 -82
- package/src/generators/application/lib/convert-to-standalone-app.js.map +0 -1
- package/src/generators/application/lib/nrwl-home-tpl.d.ts +0 -4
- package/src/generators/application/lib/nrwl-home-tpl.js.map +0 -1
- package/src/generators/application/lib/root-router-config.d.ts +0 -3
- package/src/generators/application/lib/root-router-config.js +0 -20
- package/src/generators/application/lib/root-router-config.js.map +0 -1
- package/src/generators/application/lib/update-app-component-template.d.ts +0 -3
- package/src/generators/application/lib/update-app-component-template.js +0 -29
- package/src/generators/application/lib/update-app-component-template.js.map +0 -1
- package/src/generators/application/lib/update-component-spec.d.ts +0 -3
- package/src/generators/application/lib/update-component-spec.js +0 -33
- package/src/generators/application/lib/update-component-spec.js.map +0 -1
- package/src/generators/application/lib/update-config-files.d.ts +0 -3
- package/src/generators/application/lib/update-config-files.js +0 -71
- package/src/generators/application/lib/update-config-files.js.map +0 -1
- package/src/generators/application/lib/update-nx-component-template.d.ts +0 -3
- package/src/generators/application/lib/update-nx-component-template.js +0 -35
- package/src/generators/application/lib/update-nx-component-template.js.map +0 -1
- /package/src/generators/application/files/{src → base/src}/favicon.ico +0 -0
package/migrations.json
CHANGED
|
@@ -152,6 +152,12 @@
|
|
|
152
152
|
"version": "15.8.0-beta.4",
|
|
153
153
|
"description": "Update the @angular/cli package version to ~15.2.0.",
|
|
154
154
|
"factory": "./src/migrations/update-15-8-0/update-angular-cli"
|
|
155
|
+
},
|
|
156
|
+
"update-tsconfig-spec-jest": {
|
|
157
|
+
"cli": "nx",
|
|
158
|
+
"version": "15.9.0-beta.3",
|
|
159
|
+
"description": "Update the tsconfig.spec.json to use target es2016 for jest-preset-angular v13",
|
|
160
|
+
"factory": "./src/migrations/update-15-9-0/update-testing-tsconfig"
|
|
155
161
|
}
|
|
156
162
|
},
|
|
157
163
|
"packageJsonUpdates": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/angular",
|
|
3
|
-
"version": "15.9.0-beta.
|
|
3
|
+
"version": "15.9.0-beta.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -63,13 +63,13 @@
|
|
|
63
63
|
"migrations": "./migrations.json"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@nrwl/cypress": "15.9.0-beta.
|
|
67
|
-
"@nrwl/devkit": "15.9.0-beta.
|
|
68
|
-
"@nrwl/jest": "15.9.0-beta.
|
|
69
|
-
"@nrwl/js": "15.9.0-beta.
|
|
70
|
-
"@nrwl/linter": "15.9.0-beta.
|
|
71
|
-
"@nrwl/webpack": "15.9.0-beta.
|
|
72
|
-
"@nrwl/workspace": "15.9.0-beta.
|
|
66
|
+
"@nrwl/cypress": "15.9.0-beta.5",
|
|
67
|
+
"@nrwl/devkit": "15.9.0-beta.5",
|
|
68
|
+
"@nrwl/jest": "15.9.0-beta.5",
|
|
69
|
+
"@nrwl/js": "15.9.0-beta.5",
|
|
70
|
+
"@nrwl/linter": "15.9.0-beta.5",
|
|
71
|
+
"@nrwl/webpack": "15.9.0-beta.5",
|
|
72
|
+
"@nrwl/workspace": "15.9.0-beta.5",
|
|
73
73
|
"@phenomnomnominal/tsquery": "4.1.1",
|
|
74
74
|
"chalk": "^4.1.0",
|
|
75
75
|
"chokidar": "^3.5.1",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"fesm2015": "fesm2015/nrwl-angular.mjs",
|
|
109
109
|
"typings": "index.d.ts",
|
|
110
110
|
"sideEffects": false,
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "02cd5f9445f8a2c78eb4d3b0b2f7d8fab63435ba"
|
|
112
112
|
}
|
|
@@ -4,7 +4,6 @@ exports.applicationGenerator = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
6
|
const path_1 = require("path");
|
|
7
|
-
const test_runners_1 = require("../../utils/test-runners");
|
|
8
7
|
const init_1 = require("../init/init");
|
|
9
8
|
const setup_tailwind_1 = require("../setup-tailwind/setup-tailwind");
|
|
10
9
|
const version_utils_1 = require("../utils/version-utils");
|
|
@@ -34,44 +33,10 @@ function applicationGenerator(tree, schema) {
|
|
|
34
33
|
return yield previousGenerator.default(tree, schema);
|
|
35
34
|
}
|
|
36
35
|
const options = (0, lib_1.normalizeOptions)(tree, schema);
|
|
36
|
+
const rootOffset = (0, devkit_1.offsetFromRoot)(options.appProjectRoot);
|
|
37
37
|
yield (0, init_1.angularInitGenerator)(tree, Object.assign(Object.assign({}, options), { skipFormat: true }));
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
yield angularAppSchematic(tree, {
|
|
41
|
-
name: options.name,
|
|
42
|
-
inlineStyle: options.inlineStyle,
|
|
43
|
-
inlineTemplate: options.inlineTemplate,
|
|
44
|
-
prefix: options.prefix,
|
|
45
|
-
skipTests: options.skipTests,
|
|
46
|
-
style: options.style,
|
|
47
|
-
viewEncapsulation: options.viewEncapsulation,
|
|
48
|
-
routing: false,
|
|
49
|
-
skipInstall: true,
|
|
50
|
-
skipPackageJson: options.skipPackageJson,
|
|
51
|
-
});
|
|
52
|
-
if (options.ngCliSchematicAppRoot !== options.appProjectRoot) {
|
|
53
|
-
(0, devkit_1.moveFilesToNewDirectory)(tree, options.ngCliSchematicAppRoot, options.appProjectRoot);
|
|
54
|
-
}
|
|
55
|
-
(0, lib_1.createFiles)(tree, options);
|
|
56
|
-
(0, lib_1.updateConfigFiles)(tree, options);
|
|
57
|
-
(0, lib_1.updateAppComponentTemplate)(tree, options);
|
|
58
|
-
if (!options.minimal) {
|
|
59
|
-
// Create the NxWelcomeComponent
|
|
60
|
-
const angularComponentSchematic = wrapAngularDevkitSchematic('@schematics/angular', 'component');
|
|
61
|
-
yield angularComponentSchematic(tree, {
|
|
62
|
-
name: 'NxWelcome',
|
|
63
|
-
inlineTemplate: true,
|
|
64
|
-
inlineStyle: true,
|
|
65
|
-
prefix: options.prefix,
|
|
66
|
-
skipTests: true,
|
|
67
|
-
style: options.style,
|
|
68
|
-
flat: true,
|
|
69
|
-
viewEncapsulation: 'None',
|
|
70
|
-
project: options.name,
|
|
71
|
-
standalone: options.standalone,
|
|
72
|
-
});
|
|
73
|
-
(0, lib_1.updateNxComponentTemplate)(tree, options);
|
|
74
|
-
}
|
|
38
|
+
(0, lib_1.createProject)(tree, options);
|
|
39
|
+
yield (0, lib_1.createFiles)(tree, options, rootOffset);
|
|
75
40
|
if (options.addTailwind) {
|
|
76
41
|
yield (0, setup_tailwind_1.setupTailwindGenerator)(tree, {
|
|
77
42
|
project: options.name,
|
|
@@ -79,12 +44,6 @@ function applicationGenerator(tree, schema) {
|
|
|
79
44
|
skipPackageJson: options.skipPackageJson,
|
|
80
45
|
});
|
|
81
46
|
}
|
|
82
|
-
if (options.unitTestRunner !== test_runners_1.UnitTestRunner.None) {
|
|
83
|
-
(0, lib_1.updateComponentSpec)(tree, options);
|
|
84
|
-
}
|
|
85
|
-
if (options.routing) {
|
|
86
|
-
(0, lib_1.addRouterRootConfiguration)(tree, options);
|
|
87
|
-
}
|
|
88
47
|
yield (0, lib_1.addLinting)(tree, options);
|
|
89
48
|
yield (0, lib_1.addUnitTestRunner)(tree, options);
|
|
90
49
|
yield (0, lib_1.addE2e)(tree, options);
|
|
@@ -103,9 +62,6 @@ function applicationGenerator(tree, schema) {
|
|
|
103
62
|
else {
|
|
104
63
|
(0, lib_1.setApplicationStrictDefault)(tree, false);
|
|
105
64
|
}
|
|
106
|
-
if (options.standalone) {
|
|
107
|
-
(0, lib_1.convertToStandaloneApp)(tree, options);
|
|
108
|
-
}
|
|
109
65
|
if (!options.skipFormat) {
|
|
110
66
|
yield (0, devkit_1.formatFiles)(tree);
|
|
111
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/application/application.ts"],"names":[],"mappings":";;;;AAAA,yCASsB;AACtB,+BAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"application.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/application/application.ts"],"names":[],"mappings":"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"}
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title><%= appName %></title>
|
|
6
|
+
<base href="/" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<<%= rootSelector %>></<%= rootSelector %>>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* You can add global styles to this file, and also import other style files */
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2022",
|
|
4
|
+
"useDefineForClassFields": false,
|
|
5
|
+
},
|
|
6
|
+
"files": [],
|
|
7
|
+
"include": [],
|
|
8
|
+
"references": [
|
|
9
|
+
{
|
|
10
|
+
"path": "./tsconfig.app.json"
|
|
11
|
+
},
|
|
12
|
+
<% if(unitTesting) { %>{
|
|
13
|
+
"path": "./tsconfig.spec.json"
|
|
14
|
+
},<% } %>
|
|
15
|
+
{
|
|
16
|
+
"path": "./tsconfig.editor.json"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"extends": "<%= rootTsConfig %>"
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "<%= rootOffset %>dist/out-tsc",
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"types": ["jest", "node"]
|
|
7
|
+
},
|
|
8
|
+
"files": ["src/test-setup.ts"],
|
|
9
|
+
"include": [
|
|
10
|
+
"jest.config.ts",
|
|
11
|
+
"src/**/*.test.ts",
|
|
12
|
+
"src/**/*.spec.ts",
|
|
13
|
+
"src/**/*.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<% if(minimal) { %><h1>Welcome <%= appName %></h1><% } else { %><<%= nxWelcomeSelector %>></<%= nxWelcomeSelector %>><% } %> <% if(routing) { %><router-outlet></router-outlet><% } %>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
import { AppComponent } from './app.component';<% if(!minimal) { %>
|
|
3
|
+
import { NxWelcomeComponent } from './nx-welcome.component';<% } %><% if(routing) { %>
|
|
4
|
+
import { RouterTestingModule } from '@angular/router/testing';<% } %>
|
|
5
|
+
|
|
6
|
+
describe('AppComponent', () => {
|
|
7
|
+
beforeEach(async () => {
|
|
8
|
+
await TestBed.configureTestingModule({
|
|
9
|
+
imports: [<% if(routing) { %>RouterTestingModule<% } %>],
|
|
10
|
+
declarations: [AppComponent<% if(!minimal) { %>, NxWelcomeComponent<% } %>]
|
|
11
|
+
}).compileComponents();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('should render title', () => {
|
|
15
|
+
const fixture = TestBed.createComponent(AppComponent);
|
|
16
|
+
fixture.detectChanges();
|
|
17
|
+
const compiled = fixture.nativeElement as HTMLElement;
|
|
18
|
+
expect(compiled.querySelector('h1')?.textContent).toContain('Welcome <%= appName %>');
|
|
19
|
+
});<% if(!minimal) { %>
|
|
20
|
+
|
|
21
|
+
it(`should have as title '<%= appName %>'`, () => {
|
|
22
|
+
const fixture = TestBed.createComponent(AppComponent);
|
|
23
|
+
const app = fixture.componentInstance;
|
|
24
|
+
expect(app.title).toEqual('<%= appName %>');
|
|
25
|
+
});<% } %>
|
|
26
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Component<% if(viewEncapsulation) { %>, ViewEncapsulation<% } %> } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: '<%= rootSelector %>',<% if(!inlineTemplate) { %>
|
|
5
|
+
templateUrl: './app.component.html',<% } else { %>
|
|
6
|
+
template: `<% if(minimal) { %><h1>Welcome <%= appName %></h1><% } else { %><<%= nxWelcomeSelector %>></<%= nxWelcomeSelector %>><% } %> <% if(routing) { %><router-outlet></router-outlet><% } %>`,<% } %><% if(!inlineStyle) { %>
|
|
7
|
+
styleUrls: ['./app.component.<%= style %>'],<% } else { %>
|
|
8
|
+
styles: [''],<% } %><% if(viewEncapsulation) { %>
|
|
9
|
+
encapsulation: ViewEncapsulation.<%= viewEncapsulation %>,<% } %>
|
|
10
|
+
})
|
|
11
|
+
export class AppComponent {<% if(!minimal) { %>
|
|
12
|
+
title = '<%= appName %>';
|
|
13
|
+
<% } %>}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { BrowserModule } from '@angular/platform-browser';<% if(routing) { %>
|
|
3
|
+
import { RouterModule } from '@angular/router';<% } %>
|
|
4
|
+
import { AppComponent } from './app.component';<% if(routing) { %>
|
|
5
|
+
import { appRoutes } from './app.routes';<% } %><% if(!minimal) { %>
|
|
6
|
+
import { NxWelcomeComponent } from './nx-welcome.component';<% } %>
|
|
7
|
+
|
|
8
|
+
@NgModule({
|
|
9
|
+
declarations: [AppComponent<% if(!minimal) { %>, NxWelcomeComponent<% } %>],
|
|
10
|
+
imports: [
|
|
11
|
+
BrowserModule,<% if(routing) { %>
|
|
12
|
+
RouterModule.forRoot(appRoutes, { initialNavigation: 'enabledBlocking' }),<% } %>
|
|
13
|
+
],
|
|
14
|
+
providers: [],
|
|
15
|
+
bootstrap: [AppComponent],
|
|
16
|
+
})
|
|
17
|
+
export class AppModule {}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<!--
|
|
1
|
+
import { Component, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: '<%= nxWelcomeSelector %>',
|
|
5
|
+
template: `
|
|
6
|
+
<!--
|
|
8
7
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
9
8
|
This is a starter component and can be deleted.
|
|
10
9
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
@@ -58,7 +57,6 @@ exports.nrwlHomeTemplate = {
|
|
|
58
57
|
display: block;
|
|
59
58
|
vertical-align: middle;
|
|
60
59
|
}
|
|
61
|
-
|
|
62
60
|
svg {
|
|
63
61
|
shape-rendering: auto;
|
|
64
62
|
text-rendering: optimizeLegibility;
|
|
@@ -72,7 +70,6 @@ exports.nrwlHomeTemplate = {
|
|
|
72
70
|
overflow: scroll;
|
|
73
71
|
padding: 0.5rem 0.75rem;
|
|
74
72
|
}
|
|
75
|
-
|
|
76
73
|
.shadow {
|
|
77
74
|
box-shadow: 0 0 #0000, 0 0 #0000, 0 10px 15px -3px rgba(0, 0, 0, 0.1),
|
|
78
75
|
0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
@@ -80,7 +77,6 @@ exports.nrwlHomeTemplate = {
|
|
|
80
77
|
.rounded {
|
|
81
78
|
border-radius: 1.5rem;
|
|
82
79
|
}
|
|
83
|
-
|
|
84
80
|
.wrapper {
|
|
85
81
|
width: 100%;
|
|
86
82
|
}
|
|
@@ -159,7 +155,6 @@ exports.nrwlHomeTemplate = {
|
|
|
159
155
|
color: rgba(255, 255, 255, 1);
|
|
160
156
|
width: 66.666667%;
|
|
161
157
|
}
|
|
162
|
-
|
|
163
158
|
#middle-content {
|
|
164
159
|
align-items: flex-start;
|
|
165
160
|
display: grid;
|
|
@@ -167,7 +162,6 @@ exports.nrwlHomeTemplate = {
|
|
|
167
162
|
grid-template-columns: 1fr;
|
|
168
163
|
margin-top: 3.5rem;
|
|
169
164
|
}
|
|
170
|
-
|
|
171
165
|
#learning-materials {
|
|
172
166
|
padding: 2.5rem 2rem;
|
|
173
167
|
}
|
|
@@ -243,7 +237,6 @@ exports.nrwlHomeTemplate = {
|
|
|
243
237
|
.list-item-link:hover svg:last-child {
|
|
244
238
|
transform: translateX(0.25rem);
|
|
245
239
|
}
|
|
246
|
-
|
|
247
240
|
#other-links {
|
|
248
241
|
}
|
|
249
242
|
.button-pill {
|
|
@@ -290,14 +283,12 @@ exports.nrwlHomeTemplate = {
|
|
|
290
283
|
.nx-console svg {
|
|
291
284
|
color: rgba(0, 122, 204, 1);
|
|
292
285
|
}
|
|
293
|
-
|
|
294
286
|
#nx-repo:hover {
|
|
295
287
|
background-color: rgba(24, 23, 23, 1);
|
|
296
288
|
}
|
|
297
289
|
#nx-repo svg {
|
|
298
290
|
color: rgba(24, 23, 23, 1);
|
|
299
291
|
}
|
|
300
|
-
|
|
301
292
|
#nx-cloud {
|
|
302
293
|
margin-bottom: 2rem;
|
|
303
294
|
margin-top: 2rem;
|
|
@@ -345,10 +336,8 @@ exports.nrwlHomeTemplate = {
|
|
|
345
336
|
#nx-cloud a:hover {
|
|
346
337
|
text-decoration: underline;
|
|
347
338
|
}
|
|
348
|
-
|
|
349
339
|
#commands {
|
|
350
340
|
padding: 2.5rem 2rem;
|
|
351
|
-
|
|
352
341
|
margin-top: 3.5rem;
|
|
353
342
|
}
|
|
354
343
|
#commands h2 {
|
|
@@ -398,7 +387,6 @@ exports.nrwlHomeTemplate = {
|
|
|
398
387
|
margin-right: 1rem;
|
|
399
388
|
width: 1.5rem;
|
|
400
389
|
}
|
|
401
|
-
|
|
402
390
|
#love {
|
|
403
391
|
color: rgba(107, 114, 128, 1);
|
|
404
392
|
font-size: 0.875rem;
|
|
@@ -414,7 +402,6 @@ exports.nrwlHomeTemplate = {
|
|
|
414
402
|
display: inline;
|
|
415
403
|
margin-top: -0.25rem;
|
|
416
404
|
}
|
|
417
|
-
|
|
418
405
|
@media screen and (min-width: 768px) {
|
|
419
406
|
#hero {
|
|
420
407
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
@@ -433,10 +420,9 @@ exports.nrwlHomeTemplate = {
|
|
|
433
420
|
<div id="welcome">
|
|
434
421
|
<h1>
|
|
435
422
|
<span> Hello there, </span>
|
|
436
|
-
Welcome
|
|
423
|
+
Welcome <%= appName %> 👋
|
|
437
424
|
</h1>
|
|
438
425
|
</div>
|
|
439
|
-
|
|
440
426
|
<!-- HERO -->
|
|
441
427
|
<div id="hero" class="rounded">
|
|
442
428
|
<div class="text-container">
|
|
@@ -471,7 +457,6 @@ exports.nrwlHomeTemplate = {
|
|
|
471
457
|
</svg>
|
|
472
458
|
</div>
|
|
473
459
|
</div>
|
|
474
|
-
|
|
475
460
|
<!-- MIDDLE CONTENT -->
|
|
476
461
|
<div id="middle-content">
|
|
477
462
|
<div id="learning-materials" class="rounded shadow">
|
|
@@ -725,7 +710,6 @@ exports.nrwlHomeTemplate = {
|
|
|
725
710
|
</a>
|
|
726
711
|
</div>
|
|
727
712
|
</div>
|
|
728
|
-
|
|
729
713
|
<!-- COMMANDS -->
|
|
730
714
|
<div id="commands" class="rounded shadow">
|
|
731
715
|
<h2>Next steps</h2>
|
|
@@ -749,7 +733,6 @@ exports.nrwlHomeTemplate = {
|
|
|
749
733
|
</summary>
|
|
750
734
|
<pre><span># Generate UI lib</span>
|
|
751
735
|
nx g @nrwl/angular:lib ui
|
|
752
|
-
|
|
753
736
|
<span># Add a component</span>
|
|
754
737
|
nx g @nrwl/angular:component button --project ui</pre>
|
|
755
738
|
</details>
|
|
@@ -791,15 +774,12 @@ nx g @nrwl/angular:component button --project ui</pre>
|
|
|
791
774
|
</summary>
|
|
792
775
|
<pre><span># see what's been affected by changes</span>
|
|
793
776
|
nx affected:graph
|
|
794
|
-
|
|
795
777
|
<span># run tests for current changes</span>
|
|
796
778
|
nx affected:test
|
|
797
|
-
|
|
798
779
|
<span># run e2e tests for current changes</span>
|
|
799
780
|
nx affected:e2e</pre>
|
|
800
781
|
</details>
|
|
801
782
|
</div>
|
|
802
|
-
|
|
803
783
|
<p id="love">
|
|
804
784
|
Carefully crafted with
|
|
805
785
|
<svg
|
|
@@ -819,5 +799,7 @@ nx affected:e2e</pre>
|
|
|
819
799
|
</div>
|
|
820
800
|
</div>
|
|
821
801
|
`,
|
|
822
|
-
|
|
823
|
-
|
|
802
|
+
styles: [],
|
|
803
|
+
encapsulation: ViewEncapsulation.None,
|
|
804
|
+
})
|
|
805
|
+
export class NxWelcomeComponent {}
|
package/src/generators/application/files/standalone-components/src/app/app.component.__style__
ADDED
|
File without changes
|
package/src/generators/application/files/standalone-components/src/app/app.component.html__tpl__
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<% if(minimal) { %><h1>Welcome <%= appName %></h1><% } else { %><<%= nxWelcomeSelector %>></<%= nxWelcomeSelector %>><% } %> <% if(routing) { %><router-outlet></router-outlet><% } %>
|
package/src/generators/application/files/standalone-components/src/app/app.component.spec.ts__tpl__
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
import { AppComponent } from './app.component';<% if(!minimal) { %>
|
|
3
|
+
import { NxWelcomeComponent } from './nx-welcome.component';<% } %><% if(routing) { %>
|
|
4
|
+
import { RouterTestingModule } from '@angular/router/testing';<% } %>
|
|
5
|
+
|
|
6
|
+
describe('AppComponent', () => {
|
|
7
|
+
beforeEach(async () => {
|
|
8
|
+
await TestBed.configureTestingModule({
|
|
9
|
+
imports: [AppComponent<% if(!minimal) { %>, NxWelcomeComponent<% } %><% if(routing) { %>, RouterTestingModule<% } %>],
|
|
10
|
+
}).compileComponents();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should render title', () => {
|
|
14
|
+
const fixture = TestBed.createComponent(AppComponent);
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
const compiled = fixture.nativeElement as HTMLElement;
|
|
17
|
+
expect(compiled.querySelector('h1')?.textContent).toContain('Welcome <%= appName %>');
|
|
18
|
+
});<% if(!minimal) { %>
|
|
19
|
+
|
|
20
|
+
it(`should have as title '<%= appName %>'`, () => {
|
|
21
|
+
const fixture = TestBed.createComponent(AppComponent);
|
|
22
|
+
const app = fixture.componentInstance;
|
|
23
|
+
expect(app.title).toEqual('<%= appName %>');
|
|
24
|
+
});<% } %>
|
|
25
|
+
});
|
package/src/generators/application/files/standalone-components/src/app/app.component.ts__tpl__
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component<% if(viewEncapsulation) { %>, ViewEncapsulation<% } %> } from '@angular/core';<% if(routing) { %>
|
|
2
|
+
import { RouterModule } from '@angular/router';<% } %><% if(!minimal) { %>
|
|
3
|
+
import { NxWelcomeComponent } from './nx-welcome.component';<% } %>
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
standalone: true,
|
|
7
|
+
imports: [<% if(!minimal) { %>NxWelcomeComponent, <% } %><% if(routing) { %>RouterModule<% } %>],
|
|
8
|
+
selector: '<%= rootSelector %>',<% if(!inlineTemplate) { %>
|
|
9
|
+
templateUrl: './app.component.html',<% } else { %>
|
|
10
|
+
template: `<% if(minimal) { %><h1>Welcome <%= appName %></h1><% } else { %><<%= nxWelcomeSelector %>></<%= nxWelcomeSelector %>><% } %> <% if(routing) { %><router-outlet></router-outlet><% } %>`,<% } %><% if(!inlineStyle) { %>
|
|
11
|
+
styleUrls: ['./app.component.<%= style %>'],<% } else { %>
|
|
12
|
+
styles: [''],<% } %><% if(viewEncapsulation) { %>
|
|
13
|
+
encapsulation: ViewEncapsulation.<%= viewEncapsulation %>,<% } %>
|
|
14
|
+
})
|
|
15
|
+
export class AppComponent {<% if(!minimal) { %>
|
|
16
|
+
title = '<%= appName %>';
|
|
17
|
+
<% } %>}
|