From c4331048ecccbbe7a2f37af92fc3f8580e78034e Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 29 Oct 2018 16:12:46 +0100 Subject: [PATCH] build(schematics): version placeholders not replaced (#13688) Since we copy the schematics after the version placeholders have been inlined, the version range that uses the NG version placeholder is not replaced properly. This is not problematic because by default we determine the NG version based on the installed `@angular/core` version. ``` addPackageToPackageJson(host, '@angular/animations', ngCoreVersionTag || requiredAngularVersionRange); ``` --- tools/package-tools/build-release.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/package-tools/build-release.ts b/tools/package-tools/build-release.ts index 238e1557365..8bcffdbd106 100644 --- a/tools/package-tools/build-release.ts +++ b/tools/package-tools/build-release.ts @@ -48,16 +48,18 @@ export function composeRelease(buildPackage: BuildPackage) { copyFiles(packagesDir, 'README.md', releasePath); copyFiles(sourceDir, 'package.json', releasePath); + // This must happen before replacing the version placeholders because the schematics + // could use the version placeholders for setting up specific dependencies within `ng-add`. + if (buildPackage.hasSchematics) { + copyFiles(join(packageOut, 'schematics'), '**/*', join(releasePath, 'schematics')); + } + replaceVersionPlaceholders(releasePath); insertPackageJsonVersionStamp(join(releasePath, 'package.json')); createTypingsReexportFile(releasePath, './typings/index', name); createMetadataReexportFile(releasePath, './typings/index', name, importAsName); - if (buildPackage.hasSchematics) { - copyFiles(join(packageOut, 'schematics'), '**/*', join(releasePath, 'schematics')); - } - if (buildPackage.secondaryEntryPoints.length) { createFilesForSecondaryEntryPoint(buildPackage, releasePath); }