@schematics/angular 14.0.3 → 14.0.6
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/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 +3 -3
- package/universal/files/root/tsconfig.server.json.template +1 -4
- package/universal/index.js +12 -14
- package/universal/schema.d.ts +1 -0
- package/universal/schema.json +2 -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
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.0.
|
|
3
|
+
"version": "14.0.6",
|
|
4
4
|
"description": "Schematics specific to Angular",
|
|
5
5
|
"homepage": "https://github.com/angular/angular-cli",
|
|
6
6
|
"keywords": [
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"schematics": "./collection.json",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@angular-devkit/core": "14.0.
|
|
27
|
-
"@angular-devkit/schematics": "14.0.
|
|
26
|
+
"@angular-devkit/core": "14.0.6",
|
|
27
|
+
"@angular-devkit/schematics": "14.0.6",
|
|
28
28
|
"jsonc-parser": "3.0.0"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
package/universal/index.js
CHANGED
|
@@ -45,6 +45,7 @@ const workspace_1 = require("../utility/workspace");
|
|
|
45
45
|
const workspace_models_1 = require("../utility/workspace-models");
|
|
46
46
|
function updateConfigFile(options, tsConfigDirectory) {
|
|
47
47
|
return (0, workspace_1.updateWorkspace)((workspace) => {
|
|
48
|
+
var _a;
|
|
48
49
|
const clientProject = workspace.projects.get(options.project);
|
|
49
50
|
if (clientProject) {
|
|
50
51
|
// In case the browser builder hashes the assets
|
|
@@ -79,6 +80,7 @@ function updateConfigFile(options, tsConfigDirectory) {
|
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
const mainPath = options.main;
|
|
83
|
+
const sourceRoot = (_a = clientProject.sourceRoot) !== null && _a !== void 0 ? _a : (0, core_1.join)((0, core_1.normalize)(clientProject.root), 'src');
|
|
82
84
|
const serverTsConfig = (0, core_1.join)(tsConfigDirectory, 'tsconfig.server.json');
|
|
83
85
|
clientProject.targets.add({
|
|
84
86
|
name: 'server',
|
|
@@ -86,7 +88,7 @@ function updateConfigFile(options, tsConfigDirectory) {
|
|
|
86
88
|
defaultConfiguration: 'production',
|
|
87
89
|
options: {
|
|
88
90
|
outputPath: `dist/${options.project}/server`,
|
|
89
|
-
main: (0, core_1.join)((0, core_1.normalize)(
|
|
91
|
+
main: (0, core_1.join)((0, core_1.normalize)(sourceRoot), mainPath.endsWith('.ts') ? mainPath : mainPath + '.ts'),
|
|
90
92
|
tsConfig: serverTsConfig,
|
|
91
93
|
...((buildTarget === null || buildTarget === void 0 ? void 0 : buildTarget.options) ? getServerOptions(buildTarget === null || buildTarget === void 0 ? void 0 : buildTarget.options) : {}),
|
|
92
94
|
},
|
|
@@ -135,12 +137,12 @@ function wrapBootstrapCall(mainFile) {
|
|
|
135
137
|
const afterText = `\n${triviaWidth > 2 ? ' '.repeat(triviaWidth - 1) : ''}};\n` +
|
|
136
138
|
`
|
|
137
139
|
|
|
138
|
-
if (document.readyState === 'complete') {
|
|
139
|
-
|
|
140
|
-
} else {
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
`;
|
|
140
|
+
if (document.readyState === 'complete') {
|
|
141
|
+
bootstrap();
|
|
142
|
+
} else {
|
|
143
|
+
document.addEventListener('DOMContentLoaded', bootstrap);
|
|
144
|
+
}
|
|
145
|
+
`;
|
|
144
146
|
// in some cases we need to cater for a trailing semicolon such as;
|
|
145
147
|
// bootstrap().catch(err => console.log(err));
|
|
146
148
|
const lastToken = bootstrapCall.parent.getLastToken();
|
|
@@ -215,12 +217,6 @@ function default_1(options) {
|
|
|
215
217
|
}
|
|
216
218
|
const clientBuildOptions = (clientBuildTarget.options ||
|
|
217
219
|
{});
|
|
218
|
-
const clientTsConfig = (0, core_1.normalize)(clientBuildOptions.tsConfig);
|
|
219
|
-
const tsConfigExtends = (0, core_1.basename)(clientTsConfig);
|
|
220
|
-
// this is needed because prior to version 8, tsconfig might have been in 'src'
|
|
221
|
-
// and we don't want to break the 'ng add @nguniversal/express-engine schematics'
|
|
222
|
-
const rootInSrc = clientProject.root === '' && clientTsConfig.includes('src/');
|
|
223
|
-
const tsConfigDirectory = (0, core_1.join)((0, core_1.normalize)(clientProject.root), rootInSrc ? 'src' : '');
|
|
224
220
|
if (!options.skipInstall) {
|
|
225
221
|
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
226
222
|
}
|
|
@@ -233,6 +229,9 @@ function default_1(options) {
|
|
|
233
229
|
}),
|
|
234
230
|
(0, schematics_1.move)((0, core_1.join)((0, core_1.normalize)(clientProject.root), 'src')),
|
|
235
231
|
]);
|
|
232
|
+
const clientTsConfig = (0, core_1.normalize)(clientBuildOptions.tsConfig);
|
|
233
|
+
const tsConfigExtends = (0, core_1.basename)(clientTsConfig);
|
|
234
|
+
const tsConfigDirectory = (0, core_1.dirname)(clientTsConfig);
|
|
236
235
|
const rootSource = (0, schematics_1.apply)((0, schematics_1.url)('./files/root'), [
|
|
237
236
|
(0, schematics_1.applyTemplates)({
|
|
238
237
|
...schematics_1.strings,
|
|
@@ -240,7 +239,6 @@ function default_1(options) {
|
|
|
240
239
|
stripTsExtension: (s) => s.replace(/\.ts$/, ''),
|
|
241
240
|
tsConfigExtends,
|
|
242
241
|
relativePathToWorkspaceRoot: (0, paths_1.relativePathToWorkspaceRoot)(tsConfigDirectory),
|
|
243
|
-
rootInSrc,
|
|
244
242
|
}),
|
|
245
243
|
(0, schematics_1.move)(tsConfigDirectory),
|
|
246
244
|
]);
|
package/universal/schema.d.ts
CHANGED
package/universal/schema.json
CHANGED
|
@@ -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.
|