Skip to content

Commit

Permalink
feat(schematics): adds a code formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Oct 1, 2017
1 parent 156975c commit ff7b28e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@types/jasmine": "2.5.53",
"@types/node": "8.0.7",
"angular": "1.6.6",
"clang-format": "^1.0.32",
"clang-format": "1.0.55",
"jasmine-core": "~2.6.2",
"jest": "20.0.4",
"karma": "~1.7.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"build": "ng build",
"test": "ng test",
"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,
"dependencies": {
Expand Down Expand Up @@ -50,6 +51,7 @@
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",<% } %>
"typescript": "~2.3.3"
"typescript": "~2.3.3",
"clang-format": "1.0.55"
}
}
3 changes: 2 additions & 1 deletion packages/schematics/src/workspace/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export default function(options: Schema): Rule {
const npmScope = options.npmScope ? options.npmScope : options.name;
const templateSource = apply(
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)]))]);
}
2 changes: 1 addition & 1 deletion scripts/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

./scripts/link.sh
rm -rf tmp
jest --maxWorkers=1 ./build/e2e/schematics/workspace.test.js
jest --maxWorkers=1 ./build/e2e/schematics

0 comments on commit ff7b28e

Please sign in to comment.