@coolon/angular-ui-powerups 14.36.0 → 14.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/assets/interaction/editor/inline-string-editor.scss +6 -0
  2. package/esm2020/lib/components/forms/multiple-select-input/multiple-select-input.component.mjs +21 -4
  3. package/esm2020/lib/components/forms/select-input/select-input.component.mjs +24 -4
  4. package/esm2020/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.mjs +15 -9
  5. package/fesm2015/coolon-angular-ui-powerups.mjs +54 -11
  6. package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
  7. package/fesm2020/coolon-angular-ui-powerups.mjs +54 -11
  8. package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
  9. package/lib/components/forms/multiple-select-input/multiple-select-input.component.d.ts +2 -0
  10. package/lib/components/forms/select-input/select-input.component.d.ts +2 -0
  11. package/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.d.ts +3 -2
  12. package/package.json +2 -2
  13. package/schematics/activity/index.d.ts +3 -0
  14. package/schematics/activity/index.js +32 -0
  15. package/schematics/activity/index.js.map +1 -0
  16. package/schematics/activity/index.spec.d.ts +1 -0
  17. package/schematics/activity/index.spec.js +364 -0
  18. package/schematics/activity/index.spec.js.map +1 -0
  19. package/schematics/activity/schema.d.ts +4 -0
  20. package/schematics/activity/schema.js +3 -0
  21. package/schematics/activity/schema.js.map +1 -0
  22. package/schematics/activity/schema.json +27 -0
  23. package/schematics/activity/templates/component/__name@dasherize__.component.html.template +5 -0
  24. package/schematics/activity/templates/component/__name@dasherize__.component.scss.template +4 -0
  25. package/schematics/activity/templates/component/__name@dasherize__.component.spec.ts.template +25 -0
  26. package/schematics/activity/templates/component/__name@dasherize__.component.ts.template +40 -0
  27. package/schematics/activity/templates/component/__name@dasherize__.i18n.yml.template +9 -0
  28. package/schematics/aup-i18n/index.d.ts +4 -0
  29. package/schematics/aup-i18n/index.js +86 -0
  30. package/schematics/aup-i18n/index.js.map +1 -0
  31. package/schematics/aup-i18n/schema.d.ts +3 -0
  32. package/schematics/aup-i18n/schema.js +3 -0
  33. package/schematics/aup-i18n/schema.js.map +1 -0
  34. package/schematics/aup-i18n/schema.json +18 -0
  35. package/schematics/aup-i18n/templates/app/aup.i18n.yml.template +80 -0
  36. package/schematics/bootstrap-app/index.d.ts +4 -0
  37. package/schematics/bootstrap-app/index.js +109 -0
  38. package/schematics/bootstrap-app/index.js.map +1 -0
  39. package/schematics/bootstrap-app/schema.d.ts +3 -0
  40. package/schematics/bootstrap-app/schema.js +3 -0
  41. package/schematics/bootstrap-app/schema.js.map +1 -0
  42. package/schematics/bootstrap-app/schema.json +18 -0
  43. package/schematics/bootstrap-app/templates/i18n.config.json.template +11 -0
  44. package/schematics/bootstrap-app/templates/src/app/app-routing.module.ts.template +23 -0
  45. package/schematics/bootstrap-app/templates/src/app/app.component.html.template +7 -0
  46. package/schematics/bootstrap-app/templates/src/app/app.component.scss.template +12 -0
  47. package/schematics/bootstrap-app/templates/src/app/app.component.ts.template +19 -0
  48. package/schematics/bootstrap-app/templates/src/app/app.module.ts.template +74 -0
  49. package/schematics/bootstrap-app/templates/src/app/components/components.module.ts.template +16 -0
  50. package/schematics/bootstrap-app/templates/src/app/i18n.ts.template +9 -0
  51. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.eot +0 -0
  52. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.ijmap +1 -0
  53. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.svg +2373 -0
  54. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.ttf +0 -0
  55. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.woff +0 -0
  56. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.woff2 +0 -0
  57. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/codepoints +932 -0
  58. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/material-icons.css +36 -0
  59. package/schematics/bootstrap-app/templates/src/index.html.template +13 -0
  60. package/schematics/bootstrap-app/templates/src/styles/global-variables.scss.template +13 -0
  61. package/schematics/bootstrap-app/templates/src/styles.scss.template +85 -0
  62. package/schematics/collection.json +48 -0
  63. package/schematics/component/index.d.ts +3 -0
  64. package/schematics/component/index.js +32 -0
  65. package/schematics/component/index.js.map +1 -0
  66. package/schematics/component/index.spec.d.ts +1 -0
  67. package/schematics/component/index.spec.js +364 -0
  68. package/schematics/component/index.spec.js.map +1 -0
  69. package/schematics/component/schema.d.ts +4 -0
  70. package/schematics/component/schema.js +3 -0
  71. package/schematics/component/schema.js.map +1 -0
  72. package/schematics/component/schema.json +27 -0
  73. package/schematics/component/templates/component/__name@dasherize__.component.html.template +1 -0
  74. package/schematics/component/templates/component/__name@dasherize__.component.scss.template +4 -0
  75. package/schematics/component/templates/component/__name@dasherize__.component.spec.ts.template +25 -0
  76. package/schematics/component/templates/component/__name@dasherize__.component.ts.template +23 -0
  77. package/schematics/component/templates/component/__name@dasherize__.i18n.yml.template +1 -0
  78. package/schematics/ng-add/index.d.ts +3 -0
  79. package/schematics/ng-add/index.js +37 -0
  80. package/schematics/ng-add/index.js.map +1 -0
  81. package/schematics/package-util.d.ts +13 -0
  82. package/schematics/package-util.js +61 -0
  83. package/schematics/package-util.js.map +1 -0
  84. package/schematics/place-add/index.d.ts +3 -0
  85. package/schematics/place-add/index.js +37 -0
  86. package/schematics/place-add/index.js.map +1 -0
  87. package/schematics/place-add/index.spec.d.ts +1 -0
  88. package/schematics/place-add/index.spec.js +364 -0
  89. package/schematics/place-add/index.spec.js.map +1 -0
  90. package/schematics/place-add/schema.d.ts +4 -0
  91. package/schematics/place-add/schema.js +3 -0
  92. package/schematics/place-add/schema.js.map +1 -0
  93. package/schematics/place-add/schema.json +27 -0
  94. package/schematics/place-add/templates/component/__name@dasherize__.component.html.template +1 -0
  95. package/schematics/place-add/templates/component/__name@dasherize__.component.scss.template +5 -0
  96. package/schematics/place-add/templates/component/__name@dasherize__.component.spec.ts.template +25 -0
  97. package/schematics/place-add/templates/component/__name@dasherize__.component.ts.template +33 -0
  98. package/schematics/place-add/templates/component/__name@dasherize__.i18n.yml.template +5 -0
  99. package/schematics/place-bootstrap/index.d.ts +3 -0
  100. package/schematics/place-bootstrap/index.js +21 -0
  101. package/schematics/place-bootstrap/index.js.map +1 -0
  102. package/schematics/place-bootstrap/schema.d.ts +4 -0
  103. package/schematics/place-bootstrap/schema.js +3 -0
  104. package/schematics/place-bootstrap/schema.js.map +1 -0
  105. package/schematics/place-bootstrap/schema.json +28 -0
  106. package/schematics/place-bootstrap/templates/__name@dasherize__/place-routes.ts.template +3 -0
  107. package/schematics/place-bootstrap/templates/__name@dasherize__/places.module.ts.template +16 -0
  108. package/schematics/place-routes/index.d.ts +3 -0
  109. package/schematics/place-routes/index.js +24 -0
  110. package/schematics/place-routes/index.js.map +1 -0
  111. package/schematics/place-routes/place-builder.d.ts +18 -0
  112. package/schematics/place-routes/place-builder.js +123 -0
  113. package/schematics/place-routes/place-builder.js.map +1 -0
  114. package/schematics/place-routes/place-class-scanner.d.ts +47 -0
  115. package/schematics/place-routes/place-class-scanner.js +223 -0
  116. package/schematics/place-routes/place-class-scanner.js.map +1 -0
  117. package/schematics/place-routes/place-def.d.ts +62 -0
  118. package/schematics/place-routes/place-def.js +195 -0
  119. package/schematics/place-routes/place-def.js.map +1 -0
  120. package/schematics/place-routes/schema.d.ts +4 -0
  121. package/schematics/place-routes/schema.js +3 -0
  122. package/schematics/place-routes/schema.js.map +1 -0
  123. package/schematics/place-routes/schema.json +25 -0
  124. package/schematics/place-routes/templates/place-routes.ts.template +14 -0
  125. package/schematics/utils/build-context.d.ts +73 -0
  126. package/schematics/utils/build-context.js +184 -0
  127. package/schematics/utils/build-context.js.map +1 -0
  128. package/schematics/utils/decorators/decorated-class.d.ts +13 -0
  129. package/schematics/utils/decorators/decorated-class.js +28 -0
  130. package/schematics/utils/decorators/decorated-class.js.map +1 -0
  131. package/schematics/utils/decorators/decorated-source-file.d.ts +15 -0
  132. package/schematics/utils/decorators/decorated-source-file.js +27 -0
  133. package/schematics/utils/decorators/decorated-source-file.js.map +1 -0
  134. package/schematics/utils/import-def.d.ts +30 -0
  135. package/schematics/utils/import-def.js +97 -0
  136. package/schematics/utils/import-def.js.map +1 -0
  137. package/schematics/utils/method-scanner.d.ts +16 -0
  138. package/schematics/utils/method-scanner.js +70 -0
  139. package/schematics/utils/method-scanner.js.map +1 -0
  140. package/schematics/utils/mixin.d.ts +11 -0
  141. package/schematics/utils/mixin.js +27 -0
  142. package/schematics/utils/mixin.js.map +1 -0
  143. package/schematics/utils/parameter-def.d.ts +5 -0
  144. package/schematics/utils/parameter-def.js +3 -0
  145. package/schematics/utils/parameter-def.js.map +1 -0
  146. package/schematics/utils/path-helper.d.ts +14 -0
  147. package/schematics/utils/path-helper.js +30 -0
  148. package/schematics/utils/path-helper.js.map +1 -0
  149. package/schematics/utils/schematic-tree-file-system.d.ts +30 -0
  150. package/schematics/utils/schematic-tree-file-system.js +113 -0
  151. package/schematics/utils/schematic-tree-file-system.js.map +1 -0
  152. package/schematics/utils/source-file-scanner.d.ts +14 -0
  153. package/schematics/utils/source-file-scanner.js +89 -0
  154. package/schematics/utils/source-file-scanner.js.map +1 -0
  155. package/schematics/utils/source-file-utilities.d.ts +6 -0
  156. package/schematics/utils/source-file-utilities.js +35 -0
  157. package/schematics/utils/source-file-utilities.js.map +1 -0
  158. package/schematics/utils/stringy.d.ts +15 -0
  159. package/schematics/utils/stringy.js +50 -0
  160. package/schematics/utils/stringy.js.map +1 -0
  161. package/schematics/utils/template-utilities.d.ts +2 -0
  162. package/schematics/utils/template-utilities.js +24 -0
  163. package/schematics/utils/template-utilities.js.map +1 -0
  164. package/schematics/utils/workspace.d.ts +15 -0
  165. package/schematics/utils/workspace.js +59 -0
  166. package/schematics/utils/workspace.js.map +1 -0
@@ -0,0 +1,30 @@
1
+ /// <reference types="node" />
2
+ import { SchematicContext, Tree } from '@angular-devkit/schematics';
3
+ import { FileSystemHost } from 'ts-morph';
4
+ export declare class SchematicTreeFileSystem implements FileSystemHost {
5
+ private readonly tree;
6
+ private readonly context;
7
+ constructor(tree: Tree, context: SchematicContext);
8
+ copy(srcPath: string, destPath: string): Promise<void>;
9
+ copySync(srcPath: string, destPath: string): void;
10
+ delete(path: string): Promise<void>;
11
+ deleteSync(path: string): void;
12
+ directoryExists(dirPath: string): Promise<boolean>;
13
+ directoryExistsSync(dirPath: string): boolean;
14
+ fileExists(filePath: string): Promise<boolean>;
15
+ fileExistsSync(filePath: string): boolean;
16
+ getCurrentDirectory(): string;
17
+ glob(patterns: ReadonlyArray<string>): Promise<string[]>;
18
+ globSync(patterns: ReadonlyArray<string>): string[];
19
+ isCaseSensitive(): boolean;
20
+ mkdir(dirPath: string): Promise<void>;
21
+ mkdirSync(dirPath: string): void;
22
+ move(srcPath: string, destPath: string): Promise<void>;
23
+ moveSync(srcPath: string, destPath: string): void;
24
+ readDirSync(dirPath: string): string[];
25
+ readFile(filePath: string, encoding?: BufferEncoding): Promise<string>;
26
+ readFileSync(filePath: string, encoding?: BufferEncoding): string;
27
+ realpathSync(path: string): string;
28
+ writeFile(filePath: string, fileText: string): Promise<void>;
29
+ writeFileSync(filePath: string, fileText: string): void;
30
+ }
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SchematicTreeFileSystem = void 0;
13
+ class SchematicTreeFileSystem {
14
+ constructor(tree, context) {
15
+ this.tree = tree;
16
+ this.context = context;
17
+ }
18
+ copy(srcPath, destPath) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ return Promise.reject("not implemented");
21
+ });
22
+ }
23
+ copySync(srcPath, destPath) {
24
+ throw new Error("not implemented");
25
+ }
26
+ delete(path) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ return this.deleteSync(path);
29
+ });
30
+ }
31
+ deleteSync(path) {
32
+ return this.tree.delete(path);
33
+ }
34
+ directoryExists(dirPath) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ return this.directoryExistsSync(dirPath);
37
+ });
38
+ }
39
+ directoryExistsSync(dirPath) {
40
+ const p = `${dirPath}`;
41
+ const exists = this.tree.exists(p);
42
+ this.context.logger.info(this.tree.root.subdirs.join(','));
43
+ this.context.logger.info(`dirExists->${p}? ${exists}`);
44
+ return exists;
45
+ }
46
+ fileExists(filePath) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ return this.fileExistsSync(filePath);
49
+ });
50
+ }
51
+ fileExistsSync(filePath) {
52
+ const exists = this.tree.exists(filePath);
53
+ // NOTE: If we turn the logging on this will show ts-morph trying to read
54
+ // the tsconfig.app.json parent config from a double nested directory i.e
55
+ // apps/test-bed/dummy-app/apps/test-bed/dummy-app/tsconfig.json
56
+ // This is happening from within the typescript compiler so I'm not sure if
57
+ // it's intended behaviour or not.
58
+ this.context.logger.info(`fileExists->${filePath}? ${exists}`);
59
+ return exists;
60
+ }
61
+ getCurrentDirectory() {
62
+ return '';
63
+ }
64
+ glob(patterns) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ return Promise.reject("not implemented");
67
+ });
68
+ }
69
+ globSync(patterns) {
70
+ throw new Error("not implemented");
71
+ }
72
+ isCaseSensitive() {
73
+ return false;
74
+ }
75
+ mkdir(dirPath) {
76
+ return Promise.reject("not implemented");
77
+ }
78
+ mkdirSync(dirPath) {
79
+ throw new Error("not implemented");
80
+ }
81
+ move(srcPath, destPath) {
82
+ return Promise.resolve(undefined);
83
+ }
84
+ moveSync(srcPath, destPath) {
85
+ throw new Error("not implemented");
86
+ }
87
+ readDirSync(dirPath) {
88
+ const dir = this.tree.getDir(dirPath);
89
+ return dir.subdirs.concat(dir.subfiles).map(name => `${dirPath}/${name}`);
90
+ }
91
+ readFile(filePath, encoding) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ return this.readFileSync(filePath, encoding);
94
+ });
95
+ }
96
+ readFileSync(filePath, encoding) {
97
+ // this.context.logger.info(`readFile->${filePath}`)
98
+ return this.tree.get(filePath).content.toString(encoding || "utf8");
99
+ }
100
+ realpathSync(path) {
101
+ return path;
102
+ }
103
+ writeFile(filePath, fileText) {
104
+ return __awaiter(this, void 0, void 0, function* () {
105
+ return this.writeFileSync(filePath, fileText);
106
+ });
107
+ }
108
+ writeFileSync(filePath, fileText) {
109
+ this.tree.create(filePath, fileText);
110
+ }
111
+ }
112
+ exports.SchematicTreeFileSystem = SchematicTreeFileSystem;
113
+ //# sourceMappingURL=schematic-tree-file-system.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schematic-tree-file-system.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/utils/schematic-tree-file-system.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,MAAa,uBAAuB;IAElC,YAA6B,IAAU,EAAmB,OAAyB;QAAtD,SAAI,GAAJ,IAAI,CAAM;QAAmB,YAAO,GAAP,OAAO,CAAkB;IACnF,CAAC;IAEK,IAAI,CAAC,OAAe,EAAE,QAAgB;;YAC1C,OAAO,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAC3C,CAAC;KAAA;IAED,QAAQ,CAAC,OAAe,EAAE,QAAgB;QACxC,MA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AAY;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAEK,SAAS,CAAC,QAAgB,EAAE,QAAgB;;YAChD,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAChD,CAAC;KAAA;IAED,aAAa,CAAC,QAAgB,EAAE,QAAgB;QAC9C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;CAMF;AA9GD,0DA8GC"}
@@ -0,0 +1,14 @@
1
+ import { Decorator, ImportDeclaration, ObjectLiteralExpression, SourceFile, TypeNode } from 'ts-morph';
2
+ import { ImportDef } from './import-def';
3
+ export declare class SourceFileScanner {
4
+ readonly sourceFile: SourceFile;
5
+ constructor(sourceFile: SourceFile);
6
+ extractImports(type: TypeNode): ImportDef[];
7
+ getImportDeclaration(typeName: string): ImportDeclaration;
8
+ getObjectLiteralArgument(annotation: Decorator, position: number): ObjectLiteralExpression;
9
+ getOptionsArg<T extends {}>(annotation: Decorator, structure: T, options?: {
10
+ position: number;
11
+ required: boolean;
12
+ }): T;
13
+ scanObjectLiteral<T extends object>(structure: T, expression: ObjectLiteralExpression): T;
14
+ }
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SourceFileScanner = void 0;
4
+ const lodash_1 = require("lodash");
5
+ const ts_morph_1 = require("ts-morph");
6
+ const import_def_1 = require("./import-def");
7
+ const source_file_utilities_1 = require("./source-file-utilities");
8
+ class SourceFileScanner {
9
+ constructor(sourceFile) {
10
+ this.sourceFile = sourceFile;
11
+ }
12
+ extractImports(type) {
13
+ const result = [];
14
+ type.getDescendantsOfKind(ts_morph_1.SyntaxKind.Identifier).forEach(v => {
15
+ const importDeclaration = this.getImportDeclaration(v.getFullText());
16
+ if (importDeclaration) {
17
+ // console.log(importDeclaration.getModuleSpecifierValue());
18
+ result.push(import_def_1.ImportDef.create(v.getFullText().trim(), importDeclaration));
19
+ }
20
+ });
21
+ return result;
22
+ }
23
+ getImportDeclaration(typeName) {
24
+ // importDecl.getModuleSpecifierSourceFile().getFilePath()
25
+ const baseName = typeName.split('.')[0].trim(); // Page.Criteria we check for Page.
26
+ return this.sourceFile.getImportDeclarations().find(d => {
27
+ const namedImports = d.getNamedImports().map(i => i.getText());
28
+ const result = namedImports.includes(baseName);
29
+ // console.log(`${baseName} in [${namedImports.join(',')}] -> ${result}`);
30
+ return result;
31
+ });
32
+ }
33
+ getObjectLiteralArgument(annotation, position) {
34
+ const args = annotation.getArguments();
35
+ if (args.length > position && args[position] instanceof ts_morph_1.ObjectLiteralExpression) {
36
+ return args[position];
37
+ }
38
+ return null;
39
+ }
40
+ getOptionsArg(annotation, structure, options = {
41
+ position: 0,
42
+ required: true
43
+ }) {
44
+ const objectLiteralArgument = this.getObjectLiteralArgument(annotation, options.position);
45
+ if (!objectLiteralArgument) {
46
+ if (options.required) {
47
+ console.error(`expected object literal arg at position ${options.position}`, { expectedType: structure });
48
+ }
49
+ return structure;
50
+ }
51
+ else {
52
+ return this.scanObjectLiteral(structure, objectLiteralArgument);
53
+ }
54
+ }
55
+ scanObjectLiteral(structure, expression) {
56
+ return Object.keys(structure).reduce((result, key) => {
57
+ // @ts-ignore
58
+ const defaultValue = structure[key];
59
+ const property = expression.getProperty(key);
60
+ if (property) {
61
+ if ((0, lodash_1.isPlainObject)(defaultValue)) {
62
+ const children = property.getChildren();
63
+ const objectLiteral = children[2];
64
+ return Object.assign(Object.assign({}, result), { [key]: this.scanObjectLiteral(defaultValue, objectLiteral) });
65
+ }
66
+ else {
67
+ const pas = property.getStructure();
68
+ if ((0, lodash_1.isArray)(defaultValue)) {
69
+ return Object.assign(Object.assign({}, result), { [pas.name]: (0, source_file_utilities_1.parseArrayLiteralValue)(pas.initializer) });
70
+ }
71
+ else {
72
+ return Object.assign(Object.assign({}, result), { [pas.name]: pas.initializer });
73
+ }
74
+ }
75
+ }
76
+ else {
77
+ if ((0, lodash_1.isPlainObject)(defaultValue)) {
78
+ // todo: add support for checking nested default values.
79
+ return result;
80
+ }
81
+ else {
82
+ return (0, lodash_1.isNil)(defaultValue) ? result : Object.assign(Object.assign({}, result), { [key]: defaultValue });
83
+ }
84
+ }
85
+ }, {});
86
+ }
87
+ }
88
+ exports.SourceFileScanner = SourceFileScanner;
89
+ //# sourceMappingURL=source-file-scanner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-file-scanner.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/utils/source-file-scanner.ts"],"names":[],"mappings":";;;AACA,mCAAuD;AACvD,uCAQkB;AAElB,6CAAyC;AACzC,mEAAiE;AAEjE,MAAa,iBAAiB;IAE5B,YAAqB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAC3C,CAAC;IAGD,cAAc,CAAC,IAAc;QAC3B,MAAM,MAAM,GAAgB,EAAE,CAAC;QAC/B,IAAI,CAAC,oBAAoB,CAAC,qBAAU,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAC3D,MAAM,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;YACrE,IAAI,iBAAiB,EAAE;gBACrB,4DAA4D;gBAC5D,MAAM,CAAC,IAAI,CAAC,sBAAS,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC;aAC1E;QACH,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,oBAAoB,CAAC,QAAgB;QACnC,0DAA0D;QAC1D,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,mCAAmC;QACnF,OAAO,IAAI,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,IAAI,CAAC,CAAC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MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;YACpC,MAAM,QAAQ,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;YAC7C,IAAI,QAAQ,EAAE;gBACZ,IAAI,IAAA,sBAAa,EAAC,YAAY,CAAC,EAAE;oBAC/B,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;oBACxC,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAA4B,CAAC;oBAC7D,uCAAY,MAAM,KAAE,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,aAAa,CAAC,IAAG;iBAClF;qBAAM;oBACL,MAAM,GAAG,GAAG,QAAQ,CAAC,YAAY,EAAiC,CAAC;oBACnE,IAAI,IAAA,gBAAO,EAAC,YAAY,CAAC,EAAE;wBACzB,uCAAY,MAAM,KAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAA,8CAAsB,EAAC,GAAG,CAAC,WAAqB,CAAC,IAAG;qBACrF;yBAAM;wBACL,uCAAY,MAAM,KAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,WAAqB,IAAG;qBAC7D;iBACF;aACF;iBAAM;gBACL,IAAI,IAAA,sBAAa,EAAC,YAAY,CAAC,EAAE;oBAC/B,wDAAwD;oBACxD,OAAO,MAAM,CAAC;iBACf;qBAAM;oBACL,OAAO,IAAA,cAAK,EAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,iCAAM,MAAM,KAAE,CAAC,GAAG,CAAC,EAAE,YAAY,GAAE,CAAC;iBAC1E;aACF;QACH,CAAC,EAAE,EAAO,CAAC,CAAC;IAEd,CAAC;CAGF;AAnFD,8CAmFC"}
@@ -0,0 +1,6 @@
1
+ import { ClassDeclaration, Decorator, Node, ts, Type } from 'ts-morph';
2
+ export declare function isDecoratorNode(node: Node, name: string): node is Decorator;
3
+ export declare function stripEnclosingQuotes(value: string): string;
4
+ export declare function parseArrayLiteralValue(value: string): string[];
5
+ export declare function findClassDecoratorNode(classDecl: ClassDeclaration, decoratorName: string): Decorator;
6
+ export declare function stripImports(type: Type<ts.Type>): string;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stripImports = exports.findClassDecoratorNode = exports.parseArrayLiteralValue = exports.stripEnclosingQuotes = exports.isDecoratorNode = void 0;
4
+ const lodash_1 = require("lodash");
5
+ const ts_morph_1 = require("ts-morph");
6
+ function isDecoratorNode(node, name) {
7
+ return node.getKind() === ts_morph_1.SyntaxKind.Decorator &&
8
+ node.getText().startsWith(`${name}(`); // NOTE: I'm only supporting the @Decorator(...) style of usage (i.e. decorator factories).
9
+ }
10
+ exports.isDecoratorNode = isDecoratorNode;
11
+ function stripEnclosingQuotes(value) {
12
+ return (0, lodash_1.isNil)(value) ? value : value.replace(/(^["'])|(["']$)/g, '');
13
+ }
14
+ exports.stripEnclosingQuotes = stripEnclosingQuotes;
15
+ function parseArrayLiteralValue(value) {
16
+ return value ? stripEnclosingQuotes(value).trim().slice(1, -1).split(',').map(s => stripEnclosingQuotes(s.trim())) : [];
17
+ }
18
+ exports.parseArrayLiteralValue = parseArrayLiteralValue;
19
+ function findClassDecoratorNode(classDecl, decoratorName) {
20
+ let result = null;
21
+ classDecl.forEachChild((node) => {
22
+ if (isDecoratorNode(node, decoratorName)) {
23
+ result = node;
24
+ // stop iterating when the node is a class declaration
25
+ return true;
26
+ }
27
+ });
28
+ return result;
29
+ }
30
+ exports.findClassDecoratorNode = findClassDecoratorNode;
31
+ function stripImports(type) {
32
+ return type.getText().replace(/import\([^\)]+\)\./g, '');
33
+ }
34
+ exports.stripImports = stripImports;
35
+ //# sourceMappingURL=source-file-utilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-file-utilities.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/utils/source-file-utilities.ts"],"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C,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
+ constructor(value) {
9
+ this.value = value;
10
+ }
11
+ static from(value) {
12
+ const base = ALL_CAPS.test(value) ? value.toLowerCase() : value;
13
+ return new Stringy(base);
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;IAOlB,YAA6B,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAC1C,CAAC;IAND,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;IAKD,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,2 @@
1
+ import { Rule, Tree } from '@angular-devkit/schematics';
2
+ export declare function applyTemplatesWithOverwrite(tree: Tree, templateUrl: string, templateData: object, outDir: string): Rule;
@@ -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
+ constructor(schema, tree, context) {
7
+ this.schema = schema;
8
+ this.tree = tree;
9
+ this.context = context;
10
+ }
11
+ get defaultProject() {
12
+ return this.schema.defaultProject;
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;IAMpB,YAAqB,MAAW,EAAW,IAAU,EAAW,OAAyB;QAApE,WAAM,GAAN,MAAM,CAAK;QAAW,SAAI,GAAJ,IAAI,CAAM;QAAW,YAAO,GAAP,OAAO,CAAkB;IACzF,CAAC;IALD,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;IACpC,CAAC;IAKD,MAAM,CAAC,IAAI,CAAC,IAAU,EAAE,QAA0B;QAChD,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACnD,IAAI,CAAC,eAAe,EAAE;YACpB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;SACnE;QACD,MAAM,gBAAgB,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC;QACpD,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IACrE,CAAC;IAED,UAAU,CAAC,WAAmB;QAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAClE,OAAO,QAAQ,CAAC,WAAW,KAAK,KAAK,CAAC,CAAC;YACrC,IAAI,C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