Skip to content

Commit e893806

Browse files
scrodriguesSamuel Rodrigues
and
Samuel Rodrigues
authored
chore: support es6 and @angular in newly created projects (#30)
* chore: support es6 and @angular in newly created projects * code review * Format code Co-authored-by: Samuel Rodrigues <[email protected]>
1 parent e12d965 commit e893806

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
22
"compileOnSave": true,
33
"compilerOptions": {
4-
"target": "es5",
4+
"target": "es6",
55
"module": "system",
66
"moduleResolution": "node",
77
"sourceMap": true,
88
"emitDecoratorMetadata": true,
99
"experimentalDecorators": true,
10-
"removeComments": false,
10+
"removeComments": true,
1111
"noImplicitAny": false,
12-
"declaration": true,
12+
"declaration": true,
1313
"forceConsistentCasingInFileNames" : true,
1414
"allowUnreachableCode" : false,
1515
"noUnusedLocals": false,
1616
"noUnusedParameters" : false,
1717
"noImplicitReturns": true,
1818
"rootDir": "../../../"
1919
},
20-
"include": [
20+
"include": [
2121
"src/**/*.ts"
22-
]
22+
]
2323
}

generators/package/index.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,15 @@ module.exports = class extends HtmlGenerator {
6161
}
6262

6363
if (fs.existsSync(this.destinationPath(webAppFolder, "node_modules"))) {
64-
const excludeFilter = (folder) => { return folder.startsWith("cmf") && ["cmf.taura", "cmf.core", "cmf.core.multicast.client", "cmf.mes", "cmf.polyfill", "cmf.angular", "cmf.instascan", "cmf.core.examples", "cmf.mes.examples"].indexOf(folder) < 0 && !folder.startsWith("cmf.style") };
65-
webAppPackages = new Set(fs.readdirSync(this.destinationPath(webAppFolder, "node_modules")).filter(excludeFilter));
64+
const excludeFilter = (folder) => {
65+
const inclusionList = folder.startsWith("cmf") && ["cmf.taura", "cmf.core", "cmf.core.multicast.client", "cmf.mes", "cmf.polyfill", "cmf.angular", "cmf.instascan", "cmf.core.examples", "cmf.mes.examples"].indexOf(folder) < 0 && !folder.startsWith("cmf.style");
66+
return inclusionList || folder === "@angular"; // let's add the @angular dependency since it's a special case
67+
};
68+
webAppPackages = new Set(fs.readdirSync(this.destinationPath(webAppFolder, "node_modules")).filter(excludeFilter));
6669
}
6770

6871
allPackages = (<any>repositoryPackages).union(webAppPackages);
69-
const packageNames: {name: string, checked: boolean}[] = Array.from(allPackages).filter((pkg) => !(<string>pkg).startsWith(".")).sort().map((pkg) => {return {name: pkg, checked: pkg === "cmf.lbos" }})
72+
const packageNames: {name: string, checked: boolean}[] = Array.from(allPackages).filter((pkg) => !(<string>pkg).startsWith(".")).sort().map((pkg) => {return {name: pkg, checked: (pkg === "cmf.lbos" || pkg === "@angular") }})
7073
const choices = this._getAppPackageDescriptions(webAppFolder, packageNames);
7174

7275
return this.prompt([{
+7-7
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
22
"compileOnSave": true,
33
"compilerOptions": {
4-
"target": "es5",
4+
"target": "es6",
55
"module": "system",
66
"lib": ["es2016", "dom"],
77
"moduleResolution": "node",
88
"sourceMap": true,
99
"emitDecoratorMetadata": true,
1010
"experimentalDecorators": true,
11-
"removeComments": false,
11+
"removeComments": true,
1212
"noImplicitAny": false,
13-
"declaration": true,
13+
"declaration": true,
1414
"forceConsistentCasingInFileNames" : true,
1515
"allowUnreachableCode" : false,
1616
"noUnusedLocals": false,
1717
"noUnusedParameters" : false,
1818
"noImplicitReturns": true,
19-
"skipLibCheck": true,
19+
"skipLibCheck": true,
2020
"rootDir": "../../../../"
2121
},
22-
"include": [
22+
"include": [
2323
"src/**/*.ts",
2424
"test/**/*.ts"
25-
]
26-
}
25+
]
26+
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@criticalmanufacturing/generator-html",
3-
"version": "7.1.1",
3+
"version": "8.0.0-0",
44
"description": "CMF HTML GUI Scaffolding",
55
"files": [
66
"generators/*.js",

0 commit comments

Comments
 (0)