igniteui-cli 10.0.5 → 10.1.0-alpha.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.
- package/lib/templates/IgniteUIForWebComponentsTemplate.js +14 -3
- package/package.json +3 -3
- package/templates/webcomponents/TypeScriptFileUpdate.d.ts +5 -4
- package/templates/webcomponents/TypeScriptFileUpdate.js +55 -17
- package/templates/webcomponents/igc-ts/projects/_base/files/index.html +1 -1
- package/templates/webcomponents/igc-ts/projects/_base/files/package.json +9 -29
- package/templates/webcomponents/igc-ts/projects/_base/files/rollup.config.mjs +3 -3
- package/templates/webcomponents/igc-ts/projects/_base/files/src/app/app-routing.ts +1 -5
- package/templates/webcomponents/igc-ts/projects/_base/files/src/app/app.ts +2 -2
- package/templates/webcomponents/igc-ts/projects/_base/files/styles.css +2 -1
- package/templates/webcomponents/igc-ts/projects/_base/files/web-dev-server.config.mjs +16 -16
- package/templates/webcomponents/igc-ts/projects/_base/files/web-test-runner.config.mjs +36 -36
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/index.html +18 -0
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/package.json +75 -0
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/src/app/app-routing.ts +9 -0
- package/templates/webcomponents/igc-ts/projects/{_base → _base_with_home}/files/src/app/home/home.test.ts +0 -0
- package/templates/webcomponents/igc-ts/projects/{_base → _base_with_home}/files/src/app/home/home.ts +0 -0
- package/templates/webcomponents/igc-ts/projects/{_base → _base_with_home}/files/src/assets/astronaut-components.svg +0 -0
- package/templates/webcomponents/igc-ts/projects/_base_with_home/index.d.ts +8 -0
- package/templates/webcomponents/igc-ts/projects/_base_with_home/index.js +17 -0
- package/templates/webcomponents/igc-ts/projects/base/index.d.ts +14 -0
- package/templates/webcomponents/igc-ts/projects/base/index.js +21 -0
- package/templates/webcomponents/igc-ts/projects/empty/index.d.ts +2 -2
- package/templates/webcomponents/igc-ts/projects/empty/index.js +2 -2
- package/templates/webcomponents/igc-ts/projects/side-nav/index.d.ts +2 -2
- package/templates/webcomponents/igc-ts/projects/side-nav/index.js +2 -2
|
@@ -28,10 +28,21 @@ class IgniteUIForWebComponentsTemplate {
|
|
|
28
28
|
return Object.assign({}, options["extraConfig"], this.getBaseVariables(name));
|
|
29
29
|
}
|
|
30
30
|
registerInProject(projectPath, fullName, options) {
|
|
31
|
+
cli_core_1.App.initialize(); // remove after POC
|
|
32
|
+
const routeModulePath = path.posix.join(`src/app`, `${options.routingModulePath}-routing.ts`);
|
|
33
|
+
let routingModule;
|
|
31
34
|
if (!(options && options.skipRoute) && cli_core_1.App.container.get(cli_core_1.FS_TOKEN)
|
|
32
|
-
.fileExists(
|
|
33
|
-
|
|
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));
|
|
35
|
+
.fileExists(routeModulePath)) {
|
|
36
|
+
routingModule = new TypeScriptFileUpdate_1.TypeScriptFileUpdate(path.join(projectPath, routeModulePath));
|
|
37
|
+
routingModule.addRoute(path.join(projectPath, `src/app/${this.folderName(fullName)}/${this.fileName(fullName)}.component.ts`), this.fileName(fullName), cli_core_1.Util.nameFromPath(fullName), options);
|
|
38
|
+
}
|
|
39
|
+
if (options.routingModulePath !== "app") {
|
|
40
|
+
routingModule = new TypeScriptFileUpdate_1.TypeScriptFileUpdate(path.join(projectPath, "src/app/app-routing.ts"));
|
|
41
|
+
const routingModuleText = routingModule.targetSource.text;
|
|
42
|
+
const moduleName = options.routingModulePath.split("/")[1];
|
|
43
|
+
if (routingModuleText.indexOf(moduleName + "-routing") < 0) {
|
|
44
|
+
routingModule.addRoute(path.join(projectPath, `src/app/${options.routingModulePath}-routing.ts`), this.fileName(`${options.routingModulePath}-routing.ts`), cli_core_1.Util.nameFromPath(`${options.routingModulePath}-routing.ts`), options, options.parentName);
|
|
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.
|
|
3
|
+
"version": "10.1.0-alpha.0",
|
|
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.
|
|
76
|
-
"@igniteui/cli-core": "~10.0.
|
|
75
|
+
"@igniteui/angular-templates": "~14.1.1010-alpha.0",
|
|
76
|
+
"@igniteui/cli-core": "~10.1.0-alpha.0",
|
|
77
77
|
"chalk": "^2.3.2",
|
|
78
78
|
"fs-extra": "^3.0.1",
|
|
79
79
|
"glob": "^7.1.2",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AddTemplateArgs } from "@igniteui/cli-core";
|
|
1
2
|
import * as ts from "typescript";
|
|
2
3
|
/**
|
|
3
4
|
* Apply various updates to typescript files using AST
|
|
@@ -18,18 +19,18 @@ export declare class TypeScriptFileUpdate {
|
|
|
18
19
|
constructor(targetPath: string);
|
|
19
20
|
/** Applies accumulated transforms, saves and formats the file */
|
|
20
21
|
finalize(): void;
|
|
21
|
-
addRoute(filePath: string, linkPath: string, linkText: string, routesVariable?: string): void;
|
|
22
|
+
addRoute(filePath: string, linkPath: string, linkText: string, options: AddTemplateArgs, parentName: string, routesVariable?: string): void;
|
|
22
23
|
/** Initializes existing imports info, [re]sets import and `NgModule` edits */
|
|
23
24
|
protected initState(): void;
|
|
24
25
|
protected loadImportsMeta(): {
|
|
25
26
|
lastIndex: number;
|
|
26
27
|
modulePaths: any[];
|
|
27
28
|
};
|
|
28
|
-
protected addRouteModuleEntry(targetPath: string, filePath: string, linkText: string,
|
|
29
|
-
protected requestImport(modulePath: string): void;
|
|
29
|
+
protected addRouteModuleEntry(targetPath: string, filePath: string, linkText: string, routesVariable: string, options: any, parentName?: string): void;
|
|
30
|
+
protected requestImport(modulePath: string, parentName: string): void;
|
|
30
31
|
/** Add `import` statements not previously found in the file */
|
|
31
32
|
protected addNewFileImports(): void;
|
|
32
|
-
protected createIdentifierImport(importPath: string): ts.ImportDeclaration;
|
|
33
|
+
protected createIdentifierImport(importPath: string, as: string): ts.ImportDeclaration;
|
|
33
34
|
/** Transformation to apply edits to existing named import declarations */
|
|
34
35
|
protected importsTransformer: ts.TransformerFactory<ts.Node>;
|
|
35
36
|
/** 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(filePath, linkPath, linkText, options, parentName, routesVariable = DEFAULT_ROUTES_VARIABLE) {
|
|
50
|
+
this.addRouteModuleEntry(filePath, linkPath, linkText, routesVariable, options, parentName);
|
|
51
51
|
}
|
|
52
52
|
//#region File state
|
|
53
53
|
/** Initializes existing imports info, [re]sets import and `NgModule` edits */
|
|
@@ -82,17 +82,26 @@ class TypeScriptFileUpdate {
|
|
|
82
82
|
return meta;
|
|
83
83
|
}
|
|
84
84
|
//#endregion File state
|
|
85
|
-
addRouteModuleEntry(targetPath, filePath, linkText,
|
|
85
|
+
addRouteModuleEntry(targetPath, filePath, linkText, routesVariable = DEFAULT_ROUTES_VARIABLE, options, parentName) {
|
|
86
|
+
const isRouting = filePath.indexOf("routing") >= 0;
|
|
87
|
+
if (isRouting && this.targetSource.text.indexOf(filePath.slice(0, -3)) > 0) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
86
90
|
let className;
|
|
87
|
-
const
|
|
91
|
+
const moduleName = filePath.substring(0, filePath.indexOf("-routing"));
|
|
92
|
+
const relativePath = isRouting ?
|
|
93
|
+
"./" + moduleName + "/" + filePath.slice(0, -3) : "./" + filePath + "/" + filePath;
|
|
94
|
+
const hasParent = parentName ? true : false;
|
|
95
|
+
const hasChildren = options.hasChildren ? true : false;
|
|
96
|
+
const hasNestedModule = (!hasParent && hasChildren) ? true : false;
|
|
88
97
|
className = "app-" + filePath;
|
|
89
|
-
this.requestImport(relativePath);
|
|
98
|
+
this.requestImport(relativePath, parentName);
|
|
90
99
|
// https://github.com/Microsoft/TypeScript/issues/14419#issuecomment-307256171
|
|
91
100
|
const transformer = (context) => (rootNode) => {
|
|
92
101
|
// the visitor that should be used when adding routes to the main route array
|
|
93
102
|
const conditionalVisitor = (node) => {
|
|
94
103
|
if (node.kind === ts.SyntaxKind.ArrayLiteralExpression) {
|
|
95
|
-
const newObject = this.createRouteEntry(filePath, className, linkText);
|
|
104
|
+
const newObject = this.createRouteEntry(filePath, className, linkText, hasNestedModule);
|
|
96
105
|
const array = node;
|
|
97
106
|
this.createdStringLiterals.push(filePath, linkText);
|
|
98
107
|
const notFoundWildCard = ".*";
|
|
@@ -118,11 +127,19 @@ class TypeScriptFileUpdate {
|
|
|
118
127
|
return ts.visitEachChild(node, conditionalVisitor, context);
|
|
119
128
|
}
|
|
120
129
|
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
node.
|
|
125
|
-
|
|
130
|
+
let visitCondition;
|
|
131
|
+
if (!isRouting) {
|
|
132
|
+
visitCondition = (node) => {
|
|
133
|
+
return node.kind === ts.SyntaxKind.VariableDeclaration &&
|
|
134
|
+
node.name.getText() === routesVariable &&
|
|
135
|
+
node.type.getText() === "Route[]";
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
visitCondition = (node) => {
|
|
140
|
+
return undefined;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
126
143
|
const visitor = this.createVisitor(conditionalVisitor, visitCondition, context);
|
|
127
144
|
context.enableSubstitution(ts.SyntaxKind.ClassDeclaration);
|
|
128
145
|
return ts.visitNode(rootNode, visitor);
|
|
@@ -132,11 +149,13 @@ class TypeScriptFileUpdate {
|
|
|
132
149
|
}).transformed[0];
|
|
133
150
|
this.finalize();
|
|
134
151
|
}
|
|
135
|
-
requestImport(modulePath) {
|
|
152
|
+
requestImport(modulePath, parentName) {
|
|
136
153
|
const existing = this.requestedImports.find(x => x.from === modulePath);
|
|
137
154
|
if (!existing) {
|
|
155
|
+
const exportedObject = parentName ? parentName : undefined;
|
|
138
156
|
// new imports, check if already exists in file
|
|
139
157
|
this.requestedImports.push({
|
|
158
|
+
as: exportedObject,
|
|
140
159
|
from: modulePath,
|
|
141
160
|
edit: this.importsMeta.modulePaths.indexOf(modulePath) !== -1
|
|
142
161
|
});
|
|
@@ -153,14 +172,27 @@ class TypeScriptFileUpdate {
|
|
|
153
172
|
}
|
|
154
173
|
const newStatements = ts.factory.createNodeArray([
|
|
155
174
|
...this.targetSource.statements.slice(0, this.importsMeta.lastIndex),
|
|
156
|
-
...newImports.map(x => this.createIdentifierImport(x.from)),
|
|
175
|
+
...newImports.map(x => this.createIdentifierImport(x.from, x.as)),
|
|
157
176
|
...this.targetSource.statements.slice(this.importsMeta.lastIndex)
|
|
158
177
|
]);
|
|
159
178
|
newImports.forEach(x => this.createdStringLiterals.push(x.from));
|
|
160
179
|
this.targetSource = ts.factory.updateSourceFile(this.targetSource, newStatements);
|
|
161
180
|
}
|
|
162
|
-
createIdentifierImport(importPath) {
|
|
163
|
-
|
|
181
|
+
createIdentifierImport(importPath, as) {
|
|
182
|
+
let exportedObject;
|
|
183
|
+
let exportedObjectName;
|
|
184
|
+
let importClause;
|
|
185
|
+
if (as) {
|
|
186
|
+
exportedObject = "routes";
|
|
187
|
+
exportedObjectName = as.replace(/\s/g, "");
|
|
188
|
+
importClause = ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([
|
|
189
|
+
ts.factory.createImportSpecifier(false, ts.factory.createIdentifier(exportedObject), ts.factory.createIdentifier(exportedObjectName))
|
|
190
|
+
]));
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
importClause = undefined;
|
|
194
|
+
}
|
|
195
|
+
const importDeclaration = ts.factory.createImportDeclaration(undefined, undefined, importClause, ts.factory.createStringLiteral(importPath));
|
|
164
196
|
return importDeclaration;
|
|
165
197
|
}
|
|
166
198
|
//#endregion ts.TransformerFactory
|
|
@@ -297,11 +329,17 @@ class TypeScriptFileUpdate {
|
|
|
297
329
|
return node;
|
|
298
330
|
};
|
|
299
331
|
}
|
|
300
|
-
createRouteEntry(filePath, className, linkText) {
|
|
332
|
+
createRouteEntry(filePath, className, linkText, hasNestedModule) {
|
|
301
333
|
const routePath = ts.factory.createPropertyAssignment("path", ts.factory.createStringLiteral(filePath));
|
|
302
334
|
const routeComponent = ts.factory.createPropertyAssignment("component", ts.factory.createStringLiteral(className));
|
|
303
335
|
const routeData = ts.factory.createPropertyAssignment("name", ts.factory.createStringLiteral(linkText));
|
|
304
|
-
|
|
336
|
+
const childrenData = ts.factory.createPropertyAssignment("children", ts.factory.createStringLiteral(linkText.replace(/\s/g, "")));
|
|
337
|
+
if (hasNestedModule) {
|
|
338
|
+
return ts.factory.createObjectLiteralExpression([routePath, routeComponent, routeData, childrenData]);
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
return ts.factory.createObjectLiteralExpression([routePath, routeComponent, routeData]);
|
|
342
|
+
}
|
|
305
343
|
}
|
|
306
344
|
}
|
|
307
345
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
|
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 {
|
|
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')
|
|
@@ -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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
16
|
-
|
|
15
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
16
|
+
// esbuildTarget: 'auto'
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/** Set appIndex to enable SPA routing */
|
|
19
|
+
appIndex: './index.html',
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
+
];
|
|
File without changes
|
package/templates/webcomponents/igc-ts/projects/{_base → _base_with_home}/files/src/app/home/home.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -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 {
|
|
3
|
-
export declare class EmptyPageTemplate extends
|
|
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
|
|
6
|
-
class EmptyPageTemplate extends
|
|
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 {
|
|
3
|
-
export declare class SideNavProject extends
|
|
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
|
|
6
|
-
class SideNavProject extends
|
|
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";
|