@schematics/angular 14.0.1 → 14.0.4
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/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/workspace/files/__dot__vscode/launch.json.template +2 -2
- package/workspace/files/__dot__vscode/tasks.json.template +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematics/angular",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.4",
|
|
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.4",
|
|
27
|
+
"@angular-devkit/schematics": "14.0.4",
|
|
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
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"request": "launch",
|
|
9
9
|
"preLaunchTask": "npm: start",
|
|
10
10
|
"url": "http://localhost:4200/"
|
|
11
|
-
}
|
|
11
|
+
}<% if (!minimal) { %>,
|
|
12
12
|
{
|
|
13
13
|
"name": "ng test",
|
|
14
14
|
"type": "chrome",
|
|
15
15
|
"request": "launch",
|
|
16
16
|
"preLaunchTask": "npm: test",
|
|
17
17
|
"url": "http://localhost:9876/debug.html"
|
|
18
|
-
}
|
|
18
|
+
}<% } %>
|
|
19
19
|
]
|
|
20
20
|
}
|