test(aio): fix running docs examples against local builds (#18520)

This commit also updates the version of `@angular/cli` used for docs examples.
The previous (transient) dependency `@ngtools/webpack` was not compatible with
`@angular/compiler-cli@>=5` and was breaking when running against the local
builds (currently at 5.0.0-beta.2). The version of `@ngtools/webpack` used by
the latest `@angular/cli` version is compatible with `@angular/compiler-cli@5`.
This commit is contained in:
George Kalpakas
2017-08-10 00:21:10 +03:00
committed by Victor Berchet
parent fd6ae571b8
commit 7f2037f0b6
7 changed files with 123 additions and 47 deletions

View File

@ -41,12 +41,9 @@ const ANGULAR_PACKAGES = [
'platform-browser-dynamic',
'platform-server',
'router',
'tsc-wrapped',
'upgrade',
];
const ANGULAR_TOOLS_PACKAGES_PATH = path.resolve(ANGULAR_DIST_PATH, 'tools', '@angular');
const ANGULAR_TOOLS_PACKAGES = [
'tsc-wrapped'
];
const EXAMPLE_CONFIG_FILENAME = 'example-config.json';
@ -63,7 +60,6 @@ class ExampleBoilerPlate {
// Replace the Angular packages with those from the dist folder, if necessary
if (useLocal) {
ANGULAR_PACKAGES.forEach(packageName => this.overridePackage(ANGULAR_PACKAGES_PATH, packageName));
ANGULAR_TOOLS_PACKAGES.forEach(packageName => this.overridePackage(ANGULAR_TOOLS_PACKAGES_PATH, packageName));
}
// Get all the examples folders, indicated by those that contain a `example-config.json` file
@ -111,7 +107,7 @@ class ExampleBoilerPlate {
const sourceFolder = path.resolve(basePath, packageName);
const destinationFolder = path.resolve(SHARED_NODE_MODULES_PATH, '@angular', packageName);
shelljs.rm('-rf', destinationFolder);
fs.ensureSymlinkSync(sourceFolder, destinationFolder);
fs.copySync(sourceFolder, destinationFolder);
}
getFoldersContaining(basePath, filename, ignore) {