@coolon/angular-ui-powerups 14.35.1 → 14.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/interaction/editor/inline-string-editor.scss +6 -0
- package/esm2020/lib/components/forms/multiple-select-input/multiple-select-input.component.mjs +10 -2
- package/esm2020/lib/components/forms/select-input/select-input.component.mjs +10 -2
- package/esm2020/lib/interaction/components/activity-container/activity-container.component.mjs +5 -6
- package/esm2020/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.mjs +15 -9
- package/fesm2015/coolon-angular-ui-powerups.mjs +34 -13
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +34 -13
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +3 -3
- package/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.d.ts +3 -2
- package/package.json +1 -1
- package/schematics/activity/index.d.ts +3 -0
- package/schematics/activity/index.js +32 -0
- package/schematics/activity/index.js.map +1 -0
- package/schematics/activity/index.spec.d.ts +1 -0
- package/schematics/activity/index.spec.js +364 -0
- package/schematics/activity/index.spec.js.map +1 -0
- package/schematics/activity/schema.d.ts +4 -0
- package/schematics/activity/schema.js +3 -0
- package/schematics/activity/schema.js.map +1 -0
- package/schematics/activity/schema.json +27 -0
- package/schematics/activity/templates/component/__name@dasherize__.component.html.template +5 -0
- package/schematics/activity/templates/component/__name@dasherize__.component.scss.template +4 -0
- package/schematics/activity/templates/component/__name@dasherize__.component.spec.ts.template +25 -0
- package/schematics/activity/templates/component/__name@dasherize__.component.ts.template +40 -0
- package/schematics/activity/templates/component/__name@dasherize__.i18n.yml.template +9 -0
- package/schematics/aup-i18n/index.d.ts +4 -0
- package/schematics/aup-i18n/index.js +86 -0
- package/schematics/aup-i18n/index.js.map +1 -0
- package/schematics/aup-i18n/schema.d.ts +3 -0
- package/schematics/aup-i18n/schema.js +3 -0
- package/schematics/aup-i18n/schema.js.map +1 -0
- package/schematics/aup-i18n/schema.json +18 -0
- package/schematics/aup-i18n/templates/app/aup.i18n.yml.template +80 -0
- package/schematics/bootstrap-app/index.d.ts +4 -0
- package/schematics/bootstrap-app/index.js +109 -0
- package/schematics/bootstrap-app/index.js.map +1 -0
- package/schematics/bootstrap-app/schema.d.ts +3 -0
- package/schematics/bootstrap-app/schema.js +3 -0
- package/schematics/bootstrap-app/schema.js.map +1 -0
- package/schematics/bootstrap-app/schema.json +18 -0
- package/schematics/bootstrap-app/templates/i18n.config.json.template +11 -0
- package/schematics/bootstrap-app/templates/src/app/app-routing.module.ts.template +23 -0
- package/schematics/bootstrap-app/templates/src/app/app.component.html.template +7 -0
- package/schematics/bootstrap-app/templates/src/app/app.component.scss.template +12 -0
- package/schematics/bootstrap-app/templates/src/app/app.component.ts.template +19 -0
- package/schematics/bootstrap-app/templates/src/app/app.module.ts.template +74 -0
- package/schematics/bootstrap-app/templates/src/app/components/components.module.ts.template +16 -0
- package/schematics/bootstrap-app/templates/src/app/i18n.ts.template +9 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.eot +0 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.ijmap +1 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.svg +2373 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.ttf +0 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.woff +0 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.woff2 +0 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/codepoints +932 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/material-icons.css +36 -0
- package/schematics/bootstrap-app/templates/src/index.html.template +13 -0
- package/schematics/bootstrap-app/templates/src/styles/global-variables.scss.template +13 -0
- package/schematics/bootstrap-app/templates/src/styles.scss.template +85 -0
- package/schematics/collection.json +48 -0
- package/schematics/component/index.d.ts +3 -0
- package/schematics/component/index.js +32 -0
- package/schematics/component/index.js.map +1 -0
- package/schematics/component/index.spec.d.ts +1 -0
- package/schematics/component/index.spec.js +364 -0
- package/schematics/component/index.spec.js.map +1 -0
- package/schematics/component/schema.d.ts +4 -0
- package/schematics/component/schema.js +3 -0
- package/schematics/component/schema.js.map +1 -0
- package/schematics/component/schema.json +27 -0
- package/schematics/component/templates/component/__name@dasherize__.component.html.template +1 -0
- package/schematics/component/templates/component/__name@dasherize__.component.scss.template +4 -0
- package/schematics/component/templates/component/__name@dasherize__.component.spec.ts.template +25 -0
- package/schematics/component/templates/component/__name@dasherize__.component.ts.template +23 -0
- package/schematics/component/templates/component/__name@dasherize__.i18n.yml.template +1 -0
- package/schematics/ng-add/index.d.ts +3 -0
- package/schematics/ng-add/index.js +37 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/package-util.d.ts +13 -0
- package/schematics/package-util.js +61 -0
- package/schematics/package-util.js.map +1 -0
- package/schematics/place-add/index.d.ts +3 -0
- package/schematics/place-add/index.js +37 -0
- package/schematics/place-add/index.js.map +1 -0
- package/schematics/place-add/index.spec.d.ts +1 -0
- package/schematics/place-add/index.spec.js +364 -0
- package/schematics/place-add/index.spec.js.map +1 -0
- package/schematics/place-add/schema.d.ts +4 -0
- package/schematics/place-add/schema.js +3 -0
- package/schematics/place-add/schema.js.map +1 -0
- package/schematics/place-add/schema.json +27 -0
- package/schematics/place-add/templates/component/__name@dasherize__.component.html.template +1 -0
- package/schematics/place-add/templates/component/__name@dasherize__.component.scss.template +5 -0
- package/schematics/place-add/templates/component/__name@dasherize__.component.spec.ts.template +25 -0
- package/schematics/place-add/templates/component/__name@dasherize__.component.ts.template +33 -0
- package/schematics/place-add/templates/component/__name@dasherize__.i18n.yml.template +5 -0
- package/schematics/place-bootstrap/index.d.ts +3 -0
- package/schematics/place-bootstrap/index.js +21 -0
- package/schematics/place-bootstrap/index.js.map +1 -0
- package/schematics/place-bootstrap/schema.d.ts +4 -0
- package/schematics/place-bootstrap/schema.js +3 -0
- package/schematics/place-bootstrap/schema.js.map +1 -0
- package/schematics/place-bootstrap/schema.json +28 -0
- package/schematics/place-bootstrap/templates/__name@dasherize__/place-routes.ts.template +3 -0
- package/schematics/place-bootstrap/templates/__name@dasherize__/places.module.ts.template +16 -0
- package/schematics/place-routes/index.d.ts +3 -0
- package/schematics/place-routes/index.js +24 -0
- package/schematics/place-routes/index.js.map +1 -0
- package/schematics/place-routes/place-builder.d.ts +18 -0
- package/schematics/place-routes/place-builder.js +123 -0
- package/schematics/place-routes/place-builder.js.map +1 -0
- package/schematics/place-routes/place-class-scanner.d.ts +47 -0
- package/schematics/place-routes/place-class-scanner.js +223 -0
- package/schematics/place-routes/place-class-scanner.js.map +1 -0
- package/schematics/place-routes/place-def.d.ts +62 -0
- package/schematics/place-routes/place-def.js +195 -0
- package/schematics/place-routes/place-def.js.map +1 -0
- package/schematics/place-routes/schema.d.ts +4 -0
- package/schematics/place-routes/schema.js +3 -0
- package/schematics/place-routes/schema.js.map +1 -0
- package/schematics/place-routes/schema.json +25 -0
- package/schematics/place-routes/templates/place-routes.ts.template +14 -0
- package/schematics/utils/build-context.d.ts +73 -0
- package/schematics/utils/build-context.js +184 -0
- package/schematics/utils/build-context.js.map +1 -0
- package/schematics/utils/decorators/decorated-class.d.ts +13 -0
- package/schematics/utils/decorators/decorated-class.js +28 -0
- package/schematics/utils/decorators/decorated-class.js.map +1 -0
- package/schematics/utils/decorators/decorated-source-file.d.ts +15 -0
- package/schematics/utils/decorators/decorated-source-file.js +27 -0
- package/schematics/utils/decorators/decorated-source-file.js.map +1 -0
- package/schematics/utils/import-def.d.ts +30 -0
- package/schematics/utils/import-def.js +97 -0
- package/schematics/utils/import-def.js.map +1 -0
- package/schematics/utils/method-scanner.d.ts +16 -0
- package/schematics/utils/method-scanner.js +70 -0
- package/schematics/utils/method-scanner.js.map +1 -0
- package/schematics/utils/mixin.d.ts +11 -0
- package/schematics/utils/mixin.js +27 -0
- package/schematics/utils/mixin.js.map +1 -0
- package/schematics/utils/parameter-def.d.ts +5 -0
- package/schematics/utils/parameter-def.js +3 -0
- package/schematics/utils/parameter-def.js.map +1 -0
- package/schematics/utils/path-helper.d.ts +14 -0
- package/schematics/utils/path-helper.js +30 -0
- package/schematics/utils/path-helper.js.map +1 -0
- package/schematics/utils/schematic-tree-file-system.d.ts +30 -0
- package/schematics/utils/schematic-tree-file-system.js +113 -0
- package/schematics/utils/schematic-tree-file-system.js.map +1 -0
- package/schematics/utils/source-file-scanner.d.ts +14 -0
- package/schematics/utils/source-file-scanner.js +89 -0
- package/schematics/utils/source-file-scanner.js.map +1 -0
- package/schematics/utils/source-file-utilities.d.ts +6 -0
- package/schematics/utils/source-file-utilities.js +35 -0
- package/schematics/utils/source-file-utilities.js.map +1 -0
- package/schematics/utils/stringy.d.ts +15 -0
- package/schematics/utils/stringy.js +50 -0
- package/schematics/utils/stringy.js.map +1 -0
- package/schematics/utils/template-utilities.d.ts +2 -0
- package/schematics/utils/template-utilities.js +24 -0
- package/schematics/utils/template-utilities.js.map +1 -0
- package/schematics/utils/workspace.d.ts +15 -0
- package/schematics/utils/workspace.js +59 -0
- package/schematics/utils/workspace.js.map +1 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BuildContext = void 0;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
const decorated_source_file_1 = require("./decorators/decorated-source-file");
|
|
6
|
+
const _ = require("lodash");
|
|
7
|
+
class BuildContext {
|
|
8
|
+
constructor(tree, projectName, settings, context) {
|
|
9
|
+
this.tree = tree;
|
|
10
|
+
this.projectName = projectName;
|
|
11
|
+
this.settings = settings;
|
|
12
|
+
this.context = context;
|
|
13
|
+
this.typescriptProject = this.loadTypeScriptProject();
|
|
14
|
+
const projectAbsRootDir = this.typescriptProject.getModuleResolutionHost().realpath(".");
|
|
15
|
+
this.sourceCodeRootDir = new BuildContext.RootDir(`${projectAbsRootDir}`, `${this.settings.workspaceProject.sourceRoot}/${this.settings.projectType}`);
|
|
16
|
+
}
|
|
17
|
+
get logger() {
|
|
18
|
+
return this.context.logger;
|
|
19
|
+
}
|
|
20
|
+
get tsConfigPath() {
|
|
21
|
+
return this.settings.tsConfigPath;
|
|
22
|
+
}
|
|
23
|
+
get sourceCodeRoot() {
|
|
24
|
+
return this.sourceCodeRootDir.treePath;
|
|
25
|
+
}
|
|
26
|
+
get sourceRoot() {
|
|
27
|
+
return this.settings.workspaceProject.sourceRoot;
|
|
28
|
+
}
|
|
29
|
+
get rootDir() {
|
|
30
|
+
return this.settings.workspaceProject.root;
|
|
31
|
+
}
|
|
32
|
+
get selectorPrefix() {
|
|
33
|
+
return this.settings.workspaceProject['prefix'];
|
|
34
|
+
}
|
|
35
|
+
loadTypeScriptProject() {
|
|
36
|
+
// TODO: this barfs if you're not running it from teh project root directory
|
|
37
|
+
this.logger.info(`loading tsConfig from -> ${this.tsConfigPath}`);
|
|
38
|
+
try {
|
|
39
|
+
return new ts_morph_1.Project({
|
|
40
|
+
tsConfigFilePath: this.tsConfigPath
|
|
41
|
+
// this isn't finding things during the place-routes schematic... and I can't remember why I needed it....
|
|
42
|
+
// fileSystem: new SchematicTreeFileSystem(this.tree, this.context)
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
this.logger.error(error.toString());
|
|
47
|
+
this.logger.fatal(`Failed to load typescript project from: ${this.tsConfigPath} You probably need to specify the --project option?`);
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
scanClassesInTree(tree, scanRootDirectory, scanClass) {
|
|
52
|
+
const importPrefix = `./${scanRootDirectory}`;
|
|
53
|
+
this.context.logger.info(`Scanning sources in -> ${scanRootDirectory}`);
|
|
54
|
+
tree.getDir(scanRootDirectory).visit(filePath => {
|
|
55
|
+
if (!filePath.endsWith('.ts') || filePath.endsWith('.spec.ts')) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const content = tree.read(filePath);
|
|
59
|
+
if (!content) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const sourceFile = this.typescriptProject.getSourceFileOrThrow(`./${filePath}`);
|
|
63
|
+
const imports = sourceFile.getImportDeclarations();
|
|
64
|
+
sourceFile.getClasses().forEach((classDecl) => {
|
|
65
|
+
scanClass(sourceFile, classDecl, filePath);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
findFileInAncestorPath(pathToSourceRoot, fileName) {
|
|
70
|
+
for (let i = pathToSourceRoot.length; i > 0; i--) {
|
|
71
|
+
const possibleModulePath = pathToSourceRoot.slice(0, i).join('/') + `/${fileName}`;
|
|
72
|
+
if (this.tree.exists(possibleModulePath)) {
|
|
73
|
+
return possibleModulePath;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
getSourceFile(pathFromSrcRoot) {
|
|
79
|
+
// Weirdness with out tree based file system, `getSourceFile(..)` returns undefined.
|
|
80
|
+
// const f = this.typescriptProject.getSourceFile(path);
|
|
81
|
+
// to work around it we
|
|
82
|
+
const fileEntry = this.tree.get(pathFromSrcRoot);
|
|
83
|
+
const sourceFile = this.typescriptProject.createSourceFile(pathFromSrcRoot, fileEntry.content.toString('utf8'), {
|
|
84
|
+
overwrite: true
|
|
85
|
+
});
|
|
86
|
+
return decorated_source_file_1.DecoratedSourceFile.create(sourceFile, pathFromSrcRoot);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.BuildContext = BuildContext;
|
|
90
|
+
(function (BuildContext) {
|
|
91
|
+
class App extends BuildContext {
|
|
92
|
+
}
|
|
93
|
+
BuildContext.App = App;
|
|
94
|
+
class Lib extends BuildContext {
|
|
95
|
+
}
|
|
96
|
+
BuildContext.Lib = Lib;
|
|
97
|
+
class Dir {
|
|
98
|
+
constructor() {
|
|
99
|
+
// const sourcePrefix = 1 + this.sourceRoot.length;
|
|
100
|
+
// const resourcePath = filePath.substr(1 + sourcePrefix, filePath.length - 1 - sourcePrefix - '.ts'.length);
|
|
101
|
+
// const relativePath = this.outDir.substr(sourcePrefix).split('/').map(v => '..').join('/');
|
|
102
|
+
// const absolutResourceClassPath = `${relativePath}/${resourcePath}`;
|
|
103
|
+
}
|
|
104
|
+
get path() {
|
|
105
|
+
return this.clean(this.getPath());
|
|
106
|
+
}
|
|
107
|
+
get treePath() {
|
|
108
|
+
return this.clean(this.getTreePath());
|
|
109
|
+
}
|
|
110
|
+
get absPath() {
|
|
111
|
+
return this.clean(this.getAbsPath());
|
|
112
|
+
}
|
|
113
|
+
relativeDir(path) {
|
|
114
|
+
return new BuildContext.RelativeDir(this, path);
|
|
115
|
+
}
|
|
116
|
+
getDotPathToRoot() {
|
|
117
|
+
const result = `${this.path.split('/')
|
|
118
|
+
.filter(p => !_.isEmpty(p))
|
|
119
|
+
.map(d => '..').join('/')}/`;
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
clean(path) {
|
|
123
|
+
return path.replace(/\/\/+/, "/");
|
|
124
|
+
}
|
|
125
|
+
getRelativePathTo(path) {
|
|
126
|
+
const other = this.resolveAgainstRoot(path);
|
|
127
|
+
return this.clean(`${this.getDotPathToRoot()}/${other.path}`);
|
|
128
|
+
}
|
|
129
|
+
resolveAgainstRoot(path) {
|
|
130
|
+
if (path.startsWith(this.getRoot().absPath)) {
|
|
131
|
+
return this.getRoot().relativeDir(path.substring(this.getRoot().absPath.length));
|
|
132
|
+
}
|
|
133
|
+
if (path.startsWith(this.getRoot().treePath)) {
|
|
134
|
+
return this.getRoot().relativeDir(path.substring(this.getRoot().treePath.length));
|
|
135
|
+
}
|
|
136
|
+
return this.getRoot().relativeDir(path);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
BuildContext.Dir = Dir;
|
|
140
|
+
class RootDir extends Dir {
|
|
141
|
+
constructor(treeAbsRoot, _treePath) {
|
|
142
|
+
super();
|
|
143
|
+
this.treeAbsRoot = treeAbsRoot;
|
|
144
|
+
this._treePath = _treePath;
|
|
145
|
+
}
|
|
146
|
+
getTreePath() {
|
|
147
|
+
return this._treePath;
|
|
148
|
+
}
|
|
149
|
+
getPath() {
|
|
150
|
+
return "";
|
|
151
|
+
}
|
|
152
|
+
getRoot() {
|
|
153
|
+
return this;
|
|
154
|
+
}
|
|
155
|
+
getAbsPath() {
|
|
156
|
+
return `${this.treeAbsRoot}/${this.treePath}`;
|
|
157
|
+
}
|
|
158
|
+
relativeDir(path) {
|
|
159
|
+
return new RelativeDir(this, path);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
BuildContext.RootDir = RootDir;
|
|
163
|
+
class RelativeDir extends Dir {
|
|
164
|
+
constructor(parent, _relativePath) {
|
|
165
|
+
super();
|
|
166
|
+
this.parent = parent;
|
|
167
|
+
this._relativePath = _relativePath;
|
|
168
|
+
}
|
|
169
|
+
getRoot() {
|
|
170
|
+
return this.parent.getRoot();
|
|
171
|
+
}
|
|
172
|
+
getPath() {
|
|
173
|
+
return `${this.parent.path}/${this._relativePath}`;
|
|
174
|
+
}
|
|
175
|
+
getTreePath() {
|
|
176
|
+
return `${this.parent.treePath}/${this._relativePath}`;
|
|
177
|
+
}
|
|
178
|
+
getAbsPath() {
|
|
179
|
+
return `${this.parent.absPath}/${this.getRelativePathTo}`;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
BuildContext.RelativeDir = RelativeDir;
|
|
183
|
+
})(BuildContext = exports.BuildContext || (exports.BuildContext = {}));
|
|
184
|
+
//# sourceMappingURL=build-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-context.js","sourceRoot":"","sources":["../../../../../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I,IAAI,CAAC,aAAa,EAAE,CAAA;QACpD,CAAC;QAES,WAAW;YACnB,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,IAAI,CAAC,aAAa,EAAE,CAAA;QACxD,CAAC;QAES,UAAU;YAClB,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC5D,CAAC;KAEF;IArBY,wBAAW,cAqBvB,CAAA;AAEH,CAAC,EA7HgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA6H5B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ClassDeclaration, Decorator } from 'ts-morph';
|
|
2
|
+
import { Mixin } from "../mixin";
|
|
3
|
+
export interface DecoratedClass extends ClassDeclaration, ClassDecoratorMixin {
|
|
4
|
+
}
|
|
5
|
+
export declare class ClassDecoratorMixin extends Mixin<ClassDeclaration> {
|
|
6
|
+
private readonly target;
|
|
7
|
+
constructor(target: ClassDeclaration);
|
|
8
|
+
hasClassDecorator(name: string): boolean;
|
|
9
|
+
getClassDecoratorNode(name: string): Decorator;
|
|
10
|
+
}
|
|
11
|
+
export declare namespace DecoratedClass {
|
|
12
|
+
function create(classDeclaration: ClassDeclaration): DecoratedClass;
|
|
13
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DecoratedClass = exports.ClassDecoratorMixin = void 0;
|
|
4
|
+
const mixin_1 = require("../mixin");
|
|
5
|
+
const source_file_utilities_1 = require("../source-file-utilities");
|
|
6
|
+
class ClassDecoratorMixin extends mixin_1.Mixin {
|
|
7
|
+
constructor(target) {
|
|
8
|
+
super();
|
|
9
|
+
this.target = target;
|
|
10
|
+
}
|
|
11
|
+
hasClassDecorator(name) {
|
|
12
|
+
return !!this.getClassDecoratorNode(name);
|
|
13
|
+
}
|
|
14
|
+
getClassDecoratorNode(name) {
|
|
15
|
+
return this.target.forEachChildAsArray().find((node) => {
|
|
16
|
+
return (0, source_file_utilities_1.isDecoratorNode)(node, name);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.ClassDecoratorMixin = ClassDecoratorMixin;
|
|
21
|
+
var DecoratedClass;
|
|
22
|
+
(function (DecoratedClass) {
|
|
23
|
+
function create(classDeclaration) {
|
|
24
|
+
return mixin_1.Mixin.createProxy(classDeclaration, new ClassDecoratorMixin(classDeclaration));
|
|
25
|
+
}
|
|
26
|
+
DecoratedClass.create = create;
|
|
27
|
+
})(DecoratedClass = exports.DecoratedClass || (exports.DecoratedClass = {}));
|
|
28
|
+
//# sourceMappingURL=decorated-class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorated-class.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/schematics/utils/decorators/decorated-class.ts"],"names":[],"mappings":";;;AACA,oCAAiC;AACjC,oEAA2D;AAM3D,MAAa,mBAAoB,SAAQ,aAAuB;IAC9D,YAA6B,MAAwB;QACnD,KAAK,EAAE,CAAC;QADmB,WAAM,GAAN,MAAM,CAAkB;IAErD,CAAC;IAED,iBAAiB,CAAC,IAAW;QAC3B,OAAO,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,qBAAqB,CAAC,IAAY;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACrD,OAAO,IAAA,uCAAe,EAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QACpC,CAAC,CAAc,CAAC;IAClB,CAAC;CACF;AAdD,kDAcC;AAED,IAAiB,cAAc,CAI9B;AAJD,WAAiB,cAAc;IAC7B,SAAgB,MAAM,CAAC,gBAAkC;QACvD,OAAO,aAAK,CAAC,WAAW,CAAC,gBAAgB,EAAE,IAAI,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACxF,CAAC;IAFe,qBAAM,SAErB,CAAA;AACH,CAAC,EAJgB,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAI9B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SourceFile } from 'ts-morph';
|
|
2
|
+
import { Mixin } from "../mixin";
|
|
3
|
+
import { DecoratedClass } from './decorated-class';
|
|
4
|
+
export interface DecoratedSourceFile extends Omit<SourceFile, 'getClasses'>, SourceFileDecoratorMixin {
|
|
5
|
+
}
|
|
6
|
+
export declare class SourceFileDecoratorMixin extends Mixin<SourceFile> {
|
|
7
|
+
private readonly target;
|
|
8
|
+
readonly path: string;
|
|
9
|
+
constructor(target: SourceFile, path: string);
|
|
10
|
+
findClassWithDecorator(name: string): DecoratedClass;
|
|
11
|
+
getClasses(): DecoratedClass[];
|
|
12
|
+
}
|
|
13
|
+
export declare namespace DecoratedSourceFile {
|
|
14
|
+
function create(sourceFile: SourceFile, path: string): DecoratedSourceFile;
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DecoratedSourceFile = exports.SourceFileDecoratorMixin = void 0;
|
|
4
|
+
const mixin_1 = require("../mixin");
|
|
5
|
+
const decorated_class_1 = require("./decorated-class");
|
|
6
|
+
class SourceFileDecoratorMixin extends mixin_1.Mixin {
|
|
7
|
+
constructor(target, path) {
|
|
8
|
+
super();
|
|
9
|
+
this.target = target;
|
|
10
|
+
this.path = path;
|
|
11
|
+
}
|
|
12
|
+
findClassWithDecorator(name) {
|
|
13
|
+
return this.getClasses().find(c => c.hasClassDecorator(name));
|
|
14
|
+
}
|
|
15
|
+
getClasses() {
|
|
16
|
+
return this.target.getClasses().map(c => decorated_class_1.DecoratedClass.create(c));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.SourceFileDecoratorMixin = SourceFileDecoratorMixin;
|
|
20
|
+
var DecoratedSourceFile;
|
|
21
|
+
(function (DecoratedSourceFile) {
|
|
22
|
+
function create(sourceFile, path) {
|
|
23
|
+
return mixin_1.Mixin.createProxy(sourceFile, new SourceFileDecoratorMixin(sourceFile, path));
|
|
24
|
+
}
|
|
25
|
+
DecoratedSourceFile.create = create;
|
|
26
|
+
})(DecoratedSourceFile = exports.DecoratedSourceFile || (exports.DecoratedSourceFile = {}));
|
|
27
|
+
//# sourceMappingURL=decorated-source-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorated-source-file.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/schematics/utils/decorators/decorated-source-file.ts"],"names":[],"mappings":";;;AAEA,oCAAiC;AACjC,uDAAmD;AAKnD,MAAa,wBAAyB,SAAQ,aAAiB;IAC7D,YAA6B,MAAkB,EAAW,IAAY;QACpE,KAAK,EAAE,CAAC;QADmB,WAAM,GAAN,MAAM,CAAY;QAAW,SAAI,GAAJ,IAAI,CAAQ;IAEtE,CAAC;IAED,sBAAsB,CAAC,IAAY;QACjC,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,gCAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;CACF;AAZD,4DAYC;AAED,IAAiB,mBAAmB,CAInC;AAJD,WAAiB,mBAAmB;IAClC,SAAgB,MAAM,CAAC,UAAsB,EAAE,IAAY;QACzD,OAAO,aAAK,CAAC,WAAW,CAAC,UAAU,EAAE,IAAI,wBAAwB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;IACvF,CAAC;IAFe,0BAAM,SAErB,CAAA;AACH,CAAC,EAJgB,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAInC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ImportDeclaration, SourceFile } from 'ts-morph';
|
|
2
|
+
import { BuildContext } from "./build-context";
|
|
3
|
+
export declare abstract class ImportDef {
|
|
4
|
+
readonly typeName: string;
|
|
5
|
+
static create(typeName: string, importDeclarationOrSourceFile: ImportDeclaration | SourceFile | string): ImportDef;
|
|
6
|
+
constructor(typeName: string);
|
|
7
|
+
importPathFor(outDir: BuildContext.Dir): string;
|
|
8
|
+
protected abstract getModuleSpecifierFor(outDir: BuildContext.Dir): string;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace ImportDef {
|
|
11
|
+
class SourceFileImport extends ImportDef {
|
|
12
|
+
private readonly sourceFile;
|
|
13
|
+
constructor(typeName: string, sourceFile: SourceFile);
|
|
14
|
+
get id(): string;
|
|
15
|
+
getModuleSpecifierFor(outDir: BuildContext.Dir): string;
|
|
16
|
+
}
|
|
17
|
+
class ImportDeclarationImport extends ImportDef {
|
|
18
|
+
private readonly importDeclaration;
|
|
19
|
+
constructor(typeName: string, importDeclaration: ImportDeclaration);
|
|
20
|
+
get moduleSpecifier(): string;
|
|
21
|
+
get id(): string;
|
|
22
|
+
getModuleSpecifierFor(outDir: BuildContext.Dir): string;
|
|
23
|
+
}
|
|
24
|
+
class ExternalImport extends ImportDef {
|
|
25
|
+
readonly moduleSpecifier: string;
|
|
26
|
+
constructor(typeName: string, moduleSpecifier: string);
|
|
27
|
+
get id(): string;
|
|
28
|
+
getModuleSpecifierFor(outDir: BuildContext.Dir): string;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ImportDef = void 0;
|
|
13
|
+
const fast_memoize_decorator_1 = require("@typescript-plus/fast-memoize-decorator");
|
|
14
|
+
const ts_morph_1 = require("ts-morph");
|
|
15
|
+
class ImportDef {
|
|
16
|
+
constructor(typeName) {
|
|
17
|
+
this.typeName = typeName;
|
|
18
|
+
}
|
|
19
|
+
static create(typeName, importDeclarationOrSourceFile) {
|
|
20
|
+
return importDeclarationOrSourceFile instanceof ts_morph_1.SourceFile ?
|
|
21
|
+
new ImportDef.SourceFileImport(typeName, importDeclarationOrSourceFile) :
|
|
22
|
+
importDeclarationOrSourceFile instanceof ts_morph_1.ImportDeclaration ?
|
|
23
|
+
new ImportDef.ImportDeclarationImport(typeName, importDeclarationOrSourceFile) :
|
|
24
|
+
new ImportDef.ExternalImport(typeName, importDeclarationOrSourceFile);
|
|
25
|
+
}
|
|
26
|
+
importPathFor(outDir) {
|
|
27
|
+
const specifier = this.getModuleSpecifierFor(outDir);
|
|
28
|
+
return specifier.endsWith('.ts') ? specifier.substr(0, specifier.length - '.ts'.length) : specifier;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.ImportDef = ImportDef;
|
|
32
|
+
(function (ImportDef) {
|
|
33
|
+
class SourceFileImport extends ImportDef {
|
|
34
|
+
constructor(typeName, sourceFile) {
|
|
35
|
+
super(typeName);
|
|
36
|
+
this.sourceFile = sourceFile;
|
|
37
|
+
}
|
|
38
|
+
get id() {
|
|
39
|
+
return `${this.typeName} -> ${this.sourceFile.getFilePath()}`;
|
|
40
|
+
}
|
|
41
|
+
getModuleSpecifierFor(outDir) {
|
|
42
|
+
const relativePath = outDir.getRelativePathTo(this.sourceFile.getFilePath());
|
|
43
|
+
return relativePath.substr(0, relativePath.length - '.ts'.length);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, fast_memoize_decorator_1.Memoize)(),
|
|
48
|
+
__metadata("design:type", Object),
|
|
49
|
+
__metadata("design:paramtypes", [])
|
|
50
|
+
], SourceFileImport.prototype, "id", null);
|
|
51
|
+
ImportDef.SourceFileImport = SourceFileImport;
|
|
52
|
+
class ImportDeclarationImport extends ImportDef {
|
|
53
|
+
constructor(typeName, importDeclaration) {
|
|
54
|
+
super(typeName);
|
|
55
|
+
this.importDeclaration = importDeclaration;
|
|
56
|
+
}
|
|
57
|
+
get moduleSpecifier() {
|
|
58
|
+
return this.importDeclaration.getModuleSpecifierValue();
|
|
59
|
+
}
|
|
60
|
+
get id() {
|
|
61
|
+
return `${this.typeName} -> ${this.moduleSpecifier}`;
|
|
62
|
+
}
|
|
63
|
+
getModuleSpecifierFor(outDir) {
|
|
64
|
+
return this.importDeclaration.isModuleSpecifierRelative() ?
|
|
65
|
+
outDir.getRelativePathTo(this.importDeclaration.getModuleSpecifierSourceFile().getFilePath()) :
|
|
66
|
+
this.moduleSpecifier;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, fast_memoize_decorator_1.Memoize)(),
|
|
71
|
+
__metadata("design:type", Object),
|
|
72
|
+
__metadata("design:paramtypes", [])
|
|
73
|
+
], ImportDeclarationImport.prototype, "id", null);
|
|
74
|
+
ImportDef.ImportDeclarationImport = ImportDeclarationImport;
|
|
75
|
+
class ExternalImport extends ImportDef {
|
|
76
|
+
constructor(typeName, moduleSpecifier) {
|
|
77
|
+
super(typeName);
|
|
78
|
+
this.moduleSpecifier = moduleSpecifier;
|
|
79
|
+
if (moduleSpecifier.startsWith(".")) {
|
|
80
|
+
throw new Error(`External imports must not be relative. Got ${moduleSpecifier}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
get id() {
|
|
84
|
+
return `${this.typeName} -> ${this.moduleSpecifier}`;
|
|
85
|
+
}
|
|
86
|
+
getModuleSpecifierFor(outDir) {
|
|
87
|
+
return this.moduleSpecifier;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, fast_memoize_decorator_1.Memoize)(),
|
|
92
|
+
__metadata("design:type", Object),
|
|
93
|
+
__metadata("design:paramtypes", [])
|
|
94
|
+
], ExternalImport.prototype, "id", null);
|
|
95
|
+
ImportDef.ExternalImport = ExternalImport;
|
|
96
|
+
})(ImportDef = exports.ImportDef || (exports.ImportDef = {}));
|
|
97
|
+
//# sourceMappingURL=import-def.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-def.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/utils/import-def.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oFAAkE;AAClE,uCAAyD;AAIzD,MAAsB,SAAS;IAU7B,YAAqB,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;IACrC,CAAC;IATD,MAAM,CAAC,MAAM,CAAC,QAAgB,EAAE,6BAAsE;QACpG,OAAO,6BAA6B,YAAY,qBAAU,CAAC,CAAC;YAC1D,IAAI,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC,CAAC;YACzE,6BAA6B,YAAY,4BAAiB,CAAC,CAAC;gBAC1D,IAAI,SAAS,CAAC,uBAAuB,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC,CAAC;gBAChF,IAAI,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE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AAC,QAAQ,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;QACvD,CAAC;QAED,qBAAqB,CAAC,MAAwB;YAC5C,OAAO,IAAI,CAAC,iBAAiB,CAAC,yBAAyB,EAAE,CAAC,CAAC;gBACzD,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,iBAAiB,CAAC,4BAA4B,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;gBAC/F,IAAI,CAAC,eAAe,CAAC;QACzB,CAAC;KACF;IAVC;QAAC,IAAA,gCAAO,GAAE;;;qDAGT;IAbU,iCAAuB,0BAoBnC,CAAA;IAED,MAAa,cAAe,SAAQ,SAAS;QAE3C,YAAY,QAAgB,EAAW,eAAuB;YAC5D,KAAK,CAAC,QAAQ,CAAC,CAAC;YADqB,oBAAe,GAAf,eAAe,CAAQ;YAE5D,IAAI,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;gBACnC,MAAM,IAAI,KAAK,CAAC,8CAA8C,eAAe,EAAE,CAAC,CAAA;aACjF;QACH,CAAC;QAED,IACI,EAAE;YACJ,OAAO,GAAG,IAAI,CAAC,QAAQ,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;QACvD,CAAC;QAED,qBAAqB,CAAC,MAAwB;YAC5C,OAAO,IAAI,CAAC,eAAe,CAAC;QAC9B,CAAC;KACF;IARC;QAAC,IAAA,gCAAO,GAAE;;;4CAGT;IAZU,wBAAc,iBAiB1B,CAAA;AACH,CAAC,EA3DgB,SAAS,GAAT,iBAAS,KAAT,iBAAS,QA2DzB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ClassDeclaration, MethodDeclaration, SourceFile, TypeNode } from 'ts-morph';
|
|
2
|
+
import { BuildContext } from './build-context';
|
|
3
|
+
import { ImportDef } from './import-def';
|
|
4
|
+
import { ParameterDef } from './parameter-def';
|
|
5
|
+
import { SourceFileScanner } from './source-file-scanner';
|
|
6
|
+
export declare class MethodScanner extends SourceFileScanner {
|
|
7
|
+
readonly method: MethodDeclaration;
|
|
8
|
+
readonly classDecl: ClassDeclaration;
|
|
9
|
+
readonly parameterWrapperTypes: RegExp[];
|
|
10
|
+
constructor(method: MethodDeclaration, sourceFile: SourceFile, classDecl: ClassDeclaration, context: BuildContext);
|
|
11
|
+
getImportDefs(): ImportDef[];
|
|
12
|
+
getParameters(): ParameterDef[];
|
|
13
|
+
getReturnTypeText(): string;
|
|
14
|
+
getReturnTypeNode(): TypeNode | undefined;
|
|
15
|
+
stripPartialWrapperTypes(typeName: string): string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MethodScanner = void 0;
|
|
13
|
+
const fast_memoize_decorator_1 = require("@typescript-plus/fast-memoize-decorator");
|
|
14
|
+
const lodash_1 = require("lodash");
|
|
15
|
+
const source_file_scanner_1 = require("./source-file-scanner");
|
|
16
|
+
class MethodScanner extends source_file_scanner_1.SourceFileScanner {
|
|
17
|
+
constructor(method, sourceFile, classDecl, context) {
|
|
18
|
+
super(sourceFile);
|
|
19
|
+
this.method = method;
|
|
20
|
+
this.classDecl = classDecl;
|
|
21
|
+
// TODO: make this configurable
|
|
22
|
+
this.parameterWrapperTypes = [
|
|
23
|
+
/DeepPartial<(.+)>(\[\])?/,
|
|
24
|
+
/Partial<(.+)(\[\])?>/
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
getImportDefs() {
|
|
28
|
+
const parameterImports = (0, lodash_1.flatten)(this.method.getParameters()
|
|
29
|
+
.map(p => this.extractImports(p.getTypeNode())));
|
|
30
|
+
const returnTypeImports = this.extractImports(this.method.getReturnTypeNode());
|
|
31
|
+
return (0, lodash_1.uniqBy)(returnTypeImports.concat(parameterImports), 'id');
|
|
32
|
+
}
|
|
33
|
+
getParameters() {
|
|
34
|
+
return this.method.getParameters().map(p => {
|
|
35
|
+
const typeName = p.getTypeNode();
|
|
36
|
+
return {
|
|
37
|
+
name: p.getName(),
|
|
38
|
+
typeName: this.stripPartialWrapperTypes(typeName.getFullText()).trim(),
|
|
39
|
+
optional: p.hasQuestionToken()
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
getReturnTypeText() {
|
|
44
|
+
const returnTypeNode = this.getReturnTypeNode();
|
|
45
|
+
return returnTypeNode ? returnTypeNode.getFullText() : null;
|
|
46
|
+
}
|
|
47
|
+
getReturnTypeNode() {
|
|
48
|
+
return this.method.getReturnTypeNode();
|
|
49
|
+
}
|
|
50
|
+
stripPartialWrapperTypes(typeName) {
|
|
51
|
+
const match = this.parameterWrapperTypes
|
|
52
|
+
.map(regex => regex.exec(typeName.trim()))
|
|
53
|
+
.find(result => result && result.length > 0);
|
|
54
|
+
return match ? `${match[1]}${match[2] || ''}` : typeName;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, fast_memoize_decorator_1.Memoize)(),
|
|
59
|
+
__metadata("design:type", Function),
|
|
60
|
+
__metadata("design:paramtypes", []),
|
|
61
|
+
__metadata("design:returntype", Array)
|
|
62
|
+
], MethodScanner.prototype, "getImportDefs", null);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, fast_memoize_decorator_1.Memoize)(),
|
|
65
|
+
__metadata("design:type", Function),
|
|
66
|
+
__metadata("design:paramtypes", []),
|
|
67
|
+
__metadata("design:returntype", Array)
|
|
68
|
+
], MethodScanner.prototype, "getParameters", null);
|
|
69
|
+
exports.MethodScanner = MethodScanner;
|
|
70
|
+
//# sourceMappingURL=method-scanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method-scanner.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/utils/method-scanner.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oFAAkE;AAClE,mCAAyC;AAMzC,+DAA0D;AAE1D,MAAa,aAAc,SAAQ,uCAAiB;IAQlD,YAAqB,MAAyB,EAAE,UAAsB,EAAW,SAA2B,EAAE,OAAqB;QACjI,KAAK,CAAC,UAAU,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAmB;QAAmC,cAAS,GAAT,SAAS,CAAkB;QAN5G,+BAA+B;QACtB,0BAAqB,GAAG;YAC/B,0BAA0B;YAC1B,sBAAsB;SACvB,CAAC;IAIF,CAAC;IAGD,aAAa;QACX,MAAM,gBAAgB,GAAG,IAAA,gBAAO,EAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE;aACzD,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;QAEnD,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAC/E,OAAO,IAAA,eAAM,EAAC,iBAAiB,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAC;IAClE,CAAC;IAGD,aAAa;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,CA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, M extends Mixin<T>>(original: T, mixin: M): T & M;
|
|
5
|
+
class Handler<T extends object> {
|
|
6
|
+
private original;
|
|
7
|
+
private mixin;
|
|
8
|
+
constructor(original: T, mixin: Mixin<T>);
|
|
9
|
+
get(target: T, property: string | number | symbol, receiver: any): any;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Mixin = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
class Mixin {
|
|
6
|
+
}
|
|
7
|
+
exports.Mixin = Mixin;
|
|
8
|
+
(function (Mixin) {
|
|
9
|
+
function createProxy(original, mixin) {
|
|
10
|
+
return new Proxy(original, new Handler(original, mixin));
|
|
11
|
+
}
|
|
12
|
+
Mixin.createProxy = createProxy;
|
|
13
|
+
class Handler {
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
constructor(original, mixin) {
|
|
16
|
+
this.original = original;
|
|
17
|
+
this.mixin = mixin;
|
|
18
|
+
}
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
get(target, property, receiver) {
|
|
21
|
+
// @ts-ignore TODO: Should this be Object.hasOwnProperty? what if it's a chain of proxies??
|
|
22
|
+
return !(0, lodash_1.isNil)(this.mixin[property]) ? this.mixin[property] : target[property];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
Mixin.Handler = Handler;
|
|
26
|
+
})(Mixin = exports.Mixin || (exports.Mixin = {}));
|
|
27
|
+
//# sourceMappingURL=mixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mixin.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/utils/mixin.ts"],"names":[],"mappings":";;;AAAA,mCAA6B;AAE7B,MAAsB,KAAK;CAC1B;AADD,sBACC;AAED,WAAiB,KAAK;IAEpB,SAAgB,WAAW,CAAuC,QAAW,EAAE,KAAQ;QACrF,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,IAAI,OAAO,CAAI,QAAQ,EAAE,KAAK,CAAC,CAAU,CAAC;IACvE,CAAC;IAFe,iBAAW,cAE1B,CAAA;IAED,MAAa,OAAO;QAClB,aAAa;QACb,YAAoB,QAAU,EAAU,KAAe;YAAnC,aAAQ,GAAR,QAAQ,CAAE;YAAU,UAAK,GAAL,KAAK,CAAU;QACvD,CAAC;QAED,aAAa;QACb,GAAG,CAAC,MAAS,EAAE,QAAkC,EAAE,QAAa;YAC9D,2FAA2F;YAC3F,OAAO,CAAC,IAAA,cAAK,EAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAChF,CAAC;KACF;IAVY,aAAO,UAUnB,CAAA;AACH,CAAC,EAjBgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAiBrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameter-def.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/utils/parameter-def.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BuildContext } from "./build-context";
|
|
2
|
+
export declare class PathHelper {
|
|
3
|
+
private readonly buildContext;
|
|
4
|
+
constructor(buildContext: BuildContext);
|
|
5
|
+
}
|
|
6
|
+
export declare namespace PathHelper {
|
|
7
|
+
class Dir {
|
|
8
|
+
private readonly root;
|
|
9
|
+
private readonly dir;
|
|
10
|
+
private readonly pathToRoot;
|
|
11
|
+
constructor(root: string, dir: string);
|
|
12
|
+
relativePath(absPath: string): string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PathHelper = void 0;
|
|
4
|
+
class PathHelper {
|
|
5
|
+
constructor(buildContext) {
|
|
6
|
+
this.buildContext = buildContext;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.PathHelper = PathHelper;
|
|
10
|
+
(function (PathHelper) {
|
|
11
|
+
class Dir {
|
|
12
|
+
constructor(root, dir) {
|
|
13
|
+
// const sourcePrefix = 1 + this.sourceRoot.length;
|
|
14
|
+
// const resourcePath = filePath.substr(1 + sourcePrefix, filePath.length - 1 - sourcePrefix - '.ts'.length);
|
|
15
|
+
// const relativePath = this.outDir.substr(sourcePrefix).split('/').map(v => '..').join('/');
|
|
16
|
+
// const absolutResourceClassPath = `${relativePath}/${resourcePath}`;
|
|
17
|
+
this.root = root;
|
|
18
|
+
this.dir = dir;
|
|
19
|
+
this.pathToRoot = dir ? `${dir.split('/').map(d => '..').join('/')}/` : '';
|
|
20
|
+
}
|
|
21
|
+
relativePath(absPath) {
|
|
22
|
+
if (!absPath.startsWith(this.root)) {
|
|
23
|
+
throw new Error(`expected ${absPath} to start with ${this.root}`);
|
|
24
|
+
}
|
|
25
|
+
return this.pathToRoot + absPath.substr(1 + this.root.length);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
PathHelper.Dir = Dir;
|
|
29
|
+
})(PathHelper = exports.PathHelper || (exports.PathHelper = {}));
|
|
30
|
+
//# sourceMappingURL=path-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-helper.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/utils/path-helper.ts"],"names":[],"mappings":";;;AAGA,MAAa,UAAU;IACrB,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IACvD,CAAC;CACF;AAHD,gCAGC;AAED,WAAiB,UAAU;IAEzB,MAAa,GAAG;QAGd,YAA6B,IAAY,EAAmB,GAAW;YACrE,mDAAmD;YACnD,6GAA6G;YAC7G,6FAA6F;YAC7F,sEAAsE;YAJ3C,SAAI,GAAJ,IAAI,CAAQ;YAAmB,QAAG,GAAH,GAAG,CAAQ;YAMrE,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7E,CAAC;QAED,YAAY,CAAC,OAAe;YAC1B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBAClC,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,kBAAkB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;aAClE;YACD,OAAO,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChE,CAAC;KACF;IAlBY,cAAG,MAkBf,CAAA;AACH,CAAC,EArBgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAqB1B"}
|