Alan Agius 36eba0c9fc refactor: use .template suffix for all schematic files
Currently when using `ivy-ngcc` it will print out a warning

```
Failed to read entry point info from //node_modules/@schematics/angular/workspace/files/package.json with error SyntaxError: Unexpected token < in JSON at position 1121.
```

Fixes #13378
2019-01-16 10:29:56 -08:00

35 lines
860 B
TypeScript

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { strings } from '@angular-devkit/core';
import {
Rule,
apply,
applyTemplates,
filter,
mergeWith,
noop,
url,
} from '@angular-devkit/schematics';
import { latestVersions } from '../utility/latest-versions';
import { Schema as WorkspaceOptions } from './schema';
export default function (options: WorkspaceOptions): Rule {
const minimalFilesRegExp = /(.editorconfig|tslint.json)\.template$/;
return mergeWith(apply(url('./files'), [
options.minimal ? filter(path => !minimalFilesRegExp.test(path)) : noop(),
applyTemplates({
utils: strings,
...options,
'dot': '.',
latestVersions,
}),
]));
}