Skip to content

Commit

Permalink
build: reference zone.js from source directly instead of npm. (angula…
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaLiPassion authored and atscott committed Nov 6, 2019
1 parent 3de72e4 commit 8c6fb17
Show file tree
Hide file tree
Showing 100 changed files with 180 additions and 158 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ jobs:
background: true
- run: yarn tsc -p packages
- run: yarn tsc -p modules
- run: yarn bazel build //packages/zone.js:npm_package
# Waits for the Saucelabs tunnel to be ready. This ensures that we don't run tests
# too early without Saucelabs not being ready.
- run: ./scripts/saucelabs/wait-for-tunnel.sh
Expand Down
6 changes: 3 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ filegroup(
# do not sort
srcs = [
"@npm//:node_modules/core-js/client/core.js",
"@npm//:node_modules/zone.js/dist/zone.js",
"@npm//:node_modules/zone.js/dist/zone-testing.js",
"@npm//:node_modules/zone.js/dist/task-tracking.js",
"//packages/zone.js/dist:zone.js",
"//packages/zone.js/dist:zone-testing.js",
"//packages/zone.js/dist:task-tracking.js",
"//:test-events.js",
"//:shims_for_IE.js",
# Including systemjs because it defines `__eval`, which produces correct stack traces.
Expand Down
2 changes: 1 addition & 1 deletion integration/cli-hello-world-ivy-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@angular/router": "file:../../dist/packages-dist/router",
"rxjs": "file:../../node_modules/rxjs",
"tslib": "file:../../node_modules/tslib",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.900.0-rc.0",
Expand Down
2 changes: 1 addition & 1 deletion integration/cli-hello-world-ivy-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"rxjs": "file:../../node_modules/rxjs",
"serve": "^11.2.0",
"tslib": "file:../../node_modules/tslib",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.900.0-rc.0",
Expand Down
2 changes: 1 addition & 1 deletion integration/cli-hello-world-ivy-minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@angular/router": "file:../../dist/packages-dist/router",
"rxjs": "file:../../node_modules/rxjs",
"tslib": "file:../../node_modules/tslib",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.900.0-rc.0",
Expand Down
2 changes: 1 addition & 1 deletion integration/cli-hello-world-lazy-rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@angular/router": "file:../../dist/packages-dist/router",
"rxjs": "file:../../node_modules/rxjs",
"tslib": "^1.10.0",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.900.0-rc.0",
Expand Down
2 changes: 1 addition & 1 deletion integration/cli-hello-world-lazy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@angular/router": "file:../../dist/packages-dist/router",
"rxjs": "file:../../node_modules/rxjs",
"tslib": "^1.10.0",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.900.0-rc.0",
Expand Down
2 changes: 1 addition & 1 deletion integration/cli-hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@angular/router": "file:../../dist/packages-dist/router",
"rxjs": "file:../../node_modules/rxjs",
"tslib": "file:../../node_modules/tslib",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.900.0-rc.0",
Expand Down
2 changes: 1 addition & 1 deletion integration/dynamic-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
"core-js": "file:../../node_modules/core-js",
"rxjs": "file:../../node_modules/rxjs",
"systemjs": "file:../../node_modules/systemjs",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
}
}
2 changes: 1 addition & 1 deletion integration/hello_world__closure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"google-closure-compiler": "20180716.0.0",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@types/jasmine": "2.5.41",
Expand Down
2 changes: 1 addition & 1 deletion integration/hello_world__systemjs_umd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"rxjs": "file:../../node_modules/rxjs",
"systemjs": "0.20.2",
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@types/jasmine": "2.5.41",
Expand Down
2 changes: 1 addition & 1 deletion integration/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"google-closure-compiler": "git+https://github.com/alexeagle/closure-compiler.git#packagejson.dist",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@types/jasmine": "2.5.41",
Expand Down
2 changes: 1 addition & 1 deletion integration/injectable-def/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@types/node": "file:../../node_modules/@types/node",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@types/jasmine": "2.5.41",
Expand Down
3 changes: 1 addition & 2 deletions integration/ivy-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"translated:legacy:serve": "serve ../tmp/translations/legacy --listen 4200",
"translated:legacy:e2e": "npm-run-all -p -r translated:legacy:serve \"ng e2e --configuration=translated-legacy\"",
"translated:legacy:translate": "localize-translate -r \"dist/\" -s \"**/*\" -o \"../tmp/translations/{{LOCALE}}\"",

"translated:legacy-xlf:test": "yarn ng xi18n && yarn translated:legacy-xlf:update-translations && yarn ng build --configuration=translated-legacy && yarn translated:legacy:translate -t \"../tmp/legacy-locales/messages.legacy.xlf\" && yarn translated:legacy:e2e",
"translated:legacy-xlf:update-translations": "sed -i.bak -e 's/source>/target>'/ -e 's/Hello/Bonjour/' -e 's/source-language=\"en-US\"/source-language=\"en-US\" target-language=\"legacy\"/' ../tmp/legacy-locales/messages.legacy.xlf",
"translated:legacy-xmb:test": "yarn ng xi18n --format=xmb --outFile=messages.legacy.xmb && yarn translated:legacy-xmb:update-translations && yarn ng build --configuration=translated-legacy-xmb && yarn translated:legacy:translate -t \"../tmp/legacy-locales/messages.legacy.xtb\" && yarn translated:legacy:e2e",
Expand All @@ -46,7 +45,7 @@
"rxjs": "file:../../node_modules/rxjs",
"serve": "^11.2.0",
"tslib": "file:../../node_modules/tslib",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.900.0-rc.0",
Expand Down
2 changes: 1 addition & 1 deletion integration/ng_elements/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"google-closure-compiler": "20180319.0.0",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@types/jasmine": "2.5.41",
Expand Down
2 changes: 1 addition & 1 deletion integration/ng_update/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
}
}
2 changes: 1 addition & 1 deletion integration/ng_update_migrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@angular/router": "file:../../dist/packages-dist/router",
"rxjs": "file:../../node_modules/rxjs",
"tslib": "file:../../node_modules/tslib",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.900.0-rc.0",
Expand Down
2 changes: 1 addition & 1 deletion integration/ngcc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@types/node": "file:../../node_modules/@types/node",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@types/jasmine": "2.5.41",
Expand Down
2 changes: 1 addition & 1 deletion integration/platform-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"express": "^4.14.1",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"devDependencies": {
"@types/jasmine": "2.5.41",
Expand Down
2 changes: 1 addition & 1 deletion integration/platform-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ app.get('/favicon.ico', (req, res) => { res.send(''); });
app.get('/helloworld', render(HelloWorldServerModuleNgFactory, helloworld));
app.get('/transferstate', render(TransferStateServerModuleNgFactory, transferstate));

app.listen(9876, function() { console.log('Server listening on port 9876!'); });
app.listen(9876, function() { console.log('Server listening on port 9876!'); });
4 changes: 4 additions & 0 deletions integration/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cd "$(dirname "$0")"

# basedir is the workspace root
readonly basedir=$(pwd)/..
readonly bazel_bin=$(yarn bin)/bazel

# When running on the CI, we track the payload size of various integration output files. Also
# we shard tests across multiple CI job instances. The script needs to be run with a shard index
Expand All @@ -35,6 +36,9 @@ else
TEST_DIRS=$(ls | grep -v node_modules)
fi

# We need to build zone.js npm package because it is not built in build-packages-dist.sh
${bazel_bin} build //packages/zone.js:npm_package

# Workaround https://github.com/yarnpkg/yarn/issues/2165
# Yarn will cache file://dist URIs and not update Angular code
readonly cache=.yarn_local_cache
Expand Down
2 changes: 1 addition & 1 deletion integration/service-worker-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
}
}
2 changes: 1 addition & 1 deletion integration/terser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
"rxjs": "file:../../node_modules/rxjs",
"terser": "3.17.0",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
}
}
2 changes: 1 addition & 1 deletion integration/typings_test_ts36/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@types/jasmine": "2.5.41",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "3.6.4",
"zone.js": "file:../../node_modules/zone.js"
"zone.js": "file:../../dist/bin/packages/zone.js/npm_package"
},
"scripts": {
"test": "tsc"
Expand Down
6 changes: 3 additions & 3 deletions karma-js.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ module.exports = function(config) {
{pattern: 'node_modules/angular-mocks/angular-mocks.js', included: false, watched: false},

'node_modules/core-js/client/core.js',
'node_modules/zone.js/dist/zone.js',
'node_modules/zone.js/dist/zone-testing.js',
'node_modules/zone.js/dist/task-tracking.js',
'dist/bin/packages/zone.js/npm_package/dist/zone.js',
'dist/bin/packages/zone.js/npm_package/dist/zone-testing.js',
'dist/bin/packages/zone.js/npm_package/dist/task-tracking.js',

// Including systemjs because it defines `__eval`, which produces correct stack traces.
'test-events.js',
Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/class_bindings/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ts_devserver(
port = 4200,
static_files = [
":bundle.min_debug.es2015.js",
"@npm//:node_modules/zone.js/dist/zone.js",
"//packages/zone.js/dist:zone.js",
],
)

Expand Down
4 changes: 2 additions & 2 deletions modules/benchmarks/src/expanding_rows/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ts_devserver(
index_html = "index.html",
port = 4200,
static_files = [
"@npm//:node_modules/zone.js/dist/zone.js",
"//packages/zone.js/dist:zone.js",
],
deps = [
":bundle.min_debug.es2015.js",
Expand All @@ -64,7 +64,7 @@ ts_devserver(
"//tools/rxjs:rxjs_umd_modules",
],
static_files = [
"@npm//:node_modules/zone.js/dist/zone.js",
"//packages/zone.js/dist:zone.js",
],
deps = [":application_lib"],
)
Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/largeform/ng2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ ts_devserver(
"//tools/rxjs:rxjs_umd_modules",
],
static_files = [
"@npm//:node_modules/zone.js/dist/zone.js",
"@npm//:node_modules/reflect-metadata/Reflect.js",
"//packages/zone.js/dist:zone.js",
],
tags = ["fixme-ivy-aot"],
deps = [":ng2"],
Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/largetable/ng2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ts_devserver(
port = 4200,
static_files = [
":bundle.min_debug.es2015.js",
"@npm//:node_modules/zone.js/dist/zone.js",
"//packages/zone.js/dist:zone.js",
],
)

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/largetable/ng2_switch/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ ts_devserver(
"//tools/rxjs:rxjs_umd_modules",
],
static_files = [
"@npm//:node_modules/zone.js/dist/zone.js",
"@npm//:node_modules/reflect-metadata/Reflect.js",
"//packages/zone.js/dist:zone.js",
],
deps = [":ng2_switch"],
)
Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/tree/ng2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ts_devserver(
port = 4200,
static_files = [
":bundle.min_debug.es2015.js",
"@npm//:node_modules/zone.js/dist/zone.js",
"//packages/zone.js/dist:zone.js",
],
)

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/tree/ng2_static/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ ts_devserver(
"//tools/rxjs:rxjs_umd_modules",
],
static_files = [
"@npm//:node_modules/zone.js/dist/zone.js",
"@npm//:node_modules/reflect-metadata/Reflect.js",
"//packages/zone.js/dist:zone.js",
],
deps = [":ng2_static"],
)
Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/tree/ng2_switch/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ ts_devserver(
"//tools/rxjs:rxjs_umd_modules",
],
static_files = [
"@npm//:node_modules/zone.js/dist/zone.js",
"@npm//:node_modules/reflect-metadata/Reflect.js",
"//packages/zone.js/dist:zone.js",
],
deps = [":ng2_switch"],
)
Expand Down
6 changes: 4 additions & 2 deletions modules/benchmarks/src/views/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ ts_devserver(
static_files = [
":bundle.min_debug.es2015.js",
":bundle.min.es2015.js",
"@npm//:node_modules/zone.js/dist/zone.js",
"//packages/zone.js/dist:zone.js",
"index.html",
],
)

ts_devserver(
name = "devserver",
data = [
"//packages/zone.js/dist:zone.js",
],
entry_module = "angular/modules/benchmarks/src/views/index",
index_html = "index.html",
scripts = [
Expand All @@ -45,7 +48,6 @@ ts_devserver(
],
serving_path = "/index.js",
static_files = [
"@npm//:node_modules/zone.js/dist/zone.js",
"index.html",
],
deps = [":application_lib"],
Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/src/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ <h1>Views traversal benchmark</h1>
</script>
</body>

</html>
</html>
2 changes: 1 addition & 1 deletion modules/playground/src/animate/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ts_devserver(
port = 4200,
scripts = ["@npm//:node_modules/tslib/tslib.js"],
static_files = [
"@npm//:node_modules/zone.js/dist/zone.js",
"//packages/zone.js/dist:zone.js",
"@npm//:node_modules/reflect-metadata/Reflect.js",
],
deps = [":animate"],
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/async/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ts_devserver(
"//tools/rxjs:rxjs_umd_modules",
],
static_files = [
"@npm//:node_modules/zone.js/dist/zone.js",
"//packages/zone.js/dist:zone.js",
"@npm//:node_modules/reflect-metadata/Reflect.js",
],
deps = [":async"],
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/gestures/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ts_devserver(
scripts = ["@npm//:node_modules/tslib/tslib.js"],
static_files = [
"@npm//:node_modules/hammerjs/hammer.js",
"@npm//:node_modules/zone.js/dist/zone.js",
"//packages/zone.js/dist:zone.js",
"@npm//:node_modules/reflect-metadata/Reflect.js",
],
deps = [":gestures"],
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/hello_world/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ts_devserver(
"//tools/rxjs:rxjs_umd_modules",
],
static_files = [
"@npm//:node_modules/zone.js/dist/zone.js",
"//packages/zone.js/dist:zone.js",
"@npm//:node_modules/reflect-metadata/Reflect.js",
],
deps = [":hello_world"],
Expand Down
Loading

0 comments on commit 8c6fb17

Please sign in to comment.