@fundamental-ngx/core 0.58.0-rc.66 → 0.58.0-rc.68

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 (46) hide show
  1. package/package.json +26 -26
  2. package/schematics/add-animations/index.d.ts +0 -7
  3. package/schematics/add-animations/index.js +0 -83
  4. package/schematics/add-animations/index.js.map +0 -1
  5. package/schematics/add-animations/schema.json +0 -21
  6. package/schematics/add-dependencies/index.d.ts +0 -7
  7. package/schematics/add-dependencies/index.js +0 -105
  8. package/schematics/add-dependencies/index.js.map +0 -1
  9. package/schematics/add-dependencies/schema.json +0 -15
  10. package/schematics/add-styles/index.d.ts +0 -7
  11. package/schematics/add-styles/index.js +0 -97
  12. package/schematics/add-styles/index.js.map +0 -1
  13. package/schematics/add-styles/schema.json +0 -21
  14. package/schematics/add-theming/index.d.ts +0 -7
  15. package/schematics/add-theming/index.js +0 -108
  16. package/schematics/add-theming/index.js.map +0 -1
  17. package/schematics/add-theming/schema.json +0 -72
  18. package/schematics/collection.json +0 -40
  19. package/schematics/models/schema.d.ts +0 -6
  20. package/schematics/models/schema.js +0 -3
  21. package/schematics/models/schema.js.map +0 -1
  22. package/schematics/ng-add/index.d.ts +0 -9
  23. package/schematics/ng-add/index.js +0 -30
  24. package/schematics/ng-add/index.js.map +0 -1
  25. package/schematics/ng-add/schema.json +0 -84
  26. package/schematics/utils/calls-providers-function.d.ts +0 -11
  27. package/schematics/utils/calls-providers-function.js +0 -54
  28. package/schematics/utils/calls-providers-function.js.map +0 -1
  29. package/schematics/utils/file-utils.d.ts +0 -2
  30. package/schematics/utils/file-utils.js +0 -26
  31. package/schematics/utils/file-utils.js.map +0 -1
  32. package/schematics/utils/main-ts-file-path.d.ts +0 -2
  33. package/schematics/utils/main-ts-file-path.js +0 -27
  34. package/schematics/utils/main-ts-file-path.js.map +0 -1
  35. package/schematics/utils/ng-module-utils.d.ts +0 -6
  36. package/schematics/utils/ng-module-utils.js +0 -71
  37. package/schematics/utils/ng-module-utils.js.map +0 -1
  38. package/schematics/utils/one-time-packages.d.ts +0 -6
  39. package/schematics/utils/one-time-packages.js +0 -39
  40. package/schematics/utils/one-time-packages.js.map +0 -1
  41. package/schematics/utils/package-utils.d.ts +0 -10
  42. package/schematics/utils/package-utils.js +0 -25
  43. package/schematics/utils/package-utils.js.map +0 -1
  44. package/schematics/utils/workspace.d.ts +0 -40
  45. package/schematics/utils/workspace.js +0 -110
  46. package/schematics/utils/workspace.js.map +0 -1
@@ -1,72 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "fundamental-ngx-add-theming",
4
- "title": "Fundamental Library for Angular add-theming schematic",
5
- "type": "object",
6
- "properties": {
7
- "project": {
8
- "type": "string",
9
- "description": "The name of the project.",
10
- "$default": {
11
- "$source": "projectName"
12
- }
13
- },
14
- "theme": {
15
- "description": "The theme to apply",
16
- "type": "string",
17
- "default": "sap_horizon",
18
- "x-prompt": {
19
- "message": "Choose a prebuilt theme name, or \"custom\" for a custom theme for later configuration:",
20
- "type": "list",
21
- "items": [
22
- {
23
- "value": "sap_horizon",
24
- "label": "Morning Horizon (Light) [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_horizon]"
25
- },
26
- {
27
- "value": "sap_horizon_dark",
28
- "label": "Evening Horizon (Dark) [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_horizon_dark]"
29
- },
30
- {
31
- "value": "sap_horizon_hcb",
32
- "label": "Horizon High Contrast Black [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_horizon_hcb]"
33
- },
34
- {
35
- "value": "sap_horizon_hcw",
36
- "label": "Horizon High Contrast White [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_horizon_hcw]"
37
- },
38
- {
39
- "value": "sap_fiori_3",
40
- "label": "Quartz Light [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_fiori_3]"
41
- },
42
- {
43
- "value": "sap_fiori_3_dark",
44
- "label": "Quartz Dark [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_fiori_3_dark]"
45
- },
46
- {
47
- "value": "sap_fiori_3_hcb",
48
- "label": "Quartz High Contrast Black [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_fiori_3_hcb]"
49
- },
50
- {
51
- "value": "sap_fiori_3_hcw",
52
- "label": "Quartz High Contrast White [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_fiori_3_hcw]"
53
- },
54
- {
55
- "value": "sap_fiori_3_light_dark",
56
- "label": "Quartz Auto [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_fiori_3_light_dark]"
57
- },
58
- {
59
- "value": "custom",
60
- "label": "Custom - Manual setup"
61
- }
62
- ]
63
- }
64
- },
65
- "readThemeFromURL": {
66
- "type": "boolean",
67
- "default": false,
68
- "description": "Whether to read the theme from the URL.",
69
- "x-prompt": "Read theme from URL? Makes difference if theme is not 'Custom'."
70
- }
71
- }
72
- }
@@ -1,40 +0,0 @@
1
- {
2
- "$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
3
- "schematics": {
4
- "ng-add": {
5
- "description": "Adds @fundamental-ngx/core to the project.",
6
- "factory": "./ng-add/index#ngAdd",
7
- "schema": "./ng-add/schema.json"
8
- },
9
- "proceed-with-schematics": {
10
- "description": "Adds @fundamental-ngx/core to the project.",
11
- "factory": "./ng-add/index#proceedWithSchematics",
12
- "schema": "./ng-add/schema.json",
13
- "private": true
14
- },
15
- "add-dependencies": {
16
- "description": "Adds external libraries as a dependencies for @fundamental-ngx/core",
17
- "factory": "./add-dependencies/index#addDependencies",
18
- "schema": "./add-dependencies/schema.json",
19
- "private": true
20
- },
21
- "add-styles": {
22
- "description": "Adds necessary style files for @fundamental-ngx/core",
23
- "factory": "./add-styles/index#addStyles",
24
- "schema": "./add-styles/schema.json",
25
- "private": true
26
- },
27
- "add-theming": {
28
- "description": "Adds theming capability for @fundamental-ngx/core",
29
- "factory": "./add-theming/index#addTheming",
30
- "schema": "./add-theming/schema.json",
31
- "private": true
32
- },
33
- "add-animations": {
34
- "description": "Adds animations module to the project",
35
- "factory": "./add-animations/index#addAnimations",
36
- "schema": "./add-animations/schema.json",
37
- "private": true
38
- }
39
- }
40
- }
@@ -1,6 +0,0 @@
1
- export interface Schema {
2
- project: string;
3
- animations: boolean;
4
- theme: 'sap_fiori_3' | 'sap_fiori_3_dark' | 'sap_fiori_3_hcb' | 'sap_fiori_3_hcw' | 'sap_fiori_3_light_dark' | 'sap_horizon' | 'sap_horizon_dark' | 'sap_horizon_hcb' | 'sap_horizon_hcw' | 'custom';
5
- readThemeFromURL: boolean;
6
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../libs/core/schematics/models/schema.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { Schema } from '../models/schema';
3
- /**
4
- * Adds dependencies and runs other schematics
5
- * @param options
6
- */
7
- export declare function ngAdd(options: Schema): Rule;
8
- /** Proceed with schematics */
9
- export declare function proceedWithSchematics(options: Schema): Rule;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ngAdd = ngAdd;
4
- exports.proceedWithSchematics = proceedWithSchematics;
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const tasks_1 = require("@angular-devkit/schematics/tasks");
7
- const add_dependencies_1 = require("../add-dependencies");
8
- /**
9
- * Adds dependencies and runs other schematics
10
- * @param options
11
- */
12
- function ngAdd(options) {
13
- return () => (0, schematics_1.chain)([
14
- (0, add_dependencies_1.addDependencies)(options),
15
- (t, ctx) => {
16
- const installTaskId = ctx.addTask(new tasks_1.NodePackageInstallTask());
17
- ctx.addTask(new tasks_1.RunSchematicTask('proceed-with-schematics', options), [installTaskId]);
18
- return t;
19
- }
20
- ]);
21
- }
22
- /** Proceed with schematics */
23
- function proceedWithSchematics(options) {
24
- return (0, schematics_1.chain)([
25
- (0, schematics_1.schematic)('add-animations', options),
26
- (0, schematics_1.schematic)('add-styles', options),
27
- (0, schematics_1.schematic)('add-theming', options)
28
- ]);
29
- }
30
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/core/schematics/ng-add/index.ts"],"names":[],"mappings":";;AASA,sBAUC;AAGD,sDAMC;AA5BD,2DAAoE;AACpE,4DAA4F;AAC5F,0DAAsD;AAGtD;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACjC,OAAO,GAAS,EAAE,CACd,IAAA,kBAAK,EAAC;QACF,IAAA,kCAAe,EAAC,OAAO,CAAC;QACxB,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;YACP,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;YAChE,GAAG,CAAC,OAAO,CAAC,IAAI,wBAAgB,CAAC,yBAAyB,EAAE,OAAO,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;YACvF,OAAO,CAAC,CAAC;QACb,CAAC;KACJ,CAAC,CAAC;AACX,CAAC;AAED,8BAA8B;AAC9B,SAAgB,qBAAqB,CAAC,OAAe;IACjD,OAAO,IAAA,kBAAK,EAAC;QACT,IAAA,sBAAS,EAAC,gBAAgB,EAAE,OAAO,CAAC;QACpC,IAAA,sBAAS,EAAC,YAAY,EAAE,OAAO,CAAC;QAChC,IAAA,sBAAS,EAAC,aAAa,EAAE,OAAO,CAAC;KACpC,CAAC,CAAC;AACP,CAAC"}
@@ -1,84 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "fundamental-ngx-ng-add",
4
- "title": "Fundamental Library for Angular ng-add schematic",
5
- "type": "object",
6
- "properties": {
7
- "project": {
8
- "type": "string",
9
- "description": "The name of the project.",
10
- "$default": {
11
- "$source": "projectName"
12
- }
13
- },
14
- "animations": {
15
- "type": "boolean",
16
- "default": true,
17
- "description": "Whether Angular browser animations should be set up.",
18
- "x-prompt": "Set up browser animations for Fundamental Library for Angular?"
19
- },
20
- "fonts": {
21
- "type": "boolean",
22
- "default": true,
23
- "description": "Whether default fonts from theming should be added to styles file.",
24
- "x-prompt": "Add default font imports into styles file?"
25
- },
26
- "theme": {
27
- "description": "The theme to apply",
28
- "type": "string",
29
- "default": "sap_horizon",
30
- "x-prompt": {
31
- "message": "Choose a prebuilt theme name, or \"custom\" for a custom theme for later configuration:",
32
- "type": "list",
33
- "items": [
34
- {
35
- "value": "sap_horizon",
36
- "label": "Morning Horizon (Light) [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_horizon]"
37
- },
38
- {
39
- "value": "sap_horizon_dark",
40
- "label": "Evening Horizon (Dark) [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_horizon_dark]"
41
- },
42
- {
43
- "value": "sap_horizon_hcb",
44
- "label": "Horizon High Contrast Black [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_horizon_hcb]"
45
- },
46
- {
47
- "value": "sap_horizon_hcw",
48
- "label": "Horizon High Contrast White [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_horizon_hcw]"
49
- },
50
- {
51
- "value": "sap_fiori_3",
52
- "label": "Quartz Light [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_fiori_3]"
53
- },
54
- {
55
- "value": "sap_fiori_3_dark",
56
- "label": "Quartz Dark [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_fiori_3_dark]"
57
- },
58
- {
59
- "value": "sap_fiori_3_hcb",
60
- "label": "Quartz High Contrast Black [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_fiori_3_hcb]"
61
- },
62
- {
63
- "value": "sap_fiori_3_hcw",
64
- "label": "Quartz High Contrast White [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_fiori_3_hcw]"
65
- },
66
- {
67
- "value": "sap_fiori_3_light_dark",
68
- "label": "Quartz Auto [Preview: https://sap.github.io/fundamental-ngx/#/core/home?theme=sap_fiori_3_light_dark]"
69
- },
70
- {
71
- "value": "custom",
72
- "label": "Custom - Manual setup"
73
- }
74
- ]
75
- }
76
- },
77
- "readThemeFromURL": {
78
- "type": "boolean",
79
- "default": false,
80
- "description": "Whether to read the theme from the URL.",
81
- "x-prompt": "Read theme from URL? Makes difference if theme is not 'Custom'."
82
- }
83
- }
84
- }
@@ -1,11 +0,0 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- import * as ts from 'typescript';
3
- export declare function callsProvidersFunction(tree: Tree, projectName: string, functionName: string): Promise<boolean>;
4
- /**
5
- * Checks whether a providers function is being called in a `bootstrapApplication` call.
6
- * @param tree File tree of the project.
7
- * @param bootstrapCall Call to `bootstrapApplication`
8
- * @param filePath Path of the file in which to check.
9
- * @param functionName Name of the function to search for.
10
- */
11
- export declare function callsProvidersFunctionStandalone(tree: Tree, bootstrapCall: ts.CallExpression, filePath: string, functionName: string): boolean;
@@ -1,54 +0,0 @@
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.callsProvidersFunction = callsProvidersFunction;
13
- exports.callsProvidersFunctionStandalone = callsProvidersFunctionStandalone;
14
- const schematics_1 = require("@angular-devkit/schematics");
15
- const schematics_2 = require("@angular/cdk/schematics");
16
- const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
17
- const app_config_1 = require("@schematics/angular/utility/standalone/app_config");
18
- const util_1 = require("@schematics/angular/utility/standalone/util");
19
- const ts = require("typescript");
20
- const main_ts_file_path_1 = require("./main-ts-file-path");
21
- function callsProvidersFunction(tree, projectName, functionName) {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- const mainPath = yield (0, main_ts_file_path_1.getMainTsFilePath)(tree, projectName);
24
- const isStandalone = (0, schematics_2.isStandaloneApp)(tree, mainPath);
25
- if (isStandalone) {
26
- const bootstrapCall = (0, util_1.findBootstrapApplicationCall)(tree, mainPath);
27
- return callsProvidersFunctionStandalone(tree, bootstrapCall, mainPath, functionName);
28
- }
29
- return callsProvidersFunctionNgModule(tree, mainPath, functionName);
30
- });
31
- }
32
- /**
33
- * Checks whether a providers function is being called in a `bootstrapApplication` call.
34
- * @param tree File tree of the project.
35
- * @param bootstrapCall Call to `bootstrapApplication`
36
- * @param filePath Path of the file in which to check.
37
- * @param functionName Name of the function to search for.
38
- */
39
- function callsProvidersFunctionStandalone(tree, bootstrapCall, filePath, functionName) {
40
- const appConfig = (0, app_config_1.findAppConfig)(bootstrapCall, tree, filePath);
41
- const providersLiteral = appConfig ? (0, util_1.findProvidersLiteral)(appConfig.node) : null;
42
- return !!(providersLiteral === null || providersLiteral === void 0 ? void 0 : providersLiteral.elements.some((el) => ts.isCallExpression(el) && ts.isIdentifier(el.expression) && el.expression.text === functionName));
43
- }
44
- function callsProvidersFunctionNgModule(tree, mainPath, functionName) {
45
- const appModulePath = (0, schematics_2.getAppModulePath)(tree, mainPath);
46
- const appModuleSource = (0, util_1.getSourceFile)(tree, appModulePath);
47
- const ngModuleDecorator = (0, ast_utils_1.getDecoratorMetadata)(appModuleSource, 'NgModule', '@angular/core');
48
- if (!ngModuleDecorator.length) {
49
- throw new schematics_1.SchematicsException(`❌ App module declaration not found.`);
50
- }
51
- const providersLiteral = (0, util_1.findProvidersLiteral)(ngModuleDecorator[0]);
52
- return !!(providersLiteral === null || providersLiteral === void 0 ? void 0 : providersLiteral.elements.some((el) => ts.isCallExpression(el) && ts.isIdentifier(el.expression) && el.expression.text === functionName));
53
- }
54
- //# sourceMappingURL=calls-providers-function.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calls-providers-function.js","sourceRoot":"","sources":["../../../../../libs/core/schematics/utils/calls-providers-function.ts"],"names":[],"mappings":";;;;;;;;;;;AAYA,wDAQC;AASD,4EAYC;AAzCD,2DAAuE;AACvE,wDAA4E;AAC5E,qEAA6E;AAC7E,kFAAkF;AAClF,sEAIqD;AACrD,iCAAiC;AACjC,2DAAwD;AAExD,SAAsB,sBAAsB,CAAC,IAAU,EAAE,WAAmB,EAAE,YAAoB;;QAC9F,MAAM,QAAQ,GAAG,MAAM,IAAA,qCAAiB,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAC5D,MAAM,YAAY,GAAG,IAAA,4BAAe,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACrD,IAAI,YAAY,EAAE,CAAC;YACf,MAAM,aAAa,GAAG,IAAA,mCAA4B,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YACnE,OAAO,gCAAgC,CAAC,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;QACzF,CAAC;QACD,OAAO,8BAA8B,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;IACxE,CAAC;CAAA;AAED;;;;;;GAMG;AACH,SAAgB,gCAAgC,CAC5C,IAAU,EACV,aAAgC,EAChC,QAAgB,EAChB,YAAoB;IAEpB,MAAM,SAAS,GAAG,IAAA,0BAAa,EAAC,aAAa,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/D,MAAM,gBAAgB,GAAG,SAAS,CAAC,CAAC,CAAC,IAAA,2BAAoB,EAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IA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
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findStylesheetFiles = findStylesheetFiles;
4
- const core_1 = require("@angular-devkit/core");
5
- const STYLESHEET_REGEX = /.*\.(css|scss|less|sass)/;
6
- function findStylesheetFiles(tree, startDirectory = '/') {
7
- const result = [];
8
- const visitDir = (dirPath) => {
9
- const { subfiles, subdirs } = tree.getDir(dirPath);
10
- subfiles.forEach((fileName) => {
11
- if (STYLESHEET_REGEX.test(fileName)) {
12
- result.push((0, core_1.join)(dirPath, fileName));
13
- }
14
- });
15
- // Visit directories within the current directory to find other stylesheets.
16
- subdirs.forEach((fragment) => {
17
- // Do not visit directories or files inside node modules or `dist/` folders.
18
- if (fragment !== 'node_modules' && fragment !== 'dist') {
19
- visitDir((0, core_1.join)(dirPath, fragment));
20
- }
21
- });
22
- };
23
- visitDir(startDirectory);
24
- return result;
25
- }
26
- //# sourceMappingURL=file-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-utils.js","sourceRoot":"","sources":["../../../../../libs/core/schematics/utils/file-utils.ts"],"names":[],"mappings":";;AAKA,kDAqBC;AA1BD,+CAAkD;AAGlD,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAEpD,SAAgB,mBAAmB,CAAC,IAAU,EAAE,iBAAyB,GAAG;IACxE,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAG,CAAC,OAAa,EAAQ,EAAE;QACrC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAEnD,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YAC1B,IAAI,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAClC,MAAM,CAAC,IAAI,CAAC,IAAA,WAAI,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;YACzC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,4EAA4E;QAC5E,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YACzB,4EAA4E;YAC5E,IAAI,QAAQ,KAAK,cAAc,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;gBACrD,QAAQ,CAAC,IAAA,WAAI,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;YACtC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;IACF,QAAQ,CAAC,cAAsB,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -1,2 +0,0 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- export declare function getMainTsFilePath(tree: Tree, projectName: string): Promise<string>;
@@ -1,27 +0,0 @@
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.getMainTsFilePath = getMainTsFilePath;
13
- const schematics_1 = require("@angular-devkit/schematics");
14
- const workspace_models_1 = require("@schematics/angular/utility/workspace-models");
15
- const workspace_1 = require("./workspace");
16
- function getMainTsFilePath(tree, projectName) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- const buildTarget = yield (0, workspace_1.getProjectBuildTarget)(tree, projectName);
19
- const options = buildTarget.options;
20
- const mainFilePath = buildTarget.builder === workspace_models_1.Builders.BuildApplication ? options.browser : options.main;
21
- if (!mainFilePath || !tree.exists(mainFilePath)) {
22
- throw new schematics_1.SchematicsException(`Could not find the main file of the project.`);
23
- }
24
- return mainFilePath;
25
- });
26
- }
27
- //# sourceMappingURL=main-ts-file-path.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main-ts-file-path.js","sourceRoot":"","sources":["../../../../../libs/core/schematics/utils/main-ts-file-path.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA,8CAUC;AAdD,2DAAuE;AACvE,mFAAwE;AACxE,2CAAoD;AAEpD,SAAsB,iBAAiB,CAAC,IAAU,EAAE,WAAmB;;QACnE,MAAM,WAAW,GAAG,MAAM,IAAA,iCAAqB,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACnE,MAAM,OAAO,GAAG,WAAW,CAAC,OAAiC,CAAC;QAE9D,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,KAAK,2BAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;QAExG,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;YAC9C,MAAM,IAAI,gCAAmB,CAAC,8CAA8C,CAAC,CAAC;QAClF,CAAC;QACD,OAAO,YAAY,CAAC;IACxB,CAAC;CAAA"}
@@ -1,6 +0,0 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- import { WorkspaceProject, WorkspaceSchema } from '@schematics/angular/utility/workspace-models';
3
- /** Checks if an import is included in the module. */
4
- export declare function hasModuleImport(tree: Tree, modulePath: string, className: string): boolean;
5
- /** Borrowed from Angular CDK */
6
- export declare function getProjectFromWorkspace(workspace: WorkspaceSchema, projectName: string): WorkspaceProject;
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasModuleImport = hasModuleImport;
4
- exports.getProjectFromWorkspace = getProjectFromWorkspace;
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const ts = require("typescript");
7
- /** Checks if an import is included in the module. */
8
- function hasModuleImport(tree, modulePath, className) {
9
- const moduleFileContent = tree.read(modulePath);
10
- if (!moduleFileContent) {
11
- throw new schematics_1.SchematicsException(`Could not read Angular module file: ${modulePath}`);
12
- }
13
- const parsedFile = ts.createSourceFile(modulePath, moduleFileContent.toString(), ts.ScriptTarget.Latest, true);
14
- const ngModuleMetadata = findNgModuleMetadata(parsedFile);
15
- if (!ngModuleMetadata) {
16
- throw new schematics_1.SchematicsException(`Could not find NgModule declaration inside: "${modulePath}"`);
17
- }
18
- for (const property of ngModuleMetadata.properties) {
19
- if (!ts.isPropertyAssignment(property) ||
20
- property.name.getText() !== 'imports' ||
21
- !ts.isArrayLiteralExpression(property.initializer)) {
22
- continue;
23
- }
24
- if (property.initializer.elements.some((element) => element.getText() === className)) {
25
- return true;
26
- }
27
- }
28
- return false;
29
- }
30
- /** Borrowed from Angular CDK */
31
- function findNgModuleMetadata(rootNode) {
32
- // Add immediate child nodes of the root node to the queue.
33
- const nodeQueue = [...rootNode.getChildren()];
34
- while (nodeQueue.length) {
35
- const node = nodeQueue.shift();
36
- if (ts.isDecorator(node) && ts.isCallExpression(node.expression) && isNgModuleCallExpression(node.expression)) {
37
- return node.expression.arguments[0];
38
- }
39
- else {
40
- nodeQueue.push(...node.getChildren());
41
- }
42
- }
43
- return null;
44
- }
45
- /** Borrowed from Angular CDK */
46
- function resolveIdentifierOfExpression(expression) {
47
- if (ts.isIdentifier(expression)) {
48
- return expression;
49
- }
50
- else if (ts.isPropertyAccessExpression(expression) && ts.isIdentifier(expression.name)) {
51
- return expression.name;
52
- }
53
- return null;
54
- }
55
- /** Borrowed from Angular CDK */
56
- function isNgModuleCallExpression(callExpression) {
57
- if (!callExpression.arguments.length || !ts.isObjectLiteralExpression(callExpression.arguments[0])) {
58
- return false;
59
- }
60
- const decoratorIdentifier = resolveIdentifierOfExpression(callExpression.expression);
61
- return decoratorIdentifier ? decoratorIdentifier.text === 'NgModule' : false;
62
- }
63
- /** Borrowed from Angular CDK */
64
- function getProjectFromWorkspace(workspace, projectName) {
65
- const project = workspace.projects[projectName];
66
- if (!project) {
67
- throw new schematics_1.SchematicsException(`Could not find project in workspace: ${projectName}`);
68
- }
69
- return project;
70
- }
71
- //# sourceMappingURL=ng-module-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ng-module-utils.js","sourceRoot":"","sources":["../../../../../libs/core/schematics/utils/ng-module-utils.ts"],"names":[],"mappings":";;AAMA,0CA6BC;AAyCD,0DAQC;AApFD,2DAAuE;AAGvE,iCAAiC;AAEjC,qDAAqD;AACrD,SAAgB,eAAe,CAAC,IAAU,EAAE,UAAkB,EAAE,SAAiB;IAC7E,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAEhD,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACrB,MAAM,IAAI,gCAAmB,CAAC,uCAAuC,UAAU,EAAE,CAAC,CAAC;IACvF,CAAC;IAED,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAAC,UAAU,EAAE,iBAAiB,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC/G,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAE1D,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACpB,MAAM,IAAI,gCAAmB,CAAC,gDAAgD,UAAU,GAAG,CAAC,CAAC;IACjG,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,gBAAiB,CAAC,UAAU,EAAE,CAAC;QAClD,IACI,CAAC,EAAE,CAAC,oBAAoB,CAAC,QAAQ,CAAC;YAClC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,SAAS;YACrC,CAAC,EAAE,CAAC,wBAAwB,CAAC,QAAQ,CAAC,WAAW,CAAC,EACpD,CAAC;YACC,SAAS;QACb,CAAC;QAED,IAAI,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAA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IAAI,CAAC,EAAE,CAAC,yBAAyB,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjG,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,mBAAmB,GAAG,6BAA6B,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IACrF,OAAO,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;AACjF,CAAC;AAED,gCAAgC;AAChC,SAAgB,uBAAuB,CAAC,SAA0B,EAAE,WAAmB;IACnF,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAEhD,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,gCAAmB,CAAC,wCAAwC,WAAW,EAAE,CAAC,CAAC;IACzF,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC"}
@@ -1,6 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- /**
3
- * Adds the packages to the project temporarily.
4
- * @param packagesToInstall
5
- */
6
- export declare function oneTimePackages(packagesToInstall: string[]): [Rule, Rule];
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.oneTimePackages = oneTimePackages;
4
- const tasks_1 = require("@angular-devkit/schematics/tasks");
5
- const dependencies_1 = require("@schematics/angular/utility/dependencies");
6
- /**
7
- * Adds the packages to the project temporarily.
8
- * @param packagesToInstall
9
- */
10
- function oneTimePackages(packagesToInstall) {
11
- const packages = [];
12
- return [
13
- (tree, context) => {
14
- packagesToInstall.forEach((packageName) => {
15
- const packageVersion = (0, dependencies_1.getPackageJsonDependency)(tree, packageName);
16
- if (!packageVersion) {
17
- (0, dependencies_1.addPackageJsonDependency)(tree, {
18
- type: dependencies_1.NodeDependencyType.Dev,
19
- name: packageName,
20
- version: 'latest'
21
- });
22
- packages.push(packageName);
23
- }
24
- });
25
- if (packages.length) {
26
- context.addTask(new tasks_1.NodePackageInstallTask());
27
- }
28
- },
29
- (tree, context) => {
30
- if (packages.length) {
31
- packages.forEach((packageName) => {
32
- (0, dependencies_1.removePackageJsonDependency)(tree, packageName);
33
- });
34
- context.addTask(new tasks_1.NodePackageInstallTask());
35
- }
36
- }
37
- ];
38
- }
39
- //# sourceMappingURL=one-time-packages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"one-time-packages.js","sourceRoot":"","sources":["../../../../../libs/core/schematics/utils/one-time-packages.ts"],"names":[],"mappings":";;AAaA,0CA4BC;AAxCD,4DAA0E;AAC1E,2EAKkD;AAElD;;;GAGG;AACH,SAAgB,eAAe,CAAC,iBAA2B;IACvD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,OAAO;QACH,CAAC,IAAI,EAAE,OAAyB,EAAE,EAAE;YAChC,iBAAiB,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;gBACtC,MAAM,cAAc,GAAG,IAAA,uCAAwB,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;gBACnE,IAAI,CAAC,cAAc,EAAE,CAAC;oBAClB,IAAA,uCAAwB,EAAC,IAAI,EAAE;wBAC3B,IAAI,EAAE,iCAAkB,CAAC,GAAG;wBAC5B,IAAI,EAAE,WAAW;wBACjB,OAAO,EAAE,QAAQ;qBACpB,CAAC,CAAC;oBACH,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC/B,CAAC;YACL,CAAC,CAAC,CAAC;YACH,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAClB,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;YAClD,CAAC;QACL,CAAC;QACD,CAAC,IAAI,EAAE,OAAyB,EAAE,EAAE;YAChC,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAClB,QAAQ,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;oBAC7B,IAAA,0CAA2B,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;gBACnD,CAAC,CAAC,CAAC;gBACH,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;YAClD,CAAC;QACL,CAAC;KACJ,CAAC;AACN,CAAC"}
@@ -1,10 +0,0 @@
1
- import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
2
- import { NodeDependency } from '@schematics/angular/utility/dependencies';
3
- /**
4
- * Add dependencies to the package.json
5
- */
6
- export declare function installDependencies(): Rule;
7
- /**
8
- * Add dependencies to the package.json and log the changes
9
- */
10
- export declare function addPackageDependency(tree: Tree, dep: NodeDependency, ctx?: SchematicContext): void;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.installDependencies = installDependencies;
4
- exports.addPackageDependency = addPackageDependency;
5
- const tasks_1 = require("@angular-devkit/schematics/tasks");
6
- const dependencies_1 = require("@schematics/angular/utility/dependencies");
7
- /**
8
- * Add dependencies to the package.json
9
- */
10
- function installDependencies() {
11
- return (tree, context) => {
12
- context.addTask(new tasks_1.NodePackageInstallTask());
13
- return tree;
14
- };
15
- }
16
- /**
17
- * Add dependencies to the package.json and log the changes
18
- */
19
- function addPackageDependency(tree, dep, ctx) {
20
- (0, dependencies_1.addPackageJsonDependency)(tree, dep);
21
- if (ctx) {
22
- ctx.logger.info(`✅️ Added "${dep.name}" into ${dep.type}`);
23
- }
24
- }
25
- //# sourceMappingURL=package-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-utils.js","sourceRoot":"","sources":["../../../../../libs/core/schematics/utils/package-utils.ts"],"names":[],"mappings":";;AAQA,kDAKC;AAKD,oDAKC;AArBD,4DAA0E;AAC1E,2EAAoG;AAEpG;;GAEG;AACH,SAAgB,mBAAmB;IAC/B,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC7C,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,CAAC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAAC,IAAU,EAAE,GAAmB,EAAE,GAAsB;IACxF,IAAA,uCAAwB,EAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACpC,IAAI,GAAG,EAAE,CAAC;QACN,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,IAAI,UAAU,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/D,CAAC;AACL,CAAC"}
@@ -1,40 +0,0 @@
1
- import { ProjectDefinition } from '@angular-devkit/core/src/workspace';
2
- import { TargetDefinition } from '@angular-devkit/core/src/workspace/definitions';
3
- import { Tree } from '@angular-devkit/schematics';
4
- import { WorkspaceDefinition } from '@schematics/angular/utility';
5
- /**
6
- * Clears the cached workspace.
7
- */
8
- export declare function clearWorkspaceCache(): void;
9
- /**
10
- * Gets the cached workspace definition.
11
- * @param tree
12
- */
13
- export declare function getWorkspaceDefinition(tree: Tree): Promise<WorkspaceDefinition>;
14
- /**
15
- * Gets the project definition for the given project name.
16
- * @param tree
17
- * @param projectName
18
- */
19
- export declare function getProjectDefinition(tree: Tree, projectName: string): Promise<ProjectDefinition>;
20
- /** Gets the build target name for the given project. */
21
- export declare function getProjectBuildTargetName(tree: Tree, projectName: string): Promise<string>;
22
- /**
23
- * Gets the build target for the given project name.
24
- * @param tree
25
- * @param projectName
26
- */
27
- export declare function getProjectBuildTarget(tree: Tree, projectName: string): Promise<TargetDefinition>;
28
- /**
29
- * Updates the project definition for the given project name.
30
- * @param tree
31
- * @param projectName
32
- * @param updatedProject
33
- */
34
- export declare function updateProjectDefinition(tree: Tree, projectName: string, updatedProject: ProjectDefinition): Promise<void>;
35
- /**
36
- * Updates the workspace definition.
37
- * @param tree
38
- * @param updatedWorkspace
39
- */
40
- export declare function updateWorkspaceDefinition(tree: Tree, updatedWorkspace: WorkspaceDefinition): Promise<void>;