tnp-core 21.0.136 → 21.0.138
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/VERIFIED-BUILD-DATA.jsonc +2 -2
- package/bin/start.js +1 -1
- package/browser/fesm2022/tnp-core-browser.mjs +4 -3
- package/browser/fesm2022/tnp-core-browser.mjs.map +1 -1
- package/browser/package.json +1 -1
- package/browser/types/tnp-core-browser.d.ts +0 -1
- package/browser-prod/fesm2022/tnp-core-browser-prod.mjs +4 -3
- package/browser-prod/fesm2022/tnp-core-browser-prod.mjs.map +1 -1
- package/browser-prod/package.json +1 -1
- package/browser-prod/types/tnp-core-browser-prod.d.ts +0 -1
- package/cli.backend.js +2 -2
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/global-storage.d.ts +0 -1
- package/lib/global-storage.js +4 -4
- package/lib/global-storage.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/node-chalk-mock.js +2 -2
- package/lib/node-path-mock.js +2 -2
- package/lib/package.json +1 -1
- package/lib/utils-imports.d.ts +0 -0
- package/lib/utils-imports.js +69 -0
- package/lib/utils-imports.js.map +1 -0
- package/lib/utils-imports.test.d.ts +0 -0
- package/lib/utils-imports.test.js +124 -0
- package/lib/utils-imports.test.js.map +1 -0
- package/lib-esm/app.hosts.d.ts +2 -2
- package/lib-esm/app.hosts.js +4 -4
- package/lib-esm/cli.backend.d.ts +1 -1
- package/lib-esm/cli.backend.js +1 -1
- package/lib-esm/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib-esm/lib/build-info._auto-generated_.js +1 -1
- package/lib-esm/lib/global-storage.d.ts +0 -1
- package/lib-esm/lib/global-storage.js +4 -4
- package/lib-esm/lib/global-storage.js.map +1 -1
- package/lib-esm/lib/index.js +1 -0
- package/lib-esm/lib/index.js.map +1 -1
- package/lib-esm/lib/node-chalk-mock.d.ts +1 -1
- package/lib-esm/lib/node-chalk-mock.js +1 -1
- package/lib-esm/lib/node-path-mock.d.ts +1 -1
- package/lib-esm/lib/node-path-mock.js +1 -1
- package/lib-esm/lib/utils-imports.d.ts +0 -0
- package/lib-esm/lib/utils-imports.js +69 -0
- package/lib-esm/lib/utils-imports.js.map +1 -0
- package/lib-esm/lib/utils-imports.test.d.ts +0 -0
- package/lib-esm/lib/utils-imports.test.js +124 -0
- package/lib-esm/lib/utils-imports.test.js.map +1 -0
- package/lib-prod/build-info._auto-generated_.d.ts +1 -1
- package/lib-prod/build-info._auto-generated_.js +1 -1
- package/lib-prod/global-storage.d.ts +0 -1
- package/lib-prod/global-storage.js +4 -4
- package/lib-prod/global-storage.js.map +1 -1
- package/lib-prod/index.js +1 -0
- package/lib-prod/index.js.map +1 -1
- package/lib-prod/node-chalk-mock.d.ts +1 -1
- package/lib-prod/node-chalk-mock.js +1 -1
- package/lib-prod/node-path-mock.d.ts +1 -1
- package/lib-prod/node-path-mock.js +1 -1
- package/lib-prod/package.json +1 -1
- package/lib-prod/utils-imports.d.ts +0 -0
- package/lib-prod/utils-imports.js +69 -0
- package/lib-prod/utils-imports.js.map +1 -0
- package/lib-prod/utils-imports.test.d.ts +0 -0
- package/lib-prod/utils-imports.test.js +124 -0
- package/lib-prod/utils-imports.test.js.map +1 -0
- package/package.json +1 -1
- package/websql/fesm2022/tnp-core-websql.mjs +4 -3
- package/websql/fesm2022/tnp-core-websql.mjs.map +1 -1
- package/websql/package.json +1 -1
- package/websql/types/tnp-core-websql.d.ts +0 -1
- package/websql-prod/fesm2022/tnp-core-websql-prod.mjs +4 -3
- package/websql-prod/fesm2022/tnp-core-websql-prod.mjs.map +1 -1
- package/websql-prod/package.json +1 -1
- package/websql-prod/types/tnp-core-websql-prod.d.ts +0 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// import { UtilsImports } from './utils-imports';
|
|
2
|
+
// describe('UtilsImports.replaceEsmSyncImports', () => {
|
|
3
|
+
// const packages = ['@angular/compiler'];
|
|
4
|
+
// it('replaces named import', () => {
|
|
5
|
+
// const input = `
|
|
6
|
+
// import { parseTemplate } from '@angular/compiler';
|
|
7
|
+
// `;
|
|
8
|
+
// expect(UtilsImports.replaceEsmSyncImports(input, packages)).toContain(
|
|
9
|
+
// `const { parseTemplate } = globalThis.__global_imports__['@angular/compiler'];`,
|
|
10
|
+
// );
|
|
11
|
+
// });
|
|
12
|
+
// it('replaces multiline named import', () => {
|
|
13
|
+
// const input = `
|
|
14
|
+
// import {
|
|
15
|
+
// AST,
|
|
16
|
+
// Binary,
|
|
17
|
+
// parseTemplate,
|
|
18
|
+
// TmplAstNode,
|
|
19
|
+
// } from '@angular/compiler';
|
|
20
|
+
// `;
|
|
21
|
+
// expect(UtilsImports.replaceEsmSyncImports(input, packages)).toContain(`
|
|
22
|
+
// const {
|
|
23
|
+
// AST,
|
|
24
|
+
// Binary,
|
|
25
|
+
// parseTemplate,
|
|
26
|
+
// TmplAstNode,
|
|
27
|
+
// } = globalThis.__global_imports__['@angular/compiler'];`);
|
|
28
|
+
// });
|
|
29
|
+
// it('replaces default import', () => {
|
|
30
|
+
// const input = `
|
|
31
|
+
// import compiler from '@angular/compiler';
|
|
32
|
+
// `;
|
|
33
|
+
// expect(UtilsImports.replaceEsmSyncImports(input, packages)).toContain(
|
|
34
|
+
// `const compiler = globalThis.__global_imports__['@angular/compiler'].default;`,
|
|
35
|
+
// );
|
|
36
|
+
// });
|
|
37
|
+
// it('replaces namespace import', () => {
|
|
38
|
+
// const input = `
|
|
39
|
+
// import * as compiler from '@angular/compiler';
|
|
40
|
+
// `;
|
|
41
|
+
// expect(UtilsImports.replaceEsmSyncImports(input, packages)).toContain(
|
|
42
|
+
// `const compiler = globalThis.__global_imports__['@angular/compiler'];`,
|
|
43
|
+
// );
|
|
44
|
+
// });
|
|
45
|
+
// it('replaces default + named import', () => {
|
|
46
|
+
// const input = `
|
|
47
|
+
// import compiler, { parseTemplate, AST } from '@angular/compiler';
|
|
48
|
+
// `;
|
|
49
|
+
// const output = UtilsImports.replaceEsmSyncImports(input, packages);
|
|
50
|
+
// expect(output).toContain(
|
|
51
|
+
// `const compiler = globalThis.__global_imports__['@angular/compiler'].default;`,
|
|
52
|
+
// );
|
|
53
|
+
// expect(output).toContain(
|
|
54
|
+
// `const { parseTemplate, AST } = globalThis.__global_imports__['@angular/compiler'];`,
|
|
55
|
+
// );
|
|
56
|
+
// });
|
|
57
|
+
// it('replaces multiline default + named import', () => {
|
|
58
|
+
// const input = `
|
|
59
|
+
// import compiler, {
|
|
60
|
+
// AST,
|
|
61
|
+
// Binary,
|
|
62
|
+
// parseTemplate,
|
|
63
|
+
// } from '@angular/compiler';
|
|
64
|
+
// `;
|
|
65
|
+
// const output = UtilsImports.replaceEsmSyncImports(input, packages);
|
|
66
|
+
// expect(output).toContain(
|
|
67
|
+
// `const compiler = globalThis.__global_imports__['@angular/compiler'].default;`,
|
|
68
|
+
// );
|
|
69
|
+
// // expect(output).toContain(`
|
|
70
|
+
// // const {
|
|
71
|
+
// // AST,
|
|
72
|
+
// // Binary,
|
|
73
|
+
// // parseTemplate,
|
|
74
|
+
// // } = globalThis.__global_imports__['@angular/compiler'];`);
|
|
75
|
+
// // });
|
|
76
|
+
// expect(output).toContain(
|
|
77
|
+
// `const {
|
|
78
|
+
// AST,
|
|
79
|
+
// Binary,
|
|
80
|
+
// parseTemplate,
|
|
81
|
+
// } = globalThis.__global_imports__['@angular/compiler'];`,
|
|
82
|
+
// );
|
|
83
|
+
// });
|
|
84
|
+
// it('does not touch other packages', () => {
|
|
85
|
+
// const input = `
|
|
86
|
+
// import { readFileSync } from 'fs';
|
|
87
|
+
// `;
|
|
88
|
+
// expect(UtilsImports.replaceEsmSyncImports(input, packages)).toBe(input);
|
|
89
|
+
// });
|
|
90
|
+
// it('replaces only configured package', () => {
|
|
91
|
+
// const input = `
|
|
92
|
+
// import { parseTemplate } from '@angular/compiler';
|
|
93
|
+
// import { Component } from '@angular/core';
|
|
94
|
+
// `;
|
|
95
|
+
// const output = UtilsImports.replaceEsmSyncImports(input, packages);
|
|
96
|
+
// expect(output).toContain(
|
|
97
|
+
// `const { parseTemplate } = globalThis.__global_imports__['@angular/compiler'];`,
|
|
98
|
+
// );
|
|
99
|
+
// expect(output).toContain(`import { Component } from '@angular/core';`);
|
|
100
|
+
// });
|
|
101
|
+
// it('replaces multiple imports in one file', () => {
|
|
102
|
+
// const input = `
|
|
103
|
+
// import { parseTemplate } from '@angular/compiler';
|
|
104
|
+
// import * as compiler from '@angular/compiler';
|
|
105
|
+
// `;
|
|
106
|
+
// const output = UtilsImports.replaceEsmSyncImports(input, packages);
|
|
107
|
+
// expect(output).toContain(
|
|
108
|
+
// `const { parseTemplate } = globalThis.__global_imports__['@angular/compiler'];`,
|
|
109
|
+
// );
|
|
110
|
+
// expect(output).toContain(
|
|
111
|
+
// `const compiler = globalThis.__global_imports__['@angular/compiler'];`,
|
|
112
|
+
// );
|
|
113
|
+
// });
|
|
114
|
+
// it('keeps import aliases', () => {
|
|
115
|
+
// const input = `
|
|
116
|
+
// import { parseTemplate as parse, AST as NodeAst } from '@angular/compiler';
|
|
117
|
+
// `;
|
|
118
|
+
// const output = UtilsImports.replaceEsmSyncImports(input, packages);
|
|
119
|
+
// expect(output).toContain(
|
|
120
|
+
// `const { parseTemplate as parse, AST as NodeAst } = globalThis.__global_imports__['@angular/compiler'];`,
|
|
121
|
+
// );
|
|
122
|
+
// });
|
|
123
|
+
// });
|
|
124
|
+
//# sourceMappingURL=utils-imports.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-imports.test.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,kDAAkD;AAElD,yDAAyD;AACzD,4CAA4C;AAE5C,wCAAwC;AACxC,sBAAsB;AACtB,qDAAqD;AACrD,KAAK;AAEL,6EAA6E;AAC7E,yFAAyF;AACzF,SAAS;AACT,QAAQ;AAER,kDAAkD;AAClD,sBAAsB;AACtB,WAAW;AACX,SAAS;A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AAEL,0EAA0E;AAE1E,gCAAgC;AAChC,yFAAyF;AACzF,SAAS;AAET,gCAAgC;AAChC,gFAAgF;AAChF,SAAS;AACT,QAAQ;AAER,uCAAuC;AACvC,sBAAsB;AACtB,8EAA8E;AAC9E,KAAK;AAEL,0EAA0E;AAE1E,gCAAgC;AAChC,kHAAkH;AAClH,SAAS;AACT,QAAQ;AACR,MAAM"}
|
|
@@ -21,4 +21,4 @@ export declare const CURRENT_PACKAGE_TAON_VERSION = "v21";
|
|
|
21
21
|
/**
|
|
22
22
|
* Autogenerated by current cli tool. Use *tnp release* to bump version.
|
|
23
23
|
*/
|
|
24
|
-
export declare const CURRENT_PACKAGE_VERSION = "21.0.
|
|
24
|
+
export declare const CURRENT_PACKAGE_VERSION = "21.0.138";
|
|
@@ -22,6 +22,6 @@ export const CURRENT_PACKAGE_TAON_VERSION = 'v21';
|
|
|
22
22
|
/**
|
|
23
23
|
* Autogenerated by current cli tool. Use *tnp release* to bump version.
|
|
24
24
|
*/
|
|
25
|
-
export const CURRENT_PACKAGE_VERSION = '21.0.
|
|
25
|
+
export const CURRENT_PACKAGE_VERSION = '21.0.138';
|
|
26
26
|
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
27
27
|
//# sourceMappingURL=build-info._auto-generated_.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const globalStorClassKey = '__taon__GlobalStorageClass__';
|
|
1
2
|
/**
|
|
2
3
|
* TODO WIP
|
|
3
4
|
* refactor:
|
|
@@ -6,14 +7,13 @@
|
|
|
6
7
|
* 3. ng2-logger
|
|
7
8
|
*/
|
|
8
9
|
class GlobalStorageClass {
|
|
9
|
-
static instance;
|
|
10
10
|
store = new Map();
|
|
11
11
|
constructor() { }
|
|
12
12
|
static getInstance() {
|
|
13
|
-
if (!
|
|
14
|
-
|
|
13
|
+
if (!globalThis[globalStorClassKey]) {
|
|
14
|
+
globalThis[globalStorClassKey] = new GlobalStorageClass();
|
|
15
15
|
}
|
|
16
|
-
return
|
|
16
|
+
return globalThis[globalStorClassKey];
|
|
17
17
|
}
|
|
18
18
|
set(path, value) {
|
|
19
19
|
this.store.set(path, value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-storage.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,kBAAkB;IACd,
|
|
1
|
+
{"version":3,"file":"global-storage.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,8BAA8B,CAAC;AAC1D;;;;;;GAMG;AACH,MAAM,kBAAkB;IACd,KAAK,GAAG,IAAI,GAAG,EAAe,CAAC;IAEvC,gBAAuB,CAAC;IAExB,MAAM,CAAC,WAAW;QAChB,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACpC,UAAU,CAAC,kBAAkB,CAAC,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAC5D,CAAC;QACD,OAAO,UAAU,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;IAED,GAAG,CAAI,IAAY,EAAE,KAAQ;QAC3B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,GAAG,CAAI,IAAY;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAI,IAAY,EAAE,OAAmC;QACzD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC"}
|
package/lib-prod/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export * from './utils-dot-file';
|
|
|
24
24
|
export * from './utils-binary';
|
|
25
25
|
export * from './utils-string-regex';
|
|
26
26
|
export * from './utils-i18n';
|
|
27
|
+
// export * from './utils-imports';
|
|
27
28
|
export * from './lowdb'; // @backend
|
|
28
29
|
export * from './core-cli';
|
|
29
30
|
export * from './required-global-npm-packages';
|
package/lib-prod/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC,CAAC,WAAW;AAEpC,cAAc,YAAY,CAAC;AAC3B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC,CAAC,WAAW;AAExC,eAAe,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,mCAAmC;AACnC,cAAc,SAAS,CAAC,CAAC,WAAW;AAEpC,cAAc,YAAY,CAAC;AAC3B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC,CAAC,WAAW;AAExC,eAAe,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function dummy1783725265629(): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function dummy1783725265629() { }
|
|
2
2
|
//# sourceMappingURL=node-chalk-mock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function dummy1783725265649(): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function dummy1783725265649() { }
|
|
2
2
|
//# sourceMappingURL=node-path-mock.js.map
|
package/lib-prod/package.json
CHANGED
|
File without changes
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// /**
|
|
2
|
+
// * @deprecated
|
|
3
|
+
// */
|
|
4
|
+
// export namespace UtilsCjsEsmReplaceImports {
|
|
5
|
+
// export function replaceEsmSyncImports(
|
|
6
|
+
// content: string,
|
|
7
|
+
// esmPackages: string[],
|
|
8
|
+
// ): string {
|
|
9
|
+
// //#region @backendFunc
|
|
10
|
+
// console.log('REplacing for ', esmPackages);
|
|
11
|
+
// for (const pkg of esmPackages) {
|
|
12
|
+
// content = replacePackageImport(content, pkg);
|
|
13
|
+
// }
|
|
14
|
+
// return content;
|
|
15
|
+
// //#endregion
|
|
16
|
+
// }
|
|
17
|
+
// function replacePackageImport(content: string, pkg: string): string {
|
|
18
|
+
// //#region @backendFunc
|
|
19
|
+
// const escapedPkg = pkg.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
20
|
+
// return content.replace(
|
|
21
|
+
// new RegExp(
|
|
22
|
+
// String.raw`import\s+([\s\S]*?)\s+from\s+['"]${escapedPkg}['"]\s*;?`,
|
|
23
|
+
// 'g',
|
|
24
|
+
// ),
|
|
25
|
+
// (wholeMatch: string, importPartRaw: string) => {
|
|
26
|
+
// const importPart = importPartRaw.trim();
|
|
27
|
+
// const globalPkg = `globalThis.__global_imports__['${pkg}']`;
|
|
28
|
+
// const namespaceMatch = importPart.match(
|
|
29
|
+
// /^\*\s+as\s+([A-Za-z_$][\w$]*)$/,
|
|
30
|
+
// );
|
|
31
|
+
// if (namespaceMatch) {
|
|
32
|
+
// return `const ${namespaceMatch[1]} = ${globalPkg};`;
|
|
33
|
+
// }
|
|
34
|
+
// if (importPart.startsWith('{')) {
|
|
35
|
+
// return `const ${importPart} = ${globalPkg};`;
|
|
36
|
+
// }
|
|
37
|
+
// const defaultNamedMatch = importPart.match(
|
|
38
|
+
// /^([A-Za-z_$][\w$]*)\s*,\s*(\{[\s\S]*\})$/,
|
|
39
|
+
// );
|
|
40
|
+
// if (defaultNamedMatch) {
|
|
41
|
+
// const defaultName = defaultNamedMatch[1];
|
|
42
|
+
// const namedPart = defaultNamedMatch[2];
|
|
43
|
+
// return `const ${defaultName} = ${globalPkg}.default; const ${namedPart} = ${globalPkg};`;
|
|
44
|
+
// }
|
|
45
|
+
// const defaultOnlyMatch = importPart.match(/^([A-Za-z_$][\w$]*)$/);
|
|
46
|
+
// if (defaultOnlyMatch) {
|
|
47
|
+
// return `const ${defaultOnlyMatch[1]} = ${globalPkg}.default;`;
|
|
48
|
+
// }
|
|
49
|
+
// return wholeMatch;
|
|
50
|
+
// },
|
|
51
|
+
// );
|
|
52
|
+
// //#endregion
|
|
53
|
+
// }
|
|
54
|
+
// export async function resolveEsmSyncImport(
|
|
55
|
+
// packages: string[],
|
|
56
|
+
// ): Promise<void> {
|
|
57
|
+
// //#region @backendFunc
|
|
58
|
+
// globalThis.__global_imports__ ??= {};
|
|
59
|
+
// console.log('Resovling esm for ', packages);
|
|
60
|
+
// await Promise.all(
|
|
61
|
+
// packages.map(async pkg => {
|
|
62
|
+
// console.log(`awaiting import for ${pkg}`);
|
|
63
|
+
// globalThis.__global_imports__[pkg] ??= await import(pkg);
|
|
64
|
+
// }),
|
|
65
|
+
// );
|
|
66
|
+
// //#endregion
|
|
67
|
+
// }
|
|
68
|
+
// }
|
|
69
|
+
//# sourceMappingURL=utils-imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-imports.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,MAAM;AACN,iBAAiB;AACjB,MAAM;AACN,+CAA+C;AAC/C,2CAA2C;AAC3C,uBAAuB;AACvB,6BAA6B;AAC7B,gBAAgB;AAChB,6BAA6B;AAC7B,kDAAkD;AAClD,uCAAuC;AACvC,sDAAsD;AACtD,QAAQ;AACR,sBAAsB;AACtB,mBAAmB;AACnB,MAAM;AAEN,0EAA0E;AAC1E,6BAA6B;AAC7B,qEAAqE;AAErE,8BAA8B;AAC9B,oBAAoB;AACpB,+EAA+E;AAC/E,eAAe;AACf,WAAW;AACX,yDAAyD;AACzD,mDAAmD;AACnD,uEAAuE;AAEvE,mDAAmD;AACnD,8CAA8C;AAC9C,aAAa;AACb,gCAAgC;AAChC,iEAAiE;AACjE,YAAY;AAEZ,4CAA4C;AAC5C,0DAA0D;AAC1D,YAAY;AAEZ,sDAAsD;AACtD,wDAAwD;AACxD,aAAa;AACb,mCAAmC;AACnC,sDAAsD;AACtD,oDAAoD;AAEpD,sGAAsG;AACtG,YAAY;AAEZ,6EAA6E;AAC7E,kCAAkC;AAClC,2EAA2E;AAC3E,YAAY;AAEZ,6BAA6B;AAC7B,WAAW;AACX,SAAS;AACT,mBAAmB;AACnB,MAAM;AAEN,gDAAgD;AAChD,0BAA0B;AAC1B,uBAAuB;AACvB,6BAA6B;AAC7B,4CAA4C;AAC5C,mDAAmD;AACnD,yBAAyB;AACzB,oCAAoC;AACpC,qDAAqD;AACrD,oEAAoE;AACpE,YAAY;AACZ,SAAS;AACT,mBAAmB;AACnB,MAAM;AACN,IAAI"}
|
|
File without changes
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// import { UtilsImports } from './utils-imports';
|
|
2
|
+
// describe('UtilsImports.replaceEsmSyncImports', () => {
|
|
3
|
+
// const packages = ['@angular/compiler'];
|
|
4
|
+
// it('replaces named import', () => {
|
|
5
|
+
// const input = `
|
|
6
|
+
// import { parseTemplate } from '@angular/compiler';
|
|
7
|
+
// `;
|
|
8
|
+
// expect(UtilsImports.replaceEsmSyncImports(input, packages)).toContain(
|
|
9
|
+
// `const { parseTemplate } = globalThis.__global_imports__['@angular/compiler'];`,
|
|
10
|
+
// );
|
|
11
|
+
// });
|
|
12
|
+
// it('replaces multiline named import', () => {
|
|
13
|
+
// const input = `
|
|
14
|
+
// import {
|
|
15
|
+
// AST,
|
|
16
|
+
// Binary,
|
|
17
|
+
// parseTemplate,
|
|
18
|
+
// TmplAstNode,
|
|
19
|
+
// } from '@angular/compiler';
|
|
20
|
+
// `;
|
|
21
|
+
// expect(UtilsImports.replaceEsmSyncImports(input, packages)).toContain(`
|
|
22
|
+
// const {
|
|
23
|
+
// AST,
|
|
24
|
+
// Binary,
|
|
25
|
+
// parseTemplate,
|
|
26
|
+
// TmplAstNode,
|
|
27
|
+
// } = globalThis.__global_imports__['@angular/compiler'];`);
|
|
28
|
+
// });
|
|
29
|
+
// it('replaces default import', () => {
|
|
30
|
+
// const input = `
|
|
31
|
+
// import compiler from '@angular/compiler';
|
|
32
|
+
// `;
|
|
33
|
+
// expect(UtilsImports.replaceEsmSyncImports(input, packages)).toContain(
|
|
34
|
+
// `const compiler = globalThis.__global_imports__['@angular/compiler'].default;`,
|
|
35
|
+
// );
|
|
36
|
+
// });
|
|
37
|
+
// it('replaces namespace import', () => {
|
|
38
|
+
// const input = `
|
|
39
|
+
// import * as compiler from '@angular/compiler';
|
|
40
|
+
// `;
|
|
41
|
+
// expect(UtilsImports.replaceEsmSyncImports(input, packages)).toContain(
|
|
42
|
+
// `const compiler = globalThis.__global_imports__['@angular/compiler'];`,
|
|
43
|
+
// );
|
|
44
|
+
// });
|
|
45
|
+
// it('replaces default + named import', () => {
|
|
46
|
+
// const input = `
|
|
47
|
+
// import compiler, { parseTemplate, AST } from '@angular/compiler';
|
|
48
|
+
// `;
|
|
49
|
+
// const output = UtilsImports.replaceEsmSyncImports(input, packages);
|
|
50
|
+
// expect(output).toContain(
|
|
51
|
+
// `const compiler = globalThis.__global_imports__['@angular/compiler'].default;`,
|
|
52
|
+
// );
|
|
53
|
+
// expect(output).toContain(
|
|
54
|
+
// `const { parseTemplate, AST } = globalThis.__global_imports__['@angular/compiler'];`,
|
|
55
|
+
// );
|
|
56
|
+
// });
|
|
57
|
+
// it('replaces multiline default + named import', () => {
|
|
58
|
+
// const input = `
|
|
59
|
+
// import compiler, {
|
|
60
|
+
// AST,
|
|
61
|
+
// Binary,
|
|
62
|
+
// parseTemplate,
|
|
63
|
+
// } from '@angular/compiler';
|
|
64
|
+
// `;
|
|
65
|
+
// const output = UtilsImports.replaceEsmSyncImports(input, packages);
|
|
66
|
+
// expect(output).toContain(
|
|
67
|
+
// `const compiler = globalThis.__global_imports__['@angular/compiler'].default;`,
|
|
68
|
+
// );
|
|
69
|
+
// // expect(output).toContain(`
|
|
70
|
+
// // const {
|
|
71
|
+
// // AST,
|
|
72
|
+
// // Binary,
|
|
73
|
+
// // parseTemplate,
|
|
74
|
+
// // } = globalThis.__global_imports__['@angular/compiler'];`);
|
|
75
|
+
// // });
|
|
76
|
+
// expect(output).toContain(
|
|
77
|
+
// `const {
|
|
78
|
+
// AST,
|
|
79
|
+
// Binary,
|
|
80
|
+
// parseTemplate,
|
|
81
|
+
// } = globalThis.__global_imports__['@angular/compiler'];`,
|
|
82
|
+
// );
|
|
83
|
+
// });
|
|
84
|
+
// it('does not touch other packages', () => {
|
|
85
|
+
// const input = `
|
|
86
|
+
// import { readFileSync } from 'fs';
|
|
87
|
+
// `;
|
|
88
|
+
// expect(UtilsImports.replaceEsmSyncImports(input, packages)).toBe(input);
|
|
89
|
+
// });
|
|
90
|
+
// it('replaces only configured package', () => {
|
|
91
|
+
// const input = `
|
|
92
|
+
// import { parseTemplate } from '@angular/compiler';
|
|
93
|
+
// import { Component } from '@angular/core';
|
|
94
|
+
// `;
|
|
95
|
+
// const output = UtilsImports.replaceEsmSyncImports(input, packages);
|
|
96
|
+
// expect(output).toContain(
|
|
97
|
+
// `const { parseTemplate } = globalThis.__global_imports__['@angular/compiler'];`,
|
|
98
|
+
// );
|
|
99
|
+
// expect(output).toContain(`import { Component } from '@angular/core';`);
|
|
100
|
+
// });
|
|
101
|
+
// it('replaces multiple imports in one file', () => {
|
|
102
|
+
// const input = `
|
|
103
|
+
// import { parseTemplate } from '@angular/compiler';
|
|
104
|
+
// import * as compiler from '@angular/compiler';
|
|
105
|
+
// `;
|
|
106
|
+
// const output = UtilsImports.replaceEsmSyncImports(input, packages);
|
|
107
|
+
// expect(output).toContain(
|
|
108
|
+
// `const { parseTemplate } = globalThis.__global_imports__['@angular/compiler'];`,
|
|
109
|
+
// );
|
|
110
|
+
// expect(output).toContain(
|
|
111
|
+
// `const compiler = globalThis.__global_imports__['@angular/compiler'];`,
|
|
112
|
+
// );
|
|
113
|
+
// });
|
|
114
|
+
// it('keeps import aliases', () => {
|
|
115
|
+
// const input = `
|
|
116
|
+
// import { parseTemplate as parse, AST as NodeAst } from '@angular/compiler';
|
|
117
|
+
// `;
|
|
118
|
+
// const output = UtilsImports.replaceEsmSyncImports(input, packages);
|
|
119
|
+
// expect(output).toContain(
|
|
120
|
+
// `const { parseTemplate as parse, AST as NodeAst } = globalThis.__global_imports__['@angular/compiler'];`,
|
|
121
|
+
// );
|
|
122
|
+
// });
|
|
123
|
+
// });
|
|
124
|
+
//# sourceMappingURL=utils-imports.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-imports.test.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,kDAAkD;AAElD,yDAAyD;AACzD,4CAA4C;AAE5C,wCAAwC;AACxC,sBAAsB;AACtB,qDAAqD;AACrD,KAAK;AAEL,6EAA6E;AAC7E,yFAAyF;AACzF,SAAS;AACT,QAAQ;AAER,kDAAkD;AAClD,sBAAsB;AACtB,WAAW;AACX,SAAS;AACT,YAAY;AACZ,mBAAmB;AACnB,iBAAiB;AACjB,8BAA8B;AAC9B,KAAK;AAEL,8EAA8E;AAC9E,UAAU;AACV,SAAS;AACT,YAAY;AACZ,mBAAmB;AACnB,iBAAiB;AACjB,6DAA6D;AAC7D,QA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,0EAA0E;AAE1E,gCAAgC;AAChC,kHAAkH;AAClH,SAAS;AACT,QAAQ;AACR,MAAM"}
|
package/package.json
CHANGED
|
@@ -12469,6 +12469,7 @@ class CLI {
|
|
|
12469
12469
|
}
|
|
12470
12470
|
}
|
|
12471
12471
|
|
|
12472
|
+
const globalStorClassKey = '__taon__GlobalStorageClass__';
|
|
12472
12473
|
/**
|
|
12473
12474
|
* TODO WIP
|
|
12474
12475
|
* refactor:
|
|
@@ -12481,10 +12482,10 @@ class GlobalStorageClass {
|
|
|
12481
12482
|
this.store = new Map();
|
|
12482
12483
|
}
|
|
12483
12484
|
static getInstance() {
|
|
12484
|
-
if (!
|
|
12485
|
-
|
|
12485
|
+
if (!globalThis[globalStorClassKey]) {
|
|
12486
|
+
globalThis[globalStorClassKey] = new GlobalStorageClass();
|
|
12486
12487
|
}
|
|
12487
|
-
return
|
|
12488
|
+
return globalThis[globalStorClassKey];
|
|
12488
12489
|
}
|
|
12489
12490
|
set(path, value) {
|
|
12490
12491
|
this.store.set(path, value);
|