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,2 +1,2 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- export default function (options: any): Rule;
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ export default function (options: any): Rule;
@@ -1,64 +1,77 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const schematics_1 = require("@angular-devkit/schematics");
4
- const styles_1 = require("../utility/styles");
5
- const dependencies_1 = require("@schematics/angular/utility/dependencies");
6
- const tasks_1 = require("@angular-devkit/schematics/tasks");
7
- const latest_versions_1 = require("../utility/latest-versions");
8
- const modify_json_file_1 = require("../utility/modify-json-file");
9
- function default_1(options) {
10
- return schematics_1.chain([
11
- (host) => addDevExtremeDependency(host, { dxversion: options.dxversion }),
12
- (host) => addDevExtremeCSS(host, { project: options.project }),
13
- (host) => reqisterJSZip(host),
14
- (_, context) => {
15
- context.addTask(new tasks_1.NodePackageInstallTask());
16
- }
17
- ]);
18
- }
19
- exports.default = default_1;
20
- function addDevExtremeDependency(host, options) {
21
- dependencies_1.addPackageJsonDependency(host, {
22
- type: dependencies_1.NodeDependencyType.Default,
23
- name: 'devextreme',
24
- version: options.dxversion || latest_versions_1.latestVersions['devextreme']
25
- });
26
- dependencies_1.addPackageJsonDependency(host, {
27
- type: dependencies_1.NodeDependencyType.Default,
28
- name: 'devextreme-angular',
29
- version: options.dxversion || latest_versions_1.latestVersions['devextreme-angular']
30
- });
31
- dependencies_1.addPackageJsonDependency(host, {
32
- type: dependencies_1.NodeDependencyType.Dev,
33
- name: 'devextreme-cli',
34
- version: latest_versions_1.latestVersions['devextreme-cli']
35
- });
36
- dependencies_1.addPackageJsonDependency(host, {
37
- type: dependencies_1.NodeDependencyType.Dev,
38
- name: 'devextreme-themebuilder',
39
- version: options.dxversion || latest_versions_1.latestVersions['devextreme']
40
- });
41
- return host;
42
- }
43
- function addDevExtremeCSS(host, options) {
44
- modify_json_file_1.modifyJSONFile(host, './angular.json', config => {
45
- return styles_1.addStylesToApp(host, options.project, config);
46
- });
47
- return host;
48
- }
49
- function reqisterJSZip(host) {
50
- modify_json_file_1.modifyJSONFile(host, './tsconfig.app.json', config => {
51
- const compilerOptions = config['compilerOptions'];
52
- let paths = compilerOptions['paths'];
53
- if (!paths) {
54
- paths = {};
55
- }
56
- if (!paths['jszip']) {
57
- paths['jszip'] = ['node_modules/jszip/dist/jszip.min.js'];
58
- }
59
- compilerOptions['paths'] = paths;
60
- return config;
61
- });
62
- return host;
63
- }
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
+ const schematics_1 = require("@angular-devkit/schematics");
13
+ const styles_1 = require("../utility/styles");
14
+ const dependencies_1 = require("@schematics/angular/utility/dependencies");
15
+ const tasks_1 = require("@angular-devkit/schematics/tasks");
16
+ const latest_versions_1 = require("../utility/latest-versions");
17
+ const modify_json_file_1 = require("../utility/modify-json-file");
18
+ const project_1 = require("../utility/project");
19
+ function default_1(options) {
20
+ return schematics_1.chain([
21
+ (host) => addDevExtremeDependency(host, { dxversion: options.dxversion }),
22
+ (host) => addDevExtremeCSS(host, { project: options.project }),
23
+ (host) => reqisterJSZip(host),
24
+ (_, context) => {
25
+ context.addTask(new tasks_1.NodePackageInstallTask());
26
+ }
27
+ ]);
28
+ }
29
+ exports.default = default_1;
30
+ function addDevExtremeDependency(host, options) {
31
+ dependencies_1.addPackageJsonDependency(host, {
32
+ type: dependencies_1.NodeDependencyType.Default,
33
+ name: 'devextreme',
34
+ version: options.dxversion || latest_versions_1.latestVersions['devextreme']
35
+ });
36
+ dependencies_1.addPackageJsonDependency(host, {
37
+ type: dependencies_1.NodeDependencyType.Default,
38
+ name: 'devextreme-angular',
39
+ version: options.dxversion || latest_versions_1.latestVersions['devextreme-angular']
40
+ });
41
+ dependencies_1.addPackageJsonDependency(host, {
42
+ type: dependencies_1.NodeDependencyType.Dev,
43
+ name: 'devextreme-cli',
44
+ version: latest_versions_1.latestVersions['devextreme-cli']
45
+ });
46
+ dependencies_1.addPackageJsonDependency(host, {
47
+ type: dependencies_1.NodeDependencyType.Dev,
48
+ name: 'devextreme-themebuilder',
49
+ version: options.dxversion || latest_versions_1.latestVersions['devextreme']
50
+ });
51
+ return host;
52
+ }
53
+ function addDevExtremeCSS(host, options) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ const projectName = yield project_1.getProjectName(host, options.project);
56
+ modify_json_file_1.modifyJSONFile(host, './angular.json', config => {
57
+ return styles_1.addStylesToApp(projectName, config);
58
+ });
59
+ return host;
60
+ });
61
+ }
62
+ function reqisterJSZip(host) {
63
+ modify_json_file_1.modifyJSONFile(host, './tsconfig.app.json', config => {
64
+ const compilerOptions = config['compilerOptions'];
65
+ let paths = compilerOptions['paths'];
66
+ if (!paths) {
67
+ paths = {};
68
+ }
69
+ if (!paths['jszip']) {
70
+ paths['jszip'] = ['node_modules/jszip/dist/jszip.min.js'];
71
+ }
72
+ compilerOptions['paths'] = paths;
73
+ return config;
74
+ });
75
+ return host;
76
+ }
64
77
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAAA,2DAKoC;AAEpC,8CAAmD;AAEnD,2EAGkD;AAElD,4DAE0C;AAE1C,gEAA4D;AAC5D,kEAA6D;AAE7D,mBAAwB,OAAY;IAClC,OAAO,kBAAK,CAAC;QACX,CAAC,IAAU,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;QAC/E,CAAC,IAAU,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC;QACpE,CAAC,IAAU,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC;QACnC,CAAC,CAAC,EAAE,OAAyB,EAAE,EAAE;YAC/B,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB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,KAAK,CAAC,OAAO,CAAC,EAAE;YACnB,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;SAC3D;QAED,eAAe,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;QAEjC,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -18,6 +18,7 @@ import {
18
18
 
19
19
  import { latestVersions } from '../utility/latest-versions';
20
20
  import { modifyJSONFile } from '../utility/modify-json-file';
21
+ import { getProjectName } from '../utility/project';
21
22
 
22
23
  export default function(options: any): Rule {
23
24
  return chain([
@@ -55,10 +56,11 @@ function addDevExtremeDependency(host: Tree, options: any) {
55
56
  return host;
56
57
  }
57
58
 
58
- function addDevExtremeCSS(host: Tree, options: any) {
59
+ async function addDevExtremeCSS(host: Tree, options: any) {
60
+ const projectName = await getProjectName(host, options.project);
59
61
  modifyJSONFile(host, './angular.json', config => {
60
62
 
61
- return addStylesToApp(host, options.project, config);
63
+ return addStylesToApp(projectName, config);
62
64
  });
63
65
 
64
66
  return host;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,96 +1,97 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const testing_1 = require("@angular-devkit/schematics/testing");
12
- const path = require("path");
13
- const latest_versions_1 = require("../utility/latest-versions");
14
- const collectionPath = path.join(__dirname, '../collection.json');
15
- describe('install', () => {
16
- // TODO: Extract workspase preparing somewhere
17
- const appOptions = {
18
- name: 'testApp',
19
- projectRoot: '',
20
- inlineStyle: false,
21
- inlineTemplate: false,
22
- routing: true,
23
- style: 'css',
24
- skipTests: false,
25
- skipPackageJson: false
26
- };
27
- const workspaceOptions = {
28
- name: 'workspace',
29
- // TODO: use angular latest-versions module
30
- version: '6.0.0'
31
- };
32
- const angularSchematicsCollection = require.resolve('../../node_modules/@schematics/angular/collection.json');
33
- const schematicRunner = new testing_1.SchematicTestRunner('@schematics/angular', angularSchematicsCollection);
34
- let appTree;
35
- beforeEach(() => __awaiter(this, void 0, void 0, function* () {
36
- appTree = yield schematicRunner.runSchematicAsync('workspace', workspaceOptions).toPromise();
37
- appTree = yield schematicRunner.runSchematicAsync('application', appOptions, appTree).toPromise();
38
- }));
39
- it('should add devextreme dependency (default)', () => __awaiter(this, void 0, void 0, function* () {
40
- const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
41
- const tree = yield runner.runSchematicAsync('install', {}, appTree).toPromise();
42
- const packageConfig = JSON.parse(tree.readContent('package.json'));
43
- expect(packageConfig.dependencies['devextreme']).toBe(latest_versions_1.latestVersions['devextreme']);
44
- expect(packageConfig.dependencies['devextreme-angular']).toBe(latest_versions_1.latestVersions['devextreme-angular']);
45
- expect(packageConfig.devDependencies['devextreme-themebuilder']).toBe(latest_versions_1.latestVersions['devextreme']);
46
- }));
47
- it('should add devextreme dependency (custom)', () => __awaiter(this, void 0, void 0, function* () {
48
- const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
49
- const tree = yield runner.runSchematicAsync('install', { dxversion: '18.2.5' }, appTree).toPromise();
50
- const packageConfig = JSON.parse(tree.readContent('package.json'));
51
- expect(packageConfig.dependencies.devextreme).toBe('18.2.5');
52
- expect(packageConfig.devDependencies['devextreme-themebuilder']).toBe('18.2.5');
53
- }));
54
- it('should add devextreme cli devDependency', () => __awaiter(this, void 0, void 0, function* () {
55
- const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
56
- const tree = yield runner.runSchematicAsync('install', { dxversion: '18.2.5' }, appTree).toPromise();
57
- const packageConfig = JSON.parse(tree.readContent('package.json'));
58
- expect(packageConfig.devDependencies['devextreme-cli']).toBeDefined();
59
- }));
60
- it('should add devextreme styles', () => __awaiter(this, void 0, void 0, function* () {
61
- const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
62
- const tree = yield runner.runSchematicAsync('install', {}, appTree).toPromise();
63
- const angularConfig = JSON.parse(tree.readContent('angular.json'));
64
- const styles = angularConfig['projects']['testApp']['architect']['build']['options']['styles'];
65
- expect(styles[0]).toBe('node_modules/devextreme/dist/css/dx.common.css');
66
- expect(styles[1]).toBe('node_modules/devextreme/dist/css/dx.light.css');
67
- }));
68
- it('should register jszip', () => __awaiter(this, void 0, void 0, function* () {
69
- const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
70
- const tree = yield runner.runSchematicAsync('install', {}, appTree).toPromise();
71
- const tsconfig = JSON.parse(tree.readContent('tsconfig.app.json'));
72
- const jszip = tsconfig['compilerOptions']['paths']['jszip'];
73
- expect(jszip[0]).toBe('node_modules/jszip/dist/jszip.min.js');
74
- }));
75
- it('should add devextreme styles to the specified project', () => __awaiter(this, void 0, void 0, function* () {
76
- const secondAppOptions = {
77
- name: 'testApp2',
78
- inlineStyle: false,
79
- inlineTemplate: false,
80
- projectRoot: 'src2',
81
- routing: true,
82
- style: 'css',
83
- skipTests: false,
84
- skipPackageJson: false
85
- };
86
- appTree = yield schematicRunner.runSchematicAsync('application', secondAppOptions, appTree).toPromise();
87
- const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
88
- const tree = yield runner.runSchematicAsync('install', { project: 'testApp2' }, appTree).toPromise();
89
- const angularConfig = JSON.parse(tree.readContent('angular.json'));
90
- const styles = angularConfig['projects']['testApp2']['architect']['build']['options']['styles'];
91
- expect(styles[0]).toBe('node_modules/devextreme/dist/css/dx.common.css');
92
- expect(styles[1]).toBe('node_modules/devextreme/dist/css/dx.light.css');
93
- expect(angularConfig['projects']['testApp']['architect']['build']['options']['styles'].length).toBe(1);
94
- }));
95
- });
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
+ const testing_1 = require("@angular-devkit/schematics/testing");
13
+ const path = require("path");
14
+ const latest_versions_1 = require("../utility/latest-versions");
15
+ const collectionPath = path.join(__dirname, '../collection.json');
16
+ describe('install', () => {
17
+ // TODO: Extract workspase preparing somewhere
18
+ const appOptions = {
19
+ name: 'testApp',
20
+ projectRoot: '',
21
+ inlineStyle: false,
22
+ inlineTemplate: false,
23
+ routing: true,
24
+ style: 'css',
25
+ skipTests: false,
26
+ skipPackageJson: false
27
+ };
28
+ const workspaceOptions = {
29
+ name: 'workspace',
30
+ // TODO: use angular latest-versions module
31
+ version: '12.0.0'
32
+ };
33
+ const angularSchematicsCollection = require.resolve('../../node_modules/@schematics/angular/collection.json');
34
+ const schematicRunner = new testing_1.SchematicTestRunner('@schematics/angular', angularSchematicsCollection);
35
+ let appTree;
36
+ beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
37
+ appTree = yield schematicRunner.runSchematicAsync('workspace', workspaceOptions).toPromise();
38
+ appTree = yield schematicRunner.runSchematicAsync('application', appOptions, appTree).toPromise();
39
+ }));
40
+ it('should add devextreme dependency (default)', () => __awaiter(void 0, void 0, void 0, function* () {
41
+ const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
42
+ const tree = yield runner.runSchematicAsync('install', {}, appTree).toPromise();
43
+ const packageConfig = JSON.parse(tree.readContent('package.json'));
44
+ expect(packageConfig.dependencies['devextreme']).toBe(latest_versions_1.latestVersions['devextreme']);
45
+ expect(packageConfig.dependencies['devextreme-angular']).toBe(latest_versions_1.latestVersions['devextreme-angular']);
46
+ expect(packageConfig.devDependencies['devextreme-themebuilder']).toBe(latest_versions_1.latestVersions['devextreme']);
47
+ }));
48
+ it('should add devextreme dependency (custom)', () => __awaiter(void 0, void 0, void 0, function* () {
49
+ const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
50
+ const tree = yield runner.runSchematicAsync('install', { dxversion: '18.2.5' }, appTree).toPromise();
51
+ const packageConfig = JSON.parse(tree.readContent('package.json'));
52
+ expect(packageConfig.dependencies.devextreme).toBe('18.2.5');
53
+ expect(packageConfig.devDependencies['devextreme-themebuilder']).toBe('18.2.5');
54
+ }));
55
+ it('should add devextreme cli devDependency', () => __awaiter(void 0, void 0, void 0, function* () {
56
+ const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
57
+ const tree = yield runner.runSchematicAsync('install', { dxversion: '18.2.5' }, appTree).toPromise();
58
+ const packageConfig = JSON.parse(tree.readContent('package.json'));
59
+ expect(packageConfig.devDependencies['devextreme-cli']).toBeDefined();
60
+ }));
61
+ it('should add devextreme styles', () => __awaiter(void 0, void 0, void 0, function* () {
62
+ const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
63
+ const tree = yield runner.runSchematicAsync('install', {}, appTree).toPromise();
64
+ const angularConfig = JSON.parse(tree.readContent('angular.json'));
65
+ const styles = angularConfig['projects']['testApp']['architect']['build']['options']['styles'];
66
+ expect(styles[0]).toBe('node_modules/devextreme/dist/css/dx.common.css');
67
+ expect(styles[1]).toBe('node_modules/devextreme/dist/css/dx.light.css');
68
+ }));
69
+ it('should register jszip', () => __awaiter(void 0, void 0, void 0, function* () {
70
+ const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
71
+ const tree = yield runner.runSchematicAsync('install', {}, appTree).toPromise();
72
+ const tsconfig = JSON.parse(tree.readContent('tsconfig.app.json'));
73
+ const jszip = tsconfig['compilerOptions']['paths']['jszip'];
74
+ expect(jszip[0]).toBe('node_modules/jszip/dist/jszip.min.js');
75
+ }));
76
+ it('should add devextreme styles to the specified project', () => __awaiter(void 0, void 0, void 0, function* () {
77
+ const secondAppOptions = {
78
+ name: 'testApp2',
79
+ inlineStyle: false,
80
+ inlineTemplate: false,
81
+ projectRoot: 'src2',
82
+ routing: true,
83
+ style: 'css',
84
+ skipTests: false,
85
+ skipPackageJson: false
86
+ };
87
+ appTree = yield schematicRunner.runSchematicAsync('application', secondAppOptions, appTree).toPromise();
88
+ const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
89
+ const tree = yield runner.runSchematicAsync('install', { project: 'testApp2' }, appTree).toPromise();
90
+ const angularConfig = JSON.parse(tree.readContent('angular.json'));
91
+ const styles = angularConfig['projects']['testApp2']['architect']['build']['options']['styles'];
92
+ expect(styles[0]).toBe('node_modules/devextreme/dist/css/dx.common.css');
93
+ expect(styles[1]).toBe('node_modules/devextreme/dist/css/dx.light.css');
94
+ expect(angularConfig['projects']['testApp']['architect']['build']['options']['styles'].length).toBe(1);
95
+ }));
96
+ });
96
97
  //# sourceMappingURL=index_spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index_spec.js","sourceRoot":"","sources":["index_spec.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,gEAAuF;AAEvF,6BAA6B;AAC7B,gEAA4D;AAE5D,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAElE,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,8CAA8C;IAC9C,MAAM,UAAU,GAAQ;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,KAAK;QAClB,cAAc,EAAE,KAAK;QACrB,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,KAA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,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;QAExE,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzG,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -21,7 +21,7 @@ describe('install', () => {
21
21
  const workspaceOptions: WorkspaceOptions = {
22
22
  name: 'workspace',
23
23
  // TODO: use angular latest-versions module
24
- version: '6.0.0'
24
+ version: '12.0.0'
25
25
  };
26
26
 
27
27
  const angularSchematicsCollection = require.resolve('../../node_modules/@schematics/angular/collection.json');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/schema",
3
- "id": "SchematicsDevextremeInstall",
3
+ "$id": "SchematicsDevextremeInstall",
4
4
  "title": "Add DevExtreme to an Angular application",
5
5
  "type": "object",
6
6
  "properties": {
@@ -1 +1 @@
1
- export declare function makeArrayUnique(arr: Array<any>): any[];
1
+ export declare function makeArrayUnique(arr: Array<any>): any[];
@@ -1,7 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- function makeArrayUnique(arr) {
4
- return [...new Set(arr)];
5
- }
6
- exports.makeArrayUnique = makeArrayUnique;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeArrayUnique = void 0;
4
+ function makeArrayUnique(arr) {
5
+ return [...new Set(arr)];
6
+ }
7
+ exports.makeArrayUnique = makeArrayUnique;
7
8
  //# sourceMappingURL=array.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"array.js","sourceRoot":"","sources":["array.ts"],"names":[],"mappings":";;AAAA,SAAgB,eAAe,CAAC,GAAe;IAC7C,OAAQ,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AAFD,0CAEC"}
1
+ {"version":3,"file":"array.js","sourceRoot":"","sources":["array.ts"],"names":[],"mappings":";;;AAAA,SAAgB,eAAe,CAAC,GAAe;IAC7C,OAAQ,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AAFD,0CAEC"}
@@ -1,7 +1,7 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- import { Change } from '@schematics/angular/utility/change';
3
- import { Node } from 'typescript';
4
- export declare function applyChanges(host: Tree, changes: Change[], filePath: string): import("@angular-devkit/schematics/src/tree/interface").Tree;
5
- export declare function insertItemToArray(host: Tree, filePath: string, node: Node, item: string, options?: {
6
- location: 'start' | 'end';
7
- }): import("@angular-devkit/schematics/src/tree/interface").Tree;
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ import { Change } from '@schematics/angular/utility/change';
3
+ import { Node } from 'typescript';
4
+ export declare function applyChanges(host: Tree, changes: Change[], filePath: string): import("@angular-devkit/schematics/src/tree/interface").Tree;
5
+ export declare function insertItemToArray(host: Tree, filePath: string, node: Node, item: string, options?: {
6
+ location: 'start' | 'end';
7
+ }): import("@angular-devkit/schematics/src/tree/interface").Tree;
@@ -1,50 +1,51 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.insertItemToArray = exports.applyChanges = void 0;
3
4
  const newLine = `
4
- `;
5
- function applyChanges(host, changes, filePath) {
6
- const recorder = host.beginUpdate(filePath);
7
- changes.forEach((change) => {
8
- recorder.insertLeft(change.pos, change.toAdd);
9
- });
10
- host.commitUpdate(recorder);
11
- return host;
12
- }
13
- exports.applyChanges = applyChanges;
14
- // TODO: implement options.index
15
- // TODO: implement spaces shift calculation
16
- function insertItemToArray(host, filePath, node, item, options = { location: 'start' }) {
17
- const isItemValid = /^\s*\{[\s\S]*\}\s*$/m.test(item);
18
- if (!isItemValid) {
19
- return host;
20
- }
21
- const nodeContent = node.getText();
22
- const nodePosition = node.getStart();
23
- const leftBracketPosition = nodePosition + nodeContent.indexOf('[');
24
- const rightBracketPosition = nodePosition + nodeContent.lastIndexOf(']');
25
- let itemPosition = leftBracketPosition + 1;
26
- let fileRecorder = host.beginUpdate(filePath);
27
- item = newLine + item;
28
- const isNodeEmpty = !/\[[\s\S]*\S+[\s\S]*\]/m.test(nodeContent);
29
- if (isNodeEmpty) {
30
- const formattedArray = `[${newLine}]`;
31
- fileRecorder.remove(leftBracketPosition, rightBracketPosition - leftBracketPosition + 1);
32
- fileRecorder.insertLeft(leftBracketPosition, formattedArray);
33
- host.commitUpdate(fileRecorder);
34
- fileRecorder = host.beginUpdate(filePath);
35
- }
36
- else {
37
- if (options.location === 'end') {
38
- itemPosition = nodePosition + nodeContent.lastIndexOf('}') + 1;
39
- item = ',' + item;
40
- }
41
- else {
42
- item = item + ',';
43
- }
44
- }
45
- fileRecorder.insertLeft(itemPosition, item);
46
- host.commitUpdate(fileRecorder);
47
- return host;
48
- }
49
- exports.insertItemToArray = insertItemToArray;
5
+ `;
6
+ function applyChanges(host, changes, filePath) {
7
+ const recorder = host.beginUpdate(filePath);
8
+ changes.forEach((change) => {
9
+ recorder.insertLeft(change.pos, change.toAdd);
10
+ });
11
+ host.commitUpdate(recorder);
12
+ return host;
13
+ }
14
+ exports.applyChanges = applyChanges;
15
+ // TODO: implement options.index
16
+ // TODO: implement spaces shift calculation
17
+ function insertItemToArray(host, filePath, node, item, options = { location: 'start' }) {
18
+ const isItemValid = /^\s*\{[\s\S]*\}\s*$/m.test(item);
19
+ if (!isItemValid) {
20
+ return host;
21
+ }
22
+ const nodeContent = node.getText();
23
+ const nodePosition = node.getStart();
24
+ const leftBracketPosition = nodePosition + nodeContent.indexOf('[');
25
+ const rightBracketPosition = nodePosition + nodeContent.lastIndexOf(']');
26
+ let itemPosition = leftBracketPosition + 1;
27
+ let fileRecorder = host.beginUpdate(filePath);
28
+ item = newLine + item;
29
+ const isNodeEmpty = !/\[[\s\S]*\S+[\s\S]*\]/m.test(nodeContent);
30
+ if (isNodeEmpty) {
31
+ const formattedArray = `[${newLine}]`;
32
+ fileRecorder.remove(leftBracketPosition, rightBracketPosition - leftBracketPosition + 1);
33
+ fileRecorder.insertLeft(leftBracketPosition, formattedArray);
34
+ host.commitUpdate(fileRecorder);
35
+ fileRecorder = host.beginUpdate(filePath);
36
+ }
37
+ else {
38
+ if (options.location === 'end') {
39
+ itemPosition = nodePosition + nodeContent.lastIndexOf('}') + 1;
40
+ item = ',' + item;
41
+ }
42
+ else {
43
+ item = item + ',';
44
+ }
45
+ }
46
+ fileRecorder.insertLeft(itemPosition, item);
47
+ host.commitUpdate(fileRecorder);
48
+ return host;
49
+ }
50
+ exports.insertItemToArray = insertItemToArray;
50
51
  //# sourceMappingURL=change.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"change.js","sourceRoot":"","sources":["change.ts"],"names":[],"mappings":";;AAOA,MAAM,OAAO,GAAG;CACf,CAAC;AAEF,SAAgB,YAAY,CAAC,IAAU,EAAE,OAAiB,EAAE,QAAgB;IAC1E,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAE5C,OAAO,CAAC,OAAO,CAAC,CAAC,MAAoB,EAAE,EAAE;QACvC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAE5B,OAAO,IAAI,CAAC;AACd,CAAC;AAVD,oCAUC;AAED,gCAAgC;AAChC,2CAA2C;AAC3C,SAAgB,iBAAiB,CAC/B,IAAU,EACV,QAAgB,EAChB,IAAU,EACV,IAAY,EACZ,UAAyC,EAAE,QAAQ,EAAE,OAAO,EAAE;IAE9D,MAAM,WAAW,GAAG,sBA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IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAE9C,IAAI,GAAG,OAAO,GAAG,IAAI,CAAC;IAEtB,MAAM,WAAW,GAAG,CAAC,wBAAwB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAChE,IAAI,WAAW,EAAE;QACf,MAAM,cAAc,GAAG,IAAI,OAAO,GAAG,CAAC;QACtC,YAAY,CAAC,MAAM,CAAC,mBAAmB,EAAE,oBAAoB,GAAG,mBAAmB,GAAG,CAAC,CAAC,CAAC;QACzF,YAAY,CAAC,UAAU,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;QAC7D,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QAChC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;KAC3C;SAAM;QACL,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,EAAE;YAC9B,YAAY,GAAG,YAAY,GAAG,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC/D,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC;SACnB;aAAM;YACL,IAAI,GAAG,IAAI,GAAG,GAAG,CAAC;SACnB;KACF;IAED,YAAY,CAAC,UAAU,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC5C,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAEhC,OAAO,IAAI,CAAC;AACd,CAAC;AAzCD,8CAyCC"}
@@ -1,5 +1,5 @@
1
- export declare const latestVersions: {
2
- 'devextreme': string;
3
- 'devextreme-angular': string;
4
- 'devextreme-cli': string;
5
- };
1
+ export declare const latestVersions: {
2
+ devextreme: string;
3
+ 'devextreme-angular': string;
4
+ 'devextreme-cli': string;
5
+ };