docs(aio): update universal for CLI

PR Close #20039
This commit is contained in:
Jesus Rodriguez
2017-10-30 23:39:58 +01:00
committed by Matias Niemelä
parent ca129ba549
commit c30eff898a
62 changed files with 1062 additions and 1149 deletions

View File

@ -54,6 +54,12 @@ BOILERPLATE_PATHS.i18n = [
'package.json'
];
BOILERPLATE_PATHS.universal = [
...cliRelativePath,
'.angular-cli.json',
'package.json'
];
const EXAMPLE_CONFIG_FILENAME = 'example-config.json';
class ExampleBoilerPlate {
@ -110,6 +116,10 @@ class ExampleBoilerPlate {
copyFile(sourceFolder, destinationFolder, filePath) {
const sourcePath = path.resolve(sourceFolder, filePath);
// normalize path if needed
filePath = this.normalizePath(filePath);
const destinationPath = path.resolve(destinationFolder, filePath);
fs.copySync(sourcePath, destinationPath, { overwrite: true });
fs.chmodSync(destinationPath, 444);
@ -118,6 +128,11 @@ class ExampleBoilerPlate {
loadJsonFile(filePath) {
return fs.readJsonSync(filePath, {throws: false}) || {};
}
normalizePath(filePath) {
// transform for example ../cli/src/tsconfig.app.json to src/tsconfig.app.json
return filePath.replace(/\.{2}\/\w+\//, '');
}
}
module.exports = new ExampleBoilerPlate();