@energycap/components 0.42.4-esbuild.20250131-1256 → 0.42.4-esbuild.20250131-1441
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
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@energycap/components",
|
3
|
-
"version": "0.42.4-esbuild.20250131-
|
3
|
+
"version": "0.42.4-esbuild.20250131-1441",
|
4
4
|
"schematics": "./schematics/collection.json",
|
5
5
|
"dependencies": {
|
6
6
|
"tslib": "^2.0.0"
|
@@ -13,7 +13,7 @@
|
|
13
13
|
"@angular/cdk": ">=17.0.0",
|
14
14
|
"@ngx-translate/core": "^15.0.0",
|
15
15
|
"popper.js": "~1.11.1",
|
16
|
-
"lodash": "^4.17.21",
|
16
|
+
"lodash-es": "^4.17.21",
|
17
17
|
"moment": "^2.29.0",
|
18
18
|
"ngx-clipboard": "^16.0.0"
|
19
19
|
},
|
@@ -8,13 +8,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
9
|
});
|
10
10
|
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
15
|
exports.rxjs7Upgrade = void 0;
|
13
16
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
14
17
|
const change_1 = require("@schematics/angular/utility/change");
|
15
18
|
const path_1 = require("path");
|
16
|
-
const
|
17
|
-
const
|
19
|
+
const typescript_1 = __importDefault(require("typescript"));
|
20
|
+
const typescript_2 = require("../utilities/typescript");
|
18
21
|
const workspace_1 = require("../utilities/workspace");
|
19
22
|
function rxjs7Upgrade(options) {
|
20
23
|
return (tree) => __awaiter(this, void 0, void 0, function* () {
|
@@ -26,7 +29,7 @@ function rxjs7Upgrade(options) {
|
|
26
29
|
// The absolute file system path is needed for the typescript compiler to resolve files correctly.
|
27
30
|
const basePath = process.cwd().replace(/\\/g, path);
|
28
31
|
tsConfigPaths.forEach(tsConfigPath => {
|
29
|
-
const program = (0,
|
32
|
+
const program = (0, typescript_2.createTsProgram)(tree, tsConfigPath, basePath);
|
30
33
|
const checker = program.getTypeChecker();
|
31
34
|
for (const sourceFile of program.getSourceFiles()) {
|
32
35
|
// Skip declaration files and external library files
|
@@ -34,8 +37,8 @@ function rxjs7Upgrade(options) {
|
|
34
37
|
continue;
|
35
38
|
}
|
36
39
|
const observableSymbols = ['Observable', 'Subject', 'BehaviorSubject', 'ReplaySubject', 'AsyncSubject'];
|
37
|
-
const toPromiseCalls = (0, ast_utils_1.findNodes)(sourceFile,
|
38
|
-
if (
|
40
|
+
const toPromiseCalls = (0, ast_utils_1.findNodes)(sourceFile, typescript_1.default.isCallExpression, undefined, true).filter(node => {
|
41
|
+
if (typescript_1.default.isPropertyAccessExpression(node.expression) && node.expression.name.text === 'toPromise') {
|
39
42
|
const symbol = checker.getTypeAtLocation(node.expression.expression).symbol;
|
40
43
|
return symbol && observableSymbols.includes(symbol.name);
|
41
44
|
}
|
@@ -45,14 +48,14 @@ function rxjs7Upgrade(options) {
|
|
45
48
|
const fileToEdit = (0, path_1.relative)(basePath, sourceFile.fileName);
|
46
49
|
const recorder = tree.beginUpdate(fileToEdit);
|
47
50
|
const changes = [];
|
48
|
-
const printer =
|
51
|
+
const printer = typescript_1.default.createPrinter();
|
49
52
|
// Add import for lastValueFrom
|
50
53
|
changes.push((0, ast_utils_1.insertImport)(sourceFile, fileToEdit, 'lastValueFrom', 'rxjs'));
|
51
54
|
// Replace toPromise calls with lastValueFrom
|
52
55
|
toPromiseCalls.forEach(node => {
|
53
|
-
if (
|
54
|
-
const newCallExpression =
|
55
|
-
const newNodeText = printer.printNode(
|
56
|
+
if (typescript_1.default.isPropertyAccessExpression(node.expression)) {
|
57
|
+
const newCallExpression = typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier('lastValueFrom'), undefined, [node.expression.expression]);
|
58
|
+
const newNodeText = printer.printNode(typescript_1.default.EmitHint.Unspecified, newCallExpression, sourceFile);
|
56
59
|
const change = new change_1.ReplaceChange(fileToEdit, node.getStart(), node.getText(), newNodeText);
|
57
60
|
changes.push(change);
|
58
61
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/components/schematics/rxjs-7-upgrade/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/components/schematics/rxjs-7-upgrade/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,qEAAgF;AAChF,+DAAkG;AAClG,+BAAgC;AAChC,4DAA4B;AAC5B,wDAA0D;AAC1D,sDAAwE;AAGxE,SAAgB,YAAY,CAAC,OAA0B;IACrD,OAAO,CAAO,IAAU,EAAE,EAAE;QAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC;QACjC,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAY,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAEjD,sEAAsE;QACtE,MAAM,aAAa,GAAG,IAAA,4BAAgB,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAExD,2IAA2I;QAC3I,mGAAmG;QACnG,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEpD,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;YACnC,MAAM,OAAO,GAAG,IAAA,4BAAe,EAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;YAC9D,MAAM,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;YAEzC,KAAK,MAAM,UAAU,IAAI,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;gBAClD,o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AAC,IAAI,CAAC,EAAE;wBAC5B,IAAI,oBAAE,CAAC,0BAA0B,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;4BACnD,MAAM,iBAAiB,GAAG,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CACvD,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,EAC5C,SAAS,EACT,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAC7B,CAAC;4BACF,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,oBAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC;4BAC9F,MAAM,MAAM,GAAG,IAAI,sBAAa,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC,CAAC;4BAC3F,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;wBACvB,CAAC;oBACH,CAAC,CAAC,CAAC;oBAEH,IAAA,8BAAqB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;oBACzC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;gBAC9B,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAA,CAAA;AACH,CAAC;AA7DD,oCA6DC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Tree } from '@angular-devkit/schematics';
|
2
|
-
import
|
2
|
+
import ts from 'typescript';
|
3
3
|
/** Parses the TSConfig file to be used in the TS Compiler Program. */
|
4
4
|
export declare function parseTsConfig(absoluteTsConfigPath: string): ts.ParsedCommandLine;
|
5
5
|
/** Creates a file host to be used with with a TS Compiler program. */
|
@@ -1,23 +1,26 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
6
|
exports.createTsProgram = exports.createTsCompilerHost = exports.parseTsConfig = void 0;
|
4
7
|
const path_1 = require("path");
|
5
|
-
const
|
8
|
+
const typescript_1 = __importDefault(require("typescript"));
|
6
9
|
/** Parses the TSConfig file to be used in the TS Compiler Program. */
|
7
10
|
function parseTsConfig(absoluteTsConfigPath) {
|
8
|
-
const { config } =
|
11
|
+
const { config } = typescript_1.default.readConfigFile(absoluteTsConfigPath, typescript_1.default.sys.readFile);
|
9
12
|
const parseHost = {
|
10
|
-
useCaseSensitiveFileNames:
|
11
|
-
fileExists:
|
12
|
-
readFile:
|
13
|
-
readDirectory:
|
13
|
+
useCaseSensitiveFileNames: typescript_1.default.sys.useCaseSensitiveFileNames,
|
14
|
+
fileExists: typescript_1.default.sys.fileExists,
|
15
|
+
readFile: typescript_1.default.sys.readFile,
|
16
|
+
readDirectory: typescript_1.default.sys.readDirectory
|
14
17
|
};
|
15
|
-
return
|
18
|
+
return typescript_1.default.parseJsonConfigFileContent(config, parseHost, (0, path_1.dirname)(absoluteTsConfigPath), {});
|
16
19
|
}
|
17
20
|
exports.parseTsConfig = parseTsConfig;
|
18
21
|
/** Creates a file host to be used with with a TS Compiler program. */
|
19
22
|
function createTsCompilerHost(tree, options, basePath) {
|
20
|
-
const host =
|
23
|
+
const host = typescript_1.default.createCompilerHost(options);
|
21
24
|
// Read files from the virtual tree to prevent conflicting changes between project migrations
|
22
25
|
host.readFile = (fileName) => {
|
23
26
|
var _a;
|
@@ -36,7 +39,7 @@ function createTsProgram(tree, tsConfigPath, basePath) {
|
|
36
39
|
const parsed = parseTsConfig(absoluteTsConfigPath);
|
37
40
|
const options = Object.assign(Object.assign({}, parsed.options), { skipLibCheck: true, skipDefaultLibCheck: true });
|
38
41
|
const host = createTsCompilerHost(tree, options, basePath);
|
39
|
-
return
|
42
|
+
return typescript_1.default.createProgram(parsed.fileNames, options, host);
|
40
43
|
}
|
41
44
|
exports.createTsProgram = createTsProgram;
|
42
45
|
//# sourceMappingURL=typescript.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../../projects/components/schematics/utilities/typescript.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../../projects/components/schematics/utilities/typescript.ts"],"names":[],"mappings":";;;;;;AACA,+BAAkD;AAClD,4DAA4B;AAE5B,sEAAsE;AACtE,SAAgB,aAAa,CAAC,oBAA4B;IACxD,MAAM,EAAE,MAAM,EAAE,GAAG,oBAAE,CAAC,cAAc,CAAC,oBAAoB,EAAE,oBAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC5E,MAAM,SAAS,GAAG;QAChB,yBAAyB,EAAE,oBAAE,CAAC,GAAG,CAAC,yBAAyB;QAC3D,UAAU,EAAE,oBAAE,CAAC,GAAG,CAAC,UAAU;QAC7B,QAAQ,EAAE,oBAAE,CAAC,GAAG,CAAC,QAAQ;QACzB,aAAa,EAAE,oBAAE,CAAC,GAAG,CAAC,aAAa;KACpC,CAAC;IAEF,OAAO,oBAAE,CAAC,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,IAAA,cAAO,EAAC,oBAAoB,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7F,CAAC;AAVD,sCAUC;AAED,sEAAsE;AACtE,SAAgB,oBAAoB,CAAC,IAAU,EAAE,OAA2B,EAAE,QAAgB;IAC5F,MAAM,IAAI,GAAG,oBAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC5C,6FAA6F;IAC7F,IAAI,CAAC,QAAQ,GAAG,CAAC,QAAgB,EAAE,EAAE;;QACnC,kFAAkF;QAClF,MAAM,QAAQ,GAAG,IAAA,eAAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC9C,MAAM,MAAM,GAAG,MAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,QAAQ,EAAE,CAAC;QAC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