igniteui-cli 9.0.6 → 9.1.0-beta.0

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 (86) hide show
  1. package/lib/commands/start.js +11 -9
  2. package/lib/templates/IgniteUIForWebComponentsTemplate.js +3 -2
  3. package/package.json +3 -3
  4. package/templates/webcomponents/TypeScriptFileUpdate.js +1 -1
  5. package/templates/webcomponents/igc-ts/avatar/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  6. package/templates/webcomponents/igc-ts/avatar/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  7. package/templates/webcomponents/igc-ts/badge/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -2
  8. package/templates/webcomponents/igc-ts/badge/default/files/src/app/__path__/__filePrefix__.ts +21 -19
  9. package/templates/webcomponents/igc-ts/button/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -2
  10. package/templates/webcomponents/igc-ts/button/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  11. package/templates/webcomponents/igc-ts/calendar/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  12. package/templates/webcomponents/igc-ts/calendar/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  13. package/templates/webcomponents/igc-ts/card/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  14. package/templates/webcomponents/igc-ts/card/default/files/src/app/__path__/__filePrefix__.ts +47 -45
  15. package/templates/webcomponents/igc-ts/checkbox/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  16. package/templates/webcomponents/igc-ts/checkbox/default/files/src/app/__path__/__filePrefix__.ts +11 -10
  17. package/templates/webcomponents/igc-ts/custom-templates/subscription-form/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  18. package/templates/webcomponents/igc-ts/custom-templates/subscription-form/files/src/app/__path__/__filePrefix__.ts +36 -36
  19. package/templates/webcomponents/igc-ts/dock-manager/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  20. package/templates/webcomponents/igc-ts/dock-manager/default/files/src/app/__path__/__filePrefix__.ts +53 -53
  21. package/templates/webcomponents/igc-ts/financial-chart/default/files/src/app/__path__/StockIndexData.ts +994 -126
  22. package/templates/webcomponents/igc-ts/financial-chart/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  23. package/templates/webcomponents/igc-ts/financial-chart/default/files/src/app/__path__/__filePrefix__.ts +19 -20
  24. package/templates/webcomponents/igc-ts/form/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  25. package/templates/webcomponents/igc-ts/form/default/files/src/app/__path__/__filePrefix__.ts +14 -13
  26. package/templates/webcomponents/igc-ts/grid/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  27. package/templates/webcomponents/igc-ts/grid/default/files/src/app/__path__/__filePrefix__.ts +34 -35
  28. package/templates/webcomponents/igc-ts/grid/grid-editing/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  29. package/templates/webcomponents/igc-ts/grid/grid-editing/files/src/app/__path__/__filePrefix__.ts +25 -26
  30. package/templates/webcomponents/igc-ts/grid/grid-summaries/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  31. package/templates/webcomponents/igc-ts/grid/grid-summaries/files/src/app/__path__/__filePrefix__.ts +17 -21
  32. package/templates/webcomponents/igc-ts/icon/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  33. package/templates/webcomponents/igc-ts/icon/default/files/src/app/__path__/__filePrefix__.ts +11 -10
  34. package/templates/webcomponents/igc-ts/icon-button/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  35. package/templates/webcomponents/igc-ts/icon-button/default/files/src/app/__path__/__filePrefix__.ts +10 -9
  36. package/templates/webcomponents/igc-ts/input/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  37. package/templates/webcomponents/igc-ts/input/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  38. package/templates/webcomponents/igc-ts/linear-gauge/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  39. package/templates/webcomponents/igc-ts/linear-gauge/default/files/src/app/__path__/__filePrefix__.ts +26 -26
  40. package/templates/webcomponents/igc-ts/list/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  41. package/templates/webcomponents/igc-ts/list/default/files/src/app/__path__/__filePrefix__.ts +7 -6
  42. package/templates/webcomponents/igc-ts/navbar/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  43. package/templates/webcomponents/igc-ts/navbar/default/files/src/app/__path__/__filePrefix__.ts +17 -9
  44. package/templates/webcomponents/igc-ts/pie-chart/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  45. package/templates/webcomponents/igc-ts/pie-chart/default/files/src/app/__path__/__filePrefix__.ts +19 -19
  46. package/templates/webcomponents/igc-ts/pie-chart/default/files/src/app/__path__/sampleData.ts +28 -23
  47. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/__dot__editorconfig +0 -0
  48. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/__dot__gitignore +0 -0
  49. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/ignite-ui-cli.json +2 -1
  50. package/templates/webcomponents/igc-ts/projects/_base/files/index.html +17 -0
  51. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/package.json +22 -22
  52. package/templates/webcomponents/igc-ts/projects/_base/files/rollup.config.mjs +90 -0
  53. package/templates/webcomponents/igc-ts/projects/_base/files/src/app/app-routing.ts +11 -0
  54. package/templates/webcomponents/igc-ts/projects/_base/files/src/app/app.ts +32 -0
  55. package/templates/webcomponents/igc-ts/projects/{empty/files/src/app/home/home.component.test.ts → _base/files/src/app/home/home.test.ts} +1 -1
  56. package/templates/webcomponents/igc-ts/projects/{empty/files/src/app/home/home.component.ts → _base/files/src/app/home/home.ts} +17 -15
  57. package/templates/webcomponents/igc-ts/projects/_base/files/src/app/not-found/not-found.ts +11 -0
  58. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/src/assets/astronaut-components.svg +0 -0
  59. package/templates/webcomponents/igc-ts/projects/_base/files/src/index.ts +2 -0
  60. package/templates/webcomponents/igc-ts/projects/_base/files/styles.css +5 -0
  61. package/templates/webcomponents/igc-ts/projects/_base/files/tsconfig.json +31 -0
  62. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/web-dev-server.config.mjs +0 -0
  63. package/templates/webcomponents/igc-ts/projects/{empty → _base}/files/web-test-runner.config.mjs +0 -0
  64. package/templates/webcomponents/igc-ts/projects/_base/index.d.ts +19 -0
  65. package/templates/webcomponents/igc-ts/projects/_base/index.js +56 -0
  66. package/templates/webcomponents/igc-ts/projects/empty/index.d.ts +14 -1
  67. package/templates/webcomponents/igc-ts/projects/empty/index.js +10 -43
  68. package/templates/webcomponents/igc-ts/projects/side-nav/files/src/app/app.ts +57 -0
  69. package/templates/webcomponents/igc-ts/projects/side-nav/index.d.ts +14 -0
  70. package/templates/webcomponents/igc-ts/projects/side-nav/index.js +21 -0
  71. package/templates/webcomponents/igc-ts/radial-gauge/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  72. package/templates/webcomponents/igc-ts/radial-gauge/default/files/src/app/__path__/__filePrefix__.ts +13 -13
  73. package/templates/webcomponents/igc-ts/radio-group/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  74. package/templates/webcomponents/igc-ts/radio-group/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  75. package/templates/webcomponents/igc-ts/ripple/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  76. package/templates/webcomponents/igc-ts/ripple/default/files/src/app/__path__/__filePrefix__.ts +6 -6
  77. package/templates/webcomponents/igc-ts/slider/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  78. package/templates/webcomponents/igc-ts/slider/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  79. package/templates/webcomponents/igc-ts/switch/default/files/src/app/__path__/{__filePrefix__.component.test.ts → __filePrefix__.test.ts} +1 -1
  80. package/templates/webcomponents/igc-ts/switch/default/files/src/app/__path__/__filePrefix__.ts +6 -5
  81. package/templates/webcomponents/igc-ts/projects/empty/files/index.html +0 -43
  82. package/templates/webcomponents/igc-ts/projects/empty/files/src/app/not-found/not-found.component.ts +0 -9
  83. package/templates/webcomponents/igc-ts/projects/empty/files/src/app.ts +0 -46
  84. package/templates/webcomponents/igc-ts/projects/empty/files/src/index.ts +0 -16
  85. package/templates/webcomponents/igc-ts/projects/empty/files/tsconfig.json +0 -31
  86. package/templates/webcomponents/igc-ts/projects/empty/files/webpack.config.mjs +0 -67
@@ -1,3 +1,5 @@
1
+ import { html, css, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
1
3
  import {
2
4
  defineComponents,
3
5
  IgcIconComponent,
@@ -5,24 +7,32 @@ import {
5
7
  } from 'igniteui-webcomponents';
6
8
  import {
7
9
  registerIcon,
8
- } from "igniteui-webcomponents/components/icon/icon.registry";
10
+ } from 'igniteui-webcomponents/components/icon/icon.registry';
9
11
 
10
12
  defineComponents(IgcIconComponent, IgcNavbarComponent);
11
13
 
12
14
  registerIcon(
13
15
  'home',
14
- 'https://unpkg.com/material-design-icons@3.0.1/action/svg/production/ic_home_24px.svg'
16
+ 'https://unpkg.com/material-design-icons@3.0.1/action/svg/production/ic_home_24px.svg',
15
17
  );
16
18
 
17
19
  registerIcon(
18
20
  'search',
19
- 'https://unpkg.com/material-design-icons@3.0.1/action/svg/production/ic_search_24px.svg'
21
+ 'https://unpkg.com/material-design-icons@3.0.1/action/svg/production/ic_search_24px.svg',
20
22
  );
21
23
 
22
- export default class $(ClassName) extends HTMLElement {
23
- connectedCallback() {
24
- this.innerHTML = `
25
- <igc-navbar style="height:30px; width:800px">
24
+
25
+ @customElement('app-$(path)')
26
+ export default class $(ClassName) extends LitElement {
27
+ static styles = css`
28
+ igc-navbar {
29
+ width:100%;
30
+ }
31
+ `;
32
+
33
+ render() {
34
+ return html`
35
+ <igc-navbar>
26
36
  <igc-icon slot="start" name="home"></igc-icon>
27
37
  <h2>Home</h2>
28
38
  <igc-icon slot="end" name="search"></igc-icon>
@@ -30,5 +40,3 @@ export default class $(ClassName) extends HTMLElement {
30
40
  `;
31
41
  }
32
42
  }
33
-
34
- customElements.define('app-$(path)', $(ClassName));
@@ -1,5 +1,5 @@
1
1
  import { expect } from '@open-wc/testing';
2
- import $(ClassName) from './$(path)';
2
+ import $(ClassName) from './$(path).js';
3
3
 
4
4
  describe('IgcPieChartComponent', () => {
5
5
  it('<app-$(path)> is an instance of $(ClassName)', async () => {
@@ -1,4 +1,5 @@
1
- import { Data } from './sampleData';
1
+ import { html, css, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
2
3
  import {
3
4
  IgcItemLegendComponent,
4
5
  IgcItemLegendModule,
@@ -6,25 +7,26 @@ import {
6
7
  IgcPieChartModule,
7
8
  } from 'igniteui-webcomponents-charts';
8
9
  import { ModuleManager } from 'igniteui-webcomponents-core';
10
+ import { Data } from './sampleData.js';
9
11
 
10
12
  ModuleManager.register(
11
13
  IgcItemLegendModule,
12
14
  IgcPieChartModule,
13
15
  );
14
16
 
15
- export default class $(ClassName) extends HTMLElement {
16
- constructor() {
17
- super();
18
- this.attachShadow({ mode: 'open' });
19
- this.shadowRoot!.innerHTML = `
20
- <style>
21
- :host, igc-pie-chart {
22
- height: 100%;
23
- }
24
- .container {
25
- height: 60%;
26
- }
27
- </style>
17
+ @customElement('app-$(path)')
18
+ export default class $(ClassName) extends LitElement {
19
+ static styles = css`
20
+ :host, igc-pie-chart {
21
+ height: 100%;
22
+ }
23
+ .container {
24
+ height: 60%;
25
+ }
26
+ `;
27
+
28
+ render() {
29
+ return html`
28
30
  <div class="legend-title">
29
31
  Global Electricity Demand by Energy Use
30
32
  </div>
@@ -48,11 +50,9 @@ export default class $(ClassName) extends HTMLElement {
48
50
  `;
49
51
  }
50
52
 
51
- connectedCallback() {
52
- const chart = document.getElementsByTagName('app-$(path)')[0].shadowRoot!.getElementById('chart') as IgcPieChartComponent;
53
+ firstUpdated() {
54
+ const chart = this.shadowRoot?.getElementById('chart') as IgcPieChartComponent;
53
55
  chart.dataSource = new Data();
54
- chart.legend = document.getElementsByTagName('app-$(path)')[0].shadowRoot!.getElementById('legend') as IgcItemLegendComponent;
56
+ chart.legend = this.shadowRoot?.getElementById('legend') as IgcItemLegendComponent;
55
57
  }
56
58
  }
57
-
58
- customElements.define('app-$(path)', $(ClassName));
@@ -1,39 +1,44 @@
1
1
  export class DataItem {
2
2
  public constructor(init: Partial<DataItem>) {
3
- Object.assign(this, init);
3
+ Object.assign(this, init);
4
4
  }
5
5
 
6
6
  public marketShare: number = 0;
7
- public category: string = '';
8
7
 
8
+ public category: string = '';
9
9
  }
10
10
  export class Data extends Array<DataItem> {
11
11
  public constructor() {
12
- super();
13
- this.push(new DataItem(
12
+ super();
13
+ this.push(new DataItem(
14
14
  {
15
- marketShare: 37,
16
- category: `Cooling`
17
- }));
18
- this.push(new DataItem(
15
+ marketShare: 37,
16
+ category: 'Cooling',
17
+ }
18
+ ));
19
+ this.push(new DataItem(
19
20
  {
20
- marketShare: 25,
21
- category: `Residential`
22
- }));
23
- this.push(new DataItem(
21
+ marketShare: 25,
22
+ category: 'Residential',
23
+ }
24
+ ));
25
+ this.push(new DataItem(
24
26
  {
25
- marketShare: 12,
26
- category: `Heating`
27
- }));
28
- this.push(new DataItem(
27
+ marketShare: 12,
28
+ category: 'Heating',
29
+ }
30
+ ));
31
+ this.push(new DataItem(
29
32
  {
30
- marketShare: 11,
31
- category: `Lighting`
32
- }));
33
- this.push(new DataItem(
33
+ marketShare: 11,
34
+ category: 'Lighting',
35
+ }
36
+ ));
37
+ this.push(new DataItem(
34
38
  {
35
- marketShare: 15,
36
- category: `Other`
37
- }));
39
+ marketShare: 15,
40
+ category: 'Other',
41
+ }
42
+ ));
38
43
  }
39
44
  }
@@ -3,6 +3,7 @@
3
3
  "project": {
4
4
  "defaultPort": 8000,
5
5
  "framework": "webcomponents",
6
+ "projectTemplate": "$(projectTemplate)",
6
7
  "projectType": "igc-ts",
7
8
  "theme": "$(theme)",
8
9
  "isBundle": false,
@@ -12,4 +13,4 @@
12
13
  "version": ""
13
14
  },
14
15
  "build": {}
15
- }
16
+ }
@@ -0,0 +1,17 @@
1
+ <!doctype html>
2
+ <html lang="en-GB">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <base href="/">
7
+ <title>Ignite UI for Web Components</title>
8
+ <link rel="stylesheet" href="./node_modules/igniteui-webcomponents/themes/light/bootstrap.css">
9
+ <link rel="stylesheet" href="./styles.css">
10
+ </head>
11
+
12
+ <body>
13
+ <app-root></app-root>
14
+
15
+ <script type="module" src="./dist/src/index.js"></script>
16
+ </body>
17
+ </html>
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "$(dash-name)",
2
+ "name": "$(dashName)",
3
3
  "version": "0.0.0",
4
4
  "private": true,
5
5
  "description": "WebComponents project for Ignite UI CLI",
@@ -10,16 +10,16 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": "./dist/src/index.js",
13
- "./$(dash-name).js": "./dist/src/$(dash-name).js"
13
+ "./$(dashName).js": "./dist/src/$(dashName).js"
14
14
  },
15
15
  "scripts": {
16
- "start": "tsc && concurrently --kill-others \"tsc -w\" \"wds\"",
17
- "build": "webpack --mode production",
16
+ "start": "tsc && concurrently -k -r \"tsc --watch\" \"wds\"",
17
+ "build": "rimraf dist && tsc && rollup -c rollup.config.mjs",
18
+ "start:build": "web-dev-server --root-dir dist --app-index index.html --open",
18
19
  "lint": "eslint --ext .js,.ts,.html . --ignore-path .gitignore",
19
20
  "test": "tsc && wtr"
20
21
  },
21
22
  "dependencies": {
22
- "@open-wc/testing": "^2.5.33",
23
23
  "@vaadin/router": "^1.7.4",
24
24
  "igniteui-webcomponents": "2.0.0",
25
25
  "igniteui-webcomponents-grids": "~1.4.1",
@@ -31,33 +31,33 @@
31
31
  "igniteui-dockmanager": "~1.6.0",
32
32
  "@igniteui/material-icons-extended": "^2.10.0",
33
33
  "lit": "^2.0.2",
34
- "typescript": "^4.5.2",
35
- "babel-runtime": "^6.26.0"
34
+ "typescript": "^4.5.2"
36
35
  },
37
36
  "devDependencies": {
37
+ "@babel/preset-env": "^7.16.4",
38
+ "@open-wc/testing": "^2.5.33",
39
+ "@open-wc/building-rollup": "^2.0.1",
40
+ "@rollup/plugin-babel": "^5.3.0",
41
+ "@rollup/plugin-node-resolve": "^13.0.6",
42
+ "rollup-plugin-copy-assets": "^2.0.3",
38
43
  "@open-wc/eslint-config": "^4.3.0",
39
44
  "@typescript-eslint/eslint-plugin": "^4.30.0",
40
45
  "@typescript-eslint/parser": "^4.30.0",
41
46
  "@web/dev-server": "^0.1.22",
47
+ "@web/rollup-plugin-html": "^1.10.1",
48
+ "@web/rollup-plugin-import-meta-assets": "^1.0.7",
49
+ "babel-plugin-template-html-minifier": "^4.1.0",
42
50
  "@web/test-runner": "next",
43
- "igniteui-cli": "$(cliVersion)",
51
+ "igniteui-cli": "~$(cliVersion)",
44
52
  "concurrently": "^6.3.0",
53
+ "deepmerge": "^4.2.2",
54
+ "rimraf": "^3.0.2",
55
+ "rollup": "^2.60.0",
56
+ "rollup-plugin-terser": "^7.0.2",
57
+ "rollup-plugin-workbox": "^6.2.0",
45
58
  "eslint": "^7.32.0",
46
59
  "tslib": "^2.3.1",
47
- "@babel/cli": "^7.16.0",
48
- "@babel/core": "^7.16.0",
49
- "@babel/plugin-proposal-class-properties": "^7.16.0",
50
- "@babel/plugin-transform-runtime": "^7.16.4",
51
- "@babel/preset-env": "^7.16.4",
52
- "@babel/preset-typescript": "^7.16.0",
53
- "@types/source-map": "^0.5.7",
54
- "babel-loader": "^8.2.3",
55
- "babel-plugin-transform-custom-element-classes": "^0.1.0",
56
- "fork-ts-checker-webpack-plugin": "^6.4.2",
57
- "html-webpack-plugin": "^5.5.0",
58
- "source-map": "^0.7.3",
59
- "webpack": "^5.64.2",
60
- "webpack-cli": "^4.9.1"
60
+ "source-map": "^0.7.3"
61
61
  },
62
62
  "eslintConfig": {
63
63
  "parser": "@typescript-eslint/parser",
@@ -0,0 +1,90 @@
1
+ import nodeResolve from '@rollup/plugin-node-resolve';
2
+ import babel from '@rollup/plugin-babel';
3
+ import copy from 'rollup-plugin-copy-assets';
4
+ import { rollupPluginHTML as html } from '@web/rollup-plugin-html';
5
+ import { importMetaAssets } from '@web/rollup-plugin-import-meta-assets';
6
+ import { terser } from 'rollup-plugin-terser';
7
+ import { generateSW } from 'rollup-plugin-workbox';
8
+ import path from 'path';
9
+
10
+ export default {
11
+ input: 'index.html',
12
+ output: {
13
+ entryFileNames: '[hash].js',
14
+ chunkFileNames: '[hash].js',
15
+ assetFileNames: '[hash][extname]',
16
+ format: 'es',
17
+ dir: 'dist',
18
+ },
19
+ preserveEntrySignatures: false,
20
+
21
+ plugins: [
22
+ copy({
23
+ assets: [
24
+ 'src/assets',
25
+ ],
26
+ }),
27
+ /** Enable using HTML as rollup entrypoint */
28
+ html({
29
+ minify: true,
30
+ injectServiceWorker: true,
31
+ serviceWorkerPath: 'dist/sw.js',
32
+ }),
33
+ /** Resolve bare module imports */
34
+ nodeResolve(),
35
+ /** Minify JS */
36
+ terser(),
37
+ /** Bundle assets references via import.meta.url */
38
+ importMetaAssets(),
39
+ /** Compile JS to a lower language target */
40
+ babel.babel({
41
+ babelHelpers: 'bundled',
42
+ presets: [
43
+ [
44
+ '@babel/preset-env',
45
+ {
46
+ targets: [
47
+ 'last 3 Chrome major versions',
48
+ 'last 3 Firefox major versions',
49
+ 'last 3 Edge major versions',
50
+ 'last 3 Safari major versions',
51
+ ],
52
+ modules: false,
53
+ bugfixes: true,
54
+ },
55
+ ],
56
+ ],
57
+ plugins: [
58
+ [
59
+ 'babel-plugin-template-html-minifier',
60
+ {
61
+ modules: { lit: ['html', { name: 'css', encapsulation: 'style' }] },
62
+ failOnError: false,
63
+ strictCSS: true,
64
+ htmlMinifier: {
65
+ collapseWhitespace: true,
66
+ conservativeCollapse: true,
67
+ removeComments: true,
68
+ caseSensitive: true,
69
+ minifyCSS: true,
70
+ },
71
+ },
72
+ ],
73
+ ],
74
+ }),
75
+ /** Create and inject a service worker */
76
+ generateSW({
77
+ globIgnores: ['polyfills/*.js', 'nomodule-*.js'],
78
+ navigateFallback: '/index.html',
79
+ // where to output the generated sw
80
+ swDest: path.join('dist', 'sw.js'),
81
+ // directory to match patterns against to be precached
82
+ globDirectory: path.join('dist'),
83
+ // cache any html js and css by default
84
+ globPatterns: ['**/*.{html,js,css,webmanifest}'],
85
+ skipWaiting: true,
86
+ clientsClaim: true,
87
+ runtimeCaching: [{ urlPattern: 'polyfills/*.js', handler: 'CacheFirst' }],
88
+ }),
89
+ ],
90
+ };
@@ -0,0 +1,11 @@
1
+ import {
2
+ Route
3
+ } from '@vaadin/router';
4
+ import './home/home.js';
5
+ import './not-found/not-found.js';
6
+
7
+ export const routes: Route[] = [
8
+ { path: '/', component: 'app-home', name: 'Home' },
9
+ // The fallback route should always be after other alternatives.
10
+ { path: '(.*)', component: 'app-not-found' },
11
+ ];
@@ -0,0 +1,32 @@
1
+ import { html, css, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
3
+ import { Router, } from '@vaadin/router';
4
+ import { routes } from './app-routing.js';
5
+
6
+ @customElement('app-root')
7
+ export class App extends LitElement {
8
+ static styles = css`
9
+ router-outlet {
10
+ width: 100%;
11
+ height: 100%;
12
+ display: flex;
13
+ text-align: center;
14
+ flex-flow: column nowrap;
15
+ justify-content: stretch;
16
+ align-items: center;
17
+ overflow: inherit;
18
+ }
19
+ `;
20
+
21
+ render() {
22
+ return html`
23
+ <router-outlet></router-outlet>
24
+ `;
25
+ }
26
+
27
+ firstUpdated() {
28
+ const outlet = this.shadowRoot?.querySelector('router-outlet');
29
+ const router = new Router(outlet);
30
+ router.setRoutes(routes);
31
+ }
32
+ }
@@ -1,5 +1,5 @@
1
1
  import { expect } from '@open-wc/testing';
2
- import { HomeComponent } from './home.component.js';
2
+ import { HomeComponent } from './home.js';
3
3
 
4
4
  describe('HomeComponent', () => {
5
5
  it('<my-element> is an instance of MyElement', async () => {
@@ -1,17 +1,21 @@
1
- export class HomeComponent extends HTMLElement {
2
- connectedCallback() {
3
- this.innerHTML = `
4
- <style>
5
- p {
6
- margin: 0px 0px 8px 0px;
7
- }
8
- img {
9
- margin-bottom: 48px;
10
- max-height: 480px;
11
- max-width: 100%;
12
- }
13
- </style>
1
+ import { html, css, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
14
3
 
4
+ @customElement('app-home')
5
+ export class HomeComponent extends LitElement {
6
+ static styles = css`
7
+ p {
8
+ margin: 0px 0px 8px 0px;
9
+ }
10
+ img {
11
+ margin-bottom: 48px;
12
+ max-height: 480px;
13
+ max-width: 100%;
14
+ }
15
+ `;
16
+
17
+ render() {
18
+ return html`
15
19
  <h1>Welcome to Ignite UI for Web Components!</h1>
16
20
  <h4>A complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.</h4>
17
21
  <img src="./src/assets/astronaut-components.svg" alt="indigoDesign">
@@ -35,5 +39,3 @@ export class HomeComponent extends HTMLElement {
35
39
  `;
36
40
  }
37
41
  }
38
-
39
- customElements.define('app-home', HomeComponent);
@@ -0,0 +1,11 @@
1
+ import { html, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
3
+
4
+ @customElement('app-not-found')
5
+ export default class NotFound extends LitElement {
6
+ render() {
7
+ return html`
8
+ <h2>Error 404: Page not found</h2>
9
+ `;
10
+ }
11
+ }
@@ -0,0 +1,2 @@
1
+ import './app/app.js';
2
+ import './app/app-routing.js';
@@ -0,0 +1,5 @@
1
+ html, body {
2
+ height: 100%;
3
+ margin: 0px;
4
+ background: #fafafa;
5
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2018",
4
+ "module": "esnext",
5
+ "moduleResolution": "node",
6
+ "noEmitOnError": true,
7
+ "lib": [
8
+ "es2017",
9
+ "dom",
10
+ "dom.iterable"
11
+ ],
12
+ "strict": true,
13
+ "skipLibCheck": true,
14
+ "esModuleInterop": false,
15
+ "allowSyntheticDefaultImports": true,
16
+ "experimentalDecorators": true,
17
+ "importHelpers": true,
18
+ "outDir": "dist",
19
+ "sourceMap": true,
20
+ "inlineSources": true,
21
+ "rootDir": "./",
22
+ "declaration": true,
23
+ "incremental": true
24
+ },
25
+ "exclude": [
26
+ "dist"
27
+ ],
28
+ "include": [
29
+ "**/*.ts"
30
+ ]
31
+ }
@@ -0,0 +1,19 @@
1
+ import { ControlExtraConfiguration, ProjectTemplate } from "@igniteui/cli-core";
2
+ export declare class BaseIgcProject implements ProjectTemplate {
3
+ id: string;
4
+ name: string;
5
+ description: string;
6
+ dependencies: string[];
7
+ framework: string;
8
+ projectType: string;
9
+ hasExtraConfiguration: boolean;
10
+ delimiters: import("@igniteui/cli-core").TemplateDelimiters;
11
+ get templatePaths(): string[];
12
+ installModules(): void;
13
+ upgradeIgniteUIPackages(projectPath: string, packagePath: string): Promise<boolean>;
14
+ getExtraConfiguration(): ControlExtraConfiguration[];
15
+ setExtraConfiguration(extraConfigKeys: any[]): void;
16
+ generateConfig(name: string, theme: string, ...options: any[]): {
17
+ [key: string]: any;
18
+ };
19
+ }
@@ -0,0 +1,56 @@
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.BaseIgcProject = void 0;
13
+ const cli_core_1 = require("@igniteui/cli-core");
14
+ const path = require("path");
15
+ class BaseIgcProject {
16
+ constructor() {
17
+ this.id = "base";
18
+ this.name = "base";
19
+ this.description = "Empty project layout structure for Ignite UI for Web Components";
20
+ this.dependencies = [];
21
+ this.framework = "webcomponents";
22
+ this.projectType = "igc-ts";
23
+ this.hasExtraConfiguration = false;
24
+ this.delimiters = cli_core_1.defaultDelimiters;
25
+ }
26
+ get templatePaths() {
27
+ return [path.join(__dirname, "files")];
28
+ }
29
+ installModules() {
30
+ throw new Error("Method not implemented.");
31
+ }
32
+ upgradeIgniteUIPackages(projectPath, packagePath) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ throw new Error("Method not implemented.");
35
+ });
36
+ }
37
+ getExtraConfiguration() {
38
+ return [];
39
+ }
40
+ setExtraConfiguration(extraConfigKeys) { }
41
+ generateConfig(name, theme, ...options) {
42
+ const config = {
43
+ name,
44
+ theme,
45
+ cliVersion: cli_core_1.Util.version(),
46
+ CustomTheme: "",
47
+ dashName: cli_core_1.Util.lowerDashed(name),
48
+ DefaultTheme: "",
49
+ dot: ".",
50
+ path: name,
51
+ projectTemplate: this.id
52
+ };
53
+ return config;
54
+ }
55
+ }
56
+ exports.BaseIgcProject = BaseIgcProject;
@@ -1 +1,14 @@
1
- export {};
1
+ import { ProjectTemplate } from "@igniteui/cli-core";
2
+ import { BaseIgcProject } from "../_base";
3
+ export declare class EmptyPageTemplate extends BaseIgcProject implements ProjectTemplate {
4
+ id: string;
5
+ name: string;
6
+ description: string;
7
+ framework: string;
8
+ projectType: string;
9
+ dependencies: string[];
10
+ hasExtraConfiguration: boolean;
11
+ get templatePaths(): string[];
12
+ }
13
+ declare const _default: EmptyPageTemplate;
14
+ export default _default;