feat(schematics): adds a code formatter
This commit is contained in:
parent
156975ce57
commit
ff7b28e65e
@ -37,7 +37,7 @@
|
|||||||
"@types/jasmine": "2.5.53",
|
"@types/jasmine": "2.5.53",
|
||||||
"@types/node": "8.0.7",
|
"@types/node": "8.0.7",
|
||||||
"angular": "1.6.6",
|
"angular": "1.6.6",
|
||||||
"clang-format": "^1.0.32",
|
"clang-format": "1.0.55",
|
||||||
"jasmine-core": "~2.6.2",
|
"jasmine-core": "~2.6.2",
|
||||||
"jest": "20.0.4",
|
"jest": "20.0.4",
|
||||||
"karma": "~1.7.0",
|
"karma": "~1.7.0",
|
||||||
|
|||||||
@ -8,7 +8,8 @@
|
|||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"lint": "ng lint",
|
"lint": "ng lint",
|
||||||
"e2e": "ng e2e"
|
"e2e": "ng e2e",
|
||||||
|
"format": "find apps/ -iname '*.ts' | xargs clang-format -i && find libs/ -iname '*.ts' | xargs clang-format -i"
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -50,6 +51,7 @@
|
|||||||
"protractor": "~5.1.2",
|
"protractor": "~5.1.2",
|
||||||
"ts-node": "~3.2.0",
|
"ts-node": "~3.2.0",
|
||||||
"tslint": "~5.3.2",<% } %>
|
"tslint": "~5.3.2",<% } %>
|
||||||
"typescript": "~2.3.3"
|
"typescript": "~2.3.3",
|
||||||
|
"clang-format": "1.0.55"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,8 @@ export default function(options: Schema): Rule {
|
|||||||
const npmScope = options.npmScope ? options.npmScope : options.name;
|
const npmScope = options.npmScope ? options.npmScope : options.name;
|
||||||
const templateSource = apply(
|
const templateSource = apply(
|
||||||
url('./files'),
|
url('./files'),
|
||||||
[template({utils: stringUtils, dot: '.', nxVersion, ngrxVersion, schematicsVersion, ...options as object, npmScope})]);
|
[template(
|
||||||
|
{utils: stringUtils, dot: '.', nxVersion, ngrxVersion, schematicsVersion, ...options as object, npmScope})]);
|
||||||
|
|
||||||
return chain([branchAndMerge(chain([mergeWith(templateSource)]))]);
|
return chain([branchAndMerge(chain([mergeWith(templateSource)]))]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
./scripts/link.sh
|
./scripts/link.sh
|
||||||
rm -rf tmp
|
rm -rf tmp
|
||||||
jest --maxWorkers=1 ./build/e2e/schematics/workspace.test.js
|
jest --maxWorkers=1 ./build/e2e/schematics
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user