@schematics/angular 14.1.0-next.3 → 14.1.0
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/app-shell/schema.json +0 -1
- package/application/other-files/app.component.html.template +1 -1
- package/e2e/index.js +4 -1
- package/e2e/schema.json +0 -1
- package/library/schema.json +0 -1
- package/module/files/__name@dasherize@if-flat__/__name@dasherize__.module.ts.template +2 -2
- package/package.json +4 -4
- package/utility/dependency.d.ts +22 -0
- package/utility/dependency.js +34 -10
- package/utility/index.d.ts +1 -1
- package/utility/index.js +2 -1
- package/utility/latest-versions/package.json +2 -2
- package/utility/latest-versions.js +1 -1
- package/app-shell/app-shell-long.md +0 -47
- package/e2e/e2e-long.md +0 -2
- package/library/files/.browserslistrc.template +0 -16
- package/library/library-long.md +0 -5
package/app-shell/schema.json
CHANGED
|
@@ -367,7 +367,7 @@
|
|
|
367
367
|
</a>
|
|
368
368
|
|
|
369
369
|
<a class="card" target="_blank" rel="noopener" href="https://material.angular.io">
|
|
370
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="margin-right: 8px" width="21.813" height="23.453" viewBox="0 0
|
|
370
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="margin-right: 8px" width="21.813" height="23.453" viewBox="0 0 179.2 192.7"><path fill="#ffa726" d="M89.4 0 0 32l13.5 118.4 75.9 42.3 76-42.3L179.2 32 89.4 0z"/><path fill="#fb8c00" d="M89.4 0v192.7l76-42.3L179.2 32 89.4 0z"/><path fill="#ffe0b2" d="m102.9 146.3-63.3-30.5 36.3-22.4 63.7 30.6-36.7 22.3z"/><path fill="#fff3e0" d="M102.9 122.8 39.6 92.2l36.3-22.3 63.7 30.6-36.7 22.3z"/><path fill="#fff" d="M102.9 99.3 39.6 68.7l36.3-22.4 63.7 30.6-36.7 22.4z"/></svg>
|
|
371
371
|
<span>Angular Material</span>
|
|
372
372
|
<svg class="material-icons" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>
|
|
373
373
|
</a>
|
package/e2e/index.js
CHANGED
|
@@ -65,7 +65,10 @@ function default_1(options) {
|
|
|
65
65
|
}),
|
|
66
66
|
(0, schematics_1.move)(e2eRootPath),
|
|
67
67
|
])),
|
|
68
|
-
...E2E_DEV_DEPENDENCIES.map((name) => (0, utility_1.addDependency)(name, latest_versions_1.latestVersions[name], {
|
|
68
|
+
...E2E_DEV_DEPENDENCIES.map((name) => (0, utility_1.addDependency)(name, latest_versions_1.latestVersions[name], {
|
|
69
|
+
type: utility_1.DependencyType.Dev,
|
|
70
|
+
existing: utility_1.ExistingBehavior.Skip,
|
|
71
|
+
})),
|
|
69
72
|
addScriptsToPackageJson(),
|
|
70
73
|
]);
|
|
71
74
|
});
|
package/e2e/schema.json
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
"type": "object",
|
|
6
6
|
"additionalProperties": false,
|
|
7
7
|
"description": "Generates a new, generic end-to-end test definition for the given or default project.",
|
|
8
|
-
"long-description": "e2e-long.md",
|
|
9
8
|
"properties": {
|
|
10
9
|
"rootSelector": {
|
|
11
10
|
"description": "The HTML selector for the root component of the test app.",
|
package/library/schema.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';<% if (commonModule) { %>
|
|
2
2
|
import { CommonModule } from '@angular/common';<% } %><% if (lazyRouteWithoutRouteModule) { %>
|
|
3
3
|
import { Routes, RouterModule } from '@angular/router';<% } %>
|
|
4
|
-
<% if (routing || lazyRouteWithRouteModule) { %>
|
|
4
|
+
<% if ((!lazyRoute && routing) || lazyRouteWithRouteModule) { %>
|
|
5
5
|
import { <%= classify(name) %>RoutingModule } from './<%= dasherize(name) %>-routing.module';<% } %>
|
|
6
6
|
<% if (lazyRouteWithoutRouteModule) { %>
|
|
7
7
|
const routes: Routes = [
|
|
@@ -11,7 +11,7 @@ const routes: Routes = [
|
|
|
11
11
|
@NgModule({
|
|
12
12
|
declarations: [],
|
|
13
13
|
imports: [<% if (commonModule) { %>
|
|
14
|
-
CommonModule<% } %><% if (routing || lazyRouteWithRouteModule) { %>,
|
|
14
|
+
CommonModule<% } %><% if ((!lazyRoute && routing) || lazyRouteWithRouteModule) { %>,
|
|
15
15
|
<%= classify(name) %>RoutingModule<% } %><% if (lazyRouteWithoutRouteModule) { %>,
|
|
16
16
|
RouterModule.forChild(routes)<% } %>
|
|
17
17
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematics/angular",
|
|
3
|
-
"version": "14.1.0
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"description": "Schematics specific to Angular",
|
|
5
5
|
"homepage": "https://github.com/angular/angular-cli",
|
|
6
6
|
"keywords": [
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
},
|
|
24
24
|
"schematics": "./collection.json",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@angular-devkit/core": "14.1.0
|
|
27
|
-
"@angular-devkit/schematics": "14.1.0
|
|
28
|
-
"jsonc-parser": "3.
|
|
26
|
+
"@angular-devkit/core": "14.1.0",
|
|
27
|
+
"@angular-devkit/schematics": "14.1.0",
|
|
28
|
+
"jsonc-parser": "3.1.0"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
package/utility/dependency.d.ts
CHANGED
|
@@ -38,6 +38,23 @@ export declare enum InstallBehavior {
|
|
|
38
38
|
*/
|
|
39
39
|
Always = 2
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* An enum used to specify the existing dependency behavior for the {@link addDependency}
|
|
43
|
+
* schematics rule. The existing behavior affects whether the named dependency will be added
|
|
44
|
+
* to the `package.json` when the dependency is already present with a differing specifier.
|
|
45
|
+
*/
|
|
46
|
+
export declare enum ExistingBehavior {
|
|
47
|
+
/**
|
|
48
|
+
* The dependency will not be added or otherwise changed if it already exists.
|
|
49
|
+
*/
|
|
50
|
+
Skip = 0,
|
|
51
|
+
/**
|
|
52
|
+
* The dependency's existing specifier will be replaced with the specifier provided in the
|
|
53
|
+
* {@link addDependency} call. A warning will also be shown during schematic execution to
|
|
54
|
+
* notify the user of the replacement.
|
|
55
|
+
*/
|
|
56
|
+
Replace = 1
|
|
57
|
+
}
|
|
41
58
|
/**
|
|
42
59
|
* Adds a package as a dependency to a `package.json`. By default the `package.json` located
|
|
43
60
|
* at the schematic's root will be used. The `manifestPath` option can be used to explicitly specify
|
|
@@ -71,4 +88,9 @@ export declare function addDependency(name: string, specifier: string, options?:
|
|
|
71
88
|
* Defaults to {@link InstallBehavior.Auto}.
|
|
72
89
|
*/
|
|
73
90
|
install?: InstallBehavior;
|
|
91
|
+
/**
|
|
92
|
+
* The behavior to use when the dependency already exists within the `package.json`.
|
|
93
|
+
* Defaults to {@link ExistingBehavior.Replace}.
|
|
94
|
+
*/
|
|
95
|
+
existing?: ExistingBehavior;
|
|
74
96
|
}): Rule;
|
package/utility/dependency.js
CHANGED
|
@@ -30,7 +30,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.addDependency = exports.InstallBehavior = exports.DependencyType = void 0;
|
|
33
|
+
exports.addDependency = exports.ExistingBehavior = exports.InstallBehavior = exports.DependencyType = void 0;
|
|
34
34
|
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
35
35
|
const path = __importStar(require("path"));
|
|
36
36
|
const installTasks = new WeakMap();
|
|
@@ -68,6 +68,24 @@ var InstallBehavior;
|
|
|
68
68
|
*/
|
|
69
69
|
InstallBehavior[InstallBehavior["Always"] = 2] = "Always";
|
|
70
70
|
})(InstallBehavior = exports.InstallBehavior || (exports.InstallBehavior = {}));
|
|
71
|
+
/**
|
|
72
|
+
* An enum used to specify the existing dependency behavior for the {@link addDependency}
|
|
73
|
+
* schematics rule. The existing behavior affects whether the named dependency will be added
|
|
74
|
+
* to the `package.json` when the dependency is already present with a differing specifier.
|
|
75
|
+
*/
|
|
76
|
+
var ExistingBehavior;
|
|
77
|
+
(function (ExistingBehavior) {
|
|
78
|
+
/**
|
|
79
|
+
* The dependency will not be added or otherwise changed if it already exists.
|
|
80
|
+
*/
|
|
81
|
+
ExistingBehavior[ExistingBehavior["Skip"] = 0] = "Skip";
|
|
82
|
+
/**
|
|
83
|
+
* The dependency's existing specifier will be replaced with the specifier provided in the
|
|
84
|
+
* {@link addDependency} call. A warning will also be shown during schematic execution to
|
|
85
|
+
* notify the user of the replacement.
|
|
86
|
+
*/
|
|
87
|
+
ExistingBehavior[ExistingBehavior["Replace"] = 1] = "Replace";
|
|
88
|
+
})(ExistingBehavior = exports.ExistingBehavior || (exports.ExistingBehavior = {}));
|
|
71
89
|
/**
|
|
72
90
|
* Adds a package as a dependency to a `package.json`. By default the `package.json` located
|
|
73
91
|
* at the schematic's root will be used. The `manifestPath` option can be used to explicitly specify
|
|
@@ -85,7 +103,7 @@ var InstallBehavior;
|
|
|
85
103
|
* @returns A Schematics {@link Rule}
|
|
86
104
|
*/
|
|
87
105
|
function addDependency(name, specifier, options = {}) {
|
|
88
|
-
const { type = DependencyType.Default, packageJsonPath = '/package.json', install = InstallBehavior.Auto, } = options;
|
|
106
|
+
const { type = DependencyType.Default, packageJsonPath = '/package.json', install = InstallBehavior.Auto, existing = ExistingBehavior.Replace, } = options;
|
|
89
107
|
return (tree, context) => {
|
|
90
108
|
var _a;
|
|
91
109
|
const manifest = tree.readJson(packageJsonPath);
|
|
@@ -94,15 +112,21 @@ function addDependency(name, specifier, options = {}) {
|
|
|
94
112
|
// Section is not present. The dependency can be added to a new object literal for the section.
|
|
95
113
|
manifest[type] = { [name]: specifier };
|
|
96
114
|
}
|
|
97
|
-
else if (dependencySection[name] === specifier) {
|
|
98
|
-
// Already present with same specifier
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
else if (dependencySection[name]) {
|
|
102
|
-
// Already present but different specifier
|
|
103
|
-
throw new Error(`Package dependency "${name}" already exists with a different specifier.`);
|
|
104
|
-
}
|
|
105
115
|
else {
|
|
116
|
+
const existingSpecifier = dependencySection[name];
|
|
117
|
+
if (existingSpecifier === specifier) {
|
|
118
|
+
// Already present with same specifier
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (existingSpecifier) {
|
|
122
|
+
// Already present but different specifier
|
|
123
|
+
if (existing === ExistingBehavior.Skip) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
// ExistingBehavior.Replace is the only other behavior currently
|
|
127
|
+
context.logger.warn(`Package dependency "${name}" already exists with a different specifier. ` +
|
|
128
|
+
`"${existingSpecifier}" will be replaced with "${specifier}".`);
|
|
129
|
+
}
|
|
106
130
|
// Add new dependency in alphabetical order
|
|
107
131
|
const entries = Object.entries(dependencySection);
|
|
108
132
|
entries.push([name, specifier]);
|
package/utility/index.d.ts
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export { ProjectDefinition, TargetDefinition, WorkspaceDefinition, getWorkspace as readWorkspace, updateWorkspace, writeWorkspace, } from './workspace';
|
|
9
9
|
export { Builders as AngularBuilder } from './workspace-models';
|
|
10
|
-
export { DependencyType, InstallBehavior, addDependency } from './dependency';
|
|
10
|
+
export { DependencyType, ExistingBehavior, InstallBehavior, addDependency } from './dependency';
|
package/utility/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.addDependency = exports.InstallBehavior = exports.DependencyType = exports.AngularBuilder = exports.writeWorkspace = exports.updateWorkspace = exports.readWorkspace = void 0;
|
|
10
|
+
exports.addDependency = exports.InstallBehavior = exports.ExistingBehavior = exports.DependencyType = exports.AngularBuilder = exports.writeWorkspace = exports.updateWorkspace = exports.readWorkspace = void 0;
|
|
11
11
|
// Workspace related rules and types
|
|
12
12
|
var workspace_1 = require("./workspace");
|
|
13
13
|
Object.defineProperty(exports, "readWorkspace", { enumerable: true, get: function () { return workspace_1.getWorkspace; } });
|
|
@@ -18,5 +18,6 @@ Object.defineProperty(exports, "AngularBuilder", { enumerable: true, get: functi
|
|
|
18
18
|
// Package dependency related rules and types
|
|
19
19
|
var dependency_1 = require("./dependency");
|
|
20
20
|
Object.defineProperty(exports, "DependencyType", { enumerable: true, get: function () { return dependency_1.DependencyType; } });
|
|
21
|
+
Object.defineProperty(exports, "ExistingBehavior", { enumerable: true, get: function () { return dependency_1.ExistingBehavior; } });
|
|
21
22
|
Object.defineProperty(exports, "InstallBehavior", { enumerable: true, get: function () { return dependency_1.InstallBehavior; } });
|
|
22
23
|
Object.defineProperty(exports, "addDependency", { enumerable: true, get: function () { return dependency_1.addDependency; } });
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"karma-jasmine-html-reporter": "~2.0.0",
|
|
13
13
|
"karma-jasmine": "~5.1.0",
|
|
14
14
|
"karma": "~6.4.0",
|
|
15
|
-
"ng-packagr": "^14.
|
|
15
|
+
"ng-packagr": "^14.1.0",
|
|
16
16
|
"protractor": "~7.0.0",
|
|
17
17
|
"rxjs": "~7.5.0",
|
|
18
18
|
"tslib": "^2.3.0",
|
|
19
|
-
"ts-node": "~10.
|
|
19
|
+
"ts-node": "~10.9.0",
|
|
20
20
|
"typescript": "~4.7.2",
|
|
21
21
|
"zone.js": "~0.11.4"
|
|
22
22
|
}
|
|
@@ -13,7 +13,7 @@ exports.latestVersions = {
|
|
|
13
13
|
// but ts_library doesn't support JSON inputs.
|
|
14
14
|
...require('./latest-versions/package.json')['dependencies'],
|
|
15
15
|
// As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
|
|
16
|
-
Angular: '^14.
|
|
16
|
+
Angular: '^14.1.0',
|
|
17
17
|
// Since @angular-devkit/build-angular and @schematics/angular are always
|
|
18
18
|
// published together from the same monorepo, and they are both
|
|
19
19
|
// non-experimental, they will always have the same version.
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
An app shell lets Universal render a portion of your application via a route at build time.
|
|
2
|
-
This gives users a meaningful first paint of your application that appears quickly
|
|
3
|
-
because the browser can simply render the HTML without the need to initialize any JavaScript.
|
|
4
|
-
|
|
5
|
-
Use this command with a routing app that is accompanied by a Universal server-side app.
|
|
6
|
-
|
|
7
|
-
To create an app shell, use the following command.
|
|
8
|
-
|
|
9
|
-
<code-example format="." language="bash">
|
|
10
|
-
ng generate app-shell my-app
|
|
11
|
-
</code-example>
|
|
12
|
-
|
|
13
|
-
- `my-app` is the name of your client application
|
|
14
|
-
- `server-app` is the name of the Universal (server) application
|
|
15
|
-
|
|
16
|
-
The command adds two new architect build targets to your `angular.json` configuration file (along with a few other changes).
|
|
17
|
-
|
|
18
|
-
<code-example format="." language="none" linenums="false">
|
|
19
|
-
"server": {
|
|
20
|
-
"builder": "@angular-devkit/build-angular:server",
|
|
21
|
-
"options": {
|
|
22
|
-
"outputPath": "dist/my-app-server",
|
|
23
|
-
"main": "src/main.server.ts",
|
|
24
|
-
"tsConfig": "src/tsconfig.server.json"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"app-shell": {
|
|
28
|
-
"builder": "@angular-devkit/build-angular:app-shell",
|
|
29
|
-
"options": {
|
|
30
|
-
"browserTarget": "my-app:build",
|
|
31
|
-
"serverTarget": "my-app:server",
|
|
32
|
-
"route": "shell"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
</code-example>
|
|
36
|
-
|
|
37
|
-
To verify the that the app has been built with the default shell content:
|
|
38
|
-
|
|
39
|
-
1. Run the app-shell target.
|
|
40
|
-
|
|
41
|
-
<code-example format="." language="bash">
|
|
42
|
-
ng run my-app:app-shell
|
|
43
|
-
</code-example>
|
|
44
|
-
|
|
45
|
-
1. Open `dist/app-shell/index.html` in your browser.
|
|
46
|
-
|
|
47
|
-
The default text "app-shell works!" verifies that the app-shell route was rendered as part of the output.
|
package/e2e/e2e-long.md
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
|
2
|
-
# For additional information regarding the format and rule options, please see:
|
|
3
|
-
# https://github.com/browserslist/browserslist#queries
|
|
4
|
-
|
|
5
|
-
# For the full list of supported browsers by the Angular framework, please see:
|
|
6
|
-
# https://angular.io/guide/browser-support
|
|
7
|
-
|
|
8
|
-
# You can see what browsers were selected by your queries by running:
|
|
9
|
-
# npx browserslist
|
|
10
|
-
|
|
11
|
-
last 1 Chrome version
|
|
12
|
-
last 1 Firefox version
|
|
13
|
-
last 2 Edge major versions
|
|
14
|
-
last 2 Safari major versions
|
|
15
|
-
last 2 iOS major versions
|
|
16
|
-
Firefox ESR
|
package/library/library-long.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
A library is a type of project that does not run independently.
|
|
2
|
-
The library skeleton created by this command is placed by default in the `/projects` folder, and has `type` of "library".
|
|
3
|
-
|
|
4
|
-
You can build a new library using the `ng build` command, run unit tests for it using the `ng test` command,
|
|
5
|
-
and lint it using the `ng lint` command.
|