test(zone.js): test zone.js package with tgz (#38649)
Zone.js 0.11.0 release an empty bundle, and now the npm_package tests all target bazel rule `npm_package`, but not `npm_package.pack`, and these two rules may generate different results, for example, Zone.js 0.11.0's issue is `package.json` define files array which make the bundle only include the files in the files array. So this PR install the zone.js package from the archive generated from `npm_package.pack` rule. PR Close #38649
This commit is contained in:
parent
ad372f2d20
commit
d37939623f
|
@ -553,7 +553,8 @@ jobs:
|
|||
# Publish `zone.js` package.
|
||||
- run:
|
||||
name: Create artifacts for zone.js package
|
||||
command: ./scripts/ci/create-package-archives.sh $CI_BRANCH $CI_COMMIT $ZONEJS_PACKAGES_DIR $ZONEJS_PACKAGES_ARCHIVES_DIR
|
||||
# Need to remove the zone.js.tgz before archive
|
||||
command: rm -rf $ZONEJS_PACKAGES_DIR/archive && ./scripts/ci/create-package-archives.sh $CI_BRANCH $CI_COMMIT $ZONEJS_PACKAGES_DIR $ZONEJS_PACKAGES_ARCHIVES_DIR
|
||||
- store_artifacts:
|
||||
path: *zonejs_packages_archives_dir
|
||||
destination: zone.js
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"reflect-metadata": "0.1.12",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"tslib": "file:../../node_modules/tslib",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/bazel": "file:../../dist/packages-dist/bazel",
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
"@angular/router": "file:../../dist/packages-dist/router",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"tslib": "file:../../node_modules/tslib",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "file:../../node_modules/@angular-devkit/build-angular",
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"core-js": "file:../../node_modules/core-js",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"tslib": "file:../../node_modules/tslib",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "file:../../node_modules/@angular-devkit/build-angular",
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
"@angular/router": "file:../../dist/packages-dist/router",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"tslib": "file:../../node_modules/tslib",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "file:../../node_modules/@angular-devkit/build-angular",
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"@angular/router": "file:../../dist/packages-dist/router",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"tslib": "file:../../node_modules/tslib",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "file:../../node_modules/@angular-devkit/build-angular",
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"@angular/router": "file:../../dist/packages-dist/router",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"tslib": "file:../../node_modules/tslib",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "file:../../node_modules/@angular-devkit/build-angular",
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
"@angular/router": "file:../../dist/packages-dist/router",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"tslib": "file:../../node_modules/tslib",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "file:../../node_modules/@angular-devkit/build-angular",
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
"core-js": "file:../../node_modules/core-js",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"systemjs": "file:../../node_modules/systemjs",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"//resolutions-comment": "Ensure a single version of webdriver-manager which comes from root node_modules that has already run webdriver-manager update",
|
||||
"resolutions": {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"tslib": "file:../../node_modules/tslib",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "file:../../node_modules/@types/jasmine",
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"systemjs": "0.20.2",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "file:../../node_modules/@types/jasmine",
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"tslib": "file:../../node_modules/tslib",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "file:../../node_modules/@types/jasmine",
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"@types/node": "file:../../node_modules/@types/node",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "file:../../node_modules/@types/jasmine",
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"tslib": "file:../../node_modules/tslib",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "file:../../node_modules/@types/jasmine",
|
||||
|
|
|
@ -22,6 +22,6 @@
|
|||
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
"@angular/router": "file:../../dist/packages-dist/router",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"tslib": "file:../../node_modules/tslib",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "file:../../node_modules/@angular-devkit/build-angular",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"@types/node": "file:../../node_modules/@types/node",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "file:../../node_modules/@types/jasmine",
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"express": "4.16.4",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "file:../../node_modules/@types/jasmine",
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
"@angular/core": "file:../../dist/packages-dist/core",
|
||||
"@angular/service-worker": "file:../../dist/packages-dist/service-worker",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"terser": "3.17.0",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"@types/jasmine": "file:../../node_modules/@types/jasmine",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "~3.9.5",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tsc"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"@types/jasmine": "file:../../node_modules/@types/jasmine",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "4.0.2",
|
||||
"zone.js": "file:../../dist/zone.js-dist/zone.js"
|
||||
"zone.js": "file:../../dist/zone.js-dist/archive/zone.js.tgz"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tsc"
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
'use strict';
|
||||
|
||||
const {resolve} = require('path');
|
||||
const {chmod, cp, mkdir, rm, test} = require('shelljs');
|
||||
const {chmod, cp, mkdir, mv, rm, test} = require('shelljs');
|
||||
const zonePackageJson = require('../../packages/zone.js/package.json');
|
||||
const {baseDir, bazelBin, bazelCmd, exec, scriptPath} = require('./package-builder');
|
||||
|
||||
|
||||
|
@ -45,10 +46,22 @@ function buildZoneJsPackage(destPath) {
|
|||
const buildOutputDir = `${bazelBin}/packages/zone.js/npm_package`;
|
||||
const distTargetDir = `${absDestPath}/zone.js`;
|
||||
|
||||
console.info(`# Copy artifacts to ${distTargetDir}`);
|
||||
// Also create an archive so we can test the package itself.
|
||||
// Currently, the `npm_package.pack` rule does not work on Windows, so run `npm pack` directly.
|
||||
exec(`npm pack ${buildOutputDir}`);
|
||||
|
||||
console.info(`# Copy npm_package artifacts to ${distTargetDir}`);
|
||||
rm('-rf', distTargetDir);
|
||||
cp('-R', buildOutputDir, distTargetDir);
|
||||
chmod('-R', 'u+w', distTargetDir);
|
||||
|
||||
// Copy `zone.js.tgz` to `destPath`, so we can test
|
||||
// the archive generated by the `npm_package.pack` rule.
|
||||
const distArchiveTargetDir = `${absDestPath}/archive`;
|
||||
console.info(`# Copy npm_package archive file to ${distArchiveTargetDir}`);
|
||||
rm('-rf', distArchiveTargetDir);
|
||||
mkdir('-p', distArchiveTargetDir);
|
||||
mv(`${baseDir}/zone.js-${zonePackageJson.version}.tgz`, `${distArchiveTargetDir}/zone.js.tgz`);
|
||||
|
||||
console.info('');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue