@abp/ng.schematics 10.5.0-rc.4 → 10.6.0-rc.1
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/commands/ai-config/index.d.ts +3 -3
- package/commands/ai-config/index.js +88 -88
- package/commands/ai-config/index.js.map +1 -1
- package/commands/ai-config/model.d.ts +10 -10
- package/commands/ai-config/model.js +2 -2
- package/commands/api/files-service/proxy/__namespace@dir__/__name@kebab__.service.ts.template +6 -4
- package/commands/api/index.d.ts +2 -2
- package/commands/api/index.js +139 -138
- package/commands/api/index.js.map +1 -1
- package/commands/change-theme/index.d.ts +28 -28
- package/commands/change-theme/index.js +474 -473
- package/commands/change-theme/index.js.map +1 -1
- package/commands/change-theme/model.d.ts +5 -5
- package/commands/change-theme/model.js +2 -2
- package/commands/change-theme/style-map.d.ts +16 -16
- package/commands/change-theme/style-map.js +424 -424
- package/commands/change-theme/theme-options.enum.d.ts +6 -6
- package/commands/change-theme/theme-options.enum.js +11 -11
- package/commands/change-theme/theme-options.enum.js.map +1 -1
- package/commands/create-lib/index.d.ts +13 -13
- package/commands/create-lib/index.js +298 -298
- package/commands/create-lib/index.js.map +1 -1
- package/commands/create-lib/models/generate-lib-schema.d.ts +20 -20
- package/commands/create-lib/models/generate-lib-schema.js +8 -8
- package/commands/create-lib/models/generate-lib-schema.js.map +1 -1
- package/commands/create-lib/models/index.d.ts +1 -1
- package/commands/create-lib/models/index.js +4 -17
- package/commands/create-lib/models/index.js.map +1 -1
- package/commands/proxy-add/index.d.ts +2 -2
- package/commands/proxy-add/index.js +41 -41
- package/commands/proxy-add/index.js.map +1 -1
- package/commands/proxy-index/index.d.ts +5 -5
- package/commands/proxy-index/index.js +14 -14
- package/commands/proxy-index/index.js.map +1 -1
- package/commands/proxy-refresh/index.d.ts +3 -3
- package/commands/proxy-refresh/index.js +27 -27
- package/commands/proxy-refresh/index.js.map +1 -1
- package/commands/proxy-remove/index.d.ts +3 -3
- package/commands/proxy-remove/index.js +33 -33
- package/commands/proxy-remove/index.js.map +1 -1
- package/commands/ssr-add/index.d.ts +11 -11
- package/commands/ssr-add/index.js +360 -361
- package/commands/ssr-add/index.js.map +1 -1
- package/commands/ssr-add/server/index.d.ts +10 -10
- package/commands/ssr-add/server/index.js +209 -205
- package/commands/ssr-add/server/index.js.map +1 -1
- package/commands/ssr-add/server/index.ts +6 -2
- package/constants/api.d.ts +1 -1
- package/constants/api.js +4 -4
- package/constants/index.d.ts +4 -4
- package/constants/index.js +7 -20
- package/constants/index.js.map +1 -1
- package/constants/proxy.d.ts +4 -4
- package/constants/proxy.js +7 -7
- package/constants/symbols.d.ts +1 -1
- package/constants/symbols.js +4 -4
- package/constants/system-types.d.ts +1 -1
- package/constants/system-types.js +29 -29
- package/constants/volo.d.ts +5 -5
- package/constants/volo.js +34 -34
- package/enums/binding-source-id.d.ts +8 -7
- package/enums/binding-source-id.js +12 -11
- package/enums/binding-source-id.js.map +1 -1
- package/enums/exception.d.ts +17 -17
- package/enums/exception.js +2 -2
- package/enums/import-keyword.d.ts +4 -4
- package/enums/import-keyword.js +8 -8
- package/enums/import-keyword.js.map +1 -1
- package/enums/index.d.ts +5 -5
- package/enums/index.js +8 -21
- package/enums/index.js.map +1 -1
- package/enums/method-modifier.d.ts +6 -6
- package/enums/method-modifier.js +10 -10
- package/enums/method-modifier.js.map +1 -1
- package/enums/service-types.d.ts +6 -6
- package/enums/service-types.js +10 -10
- package/enums/service-types.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.js +6 -19
- package/index.js.map +1 -1
- package/models/api-definition.d.ts +97 -93
- package/models/api-definition.js +2 -2
- package/models/generate-proxy-schema.d.ts +28 -28
- package/models/generate-proxy-schema.js +2 -2
- package/models/import.d.ts +11 -11
- package/models/import.js +13 -13
- package/models/index.d.ts +11 -11
- package/models/index.js +14 -27
- package/models/index.js.map +1 -1
- package/models/method.d.ts +36 -34
- package/models/method.js +73 -70
- package/models/method.js.map +1 -1
- package/models/model.d.ts +48 -48
- package/models/model.js +76 -76
- package/models/model.js.map +1 -1
- package/models/project.d.ts +5 -5
- package/models/project.js +2 -2
- package/models/proxy-config.d.ts +4 -4
- package/models/proxy-config.js +2 -2
- package/models/rule.d.ts +2 -2
- package/models/rule.js +2 -2
- package/models/service.d.ts +21 -21
- package/models/service.js +11 -11
- package/models/tree.d.ts +1 -1
- package/models/tree.js +2 -2
- package/models/util.d.ts +7 -7
- package/models/util.js +2 -2
- package/package.json +6 -6
- package/utils/angular/add-declaration-to-ng-module.d.ts +20 -20
- package/utils/angular/add-declaration-to-ng-module.js +45 -45
- package/utils/angular/add-declaration-to-ng-module.js.map +1 -1
- package/utils/angular/ast-utils.d.ts +106 -106
- package/utils/angular/ast-utils.js +518 -518
- package/utils/angular/ast-utils.js.map +1 -1
- package/utils/angular/change.d.ts +68 -68
- package/utils/angular/change.js +121 -121
- package/utils/angular/change.js.map +1 -1
- package/utils/angular/dependencies.d.ts +23 -23
- package/utils/angular/dependencies.js +56 -56
- package/utils/angular/dependencies.js.map +1 -1
- package/utils/angular/dependency.d.ts +96 -96
- package/utils/angular/dependency.js +123 -122
- package/utils/angular/dependency.js.map +1 -1
- package/utils/angular/eol.d.ts +8 -8
- package/utils/angular/eol.js +22 -23
- package/utils/angular/eol.js.map +1 -1
- package/utils/angular/find-module.d.ts +33 -33
- package/utils/angular/find-module.js +105 -105
- package/utils/angular/find-module.js.map +1 -1
- package/utils/angular/generate-from-files.d.ts +19 -19
- package/utils/angular/generate-from-files.js +48 -49
- package/utils/angular/generate-from-files.js.map +1 -1
- package/utils/angular/index.d.ts +15 -15
- package/utils/angular/index.js +18 -31
- package/utils/angular/index.js.map +1 -1
- package/utils/angular/json-file.d.ts +24 -24
- package/utils/angular/json-file.js +71 -71
- package/utils/angular/json-file.js.map +1 -1
- package/utils/angular/latest-versions/index.d.ts +28 -28
- package/utils/angular/latest-versions/index.js +31 -31
- package/utils/angular/ng-ast-utils.d.ts +12 -12
- package/utils/angular/ng-ast-utils.js +79 -79
- package/utils/angular/ng-ast-utils.js.map +1 -1
- package/utils/angular/parse-name.d.ts +13 -13
- package/utils/angular/parse-name.js +19 -20
- package/utils/angular/parse-name.js.map +1 -1
- package/utils/angular/paths.d.ts +8 -8
- package/utils/angular/paths.js +17 -18
- package/utils/angular/paths.js.map +1 -1
- package/utils/angular/project-targets.d.ts +11 -11
- package/utils/angular/project-targets.js +21 -22
- package/utils/angular/project-targets.js.map +1 -1
- package/utils/angular/standalone/app_component.d.ts +29 -29
- package/utils/angular/standalone/app_component.js +107 -107
- package/utils/angular/standalone/app_component.js.map +1 -1
- package/utils/angular/standalone/app_config.d.ts +23 -23
- package/utils/angular/standalone/app_config.js +89 -89
- package/utils/angular/standalone/app_config.js.map +1 -1
- package/utils/angular/standalone/code_block.d.ts +53 -53
- package/utils/angular/standalone/code_block.js +80 -79
- package/utils/angular/standalone/code_block.js.map +1 -1
- package/utils/angular/standalone/index.d.ts +9 -9
- package/utils/angular/standalone/index.js +13 -13
- package/utils/angular/standalone/rules.d.ts +45 -45
- package/utils/angular/standalone/rules.js +187 -188
- package/utils/angular/standalone/rules.js.map +1 -1
- package/utils/angular/standalone/util.d.ts +35 -35
- package/utils/angular/standalone/util.js +135 -135
- package/utils/angular/standalone/util.js.map +1 -1
- package/utils/angular/test/create-app-module.d.ts +9 -9
- package/utils/angular/test/create-app-module.js +14 -15
- package/utils/angular/test/create-app-module.js.map +1 -1
- package/utils/angular/test/get-file-content.d.ts +9 -9
- package/utils/angular/test/get-file-content.js +17 -18
- package/utils/angular/test/get-file-content.js.map +1 -1
- package/utils/angular/test/index.d.ts +9 -9
- package/utils/angular/test/index.js +12 -25
- package/utils/angular/test/index.js.map +1 -1
- package/utils/angular/validation.d.ts +10 -10
- package/utils/angular/validation.js +28 -28
- package/utils/angular/validation.js.map +1 -1
- package/utils/angular/workspace-models.d.ts +167 -167
- package/utils/angular/workspace-models.js +43 -43
- package/utils/angular/workspace-models.js.map +1 -1
- package/utils/angular/workspace.d.ts +65 -65
- package/utils/angular/workspace.js +135 -135
- package/utils/angular/workspace.js.map +1 -1
- package/utils/angular-schematic/generate-lib.d.ts +3 -3
- package/utils/angular-schematic/generate-lib.js +52 -53
- package/utils/angular-schematic/generate-lib.js.map +1 -1
- package/utils/angular-schematic/index.d.ts +1 -1
- package/utils/angular-schematic/index.js +4 -17
- package/utils/angular-schematic/index.js.map +1 -1
- package/utils/api.d.ts +2 -2
- package/utils/api.js +7 -8
- package/utils/api.js.map +1 -1
- package/utils/ast.d.ts +5 -5
- package/utils/ast.js +28 -28
- package/utils/ast.js.map +1 -1
- package/utils/barrel.d.ts +4 -4
- package/utils/barrel.js +86 -87
- package/utils/barrel.js.map +1 -1
- package/utils/common.d.ts +11 -11
- package/utils/common.js +78 -78
- package/utils/common.js.map +1 -1
- package/utils/enum.d.ts +18 -18
- package/utils/enum.js +39 -40
- package/utils/enum.js.map +1 -1
- package/utils/file.d.ts +2 -2
- package/utils/file.js +8 -9
- package/utils/file.js.map +1 -1
- package/utils/generics.d.ts +26 -26
- package/utils/generics.js +89 -89
- package/utils/generics.js.map +1 -1
- package/utils/import.d.ts +3 -3
- package/utils/import.js +10 -11
- package/utils/import.js.map +1 -1
- package/utils/index.d.ts +22 -22
- package/utils/index.js +25 -38
- package/utils/index.js.map +1 -1
- package/utils/methods.d.ts +4 -4
- package/utils/methods.js +31 -29
- package/utils/methods.js.map +1 -1
- package/utils/model.d.ts +14 -14
- package/utils/model.js +217 -211
- package/utils/model.js.map +1 -1
- package/utils/namespace.d.ts +1 -1
- package/utils/namespace.js +17 -18
- package/utils/namespace.js.map +1 -1
- package/utils/ng-module.d.ts +46 -46
- package/utils/ng-module.js +126 -125
- package/utils/ng-module.js.map +1 -1
- package/utils/path.d.ts +2 -2
- package/utils/path.js +35 -36
- package/utils/path.js.map +1 -1
- package/utils/rule.d.ts +4 -4
- package/utils/rule.js +32 -33
- package/utils/rule.js.map +1 -1
- package/utils/service.d.ts +8 -8
- package/utils/service.js +280 -171
- package/utils/service.js.map +1 -1
- package/utils/source.d.ts +13 -13
- package/utils/source.js +165 -165
- package/utils/source.js.map +1 -1
- package/utils/standalone.d.ts +59 -59
- package/utils/standalone.js +146 -145
- package/utils/standalone.js.map +1 -1
- package/utils/text.d.ts +10 -10
- package/utils/text.js +59 -59
- package/utils/text.js.map +1 -1
- package/utils/tree.d.ts +14 -14
- package/utils/tree.js +83 -83
- package/utils/tree.js.map +1 -1
- package/utils/type.d.ts +13 -13
- package/utils/type.js +112 -113
- package/utils/type.js.map +1 -1
- package/utils/workspace.d.ts +20 -20
- package/utils/workspace.js +113 -114
- package/utils/workspace.js.map +1 -1
package/utils/generics.js
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
.
|
|
88
|
-
}
|
|
89
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenericsCollector = void 0;
|
|
4
|
+
exports.generateRefWithPlaceholders = generateRefWithPlaceholders;
|
|
5
|
+
exports.extractSimpleGenerics = extractSimpleGenerics;
|
|
6
|
+
exports.extractGenerics = extractGenerics;
|
|
7
|
+
exports.replacePlaceholdersWithGenerics = replacePlaceholdersWithGenerics;
|
|
8
|
+
const models_1 = require("../models");
|
|
9
|
+
class GenericsCollector {
|
|
10
|
+
get generics() {
|
|
11
|
+
return this._generics;
|
|
12
|
+
}
|
|
13
|
+
constructor(getTypeIdentifier = (type) => type) {
|
|
14
|
+
this.getTypeIdentifier = getTypeIdentifier;
|
|
15
|
+
this._generics = [];
|
|
16
|
+
this.apply = (value, index) => {
|
|
17
|
+
const generic = this.get(index);
|
|
18
|
+
if (generic) {
|
|
19
|
+
if (!generic.type)
|
|
20
|
+
generic.setType(value);
|
|
21
|
+
return value + generic.default;
|
|
22
|
+
}
|
|
23
|
+
return value;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
createGeneric(type, ref, defaultValue) {
|
|
27
|
+
const _default = this.getTypeIdentifier(defaultValue);
|
|
28
|
+
const refs = [generateRefWithPlaceholders(ref)];
|
|
29
|
+
const generic = new models_1.Generic({ type, default: _default, refs });
|
|
30
|
+
return generic;
|
|
31
|
+
}
|
|
32
|
+
register(index, generic) {
|
|
33
|
+
const existing = this.get(index);
|
|
34
|
+
if (existing) {
|
|
35
|
+
existing.setDefault(generic.default);
|
|
36
|
+
existing.setType(generic.type);
|
|
37
|
+
}
|
|
38
|
+
else
|
|
39
|
+
this.set(index, generic);
|
|
40
|
+
}
|
|
41
|
+
collect(generics, genericArguments) {
|
|
42
|
+
generics.forEach((ref, i) => {
|
|
43
|
+
const generic = this.createGeneric(genericArguments[i], ref, genericArguments.includes(ref) ? '' : ref);
|
|
44
|
+
this.register(i, generic);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
get(index) {
|
|
48
|
+
return this.generics[index];
|
|
49
|
+
}
|
|
50
|
+
set(index, value) {
|
|
51
|
+
this.generics[index] = value;
|
|
52
|
+
}
|
|
53
|
+
reset() {
|
|
54
|
+
this._generics = [];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.GenericsCollector = GenericsCollector;
|
|
58
|
+
function generateRefWithPlaceholders(sourceType) {
|
|
59
|
+
// eslint-disable-next-line prefer-const
|
|
60
|
+
let { identifier, generics } = extractGenerics(sourceType);
|
|
61
|
+
generics = generics.map((_, i) => `T${i}`);
|
|
62
|
+
return generics.length ? `${identifier}<${generics}>` : identifier;
|
|
63
|
+
}
|
|
64
|
+
function extractSimpleGenerics(sourceType) {
|
|
65
|
+
const { identifier, generics, array } = extractGenerics(sourceType);
|
|
66
|
+
return {
|
|
67
|
+
identifier: getLastSegment(identifier),
|
|
68
|
+
generics: generics.map(getLastSegment),
|
|
69
|
+
array,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function extractGenerics(sourceType) {
|
|
73
|
+
const isArray = /\[\]$/.test(sourceType);
|
|
74
|
+
const regex = /(?<identifier>[^<]+)(<(?<generics>.+)>)?/g;
|
|
75
|
+
const { identifier = '', generics = '' } = regex.exec(sourceType)?.groups ?? {};
|
|
76
|
+
return {
|
|
77
|
+
identifier,
|
|
78
|
+
generics: generics.split(/,\s*/).filter(Boolean),
|
|
79
|
+
array: isArray ? '[]' : '',
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function getLastSegment(str) {
|
|
83
|
+
return str.split('.').pop();
|
|
84
|
+
}
|
|
85
|
+
function replacePlaceholdersWithGenerics(type, generics, genericsCollector) {
|
|
86
|
+
return generics
|
|
87
|
+
.map(genericsCollector.apply)
|
|
88
|
+
.reduce((acc, v, i) => acc.replace(new RegExp(`([<, ])T${i}([,>])`, 'g'), `$1${v}$2`), type);
|
|
89
|
+
}
|
|
90
90
|
//# sourceMappingURL=generics.js.map
|
package/utils/generics.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generics.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/generics.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"generics.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/generics.ts"],"names":[],"mappings":";;;AA2DA,kEAOC;AAED,sDAQC;AAED,0CASC;AAMD,0EAQC;AArGD,sCAAoC;AAEpC,MAAa,iBAAiB;IAE5B,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAYD,YAAoB,oBAAoB,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI;QAA1C,sBAAiB,GAAjB,iBAAiB,CAAyB;QAftD,cAAS,GAAc,EAAE,CAAC;QAKlC,UAAK,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,EAAE;YACvC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAChC,IAAI,OAAO,EAAE,CAAC;gBACZ,IAAI,CAAC,OAAO,CAAC,IAAI;oBAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC1C,OAAO,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;YACjC,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;IAE+D,CAAC;IAE1D,aAAa,CAAC,IAAY,EAAE,GAAW,EAAE,YA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GAAW;IACjC,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG,CAAC;AAC/B,CAAC;AAED,SAAgB,+BAA+B,CAC7C,IAAY,EACZ,QAAkB,EAClB,iBAAoC;IAEpC,OAAO,QAAQ;SACZ,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC;SAC5B,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AACjG,CAAC"}
|
package/utils/import.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Import } from '../models';
|
|
2
|
-
export declare function sortImports(imports: Import[]): void;
|
|
3
|
-
export declare function removeRelative(importDef: Import): string;
|
|
1
|
+
import { Import } from '../models';
|
|
2
|
+
export declare function sortImports(imports: Import[]): void;
|
|
3
|
+
export declare function removeRelative(importDef: Import): string;
|
package/utils/import.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function removeRelative(importDef) {
|
|
9
|
-
return importDef.path.replace(/\.\.\//g, '');
|
|
10
|
-
}
|
|
11
|
-
exports.removeRelative = removeRelative;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sortImports = sortImports;
|
|
4
|
+
exports.removeRelative = removeRelative;
|
|
5
|
+
function sortImports(imports) {
|
|
6
|
+
imports.sort((a, b) => removeRelative(a) > removeRelative(b) ? 1 : a.keyword > b.keyword ? 1 : -1);
|
|
7
|
+
}
|
|
8
|
+
function removeRelative(importDef) {
|
|
9
|
+
return importDef.path.replace(/\.\.\//g, '');
|
|
10
|
+
}
|
|
12
11
|
//# sourceMappingURL=import.js.map
|
package/utils/import.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/import.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/import.ts"],"names":[],"mappings":";;AAEA,kCAIC;AAED,wCAEC;AARD,SAAgB,WAAW,CAAC,OAAiB;IAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACpB,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC3E,CAAC;AACJ,CAAC;AAED,SAAgB,cAAc,CAAC,SAAiB;IAC9C,OAAO,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAC/C,CAAC"}
|
package/utils/index.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export * from './angular';
|
|
2
|
-
export * from './api';
|
|
3
|
-
export * from './ast';
|
|
4
|
-
export * from './barrel';
|
|
5
|
-
export * from './common';
|
|
6
|
-
export * from './enum';
|
|
7
|
-
export * from './file';
|
|
8
|
-
export * from './generics';
|
|
9
|
-
export * from './import';
|
|
10
|
-
export * from './methods';
|
|
11
|
-
export * from './model';
|
|
12
|
-
export * from './namespace';
|
|
13
|
-
export * from './path';
|
|
14
|
-
export * from './rule';
|
|
15
|
-
export * from './service';
|
|
16
|
-
export * from './source';
|
|
17
|
-
export * from './text';
|
|
18
|
-
export * from './tree';
|
|
19
|
-
export * from './type';
|
|
20
|
-
export * from './workspace';
|
|
21
|
-
export * from './standalone';
|
|
22
|
-
export * from './ng-module';
|
|
1
|
+
export * from './angular';
|
|
2
|
+
export * from './api';
|
|
3
|
+
export * from './ast';
|
|
4
|
+
export * from './barrel';
|
|
5
|
+
export * from './common';
|
|
6
|
+
export * from './enum';
|
|
7
|
+
export * from './file';
|
|
8
|
+
export * from './generics';
|
|
9
|
+
export * from './import';
|
|
10
|
+
export * from './methods';
|
|
11
|
+
export * from './model';
|
|
12
|
+
export * from './namespace';
|
|
13
|
+
export * from './path';
|
|
14
|
+
export * from './rule';
|
|
15
|
+
export * from './service';
|
|
16
|
+
export * from './source';
|
|
17
|
+
export * from './text';
|
|
18
|
+
export * from './tree';
|
|
19
|
+
export * from './type';
|
|
20
|
+
export * from './workspace';
|
|
21
|
+
export * from './standalone';
|
|
22
|
+
export * from './ng-module';
|
package/utils/index.js
CHANGED
|
@@ -1,39 +1,26 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
20
|
-
__exportStar(require("./
|
|
21
|
-
__exportStar(require("./
|
|
22
|
-
__exportStar(require("./
|
|
23
|
-
__exportStar(require("./
|
|
24
|
-
__exportStar(require("./
|
|
25
|
-
__exportStar(require("./
|
|
26
|
-
__exportStar(require("./methods"), exports);
|
|
27
|
-
__exportStar(require("./model"), exports);
|
|
28
|
-
__exportStar(require("./namespace"), exports);
|
|
29
|
-
__exportStar(require("./path"), exports);
|
|
30
|
-
__exportStar(require("./rule"), exports);
|
|
31
|
-
__exportStar(require("./service"), exports);
|
|
32
|
-
__exportStar(require("./source"), exports);
|
|
33
|
-
__exportStar(require("./text"), exports);
|
|
34
|
-
__exportStar(require("./tree"), exports);
|
|
35
|
-
__exportStar(require("./type"), exports);
|
|
36
|
-
__exportStar(require("./workspace"), exports);
|
|
37
|
-
__exportStar(require("./standalone"), exports);
|
|
38
|
-
__exportStar(require("./ng-module"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./angular"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./api"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./ast"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./barrel"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./common"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./enum"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./file"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./generics"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./import"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./methods"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./model"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./namespace"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./path"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./rule"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./service"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./source"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./text"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./tree"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./type"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./workspace"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./standalone"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./ng-module"), exports);
|
|
39
26
|
//# sourceMappingURL=index.js.map
|
package/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,gDAAsB;AACtB,gDAAsB;AACtB,mDAAyB;AACzB,mDAAyB;AACzB,iDAAuB;AACvB,iDAAuB;AACvB,qDAA2B;AAC3B,mDAAyB;AACzB,oDAA0B;AAC1B,kDAAwB;AACxB,sDAA4B;AAC5B,iDAAuB;AACvB,iDAAuB;AACvB,oDAA0B;AAC1B,mDAAyB;AACzB,iDAAuB;AACvB,iDAAuB;AACvB,iDAAuB;AACvB,sDAA4B;AAC5B,uDAA6B;AAC7B,sDAA4B"}
|
package/utils/methods.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const getParamName: (paramName: string) => string;
|
|
2
|
-
export declare const getParamValueName: (paramName: string, descriptorName: string) => string;
|
|
3
|
-
export declare function isDictionaryType(type?: string, typeSimple?: string): boolean;
|
|
4
|
-
export declare function isCollectionType(type?: string, typeSimple?: string): boolean;
|
|
1
|
+
export declare const getParamName: (paramName: string) => string;
|
|
2
|
+
export declare const getParamValueName: (paramName: string, descriptorName: string) => string;
|
|
3
|
+
export declare function isDictionaryType(type?: string, typeSimple?: string): boolean;
|
|
4
|
+
export declare function isCollectionType(type?: string, typeSimple?: string): boolean;
|
package/utils/methods.js
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getParamValueName = exports.getParamName = void 0;
|
|
4
|
+
exports.isDictionaryType = isDictionaryType;
|
|
5
|
+
exports.isCollectionType = isCollectionType;
|
|
6
|
+
const text_1 = require("./text");
|
|
7
|
+
const shouldQuote = require('should-quote');
|
|
8
|
+
const getParamName = (paramName) => shouldQuote(paramName) ? `["${paramName}"]` : paramName;
|
|
9
|
+
exports.getParamName = getParamName;
|
|
10
|
+
const getParamValueName = (paramName, descriptorName) => {
|
|
11
|
+
if (paramName.includes('.')) {
|
|
12
|
+
const splitted = paramName.split('.');
|
|
13
|
+
// Flattened nested query params: any intermediate object may be absent at runtime, and
|
|
14
|
+
// nested members are typed as `T | null`, so navigate them with optional chaining (`?.`).
|
|
15
|
+
const param = splitted.map(x => (shouldQuote(x) ? `?.['${x}']` : `?.${(0, text_1.camel)(x)}`)).join('');
|
|
16
|
+
return `${descriptorName}${param}`;
|
|
17
|
+
}
|
|
18
|
+
if (shouldQuote(paramName)) {
|
|
19
|
+
return `${descriptorName}['${paramName}']`;
|
|
20
|
+
}
|
|
21
|
+
return `${descriptorName}.${paramName}`;
|
|
22
|
+
};
|
|
23
|
+
exports.getParamValueName = getParamValueName;
|
|
24
|
+
function isDictionaryType(type, typeSimple) {
|
|
25
|
+
const haystacks = [type || '', typeSimple || ''];
|
|
26
|
+
return haystacks.some(t => /(^|\b)(System\.Collections\.Generic\.)?(I)?Dictionary\s*</.test(t));
|
|
27
|
+
}
|
|
28
|
+
function isCollectionType(type, typeSimple) {
|
|
29
|
+
const haystacks = [type || '', typeSimple || ''];
|
|
30
|
+
return haystacks.some(t => /(^|\b)(System\.Collections\.Generic\.)?(I)?(List|Enumerable|Collection)\s*</.test(t));
|
|
31
|
+
}
|
|
30
32
|
//# sourceMappingURL=methods.js.map
|
package/utils/methods.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/methods.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/methods.ts"],"names":[],"mappings":";;;AAoBA,4CAGC;AAED,4CAGC;AA5BD,iCAA+B;AAE/B,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AACrC,MAAM,YAAY,GAAG,CAAC,SAAiB,EAAE,EAAE,CAChD,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAD7C,QAAA,YAAY,gBACiC;AAEnD,MAAM,iBAAiB,GAAG,CAAC,SAAiB,EAAE,cAAsB,EAAE,EAAE;IAC7E,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtC,uFAAuF;QACvF,0FAA0F;QAC1F,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAA,YAAK,EAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5F,OAAO,GAAG,cAAc,GAAG,KAAK,EAAE,CAAC;IACrC,CAAC;IACD,IAAI,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3B,OAAO,GAAG,cAAc,KAAK,SAAS,IAAI,CAAC;IAC7C,CAAC;IACD,OAAO,GAAG,cAAc,IAAI,SAAS,EAAE,CAAC;AAC1C,CAAC,CAAC;AAZW,QAAA,iBAAiB,qBAY5B;AAEF,SAAgB,gBAAgB,CAAC,IAAa,EAAE,UAAmB;IACjE,MAAM,SAAS,GAAG,CAAC,IAAI,IAAI,EAAE,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC;IACjD,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,2DAA2D,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAClG,CAAC;AAED,SAAgB,gBAAgB,CAAC,IAAa,EAAE,UAAmB;IACjE,MAAM,SAAS,GAAG,CAAC,IAAI,IAAI,EAAE,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC;IACjD,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,6EAA6E,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACpH,CAAC"}
|
package/utils/model.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Import, Interface, Model, Type, TypeWithEnum } from '../models';
|
|
2
|
-
export interface ModelGeneratorParams {
|
|
3
|
-
targetPath: string;
|
|
4
|
-
solution: string;
|
|
5
|
-
types: Record<string, Type>;
|
|
6
|
-
serviceImports: Record<string, string[]>;
|
|
7
|
-
modelImports: Record<string, string[]>;
|
|
8
|
-
}
|
|
9
|
-
export declare function createImportRefsToModelReducer(params: ModelGeneratorParams): (models: Model[], importRefs: string[]) => Model[];
|
|
10
|
-
export declare function createImportRefToInterfaceReducerCreator(params: ModelGeneratorParams): (interfaces: Interface[], ref: string) => Interface[];
|
|
11
|
-
export declare function createRefToImportReducerCreator(params: ModelGeneratorParams): (namespace: string) => (imports: Import[], types: TypeWithEnum[]) => Import[];
|
|
12
|
-
export declare function parseBaseTypeWithGenericTypes(type: string): string[];
|
|
13
|
-
export declare function resolveAbpPackages(models: Model[]): void;
|
|
14
|
-
export declare function resolveSelfGenericProps(params: Partial<ModelGeneratorParams>): void;
|
|
1
|
+
import { Import, Interface, Model, Type, TypeWithEnum } from '../models';
|
|
2
|
+
export interface ModelGeneratorParams {
|
|
3
|
+
targetPath: string;
|
|
4
|
+
solution: string;
|
|
5
|
+
types: Record<string, Type>;
|
|
6
|
+
serviceImports: Record<string, string[]>;
|
|
7
|
+
modelImports: Record<string, string[]>;
|
|
8
|
+
}
|
|
9
|
+
export declare function createImportRefsToModelReducer(params: ModelGeneratorParams): (models: Model[], importRefs: string[]) => Model[];
|
|
10
|
+
export declare function createImportRefToInterfaceReducerCreator(params: ModelGeneratorParams): (interfaces: Interface[], ref: string) => Interface[];
|
|
11
|
+
export declare function createRefToImportReducerCreator(params: ModelGeneratorParams): (namespace: string) => (imports: Import[], types: TypeWithEnum[]) => Import[];
|
|
12
|
+
export declare function parseBaseTypeWithGenericTypes(type: string): string[];
|
|
13
|
+
export declare function resolveAbpPackages(models: Model[]): void;
|
|
14
|
+
export declare function resolveSelfGenericProps(params: Partial<ModelGeneratorParams>): void;
|