@angular-devkit/schematics 17.1.0-next.3 → 17.1.0-rc.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/package.json +2 -2
- package/src/rules/template.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/schematics",
|
|
3
|
-
"version": "17.1.0-
|
|
3
|
+
"version": "17.1.0-rc.0",
|
|
4
4
|
"description": "Angular Schematics - Library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"typings": "src/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"tooling"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@angular-devkit/core": "17.1.0-
|
|
21
|
+
"@angular-devkit/core": "17.1.0-rc.0",
|
|
22
22
|
"jsonc-parser": "3.2.0",
|
|
23
23
|
"magic-string": "0.30.5",
|
|
24
24
|
"ora": "5.4.1",
|
package/src/rules/template.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.applyTemplates = exports.template = exports.renameTemplateFiles = exports.pathTemplate = exports.applyPathTemplate = exports.contentTemplate = exports.applyContentTemplate = exports.InvalidPipeException = exports.UnknownPipeException = exports.OptionIsNotDefinedException = exports.TEMPLATE_FILENAME_RE = void 0;
|
|
11
11
|
const core_1 = require("@angular-devkit/core");
|
|
12
|
-
const
|
|
12
|
+
const node_os_1 = require("node:os");
|
|
13
13
|
const base_1 = require("./base");
|
|
14
14
|
exports.TEMPLATE_FILENAME_RE = /\.template$/;
|
|
15
15
|
class OptionIsNotDefinedException extends core_1.BaseException {
|
|
@@ -30,12 +30,12 @@ class InvalidPipeException extends core_1.BaseException {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
exports.InvalidPipeException = InvalidPipeException;
|
|
33
|
-
const decoder = new
|
|
33
|
+
const decoder = new TextDecoder('utf-8', { fatal: true });
|
|
34
34
|
function applyContentTemplate(options) {
|
|
35
35
|
return (entry) => {
|
|
36
36
|
const { path, content } = entry;
|
|
37
37
|
try {
|
|
38
|
-
const decodedContent = decoder.decode(content);
|
|
38
|
+
const decodedContent = decoder.decode(content).replace(/\r?\n/g, node_os_1.EOL);
|
|
39
39
|
return {
|
|
40
40
|
path,
|
|
41
41
|
content: Buffer.from((0, core_1.template)(decodedContent, {})(options)),
|