@schematics/angular 17.1.0-rc.0 → 17.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/application/files/common-files/src/app/app.component.html.template +4 -4
- package/package.json +3 -3
- package/server/index.js +13 -16
- package/utility/ast-utils.js +4 -2
- package/utility/eol.d.ts +8 -0
- package/utility/eol.js +23 -0
- package/utility/json-file.d.ts +1 -0
- package/utility/json-file.js +4 -0
- package/utility/latest-versions/package.json +2 -2
- package/utility/latest-versions.js +3 -3
|
@@ -286,15 +286,15 @@
|
|
|
286
286
|
rel="noopener"
|
|
287
287
|
>
|
|
288
288
|
<svg
|
|
289
|
-
width="
|
|
290
|
-
height="
|
|
291
|
-
viewBox="0 0
|
|
289
|
+
width="24"
|
|
290
|
+
height="24"
|
|
291
|
+
viewBox="0 0 24 24"
|
|
292
292
|
fill="none"
|
|
293
293
|
xmlns="http://www.w3.org/2000/svg"
|
|
294
294
|
alt="Twitter"
|
|
295
295
|
>
|
|
296
296
|
<path
|
|
297
|
-
d="
|
|
297
|
+
d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"
|
|
298
298
|
/>
|
|
299
299
|
</svg>
|
|
300
300
|
</a>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematics/angular",
|
|
3
|
-
"version": "17.1.0
|
|
3
|
+
"version": "17.1.0",
|
|
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": "17.1.0
|
|
27
|
-
"@angular-devkit/schematics": "17.1.0
|
|
26
|
+
"@angular-devkit/core": "17.1.0",
|
|
27
|
+
"@angular-devkit/schematics": "17.1.0",
|
|
28
28
|
"jsonc-parser": "3.2.0"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
package/server/index.js
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const core_1 = require("@angular-devkit/core");
|
|
11
11
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
12
|
-
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
13
12
|
const node_path_1 = require("node:path");
|
|
14
13
|
const utility_1 = require("../utility");
|
|
15
14
|
const dependencies_1 = require("../utility/dependencies");
|
|
@@ -103,22 +102,23 @@ function updateTsConfigFile(tsConfigPath) {
|
|
|
103
102
|
json.modify(typePath, [...types]);
|
|
104
103
|
};
|
|
105
104
|
}
|
|
106
|
-
function addDependencies() {
|
|
105
|
+
function addDependencies(skipInstall) {
|
|
107
106
|
return (host) => {
|
|
108
107
|
const coreDep = (0, dependencies_1.getPackageJsonDependency)(host, '@angular/core');
|
|
109
108
|
if (coreDep === null) {
|
|
110
109
|
throw new schematics_1.SchematicsException('Could not find version.');
|
|
111
110
|
}
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
111
|
+
const install = skipInstall ? utility_1.InstallBehavior.None : utility_1.InstallBehavior.Auto;
|
|
112
|
+
return (0, schematics_1.chain)([
|
|
113
|
+
(0, utility_1.addDependency)('@angular/platform-server', coreDep.version, {
|
|
114
|
+
type: utility_1.DependencyType.Default,
|
|
115
|
+
install,
|
|
116
|
+
}),
|
|
117
|
+
(0, utility_1.addDependency)('@types/node', latest_versions_1.latestVersions['@types/node'], {
|
|
118
|
+
type: utility_1.DependencyType.Dev,
|
|
119
|
+
install,
|
|
120
|
+
}),
|
|
121
|
+
]);
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
function default_1(options) {
|
|
@@ -138,9 +138,6 @@ function default_1(options) {
|
|
|
138
138
|
// Server has already been added.
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
|
-
if (!options.skipInstall) {
|
|
142
|
-
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
143
|
-
}
|
|
144
141
|
const clientBuildOptions = clientBuildTarget.options;
|
|
145
142
|
const browserEntryPoint = await (0, util_1.getMainFilePath)(host, options.project);
|
|
146
143
|
const isStandalone = (0, ng_ast_utils_1.isStandaloneApp)(host, browserEntryPoint);
|
|
@@ -175,7 +172,7 @@ function default_1(options) {
|
|
|
175
172
|
])),
|
|
176
173
|
updateConfigFileBrowserBuilder(options, tsConfigDirectory),
|
|
177
174
|
]),
|
|
178
|
-
addDependencies(),
|
|
175
|
+
addDependencies(options.skipInstall),
|
|
179
176
|
(0, utility_1.addRootProvider)(options.project, ({ code, external }) => code `${external('provideClientHydration', '@angular/platform-browser')}()`),
|
|
180
177
|
]);
|
|
181
178
|
};
|
package/utility/ast-utils.js
CHANGED
|
@@ -34,6 +34,7 @@ exports.hasTopLevelIdentifier = exports.addRouteDeclarationToModule = exports.ge
|
|
|
34
34
|
const core_1 = require("@angular-devkit/core");
|
|
35
35
|
const ts = __importStar(require("../third_party/github.com/Microsoft/TypeScript/lib/typescript"));
|
|
36
36
|
const change_1 = require("./change");
|
|
37
|
+
const eol_1 = require("./eol");
|
|
37
38
|
/**
|
|
38
39
|
* Add Import `import { symbolName } from fileName` if the import doesn't exit
|
|
39
40
|
* already. Assumes fileToEdit can be resolved and accessed.
|
|
@@ -81,11 +82,12 @@ function insertImport(source, fileToEdit, symbolName, fileName, isDefault = fals
|
|
|
81
82
|
}
|
|
82
83
|
const open = isDefault ? '' : '{ ';
|
|
83
84
|
const close = isDefault ? '' : ' }';
|
|
85
|
+
const eol = (0, eol_1.getEOL)(rootNode.getText());
|
|
84
86
|
// if there are no imports or 'use strict' statement, insert import at beginning of file
|
|
85
87
|
const insertAtBeginning = allImports.length === 0 && useStrict.length === 0;
|
|
86
|
-
const separator = insertAtBeginning ? '' :
|
|
88
|
+
const separator = insertAtBeginning ? '' : `;${eol}`;
|
|
87
89
|
const toInsert = `${separator}import ${open}${importExpression}${close}` +
|
|
88
|
-
` from '${fileName}'${insertAtBeginning ?
|
|
90
|
+
` from '${fileName}'${insertAtBeginning ? `;${eol}` : ''}`;
|
|
89
91
|
return insertAfterLastOccurrence(allImports, toInsert, fileToEdit, fallbackPos, ts.SyntaxKind.StringLiteral);
|
|
90
92
|
}
|
|
91
93
|
exports.insertImport = insertImport;
|
package/utility/eol.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
export declare function getEOL(content: string): string;
|
package/utility/eol.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getEOL = void 0;
|
|
11
|
+
const node_os_1 = require("node:os");
|
|
12
|
+
const CRLF = '\r\n';
|
|
13
|
+
const LF = '\n';
|
|
14
|
+
function getEOL(content) {
|
|
15
|
+
const newlines = content.match(/(?:\r?\n)/g);
|
|
16
|
+
if (newlines?.length) {
|
|
17
|
+
const crlf = newlines.filter((l) => l === CRLF).length;
|
|
18
|
+
const lf = newlines.length - crlf;
|
|
19
|
+
return crlf > lf ? CRLF : LF;
|
|
20
|
+
}
|
|
21
|
+
return node_os_1.EOL;
|
|
22
|
+
}
|
|
23
|
+
exports.getEOL = getEOL;
|
package/utility/json-file.d.ts
CHANGED
package/utility/json-file.js
CHANGED
|
@@ -9,15 +9,18 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.JSONFile = void 0;
|
|
11
11
|
const jsonc_parser_1 = require("jsonc-parser");
|
|
12
|
+
const eol_1 = require("./eol");
|
|
12
13
|
/** @private */
|
|
13
14
|
class JSONFile {
|
|
14
15
|
host;
|
|
15
16
|
path;
|
|
16
17
|
content;
|
|
18
|
+
eol;
|
|
17
19
|
constructor(host, path) {
|
|
18
20
|
this.host = host;
|
|
19
21
|
this.path = path;
|
|
20
22
|
this.content = this.host.readText(this.path);
|
|
23
|
+
this.eol = (0, eol_1.getEOL)(this.content);
|
|
21
24
|
}
|
|
22
25
|
_jsonAst;
|
|
23
26
|
get JsonAst() {
|
|
@@ -55,6 +58,7 @@ class JSONFile {
|
|
|
55
58
|
const edits = (0, jsonc_parser_1.modify)(this.content, jsonPath, value, {
|
|
56
59
|
getInsertionIndex,
|
|
57
60
|
formattingOptions: {
|
|
61
|
+
eol: this.eol,
|
|
58
62
|
insertSpaces: true,
|
|
59
63
|
tabSize: 2,
|
|
60
64
|
},
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"karma-jasmine-html-reporter": "~2.1.0",
|
|
16
16
|
"karma-jasmine": "~5.1.0",
|
|
17
17
|
"karma": "~6.4.0",
|
|
18
|
-
"ng-packagr": "^17.1.0
|
|
18
|
+
"ng-packagr": "^17.1.0",
|
|
19
19
|
"protractor": "~7.0.0",
|
|
20
20
|
"rxjs": "~7.8.0",
|
|
21
21
|
"tslib": "^2.3.0",
|
|
22
22
|
"ts-node": "~10.9.0",
|
|
23
23
|
"typescript": "~5.3.2",
|
|
24
|
-
"zone.js": "~0.14.
|
|
24
|
+
"zone.js": "~0.14.3"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -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: '^17.1.0
|
|
17
|
-
DevkitBuildAngular: '^17.1.0
|
|
18
|
-
AngularSSR: '^17.1.0
|
|
16
|
+
Angular: '^17.1.0',
|
|
17
|
+
DevkitBuildAngular: '^17.1.0',
|
|
18
|
+
AngularSSR: '^17.1.0',
|
|
19
19
|
};
|