igniteui-cli 14.0.0-alpha.2 → 14.0.0-alpha.4

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 (26) hide show
  1. package/lib/templates/IgniteUIForReactTemplate.js +6 -7
  2. package/lib/templates/IgniteUIForWebComponentsTemplate.js +17 -19
  3. package/package.json +3 -3
  4. package/templates/react/ReactTypeScriptFileUpdate.js +1 -1
  5. package/templates/webcomponents/WebComponentsTypeScriptFileUpdate.js +1 -1
  6. package/templates/webcomponents/igc-ts/banner/default/files/src/app/__path__/__filePrefix__.test.ts +9 -0
  7. package/templates/webcomponents/igc-ts/banner/default/files/src/app/__path__/__filePrefix__.ts +19 -0
  8. package/templates/webcomponents/igc-ts/banner/default/index.d.ts +1 -0
  9. package/templates/webcomponents/igc-ts/banner/default/index.js +19 -0
  10. package/templates/webcomponents/igc-ts/banner/index.d.ts +1 -0
  11. package/templates/webcomponents/igc-ts/banner/index.js +15 -0
  12. package/templates/webcomponents/igc-ts/date-picker/default/files/src/app/__path__/__filePrefix__.test.ts +9 -0
  13. package/templates/webcomponents/igc-ts/date-picker/default/files/src/app/__path__/__filePrefix__.ts +18 -0
  14. package/templates/webcomponents/igc-ts/date-picker/default/index.d.ts +1 -0
  15. package/templates/webcomponents/igc-ts/date-picker/default/index.js +19 -0
  16. package/templates/webcomponents/igc-ts/date-picker/index.d.ts +1 -0
  17. package/templates/webcomponents/igc-ts/date-picker/index.js +15 -0
  18. package/templates/webcomponents/igc-ts/divider/default/files/src/app/__path__/__filePrefix__.test.ts +9 -0
  19. package/templates/webcomponents/igc-ts/divider/default/files/src/app/__path__/__filePrefix__.ts +19 -0
  20. package/templates/webcomponents/igc-ts/divider/default/index.d.ts +1 -0
  21. package/templates/webcomponents/igc-ts/divider/default/index.js +19 -0
  22. package/templates/webcomponents/igc-ts/divider/index.d.ts +1 -0
  23. package/templates/webcomponents/igc-ts/divider/index.js +15 -0
  24. package/templates/webcomponents/igc-ts/groups.json +2 -1
  25. package/templates/webcomponents/igc-ts/projects/_base/files/package.json +3 -2
  26. package/templates/webcomponents/igc-ts/projects/_base_with_home/files/package.json +3 -2
@@ -62,6 +62,12 @@ class IgniteUIForReactTemplate {
62
62
  redirectTo: options.path,
63
63
  });
64
64
  }
65
+ routingModule.addRoute({
66
+ path: this.fileName(name),
67
+ element: cli_core_1.Util.className(name),
68
+ text: cli_core_1.Util.nameFromPath(name)
69
+ }, false // multiline
70
+ );
65
71
  if (options.hasChildren) {
66
72
  const child = {
67
73
  identifierName: cli_core_1.ROUTES_VARIABLE_NAME,
@@ -70,13 +76,6 @@ class IgniteUIForReactTemplate {
70
76
  };
71
77
  routingModule.addChildRoute(this.fileName(name), child, true);
72
78
  }
73
- else {
74
- routingModule.addRoute({
75
- path: this.fileName(name),
76
- element: cli_core_1.Util.className(name),
77
- text: cli_core_1.Util.nameFromPath(name)
78
- }, false);
79
- }
80
79
  routingModule.finalize();
81
80
  }
82
81
  }
@@ -31,37 +31,35 @@ class IgniteUIForWebComponentsTemplate {
31
31
  return;
32
32
  }
33
33
  const routeModulePath = options.parentRoutingModulePath;
34
- const routingModule = new WebComponentsTypeScriptFileUpdate_1.WebComponentsTypeScriptFileUpdate(path.join(projectPath, routeModulePath), { convertTabsToSpaces: true, indentSize: 4, singleQuotes: true });
34
+ const routingModule = new WebComponentsTypeScriptFileUpdate_1.WebComponentsTypeScriptFileUpdate(path.join(projectPath, routeModulePath), { convertTabsToSpaces: true, indentSize: 2, singleQuotes: true });
35
35
  if (!(options && options.skipRoute) &&
36
36
  cli_core_1.App.container.get(cli_core_1.FS_TOKEN).fileExists(routeModulePath)) {
37
+ const modulePath = `./${cli_core_1.Util.lowerDashed(fullName)}/${cli_core_1.Util.lowerDashed(fullName)}-routing`;
38
+ const child = {
39
+ identifierName: cli_core_1.ROUTES_VARIABLE_NAME,
40
+ aliasName: options.routerChildren,
41
+ modulePath
42
+ };
37
43
  if (defaultPath) {
38
44
  routingModule.addRoute({
39
45
  path: "",
40
46
  redirectTo: options.selector,
41
47
  name: cli_core_1.Util.nameFromPath(fullName)
42
48
  });
49
+ if (options.hasChildren) {
50
+ routingModule.addChildRoute("", child, true);
51
+ }
43
52
  }
44
- const modulePath = `./${cli_core_1.Util.lowerDashed(fullName)}/${cli_core_1.Util.lowerDashed(fullName)}-routing`;
53
+ routingModule.addRoute({
54
+ path: this.fileName(fullName),
55
+ identifierName: options.selector,
56
+ name: cli_core_1.Util.nameFromPath(fullName)
57
+ }, false // multiline
58
+ );
45
59
  if (options.hasChildren) {
46
- const child = {
47
- identifierName: cli_core_1.ROUTES_VARIABLE_NAME,
48
- aliasName: options.routerChildren,
49
- modulePath
50
- };
51
60
  routingModule.addChildRoute(this.fileName(fullName), child, true);
52
61
  }
53
- else {
54
- routingModule.addRoute({
55
- path: this.fileName(fullName),
56
- identifierName: options.selector,
57
- name: cli_core_1.Util.nameFromPath(fullName)
58
- }, false // multiline
59
- );
60
- }
61
- const content = routingModule.finalize();
62
- if (content) {
63
- cli_core_1.TypeScriptUtils.saveFile(routeModulePath, content);
64
- }
62
+ routingModule.finalize();
65
63
  }
66
64
  }
67
65
  getExtraConfiguration() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-cli",
3
- "version": "14.0.0-alpha.2",
3
+ "version": "14.0.0-alpha.4",
4
4
  "description": "CLI tool for creating Ignite UI projects",
5
5
  "keywords": [
6
6
  "CLI",
@@ -72,8 +72,8 @@
72
72
  "all": true
73
73
  },
74
74
  "dependencies": {
75
- "@igniteui/angular-templates": "~18.0.1400-alpha.2",
76
- "@igniteui/cli-core": "~14.0.0-alpha.2",
75
+ "@igniteui/angular-templates": "~18.0.1400-alpha.4",
76
+ "@igniteui/cli-core": "~14.0.0-alpha.4",
77
77
  "chalk": "^2.3.2",
78
78
  "fs-extra": "^3.0.1",
79
79
  "glob": "^7.1.2",
@@ -22,7 +22,7 @@ class ReactTypeScriptFileUpdate extends cli_core_1.TypeScriptFileUpdate {
22
22
  }
23
23
  const structure = this.buildRouteStructure(_route, multiline);
24
24
  const newRoute = this.astTransformer.createObjectLiteralExpression(structure, multiline);
25
- this.astTransformer.requestNewMembersInArrayLiteral((0, cli_core_1.RoutesVariableAsParentCondition)(this.astTransformer), [newRoute], prepend, anchorElement);
25
+ this.astTransformer.requestNewMembersInArrayLiteral((0, cli_core_1.variableAsParentCondition)(this.astTransformer, cli_core_1.ROUTES_VARIABLE_NAME), [newRoute], prepend, anchorElement);
26
26
  }
27
27
  //#endregion
28
28
  //#region Overrides
@@ -17,7 +17,7 @@ class WebComponentsTypeScriptFileUpdate extends cli_core_1.TypeScriptFileUpdate
17
17
  }
18
18
  const structure = this.buildRouteStructure(route, multiline);
19
19
  const newRoute = this.astTransformer.createObjectLiteralExpression(structure, multiline);
20
- this.astTransformer.requestNewMembersInArrayLiteral((0, cli_core_1.RoutesVariableAsParentCondition)(this.astTransformer), [newRoute], prepend, anchorElement);
20
+ this.astTransformer.requestNewMembersInArrayLiteral((0, cli_core_1.variableAsParentCondition)(this.astTransformer, cli_core_1.ROUTES_VARIABLE_NAME), [newRoute], prepend, anchorElement);
21
21
  }
22
22
  //#endregion
23
23
  //#region Overrides
@@ -0,0 +1,9 @@
1
+ import { expect } from '@open-wc/testing';
2
+ import $(ClassName) from './$(path).js';
3
+
4
+ describe('IgcBannerComponent', () => {
5
+ it('<app-$(path)> is an instance of $(ClassName)', async () => {
6
+ const element = document.createElement('app-$(path)');
7
+ expect(element).to.be.instanceOf($(ClassName));
8
+ });
9
+ });
@@ -0,0 +1,19 @@
1
+ import { html, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
3
+ import {
4
+ defineComponents,
5
+ IgcBannerComponent,
6
+ } from 'igniteui-webcomponents';
7
+
8
+ defineComponents(IgcBannerComponent);
9
+
10
+ @customElement('app-$(path)')
11
+ export default class $(ClassName) extends LitElement {
12
+ render() {
13
+ return html`
14
+ <igc-banner id="banner" .open=${open}>
15
+ You are currently not logged in! Please, log into your account first.
16
+ </igc-banner>
17
+ `;
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const IgniteUIForWebComponentsTemplate_1 = require("../../../../../lib/templates/IgniteUIForWebComponentsTemplate");
4
+ class IgcBannerTemplate extends IgniteUIForWebComponentsTemplate_1.IgniteUIForWebComponentsTemplate {
5
+ constructor() {
6
+ super(__dirname);
7
+ this.components = ["Banner"];
8
+ this.controlGroup = "Notifications";
9
+ this.listInComponentTemplates = true;
10
+ this.id = "banner";
11
+ this.projectType = "igc-ts";
12
+ this.name = "Banner";
13
+ this.description = "basic IgcBanner";
14
+ }
15
+ addClassDeclaration(mainModule, projPath, name, modulePath) {
16
+ // not applicable with custom module
17
+ }
18
+ }
19
+ module.exports = new IgcBannerTemplate();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cli_core_1 = require("@igniteui/cli-core");
4
+ class IgcBannerComponent extends cli_core_1.BaseComponent {
5
+ /**
6
+ *
7
+ */
8
+ constructor() {
9
+ super(__dirname);
10
+ this.name = "Banner";
11
+ this.group = "Notifications";
12
+ this.description = `Customizable banner component`;
13
+ }
14
+ }
15
+ module.exports = new IgcBannerComponent();
@@ -0,0 +1,9 @@
1
+ import { expect } from '@open-wc/testing';
2
+ import $(ClassName) from './$(path).js';
3
+
4
+ describe('IgcAvatarComponent', () => {
5
+ it('<app-$(path)> is an instance of $(ClassName)', async () => {
6
+ const element = document.createElement('app-$(path)');
7
+ expect(element).to.be.instanceOf($(ClassName));
8
+ });
9
+ });
@@ -0,0 +1,18 @@
1
+ import { html, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
3
+ import {
4
+ defineComponents,
5
+ IgcDatePickerComponent,
6
+ } from 'igniteui-webcomponents';
7
+
8
+ defineComponents(IgcDatePickerComponent);
9
+
10
+ @customElement('app-$(path)')
11
+ export default class $(ClassName) extends LitElement {
12
+ render() {
13
+ return html`
14
+ <igc-date-picker>
15
+ </igc-date-picker>
16
+ `;
17
+ }
18
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const IgniteUIForWebComponentsTemplate_1 = require("../../../../../lib/templates/IgniteUIForWebComponentsTemplate");
4
+ class IgcDatePickerTemplate extends IgniteUIForWebComponentsTemplate_1.IgniteUIForWebComponentsTemplate {
5
+ constructor() {
6
+ super(__dirname);
7
+ this.components = ["DatePicker"];
8
+ this.controlGroup = "Scheduling";
9
+ this.listInComponentTemplates = true;
10
+ this.id = "date-picker";
11
+ this.projectType = "igc-ts";
12
+ this.name = "Date Picker";
13
+ this.description = "basic IgcDatePicker";
14
+ }
15
+ addClassDeclaration(mainModule, projPath, name, modulePath) {
16
+ // not applicable with custom module
17
+ }
18
+ }
19
+ module.exports = new IgcDatePickerTemplate();
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cli_core_1 = require("@igniteui/cli-core");
4
+ class IgcDatePickerComponent extends cli_core_1.BaseComponent {
5
+ /**
6
+ *
7
+ */
8
+ constructor() {
9
+ super(__dirname);
10
+ this.name = "DatePicker";
11
+ this.group = "Scheduling";
12
+ this.description = `Basic date picker component`;
13
+ }
14
+ }
15
+ module.exports = new IgcDatePickerComponent();
@@ -0,0 +1,9 @@
1
+ import { expect } from '@open-wc/testing';
2
+ import $(ClassName) from './$(path).js';
3
+
4
+ describe('IgcDividerComponent', () => {
5
+ it('<app-$(path)> is an instance of $(ClassName)', async () => {
6
+ const element = document.createElement('app-$(path)');
7
+ expect(element).to.be.instanceOf($(ClassName));
8
+ });
9
+ });
@@ -0,0 +1,19 @@
1
+ import { html, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
3
+ import {
4
+ defineComponents,
5
+ IgcDividerComponent,
6
+ } from 'igniteui-webcomponents';
7
+
8
+ defineComponents(IgcDividerComponent);
9
+
10
+ @customElement('app-$(path)')
11
+ export default class $(ClassName) extends LitElement {
12
+ render() {
13
+ return html`
14
+ <p>First paragraph</p>
15
+ <igc-divider ?middle=true type=solid></igc-divider>
16
+ <p>Second paragraph</p>
17
+ `;
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const IgniteUIForWebComponentsTemplate_1 = require("../../../../../lib/templates/IgniteUIForWebComponentsTemplate");
4
+ class IgcDividerTemplate extends IgniteUIForWebComponentsTemplate_1.IgniteUIForWebComponentsTemplate {
5
+ constructor() {
6
+ super(__dirname);
7
+ this.components = ["Divider"];
8
+ this.controlGroup = "Data Entry & Display";
9
+ this.listInComponentTemplates = true;
10
+ this.id = "divider";
11
+ this.projectType = "igc-ts";
12
+ this.name = "Divider";
13
+ this.description = "basic IgcDivider";
14
+ }
15
+ addClassDeclaration(mainModule, projPath, name, modulePath) {
16
+ // not applicable with custom module
17
+ }
18
+ }
19
+ module.exports = new IgcDividerTemplate();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cli_core_1 = require("@igniteui/cli-core");
4
+ class IgcDividerComponent extends cli_core_1.BaseComponent {
5
+ /**
6
+ *
7
+ */
8
+ constructor() {
9
+ super(__dirname);
10
+ this.name = "Divider";
11
+ this.group = "Data Entry & Display";
12
+ this.description = `Customizable divider component`;
13
+ }
14
+ }
15
+ module.exports = new IgcDividerComponent();
@@ -6,6 +6,7 @@
6
6
  "Scheduling": "",
7
7
  "Layouts": "",
8
8
  "Charts": "",
9
- "Gauges": ""
9
+ "Gauges": "",
10
+ "Notifications": ""
10
11
  }
11
12
 
@@ -23,7 +23,7 @@
23
23
  "@vaadin/router": "^1.7.4",
24
24
  "lit": "^3.1.2",
25
25
  "typescript": "^5.3.3",
26
- "igniteui-webcomponents": "~4.9.0"
26
+ "igniteui-webcomponents": "~4.11.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@babel/preset-env": "^7.20.2",
@@ -49,6 +49,7 @@
49
49
  "rollup-plugin-terser": "^7.0.2",
50
50
  "rollup-plugin-workbox": "^8.1.0",
51
51
  "source-map": "^0.7.4",
52
- "tslib": "^2.6.2"
52
+ "tslib": "^2.6.2",
53
+ "@types/mocha": "^10.0.6"
53
54
  }
54
55
  }
@@ -23,7 +23,7 @@
23
23
  "@vaadin/router": "^1.7.4",
24
24
  "@igniteui/material-icons-extended": "^3.0.2",
25
25
  "igniteui-dockmanager": "~1.14.3",
26
- "igniteui-webcomponents": "~4.9.0",
26
+ "igniteui-webcomponents": "~4.11.0",
27
27
  "igniteui-webcomponents-charts": "~4.8.0",
28
28
  "igniteui-webcomponents-core": "~4.8.0",
29
29
  "igniteui-webcomponents-gauges": "~4.8.0",
@@ -57,6 +57,7 @@
57
57
  "rollup-plugin-terser": "^7.0.2",
58
58
  "rollup-plugin-workbox": "^8.1.0",
59
59
  "source-map": "^0.7.4",
60
- "tslib": "^2.6.2"
60
+ "tslib": "^2.6.2",
61
+ "@types/mocha": "^10.0.6"
61
62
  }
62
63
  }