@coolon/angular-ui-powerups 16.0.0 → 16.0.2
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/esm2022/lib/interaction/interaction.module.mjs +1 -8
- package/esm2022/lib/place/components/list-place-nav/list-place-nav.component.mjs +3 -4
- package/esm2022/lib/place/place.module.mjs +1 -5
- package/fesm2022/coolon-angular-ui-powerups.mjs +1 -12
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/interaction/interaction.module.d.ts +6 -7
- package/lib/place/place.module.d.ts +3 -4
- package/package.json +2 -2
- 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/README.md +9 -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 +36 -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 +5 -0
- package/schematics/component/schema.js +3 -0
- package/schematics/component/schema.js.map +1 -0
- package/schematics/component/schema.json +39 -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 +24 -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 +45 -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 +4 -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 +35 -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 +26 -0
- package/schematics/place-routes/templates/place-routes.ts.template +15 -0
- package/schematics/utils/build-context.d.ts +74 -0
- package/schematics/utils/build-context.js +189 -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 +36 -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 @@
|
|
|
1
|
+
{"version":3,"file":"source-file-utilities.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/utils/source-file-utilities.ts"],"names":[],"mappings":";;;AACA,mCAA+B;AAC/B,uCAAmF;AAEnF,SAAgB,eAAe,CAAC,IAAU,EAAE,IAAY;IACtD,OAAO,IAAI,CAAC,OAAO,EAAE,KAAK,qBAAU,CAAC,SAAS;QAC5C,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,2FAA2F;AACtI,CAAC;AAHD,0CAGC;AAED,SAAgB,oBAAoB,CAAC,KAAa;IAChD,OAAO,IAAA,cAAK,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AACtE,CAAC;AAFD,oDAEC;AAED,SAAgB,sBAAsB,CAAC,KAAa;IAClD,OAAO,KAAK,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1H,CAAC;AAFD,wDAEC;AAED,SAAgB,sBAAsB,CAAC,SAA2B,EAAE,aAAqB;IACvF,IAAI,MAAM,GAAc,IAAI,CAAC;IAC7B,SAAS,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE;QAC9B,IAAI,eAAe,CAAC,IAAI,EAAE,aAAa,CAAC,EAAE;YACxC,MAAM,GAAG,IAAiB,CAAC;YAC3B,sDAAsD;YACtD,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAXD,wDAWC;AAED,SAAgB,YAAY,CAAC,IAAmB;IAC9C,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;AAC3D,CAAC;AAFD,oCAEC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class Stringy {
|
|
2
|
+
private readonly value;
|
|
3
|
+
static from(value: string): Stringy;
|
|
4
|
+
constructor(value: string);
|
|
5
|
+
pluralize(): Stringy;
|
|
6
|
+
camelize(upperCaseFirstLetter?: boolean): Stringy;
|
|
7
|
+
camelizeLower(): Stringy;
|
|
8
|
+
capitalise(): Stringy;
|
|
9
|
+
dasherize(): Stringy;
|
|
10
|
+
underscore(): Stringy;
|
|
11
|
+
singularize(): Stringy;
|
|
12
|
+
equals(other: string | Stringy): boolean;
|
|
13
|
+
toString(): string;
|
|
14
|
+
valueOf(): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Stringy = void 0;
|
|
4
|
+
const i = require("inflected");
|
|
5
|
+
const S = require("string"); // todo: invistigate replacing with https://vocajs.com/
|
|
6
|
+
const ALL_CAPS = /^[A-Z_-]+$/;
|
|
7
|
+
class Stringy {
|
|
8
|
+
static from(value) {
|
|
9
|
+
const base = ALL_CAPS.test(value) ? value.toLowerCase() : value;
|
|
10
|
+
return new Stringy(base);
|
|
11
|
+
}
|
|
12
|
+
constructor(value) {
|
|
13
|
+
this.value = value;
|
|
14
|
+
}
|
|
15
|
+
pluralize() {
|
|
16
|
+
return new Stringy(i.pluralize(this.value));
|
|
17
|
+
}
|
|
18
|
+
camelize(upperCaseFirstLetter = true) {
|
|
19
|
+
// S will camemlise dasherised strings to lowerCaseForm where as the inflector won't.
|
|
20
|
+
// so we camelise first then apply the case change using the inflector
|
|
21
|
+
const term = S(this.value).camelize().toString();
|
|
22
|
+
return new Stringy(i.camelize(term, upperCaseFirstLetter));
|
|
23
|
+
}
|
|
24
|
+
camelizeLower() {
|
|
25
|
+
return this.camelize(false);
|
|
26
|
+
}
|
|
27
|
+
capitalise() {
|
|
28
|
+
return new Stringy(S(this.dasherize().toString()).capitalize().toString());
|
|
29
|
+
}
|
|
30
|
+
dasherize() {
|
|
31
|
+
return new Stringy(S(this.value).dasherize().toString().replace(/^-/, ''));
|
|
32
|
+
}
|
|
33
|
+
underscore() {
|
|
34
|
+
return new Stringy(S(this.value).underscore().toString().replace(/^_/, ''));
|
|
35
|
+
}
|
|
36
|
+
singularize() {
|
|
37
|
+
return new Stringy(i.singularize(this.value));
|
|
38
|
+
}
|
|
39
|
+
equals(other) {
|
|
40
|
+
return other.toString() === this.value;
|
|
41
|
+
}
|
|
42
|
+
toString() {
|
|
43
|
+
return this.value;
|
|
44
|
+
}
|
|
45
|
+
valueOf() {
|
|
46
|
+
return this.value;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.Stringy = Stringy;
|
|
50
|
+
//# sourceMappingURL=stringy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stringy.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/utils/stringy.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,4BAA4B,CAAC,uDAAuD;AAGpF,MAAM,QAAQ,GAAG,YAAY,CAAC;AAE9B,MAAa,OAAO;IAElB,MAAM,CAAC,IAAI,CAAC,KAAa;QACvB,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QAChE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,YAA6B,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAC1C,CAAC;IAED,SAAS;QACP,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,QAAQ,CAAC,uBAAgC,IAAI;QAC3C,qFAAqF;QACrF,sEAAsE;QACtE,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;QACjD,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,UAAU;QACR,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,SAAS;QACP,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,UAAU;QACR,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,WAAW;QACT,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,KAAuB;QAC5B,OAAO,KAAK,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,KAAK,CAAC;IACzC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF;AApDD,0BAoDC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyTemplatesWithOverwrite = void 0;
|
|
4
|
+
const core_1 = require("@angular-devkit/core");
|
|
5
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
+
function applyTemplatesWithOverwrite(tree, templateUrl, templateData, outDir) {
|
|
7
|
+
// this.context.logger.info(`${this.workspaceProject.sourceRoot}/${this.projectType}`);
|
|
8
|
+
// this.context.logger.info(placeRoot.dir);
|
|
9
|
+
const newFiles = (0, schematics_1.apply)((0, schematics_1.url)(templateUrl), [
|
|
10
|
+
(0, schematics_1.applyTemplates)(Object.assign(Object.assign({}, templateData), core_1.strings)),
|
|
11
|
+
(0, schematics_1.move)(`${outDir}`),
|
|
12
|
+
// // @see https://github.com/angular/angular-cli/issues/11337#issuecomment-448259549
|
|
13
|
+
// forEach((fileEntry: FileEntry) => {
|
|
14
|
+
// // this.context.logger.info(fileEntry.path);
|
|
15
|
+
// if (tree.exists(fileEntry.path)) {
|
|
16
|
+
// tree.overwrite(fileEntry.path, fileEntry.content);
|
|
17
|
+
// }
|
|
18
|
+
// return fileEntry;
|
|
19
|
+
// }),
|
|
20
|
+
]);
|
|
21
|
+
return (0, schematics_1.mergeWith)(newFiles, schematics_1.MergeStrategy.Overwrite);
|
|
22
|
+
}
|
|
23
|
+
exports.applyTemplatesWithOverwrite = applyTemplatesWithOverwrite;
|
|
24
|
+
//# sourceMappingURL=template-utilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-utilities.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/utils/template-utilities.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAC/C,2DAWoC;AAEpC,SAAgB,2BAA2B,CAAC,IAAU,EAAE,WAAmB,EAAE,YAAoB,EAAE,MAAc;IAC/G,uFAAuF;IACvF,2CAA2C;IAC3C,MAAM,QAAQ,GAAG,IAAA,kBAAK,EACpB,IAAA,gBAAG,EAAC,WAAW,CAAC,EAChB;QACE,IAAA,2BAAc,kCACT,YAAY,GACZ,cAAO,EACV;QACF,IAAA,iBAAI,EAAC,GAAG,MAAM,EAAE,CAAC;QACjB,qFAAqF;QACrF,sCAAsC;QACtC,iDAAiD;QACjD,uCAAuC;QACvC,yDAAyD;QACzD,MAAM;QACN,sBAAsB;QACtB,MAAM;KACP,CAAC,CAAC;IACL,OAAO,IAAA,sBAAS,EAAC,QAAQ,EAAE,0BAAa,CAAC,SAAS,CAAC,CAAC;AACtD,CAAC;AArBD,kEAqBC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import { BuildContext } from './build-context';
|
|
3
|
+
export declare class Workspace {
|
|
4
|
+
readonly schema: any;
|
|
5
|
+
readonly tree: Tree;
|
|
6
|
+
readonly context: SchematicContext;
|
|
7
|
+
get defaultProject(): any;
|
|
8
|
+
constructor(schema: any, tree: Tree, context: SchematicContext);
|
|
9
|
+
static load(tree: Tree, _context: SchematicContext): Workspace;
|
|
10
|
+
getProject(projectName: string): BuildContext;
|
|
11
|
+
getApplication(projectName: string): BuildContext.App;
|
|
12
|
+
getApplicationOrDefault(projectName: string | undefined): BuildContext.App;
|
|
13
|
+
getLibrary(projectName: string): BuildContext.Lib;
|
|
14
|
+
protected loadProjectSettings(project: string, tree: Tree): BuildContext.Settings;
|
|
15
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Workspace = void 0;
|
|
4
|
+
const build_context_1 = require("./build-context");
|
|
5
|
+
class Workspace {
|
|
6
|
+
get defaultProject() {
|
|
7
|
+
return this.schema.defaultProject;
|
|
8
|
+
}
|
|
9
|
+
constructor(schema, tree, context) {
|
|
10
|
+
this.schema = schema;
|
|
11
|
+
this.tree = tree;
|
|
12
|
+
this.context = context;
|
|
13
|
+
}
|
|
14
|
+
static load(tree, _context) {
|
|
15
|
+
const workspaceConfig = tree.read('/angular.json');
|
|
16
|
+
if (!workspaceConfig) {
|
|
17
|
+
throw new Error('Could not find Angular workspace configuration');
|
|
18
|
+
}
|
|
19
|
+
const workspaceContent = workspaceConfig.toString();
|
|
20
|
+
return new Workspace(JSON.parse(workspaceContent), tree, _context);
|
|
21
|
+
}
|
|
22
|
+
getProject(projectName) {
|
|
23
|
+
const settings = this.loadProjectSettings(projectName, this.tree);
|
|
24
|
+
return settings.projectType === 'app' ?
|
|
25
|
+
this.getApplication(projectName) :
|
|
26
|
+
this.getLibrary(projectName);
|
|
27
|
+
}
|
|
28
|
+
getApplication(projectName) {
|
|
29
|
+
const settings = this.loadProjectSettings(projectName, this.tree);
|
|
30
|
+
if (settings.projectType !== 'app') {
|
|
31
|
+
throw new Error(`Requested app context, but '${projectName}' is a library`);
|
|
32
|
+
}
|
|
33
|
+
return new build_context_1.BuildContext.App(this.tree, projectName, settings, this.context);
|
|
34
|
+
}
|
|
35
|
+
getApplicationOrDefault(projectName) {
|
|
36
|
+
return this.getApplication(projectName !== null && projectName !== void 0 ? projectName : this.defaultProject);
|
|
37
|
+
}
|
|
38
|
+
getLibrary(projectName) {
|
|
39
|
+
const settings = this.loadProjectSettings(projectName, this.tree);
|
|
40
|
+
if (settings.projectType !== 'lib') {
|
|
41
|
+
throw new Error(`Requested app context, but '${projectName}' is a library`);
|
|
42
|
+
}
|
|
43
|
+
return new build_context_1.BuildContext.Lib(this.tree, projectName, settings, this.context);
|
|
44
|
+
}
|
|
45
|
+
loadProjectSettings(project, tree) {
|
|
46
|
+
const workspaceProject = this.schema.projects[project || this.schema.defaultProject];
|
|
47
|
+
const projectType = workspaceProject.projectType === 'application' ? 'app' : 'lib';
|
|
48
|
+
const tsConfigPath = projectType === "app" ?
|
|
49
|
+
workspaceProject.architect.build.options.tsConfig
|
|
50
|
+
: `${workspaceProject.root}/tsconfig.lib.json`;
|
|
51
|
+
return {
|
|
52
|
+
workspaceProject,
|
|
53
|
+
projectType: projectType,
|
|
54
|
+
tsConfigPath
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.Workspace = Workspace;
|
|
59
|
+
//# sourceMappingURL=workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/utils/workspace.ts"],"names":[],"mappings":";;;AAEA,mDAA+C;AAE/C,MAAa,SAAS;IAEpB,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,cAA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