@coolon/angular-ui-powerups 15.0.1 → 16.0.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/package.json +2 -2
- package/schematics/activity/index.d.ts +0 -3
- package/schematics/activity/index.js +0 -32
- package/schematics/activity/index.js.map +0 -1
- package/schematics/activity/index.spec.d.ts +0 -1
- package/schematics/activity/index.spec.js +0 -364
- package/schematics/activity/index.spec.js.map +0 -1
- package/schematics/activity/schema.d.ts +0 -4
- package/schematics/activity/schema.js +0 -3
- package/schematics/activity/schema.js.map +0 -1
- package/schematics/activity/schema.json +0 -27
- package/schematics/activity/templates/component/__name@dasherize__.component.html.template +0 -5
- package/schematics/activity/templates/component/__name@dasherize__.component.scss.template +0 -4
- package/schematics/activity/templates/component/__name@dasherize__.component.spec.ts.template +0 -25
- package/schematics/activity/templates/component/__name@dasherize__.component.ts.template +0 -40
- package/schematics/activity/templates/component/__name@dasherize__.i18n.yml.template +0 -9
- package/schematics/aup-i18n/index.d.ts +0 -4
- package/schematics/aup-i18n/index.js +0 -86
- package/schematics/aup-i18n/index.js.map +0 -1
- package/schematics/aup-i18n/schema.d.ts +0 -3
- package/schematics/aup-i18n/schema.js +0 -3
- package/schematics/aup-i18n/schema.js.map +0 -1
- package/schematics/aup-i18n/schema.json +0 -18
- package/schematics/aup-i18n/templates/app/aup.i18n.yml.template +0 -80
- package/schematics/bootstrap-app/index.d.ts +0 -4
- package/schematics/bootstrap-app/index.js +0 -109
- package/schematics/bootstrap-app/index.js.map +0 -1
- package/schematics/bootstrap-app/schema.d.ts +0 -3
- package/schematics/bootstrap-app/schema.js +0 -3
- package/schematics/bootstrap-app/schema.js.map +0 -1
- package/schematics/bootstrap-app/schema.json +0 -18
- package/schematics/bootstrap-app/templates/i18n.config.json.template +0 -11
- package/schematics/bootstrap-app/templates/src/app/app-routing.module.ts.template +0 -23
- package/schematics/bootstrap-app/templates/src/app/app.component.html.template +0 -7
- package/schematics/bootstrap-app/templates/src/app/app.component.scss.template +0 -12
- package/schematics/bootstrap-app/templates/src/app/app.component.ts.template +0 -19
- package/schematics/bootstrap-app/templates/src/app/app.module.ts.template +0 -74
- package/schematics/bootstrap-app/templates/src/app/components/components.module.ts.template +0 -16
- package/schematics/bootstrap-app/templates/src/app/i18n.ts.template +0 -9
- 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 +0 -1
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.svg +0 -2373
- 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/README.md +0 -9
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/codepoints +0 -932
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/material-icons.css +0 -36
- package/schematics/bootstrap-app/templates/src/index.html.template +0 -13
- package/schematics/bootstrap-app/templates/src/styles/global-variables.scss.template +0 -13
- package/schematics/bootstrap-app/templates/src/styles.scss.template +0 -85
- package/schematics/collection.json +0 -48
- package/schematics/component/index.d.ts +0 -3
- package/schematics/component/index.js +0 -36
- package/schematics/component/index.js.map +0 -1
- package/schematics/component/index.spec.d.ts +0 -1
- package/schematics/component/index.spec.js +0 -364
- package/schematics/component/index.spec.js.map +0 -1
- package/schematics/component/schema.d.ts +0 -5
- package/schematics/component/schema.js +0 -3
- package/schematics/component/schema.js.map +0 -1
- package/schematics/component/schema.json +0 -39
- package/schematics/component/templates/component/__name@dasherize__.component.html.template +0 -1
- package/schematics/component/templates/component/__name@dasherize__.component.scss.template +0 -4
- package/schematics/component/templates/component/__name@dasherize__.component.spec.ts.template +0 -25
- package/schematics/component/templates/component/__name@dasherize__.component.ts.template +0 -24
- package/schematics/component/templates/component/__name@dasherize__.i18n.yml.template +0 -1
- package/schematics/ng-add/index.d.ts +0 -3
- package/schematics/ng-add/index.js +0 -37
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/package-util.d.ts +0 -13
- package/schematics/package-util.js +0 -61
- package/schematics/package-util.js.map +0 -1
- package/schematics/place-add/index.d.ts +0 -3
- package/schematics/place-add/index.js +0 -45
- package/schematics/place-add/index.js.map +0 -1
- package/schematics/place-add/index.spec.d.ts +0 -1
- package/schematics/place-add/index.spec.js +0 -364
- package/schematics/place-add/index.spec.js.map +0 -1
- package/schematics/place-add/schema.d.ts +0 -5
- package/schematics/place-add/schema.js +0 -3
- package/schematics/place-add/schema.js.map +0 -1
- package/schematics/place-add/schema.json +0 -33
- package/schematics/place-add/templates/component/__name@dasherize__.component.html.template +0 -1
- package/schematics/place-add/templates/component/__name@dasherize__.component.scss.template +0 -4
- package/schematics/place-add/templates/component/__name@dasherize__.component.spec.ts.template +0 -25
- package/schematics/place-add/templates/component/__name@dasherize__.component.ts.template +0 -35
- package/schematics/place-add/templates/component/__name@dasherize__.i18n.yml.template +0 -5
- package/schematics/place-bootstrap/index.d.ts +0 -3
- package/schematics/place-bootstrap/index.js +0 -21
- package/schematics/place-bootstrap/index.js.map +0 -1
- package/schematics/place-bootstrap/schema.d.ts +0 -4
- package/schematics/place-bootstrap/schema.js +0 -3
- package/schematics/place-bootstrap/schema.js.map +0 -1
- package/schematics/place-bootstrap/schema.json +0 -28
- package/schematics/place-bootstrap/templates/__name@dasherize__/place-routes.ts.template +0 -3
- package/schematics/place-bootstrap/templates/__name@dasherize__/places.module.ts.template +0 -16
- package/schematics/place-routes/index.d.ts +0 -3
- package/schematics/place-routes/index.js +0 -24
- package/schematics/place-routes/index.js.map +0 -1
- package/schematics/place-routes/place-builder.d.ts +0 -18
- package/schematics/place-routes/place-builder.js +0 -123
- package/schematics/place-routes/place-builder.js.map +0 -1
- package/schematics/place-routes/place-class-scanner.d.ts +0 -47
- package/schematics/place-routes/place-class-scanner.js +0 -223
- package/schematics/place-routes/place-class-scanner.js.map +0 -1
- package/schematics/place-routes/place-def.d.ts +0 -62
- package/schematics/place-routes/place-def.js +0 -195
- package/schematics/place-routes/place-def.js.map +0 -1
- package/schematics/place-routes/schema.d.ts +0 -4
- package/schematics/place-routes/schema.js +0 -3
- package/schematics/place-routes/schema.js.map +0 -1
- package/schematics/place-routes/schema.json +0 -26
- package/schematics/place-routes/templates/place-routes.ts.template +0 -15
- package/schematics/utils/build-context.d.ts +0 -74
- package/schematics/utils/build-context.js +0 -189
- package/schematics/utils/build-context.js.map +0 -1
- package/schematics/utils/decorators/decorated-class.d.ts +0 -13
- package/schematics/utils/decorators/decorated-class.js +0 -28
- package/schematics/utils/decorators/decorated-class.js.map +0 -1
- package/schematics/utils/decorators/decorated-source-file.d.ts +0 -15
- package/schematics/utils/decorators/decorated-source-file.js +0 -27
- package/schematics/utils/decorators/decorated-source-file.js.map +0 -1
- package/schematics/utils/import-def.d.ts +0 -30
- package/schematics/utils/import-def.js +0 -97
- package/schematics/utils/import-def.js.map +0 -1
- package/schematics/utils/method-scanner.d.ts +0 -16
- package/schematics/utils/method-scanner.js +0 -70
- package/schematics/utils/method-scanner.js.map +0 -1
- package/schematics/utils/mixin.d.ts +0 -11
- package/schematics/utils/mixin.js +0 -27
- package/schematics/utils/mixin.js.map +0 -1
- package/schematics/utils/parameter-def.d.ts +0 -5
- package/schematics/utils/parameter-def.js +0 -3
- package/schematics/utils/parameter-def.js.map +0 -1
- package/schematics/utils/path-helper.d.ts +0 -14
- package/schematics/utils/path-helper.js +0 -30
- package/schematics/utils/path-helper.js.map +0 -1
- package/schematics/utils/schematic-tree-file-system.d.ts +0 -30
- package/schematics/utils/schematic-tree-file-system.js +0 -113
- package/schematics/utils/schematic-tree-file-system.js.map +0 -1
- package/schematics/utils/source-file-scanner.d.ts +0 -14
- package/schematics/utils/source-file-scanner.js +0 -89
- package/schematics/utils/source-file-scanner.js.map +0 -1
- package/schematics/utils/source-file-utilities.d.ts +0 -6
- package/schematics/utils/source-file-utilities.js +0 -36
- package/schematics/utils/source-file-utilities.js.map +0 -1
- package/schematics/utils/stringy.d.ts +0 -15
- package/schematics/utils/stringy.js +0 -50
- package/schematics/utils/stringy.js.map +0 -1
- package/schematics/utils/template-utilities.d.ts +0 -2
- package/schematics/utils/template-utilities.js +0 -24
- package/schematics/utils/template-utilities.js.map +0 -1
- package/schematics/utils/workspace.d.ts +0 -15
- package/schematics/utils/workspace.js +0 -59
- package/schematics/utils/workspace.js.map +0 -1
|
@@ -1,195 +0,0 @@
|
|
|
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.PlaceDef = void 0;
|
|
13
|
-
const fast_memoize_decorator_1 = require("@typescript-plus/fast-memoize-decorator");
|
|
14
|
-
const _ = require("lodash");
|
|
15
|
-
const place_class_scanner_1 = require("./place-class-scanner");
|
|
16
|
-
class PlaceDef {
|
|
17
|
-
constructor(sourceFilePath, importPath, componentClass, properties, routeDef, routeParameters, childRefs, defaultChildComponentClass, redirectToFirstChild) {
|
|
18
|
-
this.sourceFilePath = sourceFilePath;
|
|
19
|
-
this.importPath = importPath;
|
|
20
|
-
this.componentClass = componentClass;
|
|
21
|
-
this.properties = properties;
|
|
22
|
-
this.routeDef = routeDef;
|
|
23
|
-
this.routeParameters = routeParameters;
|
|
24
|
-
this.childRefs = childRefs;
|
|
25
|
-
this.defaultChildComponentClass = defaultChildComponentClass;
|
|
26
|
-
this.redirectToFirstChild = redirectToFirstChild;
|
|
27
|
-
}
|
|
28
|
-
get path() {
|
|
29
|
-
return PlaceDef.stripEnclosingQuotes(this.properties.path);
|
|
30
|
-
}
|
|
31
|
-
get routeIdentifier() {
|
|
32
|
-
return this.routeDef;
|
|
33
|
-
}
|
|
34
|
-
get fullPath() {
|
|
35
|
-
return !!this.routeIdentifier ?
|
|
36
|
-
`${this.path}/:${this.routeIdentifier.parameterName}` :
|
|
37
|
-
this.path;
|
|
38
|
-
}
|
|
39
|
-
getVisitParameterImports() {
|
|
40
|
-
return _.uniq([this.routeIdentifier, ...this.routeParameters].filter(p => !!p && !_.isEmpty(p.importDef))).map(p => p.importDef);
|
|
41
|
-
}
|
|
42
|
-
getPlaceDestinationParameterArg(name) {
|
|
43
|
-
const bits = [];
|
|
44
|
-
if (this.routeIdentifier) {
|
|
45
|
-
const optional = this.routeIdentifier.optional ? "?" : "";
|
|
46
|
-
bits.push(`${this.routeIdentifier.parameterName}${optional}:${this.routeIdentifier.parameterType}${this.routeIdentifier.array ? '[]' : ''}`);
|
|
47
|
-
}
|
|
48
|
-
if (this.routeParameters && this.routeParameters.length > 0) {
|
|
49
|
-
const properties = this.routeParameters.map(p => `${p.parameterName}?: ${p.parameterType}${p.array ? '[]' : ''}`);
|
|
50
|
-
bits.push(`${name}?: { ${properties.join(', ')} }`);
|
|
51
|
-
}
|
|
52
|
-
return bits.join(', ');
|
|
53
|
-
}
|
|
54
|
-
getPlaceDestinationCreateVisitMethod() {
|
|
55
|
-
const parameterNames = [];
|
|
56
|
-
if (this.routeIdentifier) {
|
|
57
|
-
parameterNames.push(this.routeIdentifier.parameterName);
|
|
58
|
-
}
|
|
59
|
-
if (this.routeParameters && this.routeParameters.length > 0) {
|
|
60
|
-
parameterNames.push('visitParams');
|
|
61
|
-
}
|
|
62
|
-
return `createVisit(${this.getPlaceDestinationParameterArg('visitParams')}): Visit {
|
|
63
|
-
return new ${this.componentClass}Visit(${parameterNames.join(', ')});
|
|
64
|
-
}`;
|
|
65
|
-
}
|
|
66
|
-
getPlaceDestinationVisitConstructor() {
|
|
67
|
-
const parameterNames = [];
|
|
68
|
-
if (this.routeIdentifier) {
|
|
69
|
-
parameterNames.push(this.routeIdentifier.parameterName);
|
|
70
|
-
}
|
|
71
|
-
if (this.routeParameters && this.routeParameters.length > 0) {
|
|
72
|
-
parameterNames.push('...visitParams');
|
|
73
|
-
}
|
|
74
|
-
return `constructor(${this.getPlaceDestinationParameterArg('visitParams')}) {
|
|
75
|
-
super(PlaceComponent.getDefinition(${this.componentClass}), {${parameterNames.join(', ')}});
|
|
76
|
-
}`;
|
|
77
|
-
}
|
|
78
|
-
get placeName() {
|
|
79
|
-
const s = this.componentClass.replace(/Component$/, '');
|
|
80
|
-
return s.charAt(0).toLowerCase() + s.slice(1);
|
|
81
|
-
}
|
|
82
|
-
setParent(placeDef) {
|
|
83
|
-
this.parent = placeDef;
|
|
84
|
-
}
|
|
85
|
-
isChild() {
|
|
86
|
-
return !!this.parent;
|
|
87
|
-
}
|
|
88
|
-
requiresRouteGuard() {
|
|
89
|
-
return this.routeIdentifier || this.routeParameters.length > 0;
|
|
90
|
-
}
|
|
91
|
-
get routeModelName() {
|
|
92
|
-
return this.routeDef ? this.routeDef.modelName : null;
|
|
93
|
-
}
|
|
94
|
-
get authenticate() {
|
|
95
|
-
return this.properties.authenticate === 'true';
|
|
96
|
-
}
|
|
97
|
-
get children() {
|
|
98
|
-
return this.childRefs.map(cr => cr.placeDef);
|
|
99
|
-
}
|
|
100
|
-
getRouteTemplate() {
|
|
101
|
-
const bits = [];
|
|
102
|
-
if (this.routeIdentifier) {
|
|
103
|
-
bits.push(`{path: "${this.path}", redirectTo: "${this.path}/"},`);
|
|
104
|
-
}
|
|
105
|
-
bits.push(`{
|
|
106
|
-
path: "${this.fullPath}",
|
|
107
|
-
component: ${this.componentClass},
|
|
108
|
-
canActivate: [PlaceGuard],
|
|
109
|
-
canDeactivate: [PlaceGuard],
|
|
110
|
-
runGuardsAndResolvers: ${this.redirectToFirstChild ? `"always", // if we don't do this the guards don't get called when navigating from a child to the parent` : `"paramsOrQueryParamsChange",`}
|
|
111
|
-
children:[
|
|
112
|
-
${this.getChildRouteTemplates().join(', ')}
|
|
113
|
-
]
|
|
114
|
-
}`);
|
|
115
|
-
return bits.join('\n');
|
|
116
|
-
}
|
|
117
|
-
getChildRouteTemplates() {
|
|
118
|
-
if (this.defaultChildRef) {
|
|
119
|
-
const redirectTo = this.defaultChildRef.routeIdentifier ? `${this.defaultChildRef.path}/` : this.defaultChildRef.path;
|
|
120
|
-
return [
|
|
121
|
-
`{path:"", redirectTo:"${redirectTo}", pathMatch:"full"}`,
|
|
122
|
-
...this.children.map(c => c.getRouteTemplate())
|
|
123
|
-
];
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
return this.children.map(c => c.getRouteTemplate());
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
get defaultChildRef() {
|
|
130
|
-
if (this.defaultChildComponentClass) {
|
|
131
|
-
const placeDef = this.children.find(c => c.componentClass === this.defaultChildComponentClass);
|
|
132
|
-
if (!placeDef) {
|
|
133
|
-
throw new Error(`defaultChild is not a known child of this place, should be one of ${this.children.map(c => c.componentClass)}, got ${this.defaultChildComponentClass}`);
|
|
134
|
-
}
|
|
135
|
-
return placeDef;
|
|
136
|
-
}
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
__decorate([
|
|
141
|
-
(0, fast_memoize_decorator_1.Memoize)()
|
|
142
|
-
// @ts-ignore keeps compaining about experimental decorators not being enabled... but they are.
|
|
143
|
-
,
|
|
144
|
-
__metadata("design:type", Object),
|
|
145
|
-
__metadata("design:paramtypes", [])
|
|
146
|
-
], PlaceDef.prototype, "path", null);
|
|
147
|
-
__decorate([
|
|
148
|
-
(0, fast_memoize_decorator_1.Memoize)()
|
|
149
|
-
// @ts-ignore keeps compaining about experimental decorators not being enabled... but they are.
|
|
150
|
-
,
|
|
151
|
-
__metadata("design:type", Object),
|
|
152
|
-
__metadata("design:paramtypes", [])
|
|
153
|
-
], PlaceDef.prototype, "placeName", null);
|
|
154
|
-
__decorate([
|
|
155
|
-
(0, fast_memoize_decorator_1.Memoize)()
|
|
156
|
-
// @ts-ignore keeps compaining about experimental decorators not being enabled... but they are.
|
|
157
|
-
,
|
|
158
|
-
__metadata("design:type", Object),
|
|
159
|
-
__metadata("design:paramtypes", [])
|
|
160
|
-
], PlaceDef.prototype, "routeModelName", null);
|
|
161
|
-
__decorate([
|
|
162
|
-
(0, fast_memoize_decorator_1.Memoize)()
|
|
163
|
-
// @ts-ignore keeps compaining about experimental decorators not being enabled... but they are.
|
|
164
|
-
,
|
|
165
|
-
__metadata("design:type", PlaceDef),
|
|
166
|
-
__metadata("design:paramtypes", [])
|
|
167
|
-
], PlaceDef.prototype, "defaultChildRef", null);
|
|
168
|
-
exports.PlaceDef = PlaceDef;
|
|
169
|
-
(function (PlaceDef) {
|
|
170
|
-
function scan(sourceFile, classDecl, context) {
|
|
171
|
-
return new place_class_scanner_1.PlaceClassScanner(sourceFile, classDecl, context);
|
|
172
|
-
}
|
|
173
|
-
PlaceDef.scan = scan;
|
|
174
|
-
function stripEnclosingQuotes(value) {
|
|
175
|
-
const cooked = value.replace(/(^["'])|(["']$)/g, '');
|
|
176
|
-
// console.log({ raw: value, cooked: cooked });
|
|
177
|
-
return cooked;
|
|
178
|
-
}
|
|
179
|
-
PlaceDef.stripEnclosingQuotes = stripEnclosingQuotes;
|
|
180
|
-
class ChildRef {
|
|
181
|
-
constructor(filePath, componentClass) {
|
|
182
|
-
this.filePath = filePath;
|
|
183
|
-
this.componentClass = componentClass;
|
|
184
|
-
}
|
|
185
|
-
get placeDef() {
|
|
186
|
-
return this._placeDef;
|
|
187
|
-
}
|
|
188
|
-
resolve(placeDefs) {
|
|
189
|
-
this._placeDef = placeDefs.find(d => d.sourceFilePath === this.filePath && d.componentClass === this.componentClass);
|
|
190
|
-
return this._placeDef;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
PlaceDef.ChildRef = ChildRef;
|
|
194
|
-
})(PlaceDef = exports.PlaceDef || (exports.PlaceDef = {}));
|
|
195
|
-
//# sourceMappingURL=place-def.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"place-def.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/place-def.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,oFAAgE;AAChE,4BAA4B;AAI5B,+DAAwD;AAExD,MAAa,QAAQ;IAInB,YACW,cAAsB,EACtB,UAAkB,EAClB,cAAsB,EACtB,UAA4B,EAC5B,QAA4B,EAC5B,eAAqC,EACrC,SAA8B,EAC9B,0BAAkC,EAClC,oBAA6B;QAR7B,mBAAc,GAAd,cAAc,CAAQ;QACtB,eAAU,GAAV,UAAU,CAAQ;QAClB,mBAAc,GAAd,cAAc,CAAQ;QACtB,eAAU,GAAV,UAAU,CAAkB;QAC5B,aAAQ,GAAR,QAAQ,CAAoB;QAC5B,oBAAe,GAAf,eAAe,CAAsB;QACrC,cAAS,GAAT,SAAS,CAAqB;QAC9B,+BAA0B,GAA1B,0BAA0B,CAAQ;QAClC,yBAAoB,GAApB,oBAAoB,CAAS;IAExC,CAAC;IAED,IAEI,IAAI;QACN,OAAO,QAAQ,CAAC,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI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,+FAA+F;;8BACxE,QAAQ;;+CAS9B;AA7JH,4BA+JC;AAED,WAAiB,QAAQ;IAoBvB,SAAgB,IAAI,CAAC,UAA+B,EAAE,SAA2B,EAAE,OAAyB;QAC1G,OAAO,IAAI,uCAAiB,CAAC,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAFe,aAAI,OAEnB,CAAA;IAED,SAAgB,oBAAoB,CAAC,KAAa;QAChD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;QACrD,+CAA+C;QAC/C,OAAO,MAAM,CAAC;IAChB,CAAC;IAJe,6BAAoB,uBAInC,CAAA;IAED,MAAa,QAAQ;QAGnB,YAAqB,QAAgB,EAAW,cAAsB;YAAjD,aAAQ,GAAR,QAAQ,CAAQ;YAAW,mBAAc,GAAd,cAAc,CAAQ;QACtE,CAAC;QAED,IAAI,QAAQ;YACV,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;QAED,OAAO,CAAC,SAAqB;YAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,KAAK,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,cAAc,KAAK,IAAI,CAAC,cAAc,CAAC,CAAC;YACrH,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;KACF;IAdY,iBAAQ,WAcpB,CAAA;AAGH,CAAC,EA/CgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QA+CxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/schema.ts"],"names":[],"mappings":""}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"$id": "place-routes",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"properties": {
|
|
6
|
-
"project": {
|
|
7
|
-
"type": "string",
|
|
8
|
-
"description": "The name of the project.",
|
|
9
|
-
"$default": {
|
|
10
|
-
"$source": "projectName"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"dir": {
|
|
14
|
-
"type": "string",
|
|
15
|
-
"description": "The directory to scan for place components",
|
|
16
|
-
"$default": {
|
|
17
|
-
"$source": "argv",
|
|
18
|
-
"index": 0
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"required": [
|
|
23
|
-
"project",
|
|
24
|
-
"dir"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// DO NOT EDIT!!!
|
|
2
|
-
// This file is automatically generated using:
|
|
3
|
-
// ng generate @coolon/angular-ui-powerups:place-routes --project=powerup-demo --dir=app/places
|
|
4
|
-
|
|
5
|
-
import { inject } from '@angular/core';
|
|
6
|
-
import {ActivatedRouteSnapshot, RouterStateSnapshot, Routes} from '@angular/router';
|
|
7
|
-
import {PlaceComponent, PlaceGuard} from '@coolon/angular-ui-powerups';
|
|
8
|
-
|
|
9
|
-
<% placeDefs.forEach(def => { %>import {<%= def.componentClass %>} from "<%= def.importPath %>";
|
|
10
|
-
<% }); %>
|
|
11
|
-
|
|
12
|
-
export const placeRoutes:Routes = [<% placeDefs.filter(def=> !def.isChild()).forEach(def => { %>
|
|
13
|
-
<%= def.getRouteTemplate() %>,
|
|
14
|
-
<% }) %>
|
|
15
|
-
];
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
-
import { ClassDeclaration, SourceFile } from 'ts-morph';
|
|
3
|
-
import { DecoratedSourceFile } from './decorators/decorated-source-file';
|
|
4
|
-
export declare abstract class BuildContext {
|
|
5
|
-
readonly tree: Tree;
|
|
6
|
-
readonly projectName: string;
|
|
7
|
-
protected readonly settings: BuildContext.Settings;
|
|
8
|
-
readonly context: SchematicContext;
|
|
9
|
-
private typescriptProject;
|
|
10
|
-
readonly sourceCodeRootDir: BuildContext.RootDir;
|
|
11
|
-
readonly appCodeRootDir: BuildContext.RootDir;
|
|
12
|
-
constructor(tree: Tree, projectName: string, settings: BuildContext.Settings, context: SchematicContext);
|
|
13
|
-
get logger(): {
|
|
14
|
-
info(message: string): void;
|
|
15
|
-
error(message: string): void;
|
|
16
|
-
fatal(message: string): void;
|
|
17
|
-
};
|
|
18
|
-
get tsConfigPath(): string;
|
|
19
|
-
get sourceCodeRoot(): string;
|
|
20
|
-
get sourceRoot(): any;
|
|
21
|
-
get rootDir(): any;
|
|
22
|
-
get selectorPrefix(): any;
|
|
23
|
-
private loadTypeScriptProject;
|
|
24
|
-
getI18nClasName(): string;
|
|
25
|
-
scanClassesInTree(tree: Tree, scanRootDirectory: string, scanClass: (sourceFile: SourceFile, classDeclaration: ClassDeclaration, path: string) => void): void;
|
|
26
|
-
findFileInAncestorPath(pathToSourceRoot: string[], fileName: string): string;
|
|
27
|
-
getSourceFile(pathFromSrcRoot: string): DecoratedSourceFile;
|
|
28
|
-
}
|
|
29
|
-
export declare namespace BuildContext {
|
|
30
|
-
interface Settings {
|
|
31
|
-
readonly workspaceProject: any;
|
|
32
|
-
readonly projectType: string;
|
|
33
|
-
readonly tsConfigPath: string;
|
|
34
|
-
}
|
|
35
|
-
class App extends BuildContext {
|
|
36
|
-
}
|
|
37
|
-
class Lib extends BuildContext {
|
|
38
|
-
}
|
|
39
|
-
abstract class Dir {
|
|
40
|
-
private readonly pathToRoot;
|
|
41
|
-
protected abstract getPath(): string;
|
|
42
|
-
protected abstract getAbsPath(): string;
|
|
43
|
-
protected abstract getTreePath(): string;
|
|
44
|
-
abstract getRoot(): BuildContext.Dir;
|
|
45
|
-
constructor();
|
|
46
|
-
get path(): string;
|
|
47
|
-
get treePath(): string;
|
|
48
|
-
get absPath(): string;
|
|
49
|
-
relativeDir(path: string): Dir;
|
|
50
|
-
getDotPathToRoot(): string;
|
|
51
|
-
private clean;
|
|
52
|
-
getRelativePathTo(path: string): string;
|
|
53
|
-
private resolveAgainstRoot;
|
|
54
|
-
}
|
|
55
|
-
class RootDir extends Dir {
|
|
56
|
-
private readonly treeAbsRoot;
|
|
57
|
-
readonly _treePath: string;
|
|
58
|
-
constructor(treeAbsRoot: string, _treePath: string);
|
|
59
|
-
protected getTreePath(): string;
|
|
60
|
-
protected getPath(): string;
|
|
61
|
-
getRoot(): BuildContext.Dir;
|
|
62
|
-
protected getAbsPath(): string;
|
|
63
|
-
relativeDir(path: string): BuildContext.Dir;
|
|
64
|
-
}
|
|
65
|
-
class RelativeDir extends Dir {
|
|
66
|
-
private readonly parent;
|
|
67
|
-
private readonly _relativePath;
|
|
68
|
-
constructor(parent: Dir, _relativePath: string);
|
|
69
|
-
getRoot(): BuildContext.Dir;
|
|
70
|
-
protected getPath(): string;
|
|
71
|
-
protected getTreePath(): string;
|
|
72
|
-
protected getAbsPath(): string;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BuildContext = void 0;
|
|
4
|
-
const _ = require("lodash");
|
|
5
|
-
const ts_morph_1 = require("ts-morph");
|
|
6
|
-
const decorated_source_file_1 = require("./decorators/decorated-source-file");
|
|
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
|
-
getI18nClasName() {
|
|
52
|
-
var _a, _b;
|
|
53
|
-
const i18nConfig = this.tree.readJson(`${this.rootDir}/i18n.config.json`);
|
|
54
|
-
return (_b = (typeof i18nConfig == 'object' && !Array.isArray(i18nConfig) ? (_a = i18nConfig["class"]) === null || _a === void 0 ? void 0 : _a.toString() : undefined)) !== null && _b !== void 0 ? _b : "I18n";
|
|
55
|
-
}
|
|
56
|
-
scanClassesInTree(tree, scanRootDirectory, scanClass) {
|
|
57
|
-
const importPrefix = `./${scanRootDirectory}`;
|
|
58
|
-
this.context.logger.info(`Scanning sources in -> ${scanRootDirectory}`);
|
|
59
|
-
tree.getDir(scanRootDirectory).visit(filePath => {
|
|
60
|
-
if (!filePath.endsWith('.ts') || filePath.endsWith('.spec.ts')) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const content = tree.read(filePath);
|
|
64
|
-
if (!content) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const sourceFile = this.typescriptProject.getSourceFileOrThrow(`./${filePath}`);
|
|
68
|
-
const imports = sourceFile.getImportDeclarations();
|
|
69
|
-
sourceFile.getClasses().forEach((classDecl) => {
|
|
70
|
-
scanClass(sourceFile, classDecl, filePath);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
findFileInAncestorPath(pathToSourceRoot, fileName) {
|
|
75
|
-
for (let i = pathToSourceRoot.length; i > 0; i--) {
|
|
76
|
-
const possibleModulePath = pathToSourceRoot.slice(0, i).join('/') + `/${fileName}`;
|
|
77
|
-
if (this.tree.exists(possibleModulePath)) {
|
|
78
|
-
return possibleModulePath;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return undefined;
|
|
82
|
-
}
|
|
83
|
-
getSourceFile(pathFromSrcRoot) {
|
|
84
|
-
// Weirdness with out tree based file system, `getSourceFile(..)` returns undefined.
|
|
85
|
-
// const f = this.typescriptProject.getSourceFile(path);
|
|
86
|
-
// to work around it we
|
|
87
|
-
const fileEntry = this.tree.get(pathFromSrcRoot);
|
|
88
|
-
const sourceFile = this.typescriptProject.createSourceFile(pathFromSrcRoot, fileEntry.content.toString('utf8'), {
|
|
89
|
-
overwrite: true
|
|
90
|
-
});
|
|
91
|
-
return decorated_source_file_1.DecoratedSourceFile.create(sourceFile, pathFromSrcRoot);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
exports.BuildContext = BuildContext;
|
|
95
|
-
(function (BuildContext) {
|
|
96
|
-
class App extends BuildContext {
|
|
97
|
-
}
|
|
98
|
-
BuildContext.App = App;
|
|
99
|
-
class Lib extends BuildContext {
|
|
100
|
-
}
|
|
101
|
-
BuildContext.Lib = Lib;
|
|
102
|
-
class Dir {
|
|
103
|
-
constructor() {
|
|
104
|
-
// const sourcePrefix = 1 + this.sourceRoot.length;
|
|
105
|
-
// const resourcePath = filePath.substr(1 + sourcePrefix, filePath.length - 1 - sourcePrefix - '.ts'.length);
|
|
106
|
-
// const relativePath = this.outDir.substr(sourcePrefix).split('/').map(v => '..').join('/');
|
|
107
|
-
// const absolutResourceClassPath = `${relativePath}/${resourcePath}`;
|
|
108
|
-
}
|
|
109
|
-
get path() {
|
|
110
|
-
return this.clean(this.getPath());
|
|
111
|
-
}
|
|
112
|
-
get treePath() {
|
|
113
|
-
return this.clean(this.getTreePath());
|
|
114
|
-
}
|
|
115
|
-
get absPath() {
|
|
116
|
-
return this.clean(this.getAbsPath());
|
|
117
|
-
}
|
|
118
|
-
relativeDir(path) {
|
|
119
|
-
return new BuildContext.RelativeDir(this, path);
|
|
120
|
-
}
|
|
121
|
-
getDotPathToRoot() {
|
|
122
|
-
const result = `${this.path.split('/')
|
|
123
|
-
.filter(p => !_.isEmpty(p))
|
|
124
|
-
.map(d => '..').join('/')}/`;
|
|
125
|
-
return result;
|
|
126
|
-
}
|
|
127
|
-
clean(path) {
|
|
128
|
-
return path.replace(/\/\/+/, "/");
|
|
129
|
-
}
|
|
130
|
-
getRelativePathTo(path) {
|
|
131
|
-
const other = this.resolveAgainstRoot(path);
|
|
132
|
-
return this.clean(`${this.getDotPathToRoot()}/${other.path}`);
|
|
133
|
-
}
|
|
134
|
-
resolveAgainstRoot(path) {
|
|
135
|
-
if (path.startsWith(this.getRoot().absPath)) {
|
|
136
|
-
return this.getRoot().relativeDir(path.substring(this.getRoot().absPath.length));
|
|
137
|
-
}
|
|
138
|
-
if (path.startsWith(this.getRoot().treePath)) {
|
|
139
|
-
return this.getRoot().relativeDir(path.substring(this.getRoot().treePath.length));
|
|
140
|
-
}
|
|
141
|
-
return this.getRoot().relativeDir(path);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
BuildContext.Dir = Dir;
|
|
145
|
-
class RootDir extends Dir {
|
|
146
|
-
constructor(treeAbsRoot, _treePath) {
|
|
147
|
-
super();
|
|
148
|
-
this.treeAbsRoot = treeAbsRoot;
|
|
149
|
-
this._treePath = _treePath;
|
|
150
|
-
}
|
|
151
|
-
getTreePath() {
|
|
152
|
-
return this._treePath;
|
|
153
|
-
}
|
|
154
|
-
getPath() {
|
|
155
|
-
return "";
|
|
156
|
-
}
|
|
157
|
-
getRoot() {
|
|
158
|
-
return this;
|
|
159
|
-
}
|
|
160
|
-
getAbsPath() {
|
|
161
|
-
return `${this.treeAbsRoot}/${this.treePath}`;
|
|
162
|
-
}
|
|
163
|
-
relativeDir(path) {
|
|
164
|
-
return new RelativeDir(this, path);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
BuildContext.RootDir = RootDir;
|
|
168
|
-
class RelativeDir extends Dir {
|
|
169
|
-
constructor(parent, _relativePath) {
|
|
170
|
-
super();
|
|
171
|
-
this.parent = parent;
|
|
172
|
-
this._relativePath = _relativePath;
|
|
173
|
-
}
|
|
174
|
-
getRoot() {
|
|
175
|
-
return this.parent.getRoot();
|
|
176
|
-
}
|
|
177
|
-
getPath() {
|
|
178
|
-
return `${this.parent.path}/${this._relativePath}`;
|
|
179
|
-
}
|
|
180
|
-
getTreePath() {
|
|
181
|
-
return `${this.parent.treePath}/${this._relativePath}`;
|
|
182
|
-
}
|
|
183
|
-
getAbsPath() {
|
|
184
|
-
return `${this.parent.absPath}/${this.getRelativePathTo}`;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
BuildContext.RelativeDir = RelativeDir;
|
|
188
|
-
})(BuildContext = exports.BuildContext || (exports.BuildContext = {}));
|
|
189
|
-
//# sourceMappingURL=build-context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"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C,IAAI,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;KAEF;IA1BY,oBAAO,UA0BnB,CAAA;IAED,MAAa,WAAY,SAAQ,GAAG;QAClC,YAA6B,MAAW,EAAmB,aAAqB;YAC9E,KAAK,EAAE,CAAC;YADmB,WAAM,GAAN,MAAM,CAAK;YAAmB,kBAAa,GAAb,aAAa,CAAQ;QAEhF,CAAC;QAED,OAAO;YACL,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAC/B,CAAC;QAES,OAAO;YACf,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,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,EA9HgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA8H5B"}
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|