@smapiot/pilet-template-angular 1.0.13 → 1.0.15-beta.8123
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/README.md +1 -1
- package/lib/index.js +185 -189
- package/package.json +4 -4
- package/src/helpers.ts +4 -4
- package/src/index.ts +1 -1
- package/src/versions.ts +3 -0
- package/templates/index.standalone.tsx.ejs +3 -3
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ For this template we have:
|
|
|
31
31
|
|
|
32
32
|
- **src**: Sets the directory of the source files. By default it's `<root>/src`.
|
|
33
33
|
- **standalone**: Sets if the pilet should be considered standalone, i.e., with Angular provided by the pilet. By default, this is derived from inspecting the used Piral instance (if it contains `piral-ng` then `standalone` would be set to `false`)
|
|
34
|
-
- **ngVersion**: Sets the (major) version of Angular to be used in case of a standalone pilet. Otherwise, would be discarded.
|
|
34
|
+
- **ngVersion**: Sets the (major) version of Angular to be used in case of a standalone pilet. Otherwise, would be discarded. By default, Angular 18 is used.
|
|
35
35
|
- **ngStandalone**: Sets if the Angular components should be configured as standalone in the `@Component` directive. By default, for Angular 19+ this is set to `true`. Otherwise, it will be set to `false`.
|
|
36
36
|
|
|
37
37
|
## License
|
package/lib/index.js
CHANGED
|
@@ -2,23 +2,8 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
7
|
var __commonJS = (cb, mod) => function __require() {
|
|
23
8
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
24
9
|
};
|
|
@@ -26,34 +11,35 @@ var __export = (target, all) => {
|
|
|
26
11
|
for (var name in all)
|
|
27
12
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
13
|
};
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
for (let key of __getOwnPropNames(
|
|
32
|
-
if (!__hasOwnProp.call(
|
|
33
|
-
__defProp(
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
19
|
}
|
|
35
|
-
return
|
|
36
|
-
};
|
|
37
|
-
var __toESM = (module2, isNodeMode) => {
|
|
38
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
20
|
+
return to;
|
|
39
21
|
};
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
31
|
|
|
46
32
|
// ../../packages/template-utils/lib/log.js
|
|
47
33
|
var require_log = __commonJS({
|
|
48
|
-
"../../packages/template-utils/lib/log.js"(
|
|
34
|
+
"../../packages/template-utils/lib/log.js"(exports2) {
|
|
49
35
|
"use strict";
|
|
50
|
-
Object.defineProperty(
|
|
51
|
-
|
|
36
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
37
|
+
exports2.setLogLevel = setLogLevel;
|
|
38
|
+
exports2.log = log2;
|
|
52
39
|
var logLevel = "warn";
|
|
53
40
|
function setLogLevel(level) {
|
|
54
41
|
logLevel = level;
|
|
55
42
|
}
|
|
56
|
-
exports.setLogLevel = setLogLevel;
|
|
57
43
|
function log2(level, message) {
|
|
58
44
|
if (level === "error") {
|
|
59
45
|
if (logLevel !== "disabled") {
|
|
@@ -73,16 +59,20 @@ var require_log = __commonJS({
|
|
|
73
59
|
}
|
|
74
60
|
}
|
|
75
61
|
}
|
|
76
|
-
exports.log = log2;
|
|
77
62
|
}
|
|
78
63
|
});
|
|
79
64
|
|
|
80
65
|
// ../../packages/template-utils/lib/utils.js
|
|
81
66
|
var require_utils = __commonJS({
|
|
82
|
-
"../../packages/template-utils/lib/utils.js"(
|
|
67
|
+
"../../packages/template-utils/lib/utils.js"(exports2) {
|
|
83
68
|
"use strict";
|
|
84
|
-
Object.defineProperty(
|
|
85
|
-
|
|
69
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
70
|
+
exports2.makeRelative = makeRelative;
|
|
71
|
+
exports2.getPackageJsonWithSource = getPackageJsonWithSource;
|
|
72
|
+
exports2.getProjectJson = getProjectJson;
|
|
73
|
+
exports2.getPiralInstance = getPiralInstance2;
|
|
74
|
+
exports2.getPlugins = getPlugins;
|
|
75
|
+
exports2.getLanguageExtension = getLanguageExtension;
|
|
86
76
|
var path_1 = require("path");
|
|
87
77
|
var fs_1 = require("fs");
|
|
88
78
|
var log_1 = require_log();
|
|
@@ -90,7 +80,6 @@ var require_utils = __commonJS({
|
|
|
90
80
|
const relPath = (0, path_1.isAbsolute)(path) ? (0, path_1.relative)(root2, path) : path;
|
|
91
81
|
return relPath.split(path_1.sep).join(path_1.posix.sep);
|
|
92
82
|
}
|
|
93
|
-
exports.makeRelative = makeRelative;
|
|
94
83
|
function getPackageJsonWithSource(root2, targetDir, fileName) {
|
|
95
84
|
const path = makeRelative(path_1.posix.join(targetDir, fileName), root2);
|
|
96
85
|
(0, log_1.log)("verbose", `Adding "source" to package.json: "${path}"`);
|
|
@@ -101,7 +90,6 @@ var require_utils = __commonJS({
|
|
|
101
90
|
target: "<root>/package.json"
|
|
102
91
|
};
|
|
103
92
|
}
|
|
104
|
-
exports.getPackageJsonWithSource = getPackageJsonWithSource;
|
|
105
93
|
function getProjectJson(root2) {
|
|
106
94
|
try {
|
|
107
95
|
return require(`${root2}/package.json`);
|
|
@@ -110,7 +98,6 @@ var require_utils = __commonJS({
|
|
|
110
98
|
}
|
|
111
99
|
return void 0;
|
|
112
100
|
}
|
|
113
|
-
exports.getProjectJson = getProjectJson;
|
|
114
101
|
function getPiralInstance2(root2, sourceName) {
|
|
115
102
|
try {
|
|
116
103
|
const packageJsonPath = require.resolve(`${sourceName}/package.json`, {
|
|
@@ -137,7 +124,6 @@ var require_utils = __commonJS({
|
|
|
137
124
|
}
|
|
138
125
|
return void 0;
|
|
139
126
|
}
|
|
140
|
-
exports.getPiralInstance = getPiralInstance2;
|
|
141
127
|
function getPlugins(root2, sourceName) {
|
|
142
128
|
const plugins = {};
|
|
143
129
|
(0, log_1.log)("verbose", `Getting the plugins of "${sourceName}/package.json" ...`);
|
|
@@ -165,7 +151,6 @@ var require_utils = __commonJS({
|
|
|
165
151
|
}
|
|
166
152
|
return plugins;
|
|
167
153
|
}
|
|
168
|
-
exports.getPlugins = getPlugins;
|
|
169
154
|
function getLanguageExtension(language, isJsx = true) {
|
|
170
155
|
switch (language) {
|
|
171
156
|
case "js":
|
|
@@ -175,16 +160,15 @@ var require_utils = __commonJS({
|
|
|
175
160
|
return isJsx ? ".tsx" : ".ts";
|
|
176
161
|
}
|
|
177
162
|
}
|
|
178
|
-
exports.getLanguageExtension = getLanguageExtension;
|
|
179
163
|
}
|
|
180
164
|
});
|
|
181
165
|
|
|
182
166
|
// ../../packages/template-utils/lib/bundler.js
|
|
183
167
|
var require_bundler = __commonJS({
|
|
184
|
-
"../../packages/template-utils/lib/bundler.js"(
|
|
168
|
+
"../../packages/template-utils/lib/bundler.js"(exports2) {
|
|
185
169
|
"use strict";
|
|
186
|
-
Object.defineProperty(
|
|
187
|
-
|
|
170
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
171
|
+
exports2.detectBundler = detectBundler;
|
|
188
172
|
var utils_1 = require_utils();
|
|
189
173
|
function detectBundler(root2) {
|
|
190
174
|
const projectJson = (0, utils_1.getProjectJson)(root2);
|
|
@@ -200,16 +184,15 @@ var require_bundler = __commonJS({
|
|
|
200
184
|
}
|
|
201
185
|
return "xbuild";
|
|
202
186
|
}
|
|
203
|
-
exports.detectBundler = detectBundler;
|
|
204
187
|
}
|
|
205
188
|
});
|
|
206
189
|
|
|
207
190
|
// ../../packages/template-utils/lib/merge.js
|
|
208
191
|
var require_merge = __commonJS({
|
|
209
|
-
"../../packages/template-utils/lib/merge.js"(
|
|
192
|
+
"../../packages/template-utils/lib/merge.js"(exports2) {
|
|
210
193
|
"use strict";
|
|
211
|
-
Object.defineProperty(
|
|
212
|
-
|
|
194
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
195
|
+
exports2.deepMerge = deepMerge;
|
|
213
196
|
function isMergeableObject(val) {
|
|
214
197
|
const nonNullObject = val && typeof val === "object";
|
|
215
198
|
return nonNullObject && Object.prototype.toString.call(val) !== "[object RegExp]" && Object.prototype.toString.call(val) !== "[object Date]";
|
|
@@ -263,16 +246,15 @@ var require_merge = __commonJS({
|
|
|
263
246
|
}
|
|
264
247
|
return mergeObject(target, source);
|
|
265
248
|
}
|
|
266
|
-
exports.deepMerge = deepMerge;
|
|
267
249
|
}
|
|
268
250
|
});
|
|
269
251
|
|
|
270
252
|
// ../../packages/template-utils/lib/io.js
|
|
271
253
|
var require_io = __commonJS({
|
|
272
|
-
"../../packages/template-utils/lib/io.js"(
|
|
254
|
+
"../../packages/template-utils/lib/io.js"(exports2) {
|
|
273
255
|
"use strict";
|
|
274
|
-
Object.defineProperty(
|
|
275
|
-
|
|
256
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
257
|
+
exports2.mergeFiles = mergeFiles;
|
|
276
258
|
var merge_1 = require_merge();
|
|
277
259
|
function mergeFiles(files, deep) {
|
|
278
260
|
const result = {};
|
|
@@ -298,16 +280,15 @@ var require_io = __commonJS({
|
|
|
298
280
|
return items.pop();
|
|
299
281
|
});
|
|
300
282
|
}
|
|
301
|
-
exports.mergeFiles = mergeFiles;
|
|
302
283
|
}
|
|
303
284
|
});
|
|
304
285
|
|
|
305
286
|
// ../../packages/template-utils/lib/assets.js
|
|
306
287
|
var require_assets = __commonJS({
|
|
307
|
-
"../../packages/template-utils/lib/assets.js"(
|
|
288
|
+
"../../packages/template-utils/lib/assets.js"(exports2) {
|
|
308
289
|
"use strict";
|
|
309
|
-
Object.defineProperty(
|
|
310
|
-
|
|
290
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
291
|
+
exports2.getAssetsSource = getAssetsSource;
|
|
311
292
|
var assetsDeclaration = `// Change the declarations in this file if your bundler
|
|
312
293
|
// is configured to handle them differently.
|
|
313
294
|
// Standard behavior is to treat default exports as a
|
|
@@ -370,16 +351,15 @@ declare module '*.codegen';
|
|
|
370
351
|
target: "<src>/assets.d.ts"
|
|
371
352
|
};
|
|
372
353
|
}
|
|
373
|
-
exports.getAssetsSource = getAssetsSource;
|
|
374
354
|
}
|
|
375
355
|
});
|
|
376
356
|
|
|
377
357
|
// ../../packages/template-utils/lib/version.js
|
|
378
358
|
var require_version = __commonJS({
|
|
379
|
-
"../../packages/template-utils/lib/version.js"(
|
|
359
|
+
"../../packages/template-utils/lib/version.js"(exports2) {
|
|
380
360
|
"use strict";
|
|
381
|
-
Object.defineProperty(
|
|
382
|
-
|
|
361
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
362
|
+
exports2.checkVersion = checkVersion;
|
|
383
363
|
var log_1 = require_log();
|
|
384
364
|
var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
|
|
385
365
|
var acceptsAll = ["*", "x", ">=0"];
|
|
@@ -502,16 +482,16 @@ var require_version = __commonJS({
|
|
|
502
482
|
(0, log_1.log)("warn", `The template was made for "piral-cli" version "${desired}" but was used with "${actual}".`);
|
|
503
483
|
}
|
|
504
484
|
}
|
|
505
|
-
exports.checkVersion = checkVersion;
|
|
506
485
|
}
|
|
507
486
|
});
|
|
508
487
|
|
|
509
488
|
// ../../packages/template-utils/lib/parent.js
|
|
510
489
|
var require_parent = __commonJS({
|
|
511
|
-
"../../packages/template-utils/lib/parent.js"(
|
|
490
|
+
"../../packages/template-utils/lib/parent.js"(exports2) {
|
|
512
491
|
"use strict";
|
|
513
|
-
Object.defineProperty(
|
|
514
|
-
|
|
492
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
493
|
+
exports2.LogLevels = exports2.ForceOverwrite = void 0;
|
|
494
|
+
exports2.configure = configure;
|
|
515
495
|
var path_1 = require("path");
|
|
516
496
|
var log_1 = require_log();
|
|
517
497
|
var version_1 = require_version();
|
|
@@ -520,7 +500,7 @@ var require_parent = __commonJS({
|
|
|
520
500
|
ForceOverwrite2[ForceOverwrite2["no"] = 0] = "no";
|
|
521
501
|
ForceOverwrite2[ForceOverwrite2["prompt"] = 1] = "prompt";
|
|
522
502
|
ForceOverwrite2[ForceOverwrite2["yes"] = 2] = "yes";
|
|
523
|
-
})(ForceOverwrite
|
|
503
|
+
})(ForceOverwrite || (exports2.ForceOverwrite = ForceOverwrite = {}));
|
|
524
504
|
var LogLevels;
|
|
525
505
|
(function(LogLevels2) {
|
|
526
506
|
LogLevels2[LogLevels2["disabled"] = 0] = "disabled";
|
|
@@ -529,7 +509,7 @@ var require_parent = __commonJS({
|
|
|
529
509
|
LogLevels2[LogLevels2["info"] = 3] = "info";
|
|
530
510
|
LogLevels2[LogLevels2["verbose"] = 4] = "verbose";
|
|
531
511
|
LogLevels2[LogLevels2["debug"] = 5] = "debug";
|
|
532
|
-
})(LogLevels
|
|
512
|
+
})(LogLevels || (exports2.LogLevels = LogLevels = {}));
|
|
533
513
|
function configure(root2, details) {
|
|
534
514
|
var _a, _b;
|
|
535
515
|
if (details) {
|
|
@@ -559,16 +539,15 @@ var require_parent = __commonJS({
|
|
|
559
539
|
(0, log_1.log)("warn", `The used version of the "piral-cli" is outdated. The templating may still work - if not you should use a more recent version of the "piral-cli".`);
|
|
560
540
|
}
|
|
561
541
|
}
|
|
562
|
-
exports.configure = configure;
|
|
563
542
|
}
|
|
564
543
|
});
|
|
565
544
|
|
|
566
545
|
// ../../node_modules/ejs/lib/utils.js
|
|
567
546
|
var require_utils2 = __commonJS({
|
|
568
|
-
"../../node_modules/ejs/lib/utils.js"(
|
|
547
|
+
"../../node_modules/ejs/lib/utils.js"(exports2) {
|
|
569
548
|
"use strict";
|
|
570
549
|
var regExpChars = /[|\\{}()[\]^$+*?.]/g;
|
|
571
|
-
|
|
550
|
+
exports2.escapeRegExpChars = function(string) {
|
|
572
551
|
if (!string) {
|
|
573
552
|
return "";
|
|
574
553
|
}
|
|
@@ -597,20 +576,20 @@ function encode_char(c) {
|
|
|
597
576
|
return _ENCODE_HTML_RULES[c] || c;
|
|
598
577
|
};
|
|
599
578
|
`;
|
|
600
|
-
|
|
579
|
+
exports2.escapeXML = function(markup) {
|
|
601
580
|
return markup == void 0 ? "" : String(markup).replace(_MATCH_HTML, encode_char);
|
|
602
581
|
};
|
|
603
|
-
|
|
582
|
+
exports2.escapeXML.toString = function() {
|
|
604
583
|
return Function.prototype.toString.call(this) + ";\n" + escapeFuncStr;
|
|
605
584
|
};
|
|
606
|
-
|
|
585
|
+
exports2.shallowCopy = function(to, from) {
|
|
607
586
|
from = from || {};
|
|
608
587
|
for (var p in from) {
|
|
609
588
|
to[p] = from[p];
|
|
610
589
|
}
|
|
611
590
|
return to;
|
|
612
591
|
};
|
|
613
|
-
|
|
592
|
+
exports2.shallowCopyFromList = function(to, from, list) {
|
|
614
593
|
for (var i = 0; i < list.length; i++) {
|
|
615
594
|
var p = list[i];
|
|
616
595
|
if (typeof from[p] != "undefined") {
|
|
@@ -619,7 +598,7 @@ function encode_char(c) {
|
|
|
619
598
|
}
|
|
620
599
|
return to;
|
|
621
600
|
};
|
|
622
|
-
|
|
601
|
+
exports2.cache = {
|
|
623
602
|
_data: {},
|
|
624
603
|
set: function(key, val) {
|
|
625
604
|
this._data[key] = val;
|
|
@@ -639,7 +618,7 @@ function encode_char(c) {
|
|
|
639
618
|
|
|
640
619
|
// ../../node_modules/ejs/package.json
|
|
641
620
|
var require_package = __commonJS({
|
|
642
|
-
"../../node_modules/ejs/package.json"(
|
|
621
|
+
"../../node_modules/ejs/package.json"(exports2, module2) {
|
|
643
622
|
module2.exports = {
|
|
644
623
|
name: "ejs",
|
|
645
624
|
description: "Embedded JavaScript templates",
|
|
@@ -682,7 +661,7 @@ var require_package = __commonJS({
|
|
|
682
661
|
|
|
683
662
|
// ../../node_modules/ejs/lib/ejs.js
|
|
684
663
|
var require_ejs = __commonJS({
|
|
685
|
-
"../../node_modules/ejs/lib/ejs.js"(
|
|
664
|
+
"../../node_modules/ejs/lib/ejs.js"(exports2) {
|
|
686
665
|
"use strict";
|
|
687
666
|
var fs = require("fs");
|
|
688
667
|
var path = require("path");
|
|
@@ -710,11 +689,11 @@ var require_ejs = __commonJS({
|
|
|
710
689
|
];
|
|
711
690
|
var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat("cache");
|
|
712
691
|
var _BOM = /^\uFEFF/;
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
692
|
+
exports2.cache = utils.cache;
|
|
693
|
+
exports2.fileLoader = fs.readFileSync;
|
|
694
|
+
exports2.localsName = _DEFAULT_LOCALS_NAME;
|
|
695
|
+
exports2.promiseImpl = new Function("return this;")().Promise;
|
|
696
|
+
exports2.resolveInclude = function(name, filename, isDir) {
|
|
718
697
|
var dirname = path.dirname;
|
|
719
698
|
var extname = path.extname;
|
|
720
699
|
var resolve2 = path.resolve;
|
|
@@ -731,17 +710,17 @@ var require_ejs = __commonJS({
|
|
|
731
710
|
var views = options.views;
|
|
732
711
|
var match = /^[A-Za-z]+:\\|^\//.exec(path2);
|
|
733
712
|
if (match && match.length) {
|
|
734
|
-
includePath =
|
|
713
|
+
includePath = exports2.resolveInclude(path2.replace(/^\/*/, ""), options.root || "/", true);
|
|
735
714
|
} else {
|
|
736
715
|
if (options.filename) {
|
|
737
|
-
filePath =
|
|
716
|
+
filePath = exports2.resolveInclude(path2, options.filename);
|
|
738
717
|
if (fs.existsSync(filePath)) {
|
|
739
718
|
includePath = filePath;
|
|
740
719
|
}
|
|
741
720
|
}
|
|
742
721
|
if (!includePath) {
|
|
743
722
|
if (Array.isArray(views) && views.some(function(v) {
|
|
744
|
-
filePath =
|
|
723
|
+
filePath = exports2.resolveInclude(path2, v, true);
|
|
745
724
|
return fs.existsSync(filePath);
|
|
746
725
|
})) {
|
|
747
726
|
includePath = filePath;
|
|
@@ -761,7 +740,7 @@ var require_ejs = __commonJS({
|
|
|
761
740
|
if (!filename) {
|
|
762
741
|
throw new Error("cache option requires a filename");
|
|
763
742
|
}
|
|
764
|
-
func =
|
|
743
|
+
func = exports2.cache.get(filename);
|
|
765
744
|
if (func) {
|
|
766
745
|
return func;
|
|
767
746
|
}
|
|
@@ -774,17 +753,17 @@ var require_ejs = __commonJS({
|
|
|
774
753
|
}
|
|
775
754
|
template = fileLoader(filename).toString().replace(_BOM, "");
|
|
776
755
|
}
|
|
777
|
-
func =
|
|
756
|
+
func = exports2.compile(template, options);
|
|
778
757
|
if (options.cache) {
|
|
779
|
-
|
|
758
|
+
exports2.cache.set(filename, func);
|
|
780
759
|
}
|
|
781
760
|
return func;
|
|
782
761
|
}
|
|
783
762
|
function tryHandleCache(options, data, cb) {
|
|
784
763
|
var result;
|
|
785
764
|
if (!cb) {
|
|
786
|
-
if (typeof
|
|
787
|
-
return new
|
|
765
|
+
if (typeof exports2.promiseImpl == "function") {
|
|
766
|
+
return new exports2.promiseImpl(function(resolve2, reject) {
|
|
788
767
|
try {
|
|
789
768
|
result = handleCache(options)(data);
|
|
790
769
|
resolve2(result);
|
|
@@ -805,7 +784,7 @@ var require_ejs = __commonJS({
|
|
|
805
784
|
}
|
|
806
785
|
}
|
|
807
786
|
function fileLoader(filePath) {
|
|
808
|
-
return
|
|
787
|
+
return exports2.fileLoader(filePath);
|
|
809
788
|
}
|
|
810
789
|
function includeFile(path2, options) {
|
|
811
790
|
var opts = utils.shallowCopy({}, options);
|
|
@@ -843,7 +822,7 @@ var require_ejs = __commonJS({
|
|
|
843
822
|
function stripSemi(str) {
|
|
844
823
|
return str.replace(/;(\s*$)/, "$1");
|
|
845
824
|
}
|
|
846
|
-
|
|
825
|
+
exports2.compile = function compile(template, opts) {
|
|
847
826
|
var templ;
|
|
848
827
|
if (opts && opts.scope) {
|
|
849
828
|
if (!scopeOptionWarned) {
|
|
@@ -858,7 +837,7 @@ var require_ejs = __commonJS({
|
|
|
858
837
|
templ = new Template(template, opts);
|
|
859
838
|
return templ.compile();
|
|
860
839
|
};
|
|
861
|
-
|
|
840
|
+
exports2.render = function(template, d, o) {
|
|
862
841
|
var data = d || {};
|
|
863
842
|
var opts = o || {};
|
|
864
843
|
if (arguments.length == 2) {
|
|
@@ -866,7 +845,7 @@ var require_ejs = __commonJS({
|
|
|
866
845
|
}
|
|
867
846
|
return handleCache(opts, template)(data);
|
|
868
847
|
};
|
|
869
|
-
|
|
848
|
+
exports2.renderFile = function() {
|
|
870
849
|
var args = Array.prototype.slice.call(arguments);
|
|
871
850
|
var filename = args.shift();
|
|
872
851
|
var cb;
|
|
@@ -901,9 +880,9 @@ var require_ejs = __commonJS({
|
|
|
901
880
|
}
|
|
902
881
|
return tryHandleCache(opts, data, cb);
|
|
903
882
|
};
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
883
|
+
exports2.Template = Template;
|
|
884
|
+
exports2.clearCache = function() {
|
|
885
|
+
exports2.cache.reset();
|
|
907
886
|
};
|
|
908
887
|
function Template(text, opts) {
|
|
909
888
|
opts = opts || {};
|
|
@@ -919,16 +898,16 @@ var require_ejs = __commonJS({
|
|
|
919
898
|
options.compileDebug = opts.compileDebug !== false;
|
|
920
899
|
options.debug = !!opts.debug;
|
|
921
900
|
options.filename = opts.filename;
|
|
922
|
-
options.openDelimiter = opts.openDelimiter ||
|
|
923
|
-
options.closeDelimiter = opts.closeDelimiter ||
|
|
924
|
-
options.delimiter = opts.delimiter ||
|
|
901
|
+
options.openDelimiter = opts.openDelimiter || exports2.openDelimiter || _DEFAULT_OPEN_DELIMITER;
|
|
902
|
+
options.closeDelimiter = opts.closeDelimiter || exports2.closeDelimiter || _DEFAULT_CLOSE_DELIMITER;
|
|
903
|
+
options.delimiter = opts.delimiter || exports2.delimiter || _DEFAULT_DELIMITER;
|
|
925
904
|
options.strict = opts.strict || false;
|
|
926
905
|
options.context = opts.context;
|
|
927
906
|
options.cache = opts.cache || false;
|
|
928
907
|
options.rmWhitespace = opts.rmWhitespace;
|
|
929
908
|
options.root = opts.root;
|
|
930
909
|
options.outputFunctionName = opts.outputFunctionName;
|
|
931
|
-
options.localsName = opts.localsName ||
|
|
910
|
+
options.localsName = opts.localsName || exports2.localsName || _DEFAULT_LOCALS_NAME;
|
|
932
911
|
options.views = opts.views;
|
|
933
912
|
options.async = opts.async;
|
|
934
913
|
options.destructuredLocals = opts.destructuredLocals;
|
|
@@ -1101,7 +1080,10 @@ var require_ejs = __commonJS({
|
|
|
1101
1080
|
includeSrc = " ; (function(){\n" + includeObj.source + " ; }).call(this)\n";
|
|
1102
1081
|
}
|
|
1103
1082
|
self.source += includeSrc;
|
|
1104
|
-
self.dependencies.push(
|
|
1083
|
+
self.dependencies.push(exports2.resolveInclude(
|
|
1084
|
+
include[1],
|
|
1085
|
+
includeOpts.filename
|
|
1086
|
+
));
|
|
1105
1087
|
return;
|
|
1106
1088
|
}
|
|
1107
1089
|
}
|
|
@@ -1193,17 +1175,21 @@ var require_ejs = __commonJS({
|
|
|
1193
1175
|
}
|
|
1194
1176
|
}
|
|
1195
1177
|
switch (this.mode) {
|
|
1178
|
+
// Just executing code
|
|
1196
1179
|
case Template.modes.EVAL:
|
|
1197
1180
|
this.source += " ; " + line + "\n";
|
|
1198
1181
|
break;
|
|
1182
|
+
// Exec, esc, and output
|
|
1199
1183
|
case Template.modes.ESCAPED:
|
|
1200
1184
|
this.source += " ; __append(escapeFn(" + stripSemi(line) + "))\n";
|
|
1201
1185
|
break;
|
|
1186
|
+
// Exec and output
|
|
1202
1187
|
case Template.modes.RAW:
|
|
1203
1188
|
this.source += " ; __append(" + stripSemi(line) + ")\n";
|
|
1204
1189
|
break;
|
|
1205
1190
|
case Template.modes.COMMENT:
|
|
1206
1191
|
break;
|
|
1192
|
+
// Literal <%% mode, append as raw output
|
|
1207
1193
|
case Template.modes.LITERAL:
|
|
1208
1194
|
this._addOutput(line);
|
|
1209
1195
|
break;
|
|
@@ -1218,34 +1204,35 @@ var require_ejs = __commonJS({
|
|
|
1218
1204
|
}
|
|
1219
1205
|
}
|
|
1220
1206
|
};
|
|
1221
|
-
|
|
1222
|
-
|
|
1207
|
+
exports2.escapeXML = utils.escapeXML;
|
|
1208
|
+
exports2.__express = exports2.renderFile;
|
|
1223
1209
|
if (require.extensions) {
|
|
1224
1210
|
require.extensions[".ejs"] = function(module3, flnm) {
|
|
1225
1211
|
console.log("Deprecated: this API will go away in EJS v2.8");
|
|
1226
|
-
var filename = flnm ||
|
|
1212
|
+
var filename = flnm || /* istanbul ignore next */
|
|
1213
|
+
module3.filename;
|
|
1227
1214
|
var options = {
|
|
1228
1215
|
filename,
|
|
1229
1216
|
client: true
|
|
1230
1217
|
};
|
|
1231
1218
|
var template = fileLoader(filename).toString();
|
|
1232
|
-
var fn =
|
|
1219
|
+
var fn = exports2.compile(template, options);
|
|
1233
1220
|
module3._compile("module.exports = " + fn.toString() + ";", filename);
|
|
1234
1221
|
};
|
|
1235
1222
|
}
|
|
1236
|
-
|
|
1237
|
-
|
|
1223
|
+
exports2.VERSION = _VERSION_STRING;
|
|
1224
|
+
exports2.name = _NAME;
|
|
1238
1225
|
if (typeof window != "undefined") {
|
|
1239
|
-
window.ejs =
|
|
1226
|
+
window.ejs = exports2;
|
|
1240
1227
|
}
|
|
1241
1228
|
}
|
|
1242
1229
|
});
|
|
1243
1230
|
|
|
1244
1231
|
// ../../packages/template-utils/lib/template.js
|
|
1245
1232
|
var require_template = __commonJS({
|
|
1246
|
-
"../../packages/template-utils/lib/template.js"(
|
|
1233
|
+
"../../packages/template-utils/lib/template.js"(exports2) {
|
|
1247
1234
|
"use strict";
|
|
1248
|
-
var __awaiter =
|
|
1235
|
+
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
1249
1236
|
function adopt(value) {
|
|
1250
1237
|
return value instanceof P ? value : new P(function(resolve2) {
|
|
1251
1238
|
resolve2(value);
|
|
@@ -1272,8 +1259,9 @@ var require_template = __commonJS({
|
|
|
1272
1259
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1273
1260
|
});
|
|
1274
1261
|
};
|
|
1275
|
-
Object.defineProperty(
|
|
1276
|
-
|
|
1262
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1263
|
+
exports2.normalizeData = normalizeData;
|
|
1264
|
+
exports2.getFileFromTemplate = getFileFromTemplate;
|
|
1277
1265
|
var path_1 = require("path");
|
|
1278
1266
|
var ejs_1 = require_ejs();
|
|
1279
1267
|
var log_1 = require_log();
|
|
@@ -1314,7 +1302,6 @@ var require_template = __commonJS({
|
|
|
1314
1302
|
data.mocks = (0, utils_1.makeRelative)(replaceVariables(data.mocks, data), data.projectRoot);
|
|
1315
1303
|
return data;
|
|
1316
1304
|
}
|
|
1317
|
-
exports.normalizeData = normalizeData;
|
|
1318
1305
|
function getFileFromTemplate(sourceDir, source, data) {
|
|
1319
1306
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1320
1307
|
let { target, name, content } = source;
|
|
@@ -1331,15 +1318,14 @@ var require_template = __commonJS({
|
|
|
1331
1318
|
};
|
|
1332
1319
|
});
|
|
1333
1320
|
}
|
|
1334
|
-
exports.getFileFromTemplate = getFileFromTemplate;
|
|
1335
1321
|
}
|
|
1336
1322
|
});
|
|
1337
1323
|
|
|
1338
1324
|
// ../../packages/template-utils/lib/factory.js
|
|
1339
1325
|
var require_factory = __commonJS({
|
|
1340
|
-
"../../packages/template-utils/lib/factory.js"(
|
|
1326
|
+
"../../packages/template-utils/lib/factory.js"(exports2) {
|
|
1341
1327
|
"use strict";
|
|
1342
|
-
var __awaiter =
|
|
1328
|
+
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
1343
1329
|
function adopt(value) {
|
|
1344
1330
|
return value instanceof P ? value : new P(function(resolve2) {
|
|
1345
1331
|
resolve2(value);
|
|
@@ -1366,8 +1352,9 @@ var require_factory = __commonJS({
|
|
|
1366
1352
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1367
1353
|
});
|
|
1368
1354
|
};
|
|
1369
|
-
Object.defineProperty(
|
|
1370
|
-
|
|
1355
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1356
|
+
exports2.createPiletTemplateFactory = createPiletTemplateFactory2;
|
|
1357
|
+
exports2.createPiralTemplateFactory = createPiralTemplateFactory;
|
|
1371
1358
|
var path_1 = require("path");
|
|
1372
1359
|
var io_1 = require_io();
|
|
1373
1360
|
var assets_1 = require_assets();
|
|
@@ -1402,7 +1389,6 @@ var require_factory = __commonJS({
|
|
|
1402
1389
|
return (0, io_1.mergeFiles)(files, deepMerged);
|
|
1403
1390
|
});
|
|
1404
1391
|
}
|
|
1405
|
-
exports.createPiletTemplateFactory = createPiletTemplateFactory2;
|
|
1406
1392
|
function createPiralTemplateFactory(templateRoot, getAllSources, defaultArgs = {}, deepMerged = mergePackageJson) {
|
|
1407
1393
|
const sourceDir = (0, path_1.resolve)(templateRoot, "templates");
|
|
1408
1394
|
return (projectRoot, args, details) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1429,53 +1415,53 @@ var require_factory = __commonJS({
|
|
|
1429
1415
|
return (0, io_1.mergeFiles)(files, deepMerged);
|
|
1430
1416
|
});
|
|
1431
1417
|
}
|
|
1432
|
-
exports.createPiralTemplateFactory = createPiralTemplateFactory;
|
|
1433
1418
|
}
|
|
1434
1419
|
});
|
|
1435
1420
|
|
|
1436
1421
|
// ../../packages/template-utils/lib/types.js
|
|
1437
1422
|
var require_types = __commonJS({
|
|
1438
|
-
"../../packages/template-utils/lib/types.js"(
|
|
1423
|
+
"../../packages/template-utils/lib/types.js"(exports2) {
|
|
1439
1424
|
"use strict";
|
|
1440
|
-
Object.defineProperty(
|
|
1425
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1441
1426
|
}
|
|
1442
1427
|
});
|
|
1443
1428
|
|
|
1444
1429
|
// ../../packages/template-utils/lib/index.js
|
|
1445
1430
|
var require_lib = __commonJS({
|
|
1446
|
-
"../../packages/template-utils/lib/index.js"(
|
|
1431
|
+
"../../packages/template-utils/lib/index.js"(exports2) {
|
|
1447
1432
|
"use strict";
|
|
1448
|
-
var __createBinding =
|
|
1449
|
-
if (k2 === void 0)
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1433
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
1434
|
+
if (k2 === void 0) k2 = k;
|
|
1435
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1436
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1437
|
+
desc = { enumerable: true, get: function() {
|
|
1438
|
+
return m[k];
|
|
1439
|
+
} };
|
|
1440
|
+
}
|
|
1441
|
+
Object.defineProperty(o, k2, desc);
|
|
1454
1442
|
} : function(o, m, k, k2) {
|
|
1455
|
-
if (k2 === void 0)
|
|
1456
|
-
k2 = k;
|
|
1443
|
+
if (k2 === void 0) k2 = k;
|
|
1457
1444
|
o[k2] = m[k];
|
|
1458
1445
|
});
|
|
1459
|
-
var __exportStar =
|
|
1460
|
-
for (var p in m)
|
|
1461
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
1462
|
-
__createBinding(exports2, m, p);
|
|
1446
|
+
var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
1447
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
|
|
1463
1448
|
};
|
|
1464
|
-
Object.defineProperty(
|
|
1465
|
-
__exportStar(require_bundler(),
|
|
1466
|
-
__exportStar(require_factory(),
|
|
1467
|
-
__exportStar(require_log(),
|
|
1468
|
-
__exportStar(require_template(),
|
|
1469
|
-
__exportStar(require_types(),
|
|
1470
|
-
__exportStar(require_utils(),
|
|
1449
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1450
|
+
__exportStar(require_bundler(), exports2);
|
|
1451
|
+
__exportStar(require_factory(), exports2);
|
|
1452
|
+
__exportStar(require_log(), exports2);
|
|
1453
|
+
__exportStar(require_template(), exports2);
|
|
1454
|
+
__exportStar(require_types(), exports2);
|
|
1455
|
+
__exportStar(require_utils(), exports2);
|
|
1471
1456
|
}
|
|
1472
1457
|
});
|
|
1473
1458
|
|
|
1474
1459
|
// src/index.ts
|
|
1475
|
-
var
|
|
1476
|
-
__export(
|
|
1477
|
-
default: () =>
|
|
1460
|
+
var index_exports = {};
|
|
1461
|
+
__export(index_exports, {
|
|
1462
|
+
default: () => index_default
|
|
1478
1463
|
});
|
|
1464
|
+
module.exports = __toCommonJS(index_exports);
|
|
1479
1465
|
var import_path = require("path");
|
|
1480
1466
|
var import_template_utils = __toESM(require_lib());
|
|
1481
1467
|
|
|
@@ -1497,7 +1483,8 @@ var tsVersions = {
|
|
|
1497
1483
|
16: "~4.9",
|
|
1498
1484
|
17: "~5.2",
|
|
1499
1485
|
18: "~5.5",
|
|
1500
|
-
19: "~5.7"
|
|
1486
|
+
19: "~5.7",
|
|
1487
|
+
20: "~5.8"
|
|
1501
1488
|
};
|
|
1502
1489
|
var rxjsVersions = {
|
|
1503
1490
|
2: "^5.0",
|
|
@@ -1516,7 +1503,8 @@ var rxjsVersions = {
|
|
|
1516
1503
|
16: "^7.4",
|
|
1517
1504
|
17: "^7.4",
|
|
1518
1505
|
18: "^7.4",
|
|
1519
|
-
19: "^7.4"
|
|
1506
|
+
19: "^7.4",
|
|
1507
|
+
20: "^7.4"
|
|
1520
1508
|
};
|
|
1521
1509
|
var zoneVersions = {
|
|
1522
1510
|
2: "~0.9",
|
|
@@ -1535,30 +1523,29 @@ var zoneVersions = {
|
|
|
1535
1523
|
16: "0.13.0",
|
|
1536
1524
|
17: "~0.14",
|
|
1537
1525
|
18: "~0.14",
|
|
1538
|
-
19: "~0.15"
|
|
1526
|
+
19: "~0.15",
|
|
1527
|
+
20: "~0.15"
|
|
1539
1528
|
};
|
|
1540
1529
|
|
|
1541
1530
|
// src/helpers.ts
|
|
1542
1531
|
function detectMode(piralInstance) {
|
|
1543
|
-
|
|
1544
|
-
const
|
|
1545
|
-
const
|
|
1546
|
-
const allDependencies = __spreadValues(__spreadValues({}, devDependencies), dependencies);
|
|
1532
|
+
const dependencies = piralInstance?.details?.dependencies || {};
|
|
1533
|
+
const devDependencies = piralInstance?.details?.devDependencies || {};
|
|
1534
|
+
const allDependencies = { ...devDependencies, ...dependencies };
|
|
1547
1535
|
return allDependencies["piral-ng"] === void 0;
|
|
1548
1536
|
}
|
|
1549
1537
|
function detectNgVersion(piralInstance) {
|
|
1550
|
-
|
|
1551
|
-
const
|
|
1552
|
-
const
|
|
1553
|
-
const
|
|
1554
|
-
const version = allDependencies["@angular/core"] || "17.0.0";
|
|
1538
|
+
const dependencies = piralInstance?.details?.dependencies || {};
|
|
1539
|
+
const devDependencies = piralInstance?.details?.devDependencies || {};
|
|
1540
|
+
const allDependencies = { ...devDependencies, ...dependencies };
|
|
1541
|
+
const version = allDependencies["@angular/core"] || "18.0.0";
|
|
1555
1542
|
if (typeof version === "string") {
|
|
1556
1543
|
const result = /\d+/.exec(version);
|
|
1557
1544
|
if (result) {
|
|
1558
1545
|
return +result[0];
|
|
1559
1546
|
}
|
|
1560
1547
|
}
|
|
1561
|
-
return
|
|
1548
|
+
return 18;
|
|
1562
1549
|
}
|
|
1563
1550
|
function isKnownVersion(majorNgVersion) {
|
|
1564
1551
|
return typeof zoneVersions[majorNgVersion] !== "undefined";
|
|
@@ -1585,9 +1572,9 @@ function getStandalonePackageJson(cliVersion, ngVersion, majorNgVersion) {
|
|
|
1585
1572
|
"@angular/router": ngVersion,
|
|
1586
1573
|
"piral-ng": cliVersion,
|
|
1587
1574
|
"piral-ng-common": ngVersion,
|
|
1588
|
-
"core-js": "^3
|
|
1575
|
+
"core-js": "^3",
|
|
1589
1576
|
rxjs: rxjsVersions[majorNgVersion] || "^7.4",
|
|
1590
|
-
"zone.js": zoneVersions[majorNgVersion] || "^0.
|
|
1577
|
+
"zone.js": zoneVersions[majorNgVersion] || "^0.14"
|
|
1591
1578
|
},
|
|
1592
1579
|
devDependencies: {
|
|
1593
1580
|
"@angular/compiler-cli": ngVersion,
|
|
@@ -1617,7 +1604,7 @@ function getStandardPackageJson(cliVersion, ngVersion, majorNgVersion) {
|
|
|
1617
1604
|
|
|
1618
1605
|
// src/index.ts
|
|
1619
1606
|
var root = (0, import_path.resolve)(__dirname, "..");
|
|
1620
|
-
var
|
|
1607
|
+
var index_default = (0, import_template_utils.createPiletTemplateFactory)(root, (projectRoot, args, details) => {
|
|
1621
1608
|
const { sourceName } = args;
|
|
1622
1609
|
const piralInstance = (0, import_template_utils.getPiralInstance)(projectRoot, sourceName);
|
|
1623
1610
|
if (typeof args.standalone === "undefined") {
|
|
@@ -1631,13 +1618,16 @@ var src_default = (0, import_template_utils.createPiletTemplateFactory)(root, (p
|
|
|
1631
1618
|
if (args.ngVersion < 9) {
|
|
1632
1619
|
(0, import_template_utils.log)("warn", `Angular version ${args.ngVersion} is not officially supported. It might not work.`);
|
|
1633
1620
|
} else if (!isKnownVersion(args.ngVersion)) {
|
|
1634
|
-
(0, import_template_utils.log)(
|
|
1621
|
+
(0, import_template_utils.log)(
|
|
1622
|
+
"warn",
|
|
1623
|
+
`Angular version ${args.ngVersion} is not known and therefore not yet officially supported. It might not work.`
|
|
1624
|
+
);
|
|
1635
1625
|
}
|
|
1636
1626
|
if (args.ngVersion < 17) {
|
|
1637
1627
|
args.ngStandalone = false;
|
|
1638
1628
|
}
|
|
1639
1629
|
if (typeof args.ngStandalone === "undefined") {
|
|
1640
|
-
args.
|
|
1630
|
+
args.ngStandalone = args.ngVersion > 18;
|
|
1641
1631
|
}
|
|
1642
1632
|
const ngVersion = `^${args.ngVersion}`;
|
|
1643
1633
|
const packageJson = args.standalone ? getStandalonePackageJson(details.cliVersion, ngVersion, args.ngVersion) : getStandardPackageJson(details.cliVersion, ngVersion, args.ngVersion);
|
|
@@ -1695,31 +1685,37 @@ var src_default = (0, import_template_utils.createPiletTemplateFactory)(root, (p
|
|
|
1695
1685
|
}
|
|
1696
1686
|
];
|
|
1697
1687
|
if (args.ngStandalone) {
|
|
1698
|
-
templates.push(
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1688
|
+
templates.push(
|
|
1689
|
+
{
|
|
1690
|
+
languages: ["ts"],
|
|
1691
|
+
name: "index.standalone.tsx",
|
|
1692
|
+
target: "<src>/index.tsx"
|
|
1693
|
+
}
|
|
1694
|
+
);
|
|
1703
1695
|
} else {
|
|
1704
|
-
templates.push(
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1696
|
+
templates.push(
|
|
1697
|
+
{
|
|
1698
|
+
languages: ["ts"],
|
|
1699
|
+
name: "index.tsx",
|
|
1700
|
+
target: "<src>/index.tsx"
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
languages: ["ts"],
|
|
1704
|
+
name: "app.module.ts",
|
|
1705
|
+
target: "<src>/app/app.module.ts"
|
|
1706
|
+
}
|
|
1707
|
+
);
|
|
1713
1708
|
}
|
|
1714
1709
|
return templates;
|
|
1715
1710
|
});
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1711
|
+
/*! Bundled license information:
|
|
1712
|
+
|
|
1713
|
+
ejs/lib/ejs.js:
|
|
1714
|
+
(**
|
|
1715
|
+
* @file Embedded JavaScript templating engine. {@link http://ejs.co}
|
|
1716
|
+
* @author Matthew Eernisse <mde@fleegix.org>
|
|
1717
|
+
* @author Tiancheng "Timothy" Gu <timothygu99@gmail.com>
|
|
1718
|
+
* @project EJS
|
|
1719
|
+
* @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
|
|
1720
|
+
*)
|
|
1721
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smapiot/pilet-template-angular",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15-beta.8123",
|
|
4
4
|
"description": "Official scaffolding template for pilets: 'angular'.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral-cli",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"ngVersion": {
|
|
31
31
|
"description": "Defines the (major) version of Angular to use in case of a standalone pilet.",
|
|
32
|
-
"default":
|
|
32
|
+
"default": 18,
|
|
33
33
|
"type": "number"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@smapiot/template-utils": "
|
|
62
|
+
"@smapiot/template-utils": "1.0.15-beta.8123"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "c90f424531a64f0fcdf8ee130c75dd66ea3039ac"
|
|
65
65
|
}
|
package/src/helpers.ts
CHANGED
|
@@ -11,7 +11,7 @@ export function detectNgVersion(piralInstance: { details: any }) {
|
|
|
11
11
|
const dependencies = piralInstance?.details?.dependencies || {};
|
|
12
12
|
const devDependencies = piralInstance?.details?.devDependencies || {};
|
|
13
13
|
const allDependencies = { ...devDependencies, ...dependencies };
|
|
14
|
-
const version = allDependencies['@angular/core'] || '
|
|
14
|
+
const version = allDependencies['@angular/core'] || '18.0.0';
|
|
15
15
|
|
|
16
16
|
if (typeof version === 'string') {
|
|
17
17
|
const result = /\d+/.exec(version);
|
|
@@ -22,7 +22,7 @@ export function detectNgVersion(piralInstance: { details: any }) {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
return
|
|
25
|
+
return 18;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export function isKnownVersion(majorNgVersion: number) {
|
|
@@ -51,9 +51,9 @@ export function getStandalonePackageJson(cliVersion: string, ngVersion: string,
|
|
|
51
51
|
'@angular/router': ngVersion,
|
|
52
52
|
'piral-ng': cliVersion,
|
|
53
53
|
'piral-ng-common': ngVersion,
|
|
54
|
-
'core-js': '^3
|
|
54
|
+
'core-js': '^3',
|
|
55
55
|
rxjs: rxjsVersions[majorNgVersion] || '^7.4',
|
|
56
|
-
'zone.js': zoneVersions[majorNgVersion] || '^0.
|
|
56
|
+
'zone.js': zoneVersions[majorNgVersion] || '^0.14',
|
|
57
57
|
},
|
|
58
58
|
devDependencies: {
|
|
59
59
|
'@angular/compiler-cli': ngVersion,
|
package/src/index.ts
CHANGED
|
@@ -44,7 +44,7 @@ export default createPiletTemplateFactory<AngularPiletArgs>(root, (projectRoot,
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if (typeof args.ngStandalone === 'undefined') {
|
|
47
|
-
args.
|
|
47
|
+
args.ngStandalone = args.ngVersion > 18;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
const ngVersion = `^${args.ngVersion}`;
|
package/src/versions.ts
CHANGED
|
@@ -19,6 +19,7 @@ export const tsVersions = {
|
|
|
19
19
|
17: '~5.2',
|
|
20
20
|
18: '~5.5',
|
|
21
21
|
19: '~5.7',
|
|
22
|
+
20: '~5.8',
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
// Mapping of Angular to RxJs versions
|
|
@@ -40,6 +41,7 @@ export const rxjsVersions = {
|
|
|
40
41
|
17: '^7.4',
|
|
41
42
|
18: '^7.4',
|
|
42
43
|
19: '^7.4',
|
|
44
|
+
20: '^7.4',
|
|
43
45
|
};
|
|
44
46
|
|
|
45
47
|
// Mapping of Angular to Zone.js versions
|
|
@@ -61,4 +63,5 @@ export const zoneVersions = {
|
|
|
61
63
|
17: '~0.14',
|
|
62
64
|
18: '~0.14',
|
|
63
65
|
19: '~0.15',
|
|
66
|
+
20: '~0.15',
|
|
64
67
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import 'core-js/proposals/reflect-metadata';
|
|
2
|
+
import 'zone.js';
|
|
2
3
|
import { createConverter } from 'piral-ng/standalone';
|
|
3
4
|
import { provideRouter } from '@angular/router';
|
|
4
|
-
import {
|
|
5
|
+
import type { ApplicationConfig } from '@angular/core';
|
|
5
6
|
import type { PiletApi } from '<%- sourceName %>';
|
|
6
7
|
<% if (plugins.menu) { -%>
|
|
7
8
|
import { MenuComponent } from './app/menu.component';
|
|
@@ -10,10 +11,9 @@ import { PageComponent } from './app/page.component';
|
|
|
10
11
|
|
|
11
12
|
const appConfig: ApplicationConfig = {
|
|
12
13
|
providers: [
|
|
13
|
-
provideExperimentalZonelessChangeDetection(),
|
|
14
14
|
provideRouter([
|
|
15
15
|
{
|
|
16
|
-
path:
|
|
16
|
+
path: 'sample',
|
|
17
17
|
component: PageComponent,
|
|
18
18
|
},
|
|
19
19
|
]),
|