igniteui-cli 10.0.5 → 10.1.0-alpha.1

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 (27) hide show
  1. package/lib/templates/IgniteUIForWebComponentsTemplate.d.ts +1 -1
  2. package/lib/templates/IgniteUIForWebComponentsTemplate.js +15 -4
  3. package/package.json +3 -3
  4. package/templates/webcomponents/TypeScriptFileUpdate.d.ts +4 -4
  5. package/templates/webcomponents/TypeScriptFileUpdate.js +54 -20
  6. package/templates/webcomponents/igc-ts/projects/_base/files/index.html +1 -1
  7. package/templates/webcomponents/igc-ts/projects/_base/files/package.json +9 -29
  8. package/templates/webcomponents/igc-ts/projects/_base/files/rollup.config.mjs +3 -3
  9. package/templates/webcomponents/igc-ts/projects/_base/files/src/app/app-routing.ts +1 -5
  10. package/templates/webcomponents/igc-ts/projects/_base/files/src/app/app.ts +2 -2
  11. package/templates/webcomponents/igc-ts/projects/_base/files/styles.css +2 -1
  12. package/templates/webcomponents/igc-ts/projects/_base/files/web-dev-server.config.mjs +16 -16
  13. package/templates/webcomponents/igc-ts/projects/_base/files/web-test-runner.config.mjs +36 -36
  14. package/templates/webcomponents/igc-ts/projects/_base_with_home/files/index.html +18 -0
  15. package/templates/webcomponents/igc-ts/projects/_base_with_home/files/package.json +75 -0
  16. package/templates/webcomponents/igc-ts/projects/_base_with_home/files/src/app/app-routing.ts +9 -0
  17. package/templates/webcomponents/igc-ts/projects/{_base → _base_with_home}/files/src/app/home/home.test.ts +0 -0
  18. package/templates/webcomponents/igc-ts/projects/{_base → _base_with_home}/files/src/app/home/home.ts +0 -0
  19. package/templates/webcomponents/igc-ts/projects/{_base → _base_with_home}/files/src/assets/astronaut-components.svg +0 -0
  20. package/templates/webcomponents/igc-ts/projects/_base_with_home/index.d.ts +8 -0
  21. package/templates/webcomponents/igc-ts/projects/_base_with_home/index.js +17 -0
  22. package/templates/webcomponents/igc-ts/projects/base/index.d.ts +14 -0
  23. package/templates/webcomponents/igc-ts/projects/base/index.js +21 -0
  24. package/templates/webcomponents/igc-ts/projects/empty/index.d.ts +2 -2
  25. package/templates/webcomponents/igc-ts/projects/empty/index.js +2 -2
  26. package/templates/webcomponents/igc-ts/projects/side-nav/index.d.ts +2 -2
  27. package/templates/webcomponents/igc-ts/projects/side-nav/index.js +2 -2
@@ -19,7 +19,7 @@ export declare class IgniteUIForWebComponentsTemplate implements Template {
19
19
  generateConfig(name: string, options: {}): {
20
20
  [key: string]: any;
21
21
  };
22
- registerInProject(projectPath: string, fullName: string, options?: AddTemplateArgs): void;
22
+ registerInProject(projectPath: string, fullName: string, options?: AddTemplateArgs, defaultPath?: boolean): void;
23
23
  getExtraConfiguration(): ControlExtraConfiguration[];
24
24
  setExtraConfiguration(extraConfigKeys: {}): void;
25
25
  protected getBaseVariables(name: string): {
@@ -27,11 +27,22 @@ class IgniteUIForWebComponentsTemplate {
27
27
  }
28
28
  return Object.assign({}, options["extraConfig"], this.getBaseVariables(name));
29
29
  }
30
- registerInProject(projectPath, fullName, options) {
30
+ registerInProject(projectPath, fullName, options, defaultPath = false) {
31
+ cli_core_1.App.initialize(); // remove after POC
32
+ if (!options.parentName) {
33
+ return;
34
+ }
35
+ const routeModulePath = options.parentRoutingModulePath;
36
+ const routingModule = new TypeScriptFileUpdate_1.TypeScriptFileUpdate(path.join(projectPath, routeModulePath));
31
37
  if (!(options && options.skipRoute) && cli_core_1.App.container.get(cli_core_1.FS_TOKEN)
32
- .fileExists("src/app/app-routing.ts")) {
33
- const routingModule = new TypeScriptFileUpdate_1.TypeScriptFileUpdate(path.join(projectPath, "src/app/app-routing.ts"));
34
- routingModule.addRoute(path.join(projectPath, `src/app/${this.folderName(fullName)}/${this.fileName(fullName)}.component.ts`), this.fileName(fullName), cli_core_1.Util.nameFromPath(fullName));
38
+ .fileExists(routeModulePath)) {
39
+ if (defaultPath) {
40
+ routingModule.addRoute("", options.selector, cli_core_1.Util.nameFromPath(fullName), options.routerChildren, undefined);
41
+ }
42
+ routingModule.addRoute(this.fileName(fullName), options.selector, cli_core_1.Util.nameFromPath(fullName), options.routerChildren, undefined);
43
+ if (options.hasChildren) {
44
+ routingModule.addRoute(this.fileName(`${options.modulePath}-routing.ts`), options.selector, cli_core_1.Util.nameFromPath(`${options.modulePath}-routing.ts`), options.routerChildren, options.importAlias);
45
+ }
35
46
  }
36
47
  }
37
48
  getExtraConfiguration() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-cli",
3
- "version": "10.0.5",
3
+ "version": "10.1.0-alpha.1",
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": "~14.1.1005",
76
- "@igniteui/cli-core": "~10.0.5",
75
+ "@igniteui/angular-templates": "~14.1.1010-alpha.1",
76
+ "@igniteui/cli-core": "~10.1.0-alpha.1",
77
77
  "chalk": "^2.3.2",
78
78
  "fs-extra": "^3.0.1",
79
79
  "glob": "^7.1.2",
@@ -18,18 +18,18 @@ export declare class TypeScriptFileUpdate {
18
18
  constructor(targetPath: string);
19
19
  /** Applies accumulated transforms, saves and formats the file */
20
20
  finalize(): void;
21
- addRoute(filePath: string, linkPath: string, linkText: string, routesVariable?: string): void;
21
+ addRoute(path: string, component: string, name: string, routerChildren: string, importAlias: string, routesVariable?: string): void;
22
22
  /** Initializes existing imports info, [re]sets import and `NgModule` edits */
23
23
  protected initState(): void;
24
24
  protected loadImportsMeta(): {
25
25
  lastIndex: number;
26
26
  modulePaths: any[];
27
27
  };
28
- protected addRouteModuleEntry(targetPath: string, filePath: string, linkText: string, linkPath: string, routesVariable?: string, parentRoutePath?: string): void;
29
- protected requestImport(modulePath: string): void;
28
+ protected addRouteModuleEntry(path: string, component: string, name: string, routerChildren: string, importAlias: string, routesVariable?: string): void;
29
+ protected requestImport(modulePath: string, routerAlias: string): void;
30
30
  /** Add `import` statements not previously found in the file */
31
31
  protected addNewFileImports(): void;
32
- protected createIdentifierImport(importPath: string): ts.ImportDeclaration;
32
+ protected createIdentifierImport(importPath: string, as: string): ts.ImportDeclaration;
33
33
  /** Transformation to apply edits to existing named import declarations */
34
34
  protected importsTransformer: ts.TransformerFactory<ts.Node>;
35
35
  /** Format a TS source file, very TBD */
@@ -46,8 +46,8 @@ class TypeScriptFileUpdate {
46
46
  // reset state in case of further updates
47
47
  this.initState();
48
48
  }
49
- addRoute(filePath, linkPath, linkText, routesVariable = DEFAULT_ROUTES_VARIABLE) {
50
- this.addRouteModuleEntry(filePath, linkPath, linkText, routesVariable);
49
+ addRoute(path, component, name, routerChildren, importAlias, routesVariable = DEFAULT_ROUTES_VARIABLE) {
50
+ this.addRouteModuleEntry(path, component, name, routerChildren, importAlias, routesVariable);
51
51
  }
52
52
  //#region File state
53
53
  /** Initializes existing imports info, [re]sets import and `NgModule` edits */
@@ -82,19 +82,25 @@ class TypeScriptFileUpdate {
82
82
  return meta;
83
83
  }
84
84
  //#endregion File state
85
- addRouteModuleEntry(targetPath, filePath, linkText, linkPath, routesVariable = DEFAULT_ROUTES_VARIABLE, parentRoutePath) {
86
- let className;
87
- const relativePath = "./" + filePath + "/" + filePath;
88
- className = "app-" + filePath;
89
- this.requestImport(relativePath);
85
+ addRouteModuleEntry(path, component, name, routerChildren, importAlias, routesVariable = DEFAULT_ROUTES_VARIABLE) {
86
+ const isRouting = path.indexOf("routing") >= 0;
87
+ if (isRouting && this.targetSource.text.indexOf(path.slice(0, -3)) > 0) {
88
+ return;
89
+ }
90
+ const moduleName = path.substring(0, path.indexOf("-routing"));
91
+ if (path) {
92
+ const relativePath = isRouting ?
93
+ "./" + moduleName + "/" + path.slice(0, -3) : "./" + path + "/" + path;
94
+ this.requestImport(relativePath, importAlias);
95
+ }
90
96
  // https://github.com/Microsoft/TypeScript/issues/14419#issuecomment-307256171
91
97
  const transformer = (context) => (rootNode) => {
92
98
  // the visitor that should be used when adding routes to the main route array
93
99
  const conditionalVisitor = (node) => {
94
100
  if (node.kind === ts.SyntaxKind.ArrayLiteralExpression) {
95
- const newObject = this.createRouteEntry(filePath, className, linkText);
101
+ const newObject = this.createRouteEntry(path, component, name, routerChildren);
96
102
  const array = node;
97
- this.createdStringLiterals.push(filePath, linkText);
103
+ this.createdStringLiterals.push(path, name);
98
104
  const notFoundWildCard = ".*";
99
105
  const nodes = ts.visitNodes(array.elements, visitor);
100
106
  const errorRouteNode = nodes.filter(element => element.getText().includes(notFoundWildCard))[0];
@@ -118,11 +124,19 @@ class TypeScriptFileUpdate {
118
124
  return ts.visitEachChild(node, conditionalVisitor, context);
119
125
  }
120
126
  };
121
- const visitCondition = (node) => {
122
- return node.kind === ts.SyntaxKind.VariableDeclaration &&
123
- node.name.getText() === routesVariable &&
124
- node.type.getText() === "Route[]";
125
- };
127
+ let visitCondition;
128
+ if (!isRouting) {
129
+ visitCondition = (node) => {
130
+ return node.kind === ts.SyntaxKind.VariableDeclaration &&
131
+ node.name.getText() === routesVariable &&
132
+ node.type.getText() === "Route[]";
133
+ };
134
+ }
135
+ else {
136
+ visitCondition = (node) => {
137
+ return undefined;
138
+ };
139
+ }
126
140
  const visitor = this.createVisitor(conditionalVisitor, visitCondition, context);
127
141
  context.enableSubstitution(ts.SyntaxKind.ClassDeclaration);
128
142
  return ts.visitNode(rootNode, visitor);
@@ -132,11 +146,12 @@ class TypeScriptFileUpdate {
132
146
  }).transformed[0];
133
147
  this.finalize();
134
148
  }
135
- requestImport(modulePath) {
149
+ requestImport(modulePath, routerAlias) {
136
150
  const existing = this.requestedImports.find(x => x.from === modulePath);
137
151
  if (!existing) {
138
152
  // new imports, check if already exists in file
139
153
  this.requestedImports.push({
154
+ as: routerAlias,
140
155
  from: modulePath,
141
156
  edit: this.importsMeta.modulePaths.indexOf(modulePath) !== -1
142
157
  });
@@ -153,14 +168,27 @@ class TypeScriptFileUpdate {
153
168
  }
154
169
  const newStatements = ts.factory.createNodeArray([
155
170
  ...this.targetSource.statements.slice(0, this.importsMeta.lastIndex),
156
- ...newImports.map(x => this.createIdentifierImport(x.from)),
171
+ ...newImports.map(x => this.createIdentifierImport(x.from, x.as)),
157
172
  ...this.targetSource.statements.slice(this.importsMeta.lastIndex)
158
173
  ]);
159
174
  newImports.forEach(x => this.createdStringLiterals.push(x.from));
160
175
  this.targetSource = ts.factory.updateSourceFile(this.targetSource, newStatements);
161
176
  }
162
- createIdentifierImport(importPath) {
163
- const importDeclaration = ts.factory.createImportDeclaration(undefined, undefined, undefined, ts.factory.createStringLiteral(importPath));
177
+ createIdentifierImport(importPath, as) {
178
+ let exportedObject;
179
+ let exportedObjectName;
180
+ let importClause;
181
+ if (as) {
182
+ exportedObject = "routes";
183
+ exportedObjectName = as.replace(/\s/g, "");
184
+ importClause = ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([
185
+ ts.factory.createImportSpecifier(false, ts.factory.createIdentifier(exportedObject), ts.factory.createIdentifier(exportedObjectName))
186
+ ]));
187
+ }
188
+ else {
189
+ importClause = undefined;
190
+ }
191
+ const importDeclaration = ts.factory.createImportDeclaration(undefined, undefined, importClause, ts.factory.createStringLiteral(importPath));
164
192
  return importDeclaration;
165
193
  }
166
194
  //#endregion ts.TransformerFactory
@@ -297,11 +325,17 @@ class TypeScriptFileUpdate {
297
325
  return node;
298
326
  };
299
327
  }
300
- createRouteEntry(filePath, className, linkText) {
328
+ createRouteEntry(filePath, className, linkText, routerAlias) {
301
329
  const routePath = ts.factory.createPropertyAssignment("path", ts.factory.createStringLiteral(filePath));
302
330
  const routeComponent = ts.factory.createPropertyAssignment("component", ts.factory.createStringLiteral(className));
303
331
  const routeData = ts.factory.createPropertyAssignment("name", ts.factory.createStringLiteral(linkText));
304
- return ts.factory.createObjectLiteralExpression([routePath, routeComponent, routeData]);
332
+ if (routerAlias) {
333
+ const childrenData = ts.factory.createPropertyAssignment("children", ts.factory.createIdentifier(routerAlias));
334
+ return ts.factory.createObjectLiteralExpression([routePath, routeComponent, routeData, childrenData]);
335
+ }
336
+ else {
337
+ return ts.factory.createObjectLiteralExpression([routePath, routeComponent, routeData]);
338
+ }
305
339
  }
306
340
  }
307
341
  exports.TypeScriptFileUpdate = TypeScriptFileUpdate;
@@ -5,7 +5,6 @@
5
5
  <meta charset="utf-8">
6
6
  <base href="/">
7
7
  <title>Ignite UI for Web Components</title>
8
- <link rel="stylesheet" href="./node_modules/igniteui-webcomponents/themes/light/bootstrap.css">
9
8
  <link rel="stylesheet" href="./styles.css">
10
9
  </head>
11
10
 
@@ -14,4 +13,5 @@
14
13
 
15
14
  <script type="module" src="./dist/src/index.js"></script>
16
15
  </body>
16
+
17
17
  </html>
@@ -21,43 +21,34 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@vaadin/router": "^1.7.4",
24
- "igniteui-webcomponents": "~3.4.0",
25
- "igniteui-webcomponents-grids": "~3.2.1",
26
- "igniteui-webcomponents-core": "~3.2.1",
27
- "igniteui-webcomponents-layouts": "~3.2.1",
28
- "igniteui-webcomponents-inputs": "~3.2.1",
29
- "igniteui-webcomponents-charts": "~3.2.1",
30
- "igniteui-webcomponents-gauges": "~3.2.1",
31
- "igniteui-dockmanager": "~1.8.0",
32
- "@igniteui/material-icons-extended": "^2.11.0",
33
24
  "lit": "^2.0.2",
34
25
  "typescript": "^4.5.2"
35
26
  },
36
27
  "devDependencies": {
37
28
  "@babel/preset-env": "^7.16.4",
38
- "@open-wc/testing": "^2.5.33",
39
29
  "@open-wc/building-rollup": "^2.0.1",
30
+ "@open-wc/eslint-config": "^4.3.0",
31
+ "@open-wc/testing": "^2.5.33",
40
32
  "@rollup/plugin-babel": "^5.3.0",
41
33
  "@rollup/plugin-node-resolve": "^13.0.6",
42
- "rollup-plugin-copy-assets": "^2.0.3",
43
- "@open-wc/eslint-config": "^4.3.0",
44
34
  "@typescript-eslint/eslint-plugin": "^4.30.0",
45
35
  "@typescript-eslint/parser": "^4.30.0",
46
36
  "@web/dev-server": "^0.1.22",
47
37
  "@web/rollup-plugin-html": "^1.10.1",
48
38
  "@web/rollup-plugin-import-meta-assets": "^1.0.7",
49
- "babel-plugin-template-html-minifier": "^4.1.0",
50
39
  "@web/test-runner": "next",
51
- "igniteui-cli": "~$(cliVersion)",
40
+ "babel-plugin-template-html-minifier": "^4.1.0",
52
41
  "concurrently": "^6.3.0",
53
42
  "deepmerge": "^4.2.2",
43
+ "eslint": "^7.32.0",
44
+ "igniteui-cli": "~10.0.3",
54
45
  "rimraf": "^3.0.2",
55
46
  "rollup": "^2.60.0",
47
+ "rollup-plugin-copy-assets": "^2.0.3",
56
48
  "rollup-plugin-terser": "^7.0.2",
57
49
  "rollup-plugin-workbox": "^6.2.0",
58
- "eslint": "^7.32.0",
59
- "tslib": "^2.3.1",
60
- "source-map": "^0.7.3"
50
+ "source-map": "^0.7.3",
51
+ "tslib": "^2.3.1"
61
52
  },
62
53
  "eslintConfig": {
63
54
  "parser": "@typescript-eslint/parser",
@@ -68,20 +59,9 @@
68
59
  "@typescript-eslint"
69
60
  ],
70
61
  "rules": {
71
- "linebreak-style": "off",
72
62
  "no-unused-vars": "off",
73
- "@typescript-eslint/no-unused-vars": [
74
- "error"
75
- ],
76
- "import/no-extraneous-dependencies": "off",
77
63
  "import/no-unresolved": "off",
78
- "import/extensions": [
79
- "error",
80
- "always",
81
- {
82
- "ignorePackages": true
83
- }
84
- ]
64
+ "linebreak-style": "off"
85
65
  }
86
66
  }
87
67
  }
@@ -1,11 +1,11 @@
1
- import nodeResolve from '@rollup/plugin-node-resolve';
2
1
  import babel from '@rollup/plugin-babel';
3
- import copy from 'rollup-plugin-copy-assets';
2
+ import nodeResolve from '@rollup/plugin-node-resolve';
4
3
  import { rollupPluginHTML as html } from '@web/rollup-plugin-html';
5
4
  import { importMetaAssets } from '@web/rollup-plugin-import-meta-assets';
5
+ import path from 'path';
6
+ import copy from 'rollup-plugin-copy-assets';
6
7
  import { terser } from 'rollup-plugin-terser';
7
8
  import { generateSW } from 'rollup-plugin-workbox';
8
- import path from 'path';
9
9
 
10
10
  export default {
11
11
  input: 'index.html',
@@ -1,11 +1,7 @@
1
- import {
2
- Route
3
- } from '@vaadin/router';
4
- import './home/home.js';
1
+ import { Route } from '@vaadin/router';
5
2
  import './not-found/not-found.js';
6
3
 
7
4
  export const routes: Route[] = [
8
- { path: '/', component: 'app-home', name: 'Home' },
9
5
  // The fallback route should always be after other alternatives.
10
6
  { path: '(.*)', component: 'app-not-found' },
11
7
  ];
@@ -1,6 +1,6 @@
1
- import { html, css, LitElement } from 'lit';
1
+ import { Router } from '@vaadin/router';
2
+ import { css, html, LitElement } from 'lit';
2
3
  import { customElement } from 'lit/decorators.js';
3
- import { Router, } from '@vaadin/router';
4
4
  import { routes } from './app-routing.js';
5
5
 
6
6
  @customElement('app-root')
@@ -1,4 +1,5 @@
1
- html, body {
1
+ html,
2
+ body {
2
3
  height: 100%;
3
4
  margin: 0px;
4
5
  background: #fafafa;
@@ -4,24 +4,24 @@
4
4
  const hmr = process.argv.includes('--hmr');
5
5
 
6
6
  export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
7
- open: '/',
8
- /** Use regular watch mode if HMR is not enabled. */
9
- watch: !hmr,
10
- /** Resolve bare module imports */
11
- nodeResolve: {
12
- exportConditions: ['browser', 'development'],
13
- },
7
+ open: '/',
8
+ /** Use regular watch mode if HMR is not enabled. */
9
+ watch: !hmr,
10
+ /** Resolve bare module imports */
11
+ nodeResolve: {
12
+ exportConditions: ['browser', 'development'],
13
+ },
14
14
 
15
- /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
16
- // esbuildTarget: 'auto'
15
+ /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
16
+ // esbuildTarget: 'auto'
17
17
 
18
- /** Set appIndex to enable SPA routing */
19
- appIndex: './index.html',
18
+ /** Set appIndex to enable SPA routing */
19
+ appIndex: './index.html',
20
20
 
21
- plugins: [
22
- /** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
23
- // hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
24
- ],
21
+ plugins: [
22
+ /** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
23
+ // hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
24
+ ],
25
25
 
26
- // See documentation for all available options
26
+ // See documentation for all available options
27
27
  });
@@ -3,39 +3,39 @@
3
3
  const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
4
4
 
5
5
  export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
6
- /** Test files to run */
7
- files: 'dist/src/app/**/*.test.js',
8
-
9
- /** Resolve bare module imports */
10
- nodeResolve: {
11
- exportConditions: ['browser', 'development'],
12
- },
13
-
14
- /** Filter out lit dev mode logs */
15
- filterBrowserLogs(log) {
16
- for (const arg of log.args) {
17
- if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
18
- return false;
19
- }
20
- }
21
- return true;
22
- },
23
-
24
- /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
25
- // esbuildTarget: 'auto',
26
-
27
- /** Amount of browsers to run concurrently */
28
- // concurrentBrowsers: 2,
29
-
30
- /** Amount of test files per browser to test concurrently */
31
- // concurrency: 1,
32
-
33
- /** Browsers to run tests on */
34
- // browsers: [
35
- // playwrightLauncher({ product: 'chromium' }),
36
- // playwrightLauncher({ product: 'firefox' }),
37
- // playwrightLauncher({ product: 'webkit' }),
38
- // ],
39
-
40
- // See documentation for all available options
41
- });
6
+ /** Test files to run */
7
+ files: 'dist/src/app/**/*.test.js',
8
+
9
+ /** Resolve bare module imports */
10
+ nodeResolve: {
11
+ exportConditions: ['browser', 'development'],
12
+ },
13
+
14
+ /** Filter out lit dev mode logs */
15
+ filterBrowserLogs(log) {
16
+ for (const arg of log.args) {
17
+ if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
18
+ return false;
19
+ }
20
+ }
21
+ return true;
22
+ },
23
+
24
+ /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
25
+ // esbuildTarget: 'auto',
26
+
27
+ /** Amount of browsers to run concurrently */
28
+ // concurrentBrowsers: 2,
29
+
30
+ /** Amount of test files per browser to test concurrently */
31
+ // concurrency: 1,
32
+
33
+ /** Browsers to run tests on */
34
+ // browsers: [
35
+ // playwrightLauncher({ product: 'chromium' }),
36
+ // playwrightLauncher({ product: 'firefox' }),
37
+ // playwrightLauncher({ product: 'webkit' }),
38
+ // ],
39
+
40
+ // See documentation for all available options
41
+ });
@@ -0,0 +1,18 @@
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
+
18
+ </html>
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "$(dashName)",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "description": "WebComponents project for Ignite UI CLI",
6
+ "license": "MIT",
7
+ "author": "Infragistics",
8
+ "main": "dist/src/index.js",
9
+ "module": "dist/src/index.js",
10
+ "type": "module",
11
+ "exports": {
12
+ ".": "./dist/src/index.js",
13
+ "./$(dashName).js": "./dist/src/$(dashName).js"
14
+ },
15
+ "scripts": {
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",
19
+ "lint": "eslint --ext .js,.ts,.html . --ignore-path .gitignore",
20
+ "test": "tsc && wtr"
21
+ },
22
+ "dependencies": {
23
+ "@vaadin/router": "^1.7.4",
24
+ "@igniteui/material-icons-extended": "^2.11.0",
25
+ "igniteui-dockmanager": "~1.8.0",
26
+ "igniteui-webcomponents": "~3.4.0",
27
+ "igniteui-webcomponents-charts": "~3.2.1",
28
+ "igniteui-webcomponents-core": "~3.2.1",
29
+ "igniteui-webcomponents-gauges": "~3.2.1",
30
+ "igniteui-webcomponents-grids": "~3.2.1",
31
+ "igniteui-webcomponents-inputs": "~3.2.1",
32
+ "igniteui-webcomponents-layouts": "~3.2.1",
33
+ "lit": "^2.0.2",
34
+ "typescript": "^4.5.2"
35
+ },
36
+ "devDependencies": {
37
+ "@babel/preset-env": "^7.16.4",
38
+ "@open-wc/building-rollup": "^2.0.1",
39
+ "@open-wc/eslint-config": "^4.3.0",
40
+ "@open-wc/testing": "^2.5.33",
41
+ "@rollup/plugin-babel": "^5.3.0",
42
+ "@rollup/plugin-node-resolve": "^13.0.6",
43
+ "@typescript-eslint/eslint-plugin": "^4.30.0",
44
+ "@typescript-eslint/parser": "^4.30.0",
45
+ "@web/dev-server": "^0.1.22",
46
+ "@web/rollup-plugin-html": "^1.10.1",
47
+ "@web/rollup-plugin-import-meta-assets": "^1.0.7",
48
+ "@web/test-runner": "next",
49
+ "babel-plugin-template-html-minifier": "^4.1.0",
50
+ "concurrently": "^6.3.0",
51
+ "deepmerge": "^4.2.2",
52
+ "eslint": "^7.32.0",
53
+ "igniteui-cli": "~10.0.3",
54
+ "rimraf": "^3.0.2",
55
+ "rollup": "^2.60.0",
56
+ "rollup-plugin-copy-assets": "^2.0.3",
57
+ "rollup-plugin-terser": "^7.0.2",
58
+ "rollup-plugin-workbox": "^6.2.0",
59
+ "source-map": "^0.7.3",
60
+ "tslib": "^2.3.1"
61
+ },
62
+ "eslintConfig": {
63
+ "parser": "@typescript-eslint/parser",
64
+ "extends": [
65
+ "@open-wc"
66
+ ],
67
+ "plugins": [
68
+ "@typescript-eslint"
69
+ ],
70
+ "rules": {
71
+ "no-unused-vars": "off",
72
+ "import/no-unresolved": "off"
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,9 @@
1
+ import { Route } from '@vaadin/router';
2
+ import './home/home.js';
3
+ import './not-found/not-found.js';
4
+
5
+ export const routes: Route[] = [
6
+ { path: '/', component: 'app-home', name: 'Home' },
7
+ // The fallback route should always be after other alternatives.
8
+ { path: '(.*)', component: 'app-not-found' },
9
+ ];
@@ -0,0 +1,8 @@
1
+ import { ProjectTemplate } from "@igniteui/cli-core";
2
+ import { BaseIgcProject } from "../_base";
3
+ export declare class BaseWithHomeIgcProject extends BaseIgcProject implements ProjectTemplate {
4
+ id: string;
5
+ name: string;
6
+ description: string;
7
+ get templatePaths(): string[];
8
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseWithHomeIgcProject = void 0;
4
+ const path = require("path");
5
+ const _base_1 = require("../_base");
6
+ class BaseWithHomeIgcProject extends _base_1.BaseIgcProject {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.id = "base with home";
10
+ this.name = "Base With Home";
11
+ this.description = "Empty project layout structure for Ignite UI for Web Components";
12
+ }
13
+ get templatePaths() {
14
+ return [...super.templatePaths, path.join(__dirname, "files")];
15
+ }
16
+ }
17
+ exports.BaseWithHomeIgcProject = BaseWithHomeIgcProject;
@@ -0,0 +1,14 @@
1
+ import { ProjectTemplate } from "@igniteui/cli-core";
2
+ import { BaseIgcProject } from "../_base";
3
+ export declare class BasePageTemplate 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: BasePageTemplate;
14
+ export default _default;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BasePageTemplate = void 0;
4
+ const path = require("path");
5
+ const _base_1 = require("../_base");
6
+ class BasePageTemplate extends _base_1.BaseIgcProject {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.id = "base";
10
+ this.name = "Base Project";
11
+ this.description = "Project structure with routing";
12
+ this.framework = "webcomponents";
13
+ this.projectType = "igc-ts";
14
+ this.hasExtraConfiguration = false;
15
+ }
16
+ get templatePaths() {
17
+ return [...super.templatePaths, path.join(__dirname, "files")];
18
+ }
19
+ }
20
+ exports.BasePageTemplate = BasePageTemplate;
21
+ exports.default = new BasePageTemplate();
@@ -1,6 +1,6 @@
1
1
  import { ProjectTemplate } from "@igniteui/cli-core";
2
- import { BaseIgcProject } from "../_base";
3
- export declare class EmptyPageTemplate extends BaseIgcProject implements ProjectTemplate {
2
+ import { BaseWithHomeIgcProject } from "../_base_with_home";
3
+ export declare class EmptyPageTemplate extends BaseWithHomeIgcProject implements ProjectTemplate {
4
4
  id: string;
5
5
  name: string;
6
6
  description: string;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EmptyPageTemplate = void 0;
4
4
  const path = require("path");
5
- const _base_1 = require("../_base");
6
- class EmptyPageTemplate extends _base_1.BaseIgcProject {
5
+ const _base_with_home_1 = require("../_base_with_home");
6
+ class EmptyPageTemplate extends _base_with_home_1.BaseWithHomeIgcProject {
7
7
  constructor() {
8
8
  super(...arguments);
9
9
  this.id = "empty";
@@ -1,6 +1,6 @@
1
1
  import { ProjectTemplate } from "@igniteui/cli-core";
2
- import { BaseIgcProject } from "../_base";
3
- export declare class SideNavProject extends BaseIgcProject implements ProjectTemplate {
2
+ import { BaseWithHomeIgcProject } from "../_base_with_home";
3
+ export declare class SideNavProject extends BaseWithHomeIgcProject implements ProjectTemplate {
4
4
  id: string;
5
5
  name: string;
6
6
  description: string;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SideNavProject = void 0;
4
4
  const path = require("path");
5
- const _base_1 = require("../_base");
6
- class SideNavProject extends _base_1.BaseIgcProject {
5
+ const _base_with_home_1 = require("../_base_with_home");
6
+ class SideNavProject extends _base_with_home_1.BaseWithHomeIgcProject {
7
7
  constructor() {
8
8
  super(...arguments);
9
9
  this.id = "side-nav";