devextreme-schematics 1.2.23 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. package/LICENSE +21 -21
  2. package/package.json +7 -7
  3. package/src/add-app-template/index.d.ts +2 -2
  4. package/src/add-app-template/index.js +26 -26
  5. package/src/add-app-template/index_spec.d.ts +1 -1
  6. package/src/add-app-template/index_spec.js +70 -69
  7. package/src/add-app-template/index_spec.js.map +1 -1
  8. package/src/add-app-template/schema.json +2 -2
  9. package/src/add-layout/files/devextreme.json +1 -1
  10. package/src/add-layout/files/src/app/shared/services/screen.service.ts +1 -1
  11. package/src/add-layout/files/src/dx-styles.scss +4 -0
  12. package/src/add-layout/index.d.ts +2 -2
  13. package/src/add-layout/index.js +277 -266
  14. package/src/add-layout/index.js.map +1 -1
  15. package/src/add-layout/index.ts +28 -30
  16. package/src/add-layout/index_spec.d.ts +1 -1
  17. package/src/add-layout/index_spec.js +251 -250
  18. package/src/add-layout/index_spec.js.map +1 -1
  19. package/src/add-layout/index_spec.ts +2 -2
  20. package/src/add-layout/schema.json +2 -2
  21. package/src/add-sample-views/index.d.ts +2 -2
  22. package/src/add-sample-views/index.js +97 -88
  23. package/src/add-sample-views/index.js.map +1 -1
  24. package/src/add-sample-views/index.ts +3 -3
  25. package/src/add-sample-views/index_spec.d.ts +1 -1
  26. package/src/add-sample-views/index_spec.js +53 -52
  27. package/src/add-sample-views/index_spec.js.map +1 -1
  28. package/src/add-sample-views/index_spec.ts +1 -1
  29. package/src/add-sample-views/schema.json +1 -1
  30. package/src/add-view/index.d.ts +3 -3
  31. package/src/add-view/index.js +125 -113
  32. package/src/add-view/index.js.map +1 -1
  33. package/src/add-view/index.ts +14 -13
  34. package/src/add-view/index_spec.d.ts +1 -1
  35. package/src/add-view/index_spec.js +109 -108
  36. package/src/add-view/index_spec.js.map +1 -1
  37. package/src/add-view/schema.json +1 -1
  38. package/src/install/index.d.ts +2 -2
  39. package/src/install/index.js +76 -63
  40. package/src/install/index.js.map +1 -1
  41. package/src/install/index.ts +4 -2
  42. package/src/install/index_spec.d.ts +1 -1
  43. package/src/install/index_spec.js +96 -95
  44. package/src/install/index_spec.js.map +1 -1
  45. package/src/install/index_spec.ts +1 -1
  46. package/src/install/schema.json +1 -1
  47. package/src/utility/array.d.ts +1 -1
  48. package/src/utility/array.js +7 -6
  49. package/src/utility/array.js.map +1 -1
  50. package/src/utility/change.d.ts +7 -7
  51. package/src/utility/change.js +49 -48
  52. package/src/utility/change.js.map +1 -1
  53. package/src/utility/latest-versions.d.ts +5 -5
  54. package/src/utility/latest-versions.js +9 -8
  55. package/src/utility/latest-versions.js.map +1 -1
  56. package/src/utility/modify-json-file.d.ts +3 -2
  57. package/src/utility/modify-json-file.js +15 -11
  58. package/src/utility/modify-json-file.js.map +1 -1
  59. package/src/utility/modify-json-file.ts +6 -3
  60. package/src/utility/project.d.ts +5 -5
  61. package/src/utility/project.js +48 -25
  62. package/src/utility/project.js.map +1 -1
  63. package/src/utility/project.ts +19 -14
  64. package/src/utility/routing.d.ts +4 -4
  65. package/src/utility/routing.js +32 -31
  66. package/src/utility/routing.js.map +1 -1
  67. package/src/utility/source.d.ts +3 -3
  68. package/src/utility/source.js +13 -12
  69. package/src/utility/source.js.map +1 -1
  70. package/src/utility/string.d.ts +1 -1
  71. package/src/utility/string.js +8 -7
  72. package/src/utility/string.js.map +1 -1
  73. package/src/utility/styles.d.ts +1 -2
  74. package/src/utility/styles.js +29 -30
  75. package/src/utility/styles.js.map +1 -1
  76. package/src/utility/styles.ts +2 -5
@@ -1,9 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // TODO: implement
4
- exports.latestVersions = {
5
- 'devextreme': '^21.2.4',
6
- 'devextreme-angular': '^21.2.4',
7
- 'devextreme-cli': 'latest'
8
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.latestVersions = void 0;
4
+ // TODO: implement
5
+ exports.latestVersions = {
6
+ 'devextreme': '^21.2.4',
7
+ 'devextreme-angular': '^21.2.4',
8
+ 'devextreme-cli': 'latest'
9
+ };
9
10
  //# sourceMappingURL=latest-versions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"latest-versions.js","sourceRoot":"","sources":["latest-versions.ts"],"names":[],"mappings":";;AAAA,kBAAkB;AACL,QAAA,cAAc,GAAG;IAC5B,YAAY,EAAE,SAAS;IACvB,oBAAoB,EAAE,SAAS;IAC/B,gBAAgB,EAAE,QAAQ;CAC3B,CAAC"}
1
+ {"version":3,"file":"latest-versions.js","sourceRoot":"","sources":["latest-versions.ts"],"names":[],"mappings":";;;AAAA,kBAAkB;AACL,QAAA,cAAc,GAAG;IAC5B,YAAY,EAAE,SAAS;IACvB,oBAAoB,EAAE,SAAS;IAC/B,gBAAgB,EAAE,QAAQ;CAC3B,CAAC"}
@@ -1,2 +1,3 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- export declare function modifyJSONFile(host: Tree, path: string, callback: (obj: any) => any): import("@angular-devkit/schematics/src/tree/interface").Tree;
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ export declare const parseJson: (str: string) => any;
3
+ export declare function modifyJSONFile(host: Tree, path: string, callback: (obj: any) => any): import("@angular-devkit/schematics/src/tree/interface").Tree;
@@ -1,12 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- function modifyJSONFile(host, path, callback) {
4
- let serializedConfig = host.read(path).toString();
5
- serializedConfig = serializedConfig.replace(/\/\*[\S\s]+?\*\/\r?\n/g, '');
6
- let obj = JSON.parse(serializedConfig);
7
- obj = callback(obj);
8
- host.overwrite(path, `${JSON.stringify(obj, null, 2)}\n`);
9
- return host;
10
- }
11
- exports.modifyJSONFile = modifyJSONFile;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.modifyJSONFile = exports.parseJson = void 0;
4
+ const parseJson = (str) => {
5
+ return JSON.parse(str.replace(/\/\*[\S\s]+?\*\/\r?\n/g, ''));
6
+ };
7
+ exports.parseJson = parseJson;
8
+ function modifyJSONFile(host, path, callback) {
9
+ const serializedConfig = host.read(path).toString();
10
+ let obj = exports.parseJson(serializedConfig);
11
+ obj = callback(obj);
12
+ host.overwrite(path, `${JSON.stringify(obj, null, 2)}\n`);
13
+ return host;
14
+ }
15
+ exports.modifyJSONFile = modifyJSONFile;
12
16
  //# sourceMappingURL=modify-json-file.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modify-json-file.js","sourceRoot":"","sources":["modify-json-file.ts"],"names":[],"mappings":";;AAEA,SAAgB,cAAc,CAAC,IAAU,EAAE,IAAY,EAAE,QAA2B;IAClF,IAAI,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAE,CAAC,QAAQ,EAAE,CAAC;IACnD,gBAAgB,GAAG,gBAAgB,CAAC,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;IAC1E,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAEvC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAEpB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAE1D,OAAO,IAAI,CAAC;AACd,CAAC;AAVD,wCAUC"}
1
+ {"version":3,"file":"modify-json-file.js","sourceRoot":"","sources":["modify-json-file.ts"],"names":[],"mappings":";;;AAEO,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEF,SAAgB,cAAc,CAAC,IAAU,EAAE,IAAY,EAAE,QAA2B;IAClF,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAE,CAAC,QAAQ,EAAE,CAAC;IACrD,IAAI,GAAG,GAAG,iBAAS,CAAC,gBAAgB,CAAC,CAAC;IAEtC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAEpB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAE1D,OAAO,IAAI,CAAC;AACd,CAAC;AATD,wCASC"}
@@ -1,9 +1,12 @@
1
1
  import { Tree } from '@angular-devkit/schematics';
2
2
 
3
+ export const parseJson = (str: string) => {
4
+ return JSON.parse(str.replace(/\/\*[\S\s]+?\*\/\r?\n/g, ''));
5
+ };
6
+
3
7
  export function modifyJSONFile(host: Tree, path: string, callback: (obj: any) => any) {
4
- let serializedConfig = host.read(path)!.toString();
5
- serializedConfig = serializedConfig.replace(/\/\*[\S\s]+?\*\/\r?\n/g, '');
6
- let obj = JSON.parse(serializedConfig);
8
+ const serializedConfig = host.read(path)!.toString();
9
+ let obj = parseJson(serializedConfig);
7
10
 
8
11
  obj = callback(obj);
9
12
 
@@ -1,5 +1,5 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- export declare function getProjectName(host: Tree, project: any): any;
3
- export declare function getApplicationPath(host: Tree, projectName: string): string;
4
- export declare function getSourceRootPath(host: Tree, projectName: string): string;
5
- export declare function getRootPath(host: Tree, projectName: string): string;
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ export declare function getProjectName(host: Tree, projectName: string): Promise<string>;
3
+ export declare function getApplicationPath(host: Tree, projectName: string): Promise<string>;
4
+ export declare function getSourceRootPath(host: Tree, projectName: string): Promise<string | undefined>;
5
+ export declare function getRootPath(host: Tree, projectName: string): Promise<string | undefined>;
@@ -1,26 +1,49 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const config_1 = require("@schematics/angular/utility/config");
4
- function getProjectName(host, project) {
5
- const projectName = project;
6
- const workspace = config_1.getWorkspace(host);
7
- const projects = Object.keys(workspace.projects);
8
- return projectName && projects.indexOf(projectName) > -1 ? projectName : workspace.defaultProject;
9
- }
10
- exports.getProjectName = getProjectName;
11
- function getApplicationPath(host, projectName) {
12
- const sourcePath = getSourceRootPath(host, projectName);
13
- return sourcePath ? `${sourcePath}/app/` : 'src/app/';
14
- }
15
- exports.getApplicationPath = getApplicationPath;
16
- function getSourceRootPath(host, projectName) {
17
- const project = config_1.getWorkspace(host).projects[projectName];
18
- return project.sourceRoot || project.root;
19
- }
20
- exports.getSourceRootPath = getSourceRootPath;
21
- function getRootPath(host, projectName) {
22
- const project = config_1.getWorkspace(host).projects[projectName];
23
- return project.root;
24
- }
25
- exports.getRootPath = getRootPath;
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.getRootPath = exports.getSourceRootPath = exports.getApplicationPath = exports.getProjectName = void 0;
13
+ const workspace_1 = require("@schematics/angular/utility/workspace");
14
+ function getProjectName(host, projectName) {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ const projects = [];
17
+ const workspace = yield workspace_1.getWorkspace(host);
18
+ /* tslint:disable-next-line:variable-name */
19
+ workspace.projects.forEach((_v, k) => {
20
+ projects.push(k);
21
+ });
22
+ return projectName && projects.includes(projectName) ? projectName : projects[0];
23
+ });
24
+ }
25
+ exports.getProjectName = getProjectName;
26
+ function getApplicationPath(host, projectName) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ const sourcePath = yield getSourceRootPath(host, projectName);
29
+ return sourcePath ? `${sourcePath}/app/` : 'src/app/';
30
+ });
31
+ }
32
+ exports.getApplicationPath = getApplicationPath;
33
+ function getSourceRootPath(host, projectName) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ const workspace = yield workspace_1.getWorkspace(host);
36
+ const project = workspace.projects.get(projectName);
37
+ return project && (project.sourceRoot || project.root);
38
+ });
39
+ }
40
+ exports.getSourceRootPath = getSourceRootPath;
41
+ function getRootPath(host, projectName) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const workspace = yield workspace_1.getWorkspace(host);
44
+ const project = workspace.projects.get(projectName);
45
+ return project && project.root;
46
+ });
47
+ }
48
+ exports.getRootPath = getRootPath;
26
49
  //# sourceMappingURL=project.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"project.js","sourceRoot":"","sources":["project.ts"],"names":[],"mappings":";;AACA,+DAAkE;AAElE,SAAgB,cAAc,CAAC,IAAU,EAAE,OAAY;IACrD,MAAM,WAAW,GAAG,OAAO,CAAC;IAC5B,MAAM,SAAS,GAAG,qBAAY,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAEjD,OAAO,WAAW,IAAI,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC;AACpG,CAAC;AAND,wCAMC;AAED,SAAgB,kBAAkB,CAAC,IAAU,EAAE,WAAmB;IAChE,MAAM,UAAU,GAAG,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACxD,OAAO,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;AACxD,CAAC;AAHD,gDAGC;AAED,SAAgB,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AAU,EAAE,WAAmB;;QACrE,MAAM,SAAS,GAAG,MAAM,wBAAY,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC;CAAA;AAJD,8CAIC;AAED,SAAsB,WAAW,CAAC,IAAU,EAAE,WAAmB;;QAC/D,MAAM,SAAS,GAAG,MAAM,wBAAY,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IACjC,CAAC;CAAA;AAJD,kCAIC"}
@@ -1,25 +1,30 @@
1
1
  import { Tree } from '@angular-devkit/schematics';
2
- import { getWorkspace } from '@schematics/angular/utility/config';
2
+ import { getWorkspace } from '@schematics/angular/utility/workspace';
3
3
 
4
- export function getProjectName(host: Tree, project: any) {
5
- const projectName = project;
6
- const workspace = getWorkspace(host);
7
- const projects = Object.keys(workspace.projects);
4
+ export async function getProjectName(host: Tree, projectName: string) {
5
+ const projects: string[] = [];
6
+ const workspace = await getWorkspace(host);
7
+ /* tslint:disable-next-line:variable-name */
8
+ workspace.projects.forEach((_v, k) => {
9
+ projects.push(k);
10
+ });
8
11
 
9
- return projectName && projects.indexOf(projectName) > -1 ? projectName : workspace.defaultProject;
12
+ return projectName && projects.includes(projectName) ? projectName : projects[0];
10
13
  }
11
14
 
12
- export function getApplicationPath(host: Tree, projectName: string) {
13
- const sourcePath = getSourceRootPath(host, projectName);
15
+ export async function getApplicationPath(host: Tree, projectName: string) {
16
+ const sourcePath = await getSourceRootPath(host, projectName);
14
17
  return sourcePath ? `${sourcePath}/app/` : 'src/app/';
15
18
  }
16
19
 
17
- export function getSourceRootPath(host: Tree, projectName: string) {
18
- const project = getWorkspace(host).projects[projectName];
19
- return project.sourceRoot || project.root;
20
+ export async function getSourceRootPath(host: Tree, projectName: string) {
21
+ const workspace = await getWorkspace(host);
22
+ const project = workspace.projects.get(projectName);
23
+ return project && (project.sourceRoot || project.root);
20
24
  }
21
25
 
22
- export function getRootPath(host: Tree, projectName: string) {
23
- const project = getWorkspace(host).projects[projectName];
24
- return project.root;
26
+ export async function getRootPath(host: Tree, projectName: string) {
27
+ const workspace = await getWorkspace(host);
28
+ const project = workspace.projects.get(projectName);
29
+ return project && project.root;
25
30
  }
@@ -1,4 +1,4 @@
1
- import { Node, SourceFile } from 'typescript';
2
- export declare function hasComponentInRoutes(routes: Node, name: string): boolean;
3
- export declare function getRoute(name: string): string;
4
- export declare function findRoutesInSource(source: SourceFile): Node | undefined;
1
+ import { Node, SourceFile } from 'typescript';
2
+ export declare function hasComponentInRoutes(routes: Node, name: string): boolean;
3
+ export declare function getRoute(name: string): string;
4
+ export declare function findRoutesInSource(source: SourceFile): Node | undefined;
@@ -1,36 +1,37 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const typescript_1 = require("typescript");
4
- const core_1 = require("@angular-devkit/core");
5
- function getRouteComponentName(pageName) {
6
- return `${core_1.strings.classify(core_1.basename(core_1.normalize(pageName)))}Component`;
7
- }
8
- function hasComponentInRoutes(routes, name) {
9
- const routesText = routes.getText();
10
- const componentName = getRouteComponentName(name);
11
- return routesText.indexOf(componentName) !== -1;
12
- }
13
- exports.hasComponentInRoutes = hasComponentInRoutes;
14
- function getRoute(name) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findRoutesInSource = exports.getRoute = exports.hasComponentInRoutes = void 0;
4
+ const typescript_1 = require("typescript");
5
+ const core_1 = require("@angular-devkit/core");
6
+ function getRouteComponentName(pageName) {
7
+ return `${core_1.strings.classify(core_1.basename(core_1.normalize(pageName)))}Component`;
8
+ }
9
+ function hasComponentInRoutes(routes, name) {
10
+ const routesText = routes.getText();
11
+ const componentName = getRouteComponentName(name);
12
+ return routesText.indexOf(componentName) !== -1;
13
+ }
14
+ exports.hasComponentInRoutes = hasComponentInRoutes;
15
+ function getRoute(name) {
15
16
  return ` {
16
17
  path: '${core_1.strings.dasherize(name)}',
17
18
  component: ${getRouteComponentName(name)},
18
19
  canActivate: [ AuthGuardService ]
19
- }`;
20
- }
21
- exports.getRoute = getRoute;
22
- function isRouteVariable(node, text) {
23
- return node.kind === typescript_1.SyntaxKind.VariableStatement &&
24
- text.search(/\:\s*Routes/) !== -1;
25
- }
26
- function findRoutesInSource(source) {
27
- // TODO: try to use ast-utils/findNodes
28
- return source.forEachChild((node) => {
29
- const text = node.getText();
30
- if (isRouteVariable(node, text)) {
31
- return node;
32
- }
33
- });
34
- }
35
- exports.findRoutesInSource = findRoutesInSource;
20
+ }`;
21
+ }
22
+ exports.getRoute = getRoute;
23
+ function isRouteVariable(node, text) {
24
+ return node.kind === typescript_1.SyntaxKind.VariableStatement &&
25
+ text.search(/\:\s*Routes/) !== -1;
26
+ }
27
+ function findRoutesInSource(source) {
28
+ // TODO: try to use ast-utils/findNodes
29
+ return source.forEachChild((node) => {
30
+ const text = node.getText();
31
+ if (isRouteVariable(node, text)) {
32
+ return node;
33
+ }
34
+ });
35
+ }
36
+ exports.findRoutesInSource = findRoutesInSource;
36
37
  //# sourceMappingURL=routing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"routing.js","sourceRoot":"","sources":["routing.ts"],"names":[],"mappings":";;AAAA,2CAIoB;AAEpB,+CAI8B;AAE9B,SAAS,qBAAqB,CAAC,QAAgB;IAC7C,OAAO,GAAG,cAAO,CAAC,QAAQ,CAAC,eAAQ,CAAC,gBAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC;AACvE,CAAC;AAED,SAAgB,oBAAoB,CAAC,MAAY,EAAE,IAAY;IAC7D,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,EAAE,CA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a,CAAC,KAAK,CAAC,CAAC,CAAC;AAClD,CAAC;AAJD,oDAIC;AAED,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO;aACI,cAAO,CAAC,SAAS,CAAC,IAAI,CAAC;iBACnB,qBAAqB,CAAC,IAAI,CAAC;;IAExC,CAAC;AACL,CAAC;AAND,4BAMC;AAED,SAAS,eAAe,CAAC,IAAU,EAAE,IAAY;IAC7C,OAAO,IAAI,CAAC,IAAI,KAAK,uBAAU,CAAC,iBAAiB;QAC/C,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;AACtC,CAAC;AAEH,SAAgB,kBAAkB,CAAC,MAAkB;IACnD,uCAAuC;IACvC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE;QAClC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE;YAC/B,OAAO,IAAI,CAAC;SACb;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AARD,gDAQC"}
@@ -1,3 +1,3 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- import { SourceFile } from 'typescript';
3
- export declare function getSourceFile(host: Tree, filePath: string): SourceFile | undefined;
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ import { SourceFile } from 'typescript';
3
+ export declare function getSourceFile(host: Tree, filePath: string): SourceFile | undefined;
@@ -1,13 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const typescript_1 = require("typescript");
4
- function getSourceFile(host, filePath) {
5
- const buffer = host.read(filePath);
6
- if (!buffer) {
7
- return;
8
- }
9
- const serializedFile = host.read(filePath).toString();
10
- return typescript_1.createSourceFile(filePath, serializedFile, typescript_1.ScriptTarget.Latest, true);
11
- }
12
- exports.getSourceFile = getSourceFile;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSourceFile = void 0;
4
+ const typescript_1 = require("typescript");
5
+ function getSourceFile(host, filePath) {
6
+ const buffer = host.read(filePath);
7
+ if (!buffer) {
8
+ return;
9
+ }
10
+ const serializedFile = host.read(filePath).toString();
11
+ return typescript_1.createSourceFile(filePath, serializedFile, typescript_1.ScriptTarget.Latest, true);
12
+ }
13
+ exports.getSourceFile = getSourceFile;
13
14
  //# sourceMappingURL=source.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"source.js","sourceRoot":"","sources":["source.ts"],"names":[],"mappings":";;AACA,2CAIoB;AAEpB,SAAgB,aAAa,CAAC,IAAU,EAAE,QAAgB;IACxD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAEnC,IAAI,CAAC,MAAM,EAAE;QACX,OAAO;KACR;IACD,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAE,CAAC,QAAQ,EAAE,CAAC;IACvD,OAAO,6BAAgB,CAAC,QAAQ,EAAE,cAAc,EAAE,yBAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC/E,CAAC;AARD,sCAQC"}
1
+ {"version":3,"file":"source.js","sourceRoot":"","sources":["source.ts"],"names":[],"mappings":";;;AACA,2CAIoB;AAEpB,SAAgB,aAAa,CAAC,IAAU,EAAE,QAAgB;IACxD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAEnC,IAAI,CAAC,MAAM,EAAE;QACX,OAAO;KACR;IACD,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAE,CAAC,QAAQ,EAAE,CAAC;IACvD,OAAO,6BAAgB,CAAC,QAAQ,EAAE,cAAc,EAAE,yBAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC/E,CAAC;AARD,sCAQC"}
@@ -1 +1 @@
1
- export declare function humanize(str: string): string;
1
+ export declare function humanize(str: string): string;
@@ -1,8 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@angular-devkit/core");
4
- function humanize(str) {
5
- return str.split('-').map((part) => core_1.strings.capitalize(part)).join(' ');
6
- }
7
- exports.humanize = humanize;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.humanize = void 0;
4
+ const core_1 = require("@angular-devkit/core");
5
+ function humanize(str) {
6
+ return str.split('-').map((part) => core_1.strings.capitalize(part)).join(' ');
7
+ }
8
+ exports.humanize = humanize;
8
9
  //# sourceMappingURL=string.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"string.js","sourceRoot":"","sources":["string.ts"],"names":[],"mappings":";;AAAA,+CAA+C;AAE/C,SAAgB,QAAQ,CAAC,GAAW;IAClC,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,cAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClF,CAAC;AAFD,4BAEC"}
1
+ {"version":3,"file":"string.js","sourceRoot":"","sources":["string.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAE/C,SAAgB,QAAQ,CAAC,GAAW;IAClC,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,cAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClF,CAAC;AAFD,4BAEC"}
@@ -1,2 +1 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- export declare function addStylesToApp(host: Tree, project: string, config: any, styles?: Array<any>): any;
1
+ export declare function addStylesToApp(project: string, config: any, styles?: Array<any>): any;
@@ -1,31 +1,30 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const project_1 = require("./project");
4
- const array_1 = require("./array");
5
- function cleanStyles(projectStyles, defaultStyles) {
6
- return projectStyles.filter((style) => {
7
- return style !== defaultStyles[0] && style !== defaultStyles[1];
8
- });
9
- }
10
- function addStylesToApp(host, project, config, styles) {
11
- const projectName = project_1.getProjectName(host, project);
12
- const projectBuildOptopns = config['projects'][projectName]['architect']['build']['options'];
13
- const defaultStyles = [
14
- 'node_modules/devextreme/dist/css/dx.light.css',
15
- 'node_modules/devextreme/dist/css/dx.common.css'
16
- ];
17
- let projectStyles = projectBuildOptopns['styles'];
18
- if (!styles) {
19
- styles = defaultStyles;
20
- }
21
- else {
22
- projectStyles = cleanStyles(projectStyles, defaultStyles);
23
- }
24
- styles.forEach((style) => {
25
- projectStyles.unshift(style);
26
- });
27
- projectBuildOptopns['styles'] = array_1.makeArrayUnique(projectStyles);
28
- return config;
29
- }
30
- exports.addStylesToApp = addStylesToApp;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addStylesToApp = void 0;
4
+ const array_1 = require("./array");
5
+ function cleanStyles(projectStyles, defaultStyles) {
6
+ return projectStyles.filter((style) => {
7
+ return style !== defaultStyles[0] && style !== defaultStyles[1];
8
+ });
9
+ }
10
+ function addStylesToApp(project, config, styles) {
11
+ const projectBuildOptopns = config['projects'][project]['architect']['build']['options'];
12
+ const defaultStyles = [
13
+ 'node_modules/devextreme/dist/css/dx.light.css',
14
+ 'node_modules/devextreme/dist/css/dx.common.css'
15
+ ];
16
+ let projectStyles = projectBuildOptopns['styles'];
17
+ if (!styles) {
18
+ styles = defaultStyles;
19
+ }
20
+ else {
21
+ projectStyles = cleanStyles(projectStyles, defaultStyles);
22
+ }
23
+ styles.forEach((style) => {
24
+ projectStyles.unshift(style);
25
+ });
26
+ projectBuildOptopns['styles'] = array_1.makeArrayUnique(projectStyles);
27
+ return config;
28
+ }
29
+ exports.addStylesToApp = addStylesToApp;
31
30
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","s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AC,KAAK,EAAE,EAAE;QACpC,OAAO,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,cAAc,CAAC,OAAe,EAAE,MAAW,EAAE,MAAmB;IAC9E,MAAM,mBAAmB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;IACzF,MAAM,aAAa,GAAG;QACpB,+CAA+C;QAC/C,gDAAgD;KACjD,CAAC;IACF,IAAI,aAAa,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAElD,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,GAAG,aAAa,CAAC;KACxB;SAAM;QACL,aAAa,GAAG,WAAW,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;KAC3D;IAED,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACvB,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,mBAAmB,CAAC,QAAQ,CAAC,GAAG,uBAAe,CAAC,aAAa,CAAC,CAAC;IAE/D,OAAO,MAAM,CAAC;AAChB,CAAC;AArBD,wCAqBC"}
@@ -1,5 +1,3 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- import { getProjectName } from './project';
3
1
  import { makeArrayUnique } from './array';
4
2
 
5
3
  function cleanStyles(projectStyles: Array<any>, defaultStyles: any) {
@@ -8,9 +6,8 @@ function cleanStyles(projectStyles: Array<any>, defaultStyles: any) {
8
6
  });
9
7
  }
10
8
 
11
- export function addStylesToApp(host: Tree, project: string, config: any, styles?: Array<any>) {
12
- const projectName = getProjectName(host, project);
13
- const projectBuildOptopns = config['projects'][projectName]['architect']['build']['options'];
9
+ export function addStylesToApp(project: string, config: any, styles?: Array<any>) {
10
+ const projectBuildOptopns = config['projects'][project]['architect']['build']['options'];
14
11
  const defaultStyles = [
15
12
  'node_modules/devextreme/dist/css/dx.light.css',
16
13
  'node_modules/devextreme/dist/css/dx.common.css'