fix(zone.js): should have better backward compatibilities (#38797)

Close #38561, #38669

zone.js 0.11.1 introduces a breaking change to adpat Angular package format,
and it breaks the module loading order, before 0.11, in IE11, the `zone.js` es5
format bundle will be imported, but after 0.11, the `fesm2015` format bundle will
be imported, which causes error.

And since the only purpose of the `dist` folder of zone.js bundles is to keep backward
 compatibility, in the original commit, I use package redirect to implement that, but
it is not fully backward compatible, we should keep the same dist structure as `0.10.3`.

PR Close #38797
This commit is contained in:
JiaLiPassion 2020-09-11 03:28:40 +09:00 committed by Misko Hevery
parent c4b8964424
commit a33d630a21
76 changed files with 260 additions and 691 deletions

View File

@ -1,80 +1,117 @@
package(default_visibility = ["//visibility:public"])
load("//packages/zone.js/dist:tools.bzl", "copy_es2015_to_dist", "copy_es5_to_dist")
copy_es2015_to_dist()
copy_es5_to_dist()
genrule(
name = "zone_externs",
srcs = ["//packages/zone.js:zone_externs"],
outs = ["zone_externs.js"],
cmd = "cp $< $@",
)
genrule(
name = "zone_extensions_d_ts",
srcs = ["//packages/zone.js/lib:zone.api.extensions.ts"],
outs = ["zone.api.extensions.ts"],
cmd = "cp $< $@",
)
genrule(
name = "zone_configurations_d_ts",
srcs = ["//packages/zone.js/lib:zone.configurations.api.ts"],
outs = ["zone.configurations.api.ts"],
cmd = "cp $< $@",
)
genrule(
name = "zone_js_d_ts",
srcs = ["//packages/zone.js/lib:zone_d_ts"],
outs = ["zone.js.d.ts"],
cmd = "cp $< $@",
)
filegroup(
name = "dist_bundle_group",
srcs = [
"//packages/zone.js/dist:async-test.min/package.json",
"//packages/zone.js/dist:async-test/package.json",
"//packages/zone.js/dist:fake-async-test.min/package.json",
"//packages/zone.js/dist:fake-async-test/package.json",
"//packages/zone.js/dist:jasmine-patch.min/package.json",
"//packages/zone.js/dist:jasmine-patch/package.json",
"//packages/zone.js/dist:long-stack-trace-zone.min/package.json",
"//packages/zone.js/dist:long-stack-trace-zone/package.json",
"//packages/zone.js/dist:mocha-patch.min/package.json",
"//packages/zone.js/dist:mocha-patch/package.json",
"//packages/zone.js/dist:proxy.min/package.json",
"//packages/zone.js/dist:proxy/package.json",
"//packages/zone.js/dist:sync-test.min/package.json",
"//packages/zone.js/dist:sync-test/package.json",
"//packages/zone.js/dist:task-tracking.min/package.json",
"//packages/zone.js/dist:task-tracking/package.json",
"//packages/zone.js/dist:webapis-media-query.min/package.json",
"//packages/zone.js/dist:webapis-media-query/package.json",
"//packages/zone.js/dist:webapis-notification.min/package.json",
"//packages/zone.js/dist:webapis-notification/package.json",
"//packages/zone.js/dist:webapis-rtc-peer-connection.min/package.json",
"//packages/zone.js/dist:webapis-rtc-peer-connection/package.json",
"//packages/zone.js/dist:webapis-shadydom.min/package.json",
"//packages/zone.js/dist:webapis-shadydom/package.json",
"//packages/zone.js/dist:wtf.min/package.json",
"//packages/zone.js/dist:wtf/package.json",
"//packages/zone.js/dist:zone.min/package.json",
"//packages/zone.js/dist:zone-bluebird.min/package.json",
"//packages/zone.js/dist:zone-bluebird/package.json",
"//packages/zone.js/dist:zone-error.min/package.json",
"//packages/zone.js/dist:zone-error/package.json",
"//packages/zone.js/dist:zone-evergreen.min/package.json",
"//packages/zone.js/dist:zone-evergreen-testing-bundle.min/package.json",
"//packages/zone.js/dist:zone-evergreen-testing-bundle/package.json",
"//packages/zone.js/dist:zone-evergreen/package.json",
"//packages/zone.js/dist:zone-legacy.min/package.json",
"//packages/zone.js/dist:zone-legacy/package.json",
"//packages/zone.js/dist:zone-mix.min/package.json",
"//packages/zone.js/dist:zone-mix/package.json",
"//packages/zone.js/dist:zone-node.min/package.json",
"//packages/zone.js/dist:zone-node/package.json",
"//packages/zone.js/dist:zone-patch-canvas.min/package.json",
"//packages/zone.js/dist:zone-patch-canvas/package.json",
"//packages/zone.js/dist:zone-patch-cordova.min/package.json",
"//packages/zone.js/dist:zone-patch-cordova/package.json",
"//packages/zone.js/dist:zone-patch-electron.min/package.json",
"//packages/zone.js/dist:zone-patch-electron/package.json",
"//packages/zone.js/dist:zone-patch-fetch.min/package.json",
"//packages/zone.js/dist:zone-patch-fetch/package.json",
"//packages/zone.js/dist:zone-patch-jsonp.min/package.json",
"//packages/zone.js/dist:zone-patch-jsonp/package.json",
"//packages/zone.js/dist:zone-patch-message-port.min/package.json",
"//packages/zone.js/dist:zone-patch-message-port/package.json",
"//packages/zone.js/dist:zone-patch-promise-test.min/package.json",
"//packages/zone.js/dist:zone-patch-promise-test/package.json",
"//packages/zone.js/dist:zone-patch-resize-observer.min/package.json",
"//packages/zone.js/dist:zone-patch-resize-observer/package.json",
"//packages/zone.js/dist:zone-patch-rxjs.min/package.json",
"//packages/zone.js/dist:zone-patch-rxjs-fake-async.min/package.json",
"//packages/zone.js/dist:zone-patch-rxjs-fake-async/package.json",
"//packages/zone.js/dist:zone-patch-rxjs/package.json",
"//packages/zone.js/dist:zone-patch-socket-io.min/package.json",
"//packages/zone.js/dist:zone-patch-socket-io/package.json",
"//packages/zone.js/dist:zone-patch-user-media.min/package.json",
"//packages/zone.js/dist:zone-patch-user-media/package.json",
"//packages/zone.js/dist:zone-testing.min/package.json",
"//packages/zone.js/dist:zone-testing-bundle.min/package.json",
"//packages/zone.js/dist:zone-testing-bundle/package.json",
"//packages/zone.js/dist:zone-testing-node-bundle.min/package.json",
"//packages/zone.js/dist:zone-testing-node-bundle/package.json",
"//packages/zone.js/dist:zone-testing/package.json",
"//packages/zone.js/dist:zone/package.json",
"//packages/zone.js/dist:zone_externs/package.json",
":async-test.js",
":async-test.min.js",
":fake-async-test.js",
":fake-async-test.min.js",
":jasmine-patch.js",
":jasmine-patch.min.js",
":long-stack-trace-zone.js",
":long-stack-trace-zone.min.js",
":mocha-patch.js",
":mocha-patch.min.js",
":proxy.js",
":proxy.min.js",
":sync-test.js",
":sync-test.min.js",
":task-tracking.js",
":task-tracking.min.js",
":webapis-media-query.js",
":webapis-media-query.min.js",
":webapis-notification.js",
":webapis-notification.min.js",
":webapis-rtc-peer-connection.js",
":webapis-rtc-peer-connection.min.js",
":webapis-shadydom.js",
":webapis-shadydom.min.js",
":wtf.js",
":wtf.min.js",
":zone.js",
":zone.min.js",
":zone-bluebird.js",
":zone-bluebird.min.js",
":zone-error.js",
":zone-error.min.js",
":zone-evergreen.js",
":zone-evergreen.min.js",
":zone-evergreen-testing-bundle.js",
":zone-evergreen-testing-bundle.min.js",
":zone-legacy.js",
":zone-legacy.min.js",
":zone-mix.js",
":zone-mix.min.js",
":zone-node.js",
":zone-node.min.js",
":zone-patch-canvas.js",
":zone-patch-canvas.min.js",
":zone-patch-cordova.js",
":zone-patch-cordova.min.js",
":zone-patch-electron.js",
":zone-patch-electron.min.js",
":zone-patch-fetch.js",
":zone-patch-fetch.min.js",
":zone-patch-jsonp.js",
":zone-patch-jsonp.min.js",
":zone-patch-message-port.js",
":zone-patch-message-port.min.js",
":zone-patch-promise-test.js",
":zone-patch-promise-test.min.js",
":zone-patch-resize-observer.js",
":zone-patch-resize-observer.min.js",
":zone-patch-rxjs.js",
":zone-patch-rxjs.min.js",
":zone-patch-rxjs-fake-async.js",
":zone-patch-rxjs-fake-async.min.js",
":zone-patch-socket-io.js",
":zone-patch-socket-io.min.js",
":zone-patch-user-media.js",
":zone-patch-user-media.min.js",
":zone-testing.js",
":zone-testing.min.js",
":zone-testing-bundle.js",
":zone-testing-bundle.min.js",
":zone-testing-node-bundle.js",
":zone-testing-node-bundle.min.js",
":zone_configurations_d_ts",
":zone_extensions_d_ts",
":zone_externs",
":zone_js_d_ts",
],
)

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/async-test.min",
"main": "../../bundles/async-test.umd.min.js",
"fesm2015": "../../fesm2015/async-test.min.js",
"es2015": "../../fesm2015/async-test.min.js",
"module": "../../fesm2015/async-test.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/async-test",
"main": "../../bundles/async-test.umd.js",
"fesm2015": "../../fesm2015/async-test.js",
"es2015": "../../fesm2015/async-test.js",
"module": "../../fesm2015/async-test.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/fake-async-test.min",
"main": "../../bundles/fake-async-test.umd.min.js",
"fesm2015": "../../fesm2015/fake-async-test.min.js",
"es2015": "../../fesm2015/fake-async-test.min.js",
"module": "../../fesm2015/fake-async-test.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/fake-async-test",
"main": "../../bundles/fake-async-test.umd.js",
"fesm2015": "../../fesm2015/fake-async-test.js",
"es2015": "../../fesm2015/fake-async-test.js",
"module": "../../fesm2015/fake-async-test.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/jasmine-patch.min",
"main": "../../bundles/jasmine-patch.umd.min.js",
"fesm2015": "../../fesm2015/jasmine-patch.min.js",
"es2015": "../../fesm2015/jasmine-patch.min.js",
"module": "../../fesm2015/jasmine-patch.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/jasmine-patch",
"main": "../../bundles/jasmine-patch.umd.js",
"fesm2015": "../../fesm2015/jasmine-patch.js",
"es2015": "../../fesm2015/jasmine-patch.js",
"module": "../../fesm2015/jasmine-patch.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/long-stack-trace-zone.min",
"main": "../../bundles/long-stack-trace-zone.umd.min.js",
"fesm2015": "../../fesm2015/long-stack-trace-zone.min.js",
"es2015": "../../fesm2015/long-stack-trace-zone.min.js",
"module": "../../fesm2015/long-stack-trace-zone.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/long-stack-trace-zone",
"main": "../../bundles/long-stack-trace-zone.umd.js",
"fesm2015": "../../fesm2015/long-stack-trace-zone.js",
"es2015": "../../fesm2015/long-stack-trace-zone.js",
"module": "../../fesm2015/long-stack-trace-zone.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/mocha-patch.min",
"main": "../../bundles/mocha-patch.umd.min.js",
"fesm2015": "../../fesm2015/mocha-patch.min.js",
"es2015": "../../fesm2015/mocha-patch.min.js",
"module": "../../fesm2015/mocha-patch.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/mocha-patch",
"main": "../../bundles/mocha-patch.umd.js",
"fesm2015": "../../fesm2015/mocha-patch.js",
"es2015": "../../fesm2015/mocha-patch.js",
"module": "../../fesm2015/mocha-patch.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/proxy.min",
"main": "../../bundles/proxy.umd.min.js",
"fesm2015": "../../fesm2015/proxy.min.js",
"es2015": "../../fesm2015/proxy.min.js",
"module": "../../fesm2015/proxy.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/proxy",
"main": "../../bundles/proxy.umd.js",
"fesm2015": "../../fesm2015/proxy.js",
"es2015": "../../fesm2015/proxy.js",
"module": "../../fesm2015/proxy.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/sync-test.min",
"main": "../../bundles/sync-test.umd.min.js",
"fesm2015": "../../fesm2015/sync-test.min.js",
"es2015": "../../fesm2015/sync-test.min.js",
"module": "../../fesm2015/sync-test.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/sync-test",
"main": "../../bundles/sync-test.umd.js",
"fesm2015": "../../fesm2015/sync-test.js",
"es2015": "../../fesm2015/sync-test.js",
"module": "../../fesm2015/sync-test.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/task-tracking.min",
"main": "../../bundles/task-tracking.umd.min.js",
"fesm2015": "../../fesm2015/task-tracking.min.js",
"es2015": "../../fesm2015/task-tracking.min.js",
"module": "../../fesm2015/task-tracking.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/task-tracking",
"main": "../../bundles/task-tracking.umd.js",
"fesm2015": "../../fesm2015/task-tracking.js",
"es2015": "../../fesm2015/task-tracking.js",
"module": "../../fesm2015/task-tracking.js"
}

71
packages/zone.js/dist/tools.bzl vendored Normal file
View File

@ -0,0 +1,71 @@
ES5_BUNDLES = [
"zone",
"zone-mix",
"zone-node",
"zone-testing-node-bundle",
"async-test",
"fake-async-test",
"long-stack-trace-zone",
"proxy",
"zone-patch-rxjs-fake-async",
"sync-test",
"task-tracking",
"wtf",
"zone-error",
"zone-legacy",
"zone-bluebird",
"zone-patch-canvas",
"zone-patch-cordova",
"zone-patch-electron",
"zone-patch-fetch",
"jasmine-patch",
"zone-patch-jsonp",
"webapis-media-query",
"mocha-patch",
"webapis-notification",
"zone-patch-promise-test",
"zone-patch-resize-observer",
"webapis-rtc-peer-connection",
"zone-patch-rxjs",
"webapis-shadydom",
"zone-patch-socket-io",
"zone-patch-user-media",
"zone-patch-message-port",
"zone-testing",
"zone-testing-bundle",
]
ES2015_BUNDLES = {
"zone-evergreen": "//packages/zone.js/fesm2015:zone",
"zone-evergreen-testing-bundle": "//packages/zone.js/fesm2015:zone-testing-bundle",
}
def copy_es5_to_dist():
for b in ES5_BUNDLES:
native.genrule(
name = "zone_copy_" + b,
srcs = ["//packages/zone.js/bundles:" + b + ".umd.js"],
outs = [b + ".js"],
cmd = "cp $< $@",
)
native.genrule(
name = "zone_copy_min_" + b,
srcs = ["//packages/zone.js/bundles:" + b + ".umd.min.js"],
outs = [b + ".min.js"],
cmd = "cp $< $@",
)
def copy_es2015_to_dist():
for b in ES2015_BUNDLES.items():
native.genrule(
name = "zone_copy_" + b[0],
srcs = [b[1] + ".js"],
outs = [b[0] + ".js"],
cmd = "cp $< $@",
)
native.genrule(
name = "zone_copy_min_" + b[0],
srcs = [b[1] + ".min.js"],
outs = [b[0] + ".min.js"],
cmd = "cp $< $@",
)

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/webapis-media-query.min",
"main": "../../bundles/webapis-media-query.umd.min.js",
"fesm2015": "../../fesm2015/webapis-media-query.min.js",
"es2015": "../../fesm2015/webapis-media-query.min.js",
"module": "../../fesm2015/webapis-media-query.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/webapis-media-query",
"main": "../../bundles/webapis-media-query.umd.js",
"fesm2015": "../../fesm2015/webapis-media-query.js",
"es2015": "../../fesm2015/webapis-media-query.js",
"module": "../../fesm2015/webapis-media-query.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/webapis-notification.min",
"main": "../../bundles/webapis-notification.umd.min.js",
"fesm2015": "../../fesm2015/webapis-notification.min.js",
"es2015": "../../fesm2015/webapis-notification.min.js",
"module": "../../fesm2015/webapis-notification.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/webapis-notification",
"main": "../../bundles/webapis-notification.umd.js",
"fesm2015": "../../fesm2015/webapis-notification.js",
"es2015": "../../fesm2015/webapis-notification.js",
"module": "../../fesm2015/webapis-notification.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/webapis-rtc-peer-connection.min",
"main": "../../bundles/webapis-rtc-peer-connection.umd.min.js",
"fesm2015": "../../fesm2015/webapis-rtc-peer-connection.min.js",
"es2015": "../../fesm2015/webapis-rtc-peer-connection.min.js",
"module": "../../fesm2015/webapis-rtc-peer-connection.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/webapis-rtc-peer-connection",
"main": "../../bundles/webapis-rtc-peer-connection.umd.js",
"fesm2015": "../../fesm2015/webapis-rtc-peer-connection.js",
"es2015": "../../fesm2015/webapis-rtc-peer-connection.js",
"module": "../../fesm2015/webapis-rtc-peer-connection.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/webapis-shadydom.min",
"main": "../../bundles/webapis-shadydom.umd.min.js",
"fesm2015": "../../fesm2015/webapis-shadydom.min.js",
"es2015": "../../fesm2015/webapis-shadydom.min.js",
"module": "../../fesm2015/webapis-shadydom.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/webapis-shadydom",
"main": "../../bundles/webapis-shadydom.umd.js",
"fesm2015": "../../fesm2015/webapis-shadydom.js",
"es2015": "../../fesm2015/webapis-shadydom.js",
"module": "../../fesm2015/webapis-shadydom.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/wtf.min",
"main": "../../bundles/wtf.umd.min.js",
"fesm2015": "../../fesm2015/wtf.min.js",
"es2015": "../../fesm2015/wtf.min.js",
"module": "../../fesm2015/wtf.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/wtf",
"main": "../../bundles/wtf.umd.js",
"fesm2015": "../../fesm2015/wtf.js",
"es2015": "../../fesm2015/wtf.js",
"module": "../../fesm2015/wtf.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-bluebird.min",
"main": "../../bundles/zone-bluebird.umd.min.js",
"fesm2015": "../../fesm2015/zone-bluebird.min.js",
"es2015": "../../fesm2015/zone-bluebird.min.js",
"module": "../../fesm2015/zone-bluebird.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-bluebird",
"main": "../../bundles/zone-bluebird.umd.js",
"fesm2015": "../../fesm2015/zone-bluebird.js",
"es2015": "../../fesm2015/zone-bluebird.js",
"module": "../../fesm2015/zone-bluebird.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-error.min",
"main": "../../bundles/zone-error.umd.min.js",
"fesm2015": "../../fesm2015/zone-error.min.js",
"es2015": "../../fesm2015/zone-error.min.js",
"module": "../../fesm2015/zone-error.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-error",
"main": "../../bundles/zone-error.umd.js",
"fesm2015": "../../fesm2015/zone-error.js",
"es2015": "../../fesm2015/zone-error.js",
"module": "../../fesm2015/zone-error.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-evergreen-testing-bundle.min",
"main": "../../fesm2015/zone-testing-bundle.min.js",
"fesm2015": "../../fesm2015/zone-testing-bundle.min.js",
"es2015": "../../fesm2015/zone-testing-bundle.min.js",
"module": "../../fesm2015/zone-testing-bundle.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-evergreen-testing-bundle",
"main": "../../fesm2015/zone-testing-bundle.js",
"fesm2015": "../../fesm2015/zone-testing-bundle.js",
"es2015": "../../fesm2015/zone-testing-bundle.js",
"module": "../../fesm2015/zone-testing-bundle.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-evergreen.min",
"main": "../../fesm2015/zone.min.js",
"fesm2015": "../../fesm2015/zone.min.js",
"es2015": "../../fesm2015/zone.min.js",
"module": "../../fesm2015/zone.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-evergreen",
"main": "../../fesm2015/zone.js",
"fesm2015": "../../fesm2015/zone.js",
"es2015": "../../fesm2015/zone.js",
"module": "../../fesm2015/zone.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-legacy.min",
"main": "../../bundles/zone-legacy.umd.min.js",
"fesm2015": "../../fesm2015/zone-legacy.min.js",
"es2015": "../../fesm2015/zone-legacy.min.js",
"module": "../../fesm2015/zone-legacy.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-legacy",
"main": "../../bundles/zone-legacy.umd.js",
"fesm2015": "../../fesm2015/zone-legacy.js",
"es2015": "../../fesm2015/zone-legacy.js",
"module": "../../fesm2015/zone-legacy.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-mix.min",
"main": "../../bundles/zone-mix.umd.min.js",
"fesm2015": "../../fesm2015/zone-mix.min.js",
"es2015": "../../fesm2015/zone-mix.min.js",
"module": "../../fesm2015/zone-mix.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-mix",
"main": "../../bundles/zone-mix.umd.js",
"fesm2015": "../../fesm2015/zone-mix.js",
"es2015": "../../fesm2015/zone-mix.js",
"module": "../../fesm2015/zone-mix.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-node.min",
"main": "../../bundles/zone-node.umd.min.js",
"fesm2015": "../../fesm2015/zone-node.min.js",
"es2015": "../../fesm2015/zone-node.min.js",
"module": "../../fesm2015/zone-node.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-node",
"main": "../../bundles/zone-node.umd.js",
"fesm2015": "../../fesm2015/zone-node.js",
"es2015": "../../fesm2015/zone-node.js",
"module": "../../fesm2015/zone-node.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-canvas.min",
"main": "../../bundles/zone-patch-canvas.umd.min.js",
"fesm2015": "../../fesm2015/zone-patch-canvas.min.js",
"es2015": "../../fesm2015/zone-patch-canvas.min.js",
"module": "../../fesm2015/zone-patch-canvas.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-canvas",
"main": "../../bundles/zone-patch-canvas.umd.js",
"fesm2015": "../../fesm2015/zone-patch-canvas.js",
"es2015": "../../fesm2015/zone-patch-canvas.js",
"module": "../../fesm2015/zone-patch-canvas.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-cordova.min",
"main": "../../bundles/zone-patch-cordova.umd.min.js",
"fesm2015": "../../fesm2015/zone-patch-cordova.min.js",
"es2015": "../../fesm2015/zone-patch-cordova.min.js",
"module": "../../fesm2015/zone-patch-cordova.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-cordova",
"main": "../../bundles/zone-patch-cordova.umd.js",
"fesm2015": "../../fesm2015/zone-patch-cordova.js",
"es2015": "../../fesm2015/zone-patch-cordova.js",
"module": "../../fesm2015/zone-patch-cordova.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-electron.min",
"main": "../../bundles/zone-patch-electron.umd.min.js",
"fesm2015": "../../fesm2015/zone-patch-electron.min.js",
"es2015": "../../fesm2015/zone-patch-electron.min.js",
"module": "../../fesm2015/zone-patch-electron.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-electron",
"main": "../../bundles/zone-patch-electron.umd.js",
"fesm2015": "../../fesm2015/zone-patch-electron.js",
"es2015": "../../fesm2015/zone-patch-electron.js",
"module": "../../fesm2015/zone-patch-electron.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-fetch.min",
"main": "../../bundles/zone-patch-fetch.umd.min.js",
"fesm2015": "../../fesm2015/zone-patch-fetch.min.js",
"es2015": "../../fesm2015/zone-patch-fetch.min.js",
"module": "../../fesm2015/zone-patch-fetch.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-fetch",
"main": "../../bundles/zone-patch-fetch.umd.js",
"fesm2015": "../../fesm2015/zone-patch-fetch.js",
"es2015": "../../fesm2015/zone-patch-fetch.js",
"module": "../../fesm2015/zone-patch-fetch.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-jsonp.min",
"main": "../../bundles/zone-patch-jsonp.umd.min.js",
"fesm2015": "../../fesm2015/zone-patch-jsonp.min.js",
"es2015": "../../fesm2015/zone-patch-jsonp.min.js",
"module": "../../fesm2015/zone-patch-jsonp.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-jsonp",
"main": "../../bundles/zone-patch-jsonp.umd.js",
"fesm2015": "../../fesm2015/zone-patch-jsonp.js",
"es2015": "../../fesm2015/zone-patch-jsonp.js",
"module": "../../fesm2015/zone-patch-jsonp.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-message-port.min",
"main": "../../bundles/zone-patch-message-port.umd.min.js",
"fesm2015": "../../fesm2015/zone-patch-message-port.min.js",
"es2015": "../../fesm2015/zone-patch-message-port.min.js",
"module": "../../fesm2015/zone-patch-message-port.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-message-port",
"main": "../../bundles/zone-patch-message-port.umd.js",
"fesm2015": "../../fesm2015/zone-patch-message-port.js",
"es2015": "../../fesm2015/zone-patch-message-port.js",
"module": "../../fesm2015/zone-patch-message-port.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-promise-test.min",
"main": "../../bundles/zone-patch-promise-test.umd.min.js",
"fesm2015": "../../fesm2015/zone-patch-promise-test.min.js",
"es2015": "../../fesm2015/zone-patch-promise-test.min.js",
"module": "../../fesm2015/zone-patch-promise-test.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-promise-test",
"main": "../../bundles/zone-patch-promise-test.umd.js",
"fesm2015": "../../fesm2015/zone-patch-promise-test.js",
"es2015": "../../fesm2015/zone-patch-promise-test.js",
"module": "../../fesm2015/zone-patch-promise-test.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-resize-observer.min",
"main": "../../bundles/zone-patch-resize-observer.umd.min.js",
"fesm2015": "../../fesm2015/zone-patch-resize-observer.min.js",
"es2015": "../../fesm2015/zone-patch-resize-observer.min.js",
"module": "../../fesm2015/zone-patch-resize-observer.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-resize-observer",
"main": "../../bundles/zone-patch-resize-observer.umd.js",
"fesm2015": "../../fesm2015/zone-patch-resize-observer.js",
"es2015": "../../fesm2015/zone-patch-resize-observer.js",
"module": "../../fesm2015/zone-patch-resize-observer.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-rxjs-fake-async.min",
"main": "../../bundles/zone-patch-rxjs-fake-async.umd.min.js",
"fesm2015": "../../fesm2015/zone-patch-rxjs-fake-async.min.js",
"es2015": "../../fesm2015/zone-patch-rxjs-fake-async.min.js",
"module": "../../fesm2015/zone-patch-rxjs-fake-async.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-rxjs-fake-async",
"main": "../../bundles/zone-patch-rxjs-fake-async.umd.js",
"fesm2015": "../../fesm2015/zone-patch-rxjs-fake-async.js",
"es2015": "../../fesm2015/zone-patch-rxjs-fake-async.js",
"module": "../../fesm2015/zone-patch-rxjs-fake-async.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-rxjs.min",
"main": "../../bundles/zone-patch-rxjs.umd.min.js",
"fesm2015": "../../fesm2015/zone-patch-rxjs.min.js",
"es2015": "../../fesm2015/zone-patch-rxjs.min.js",
"module": "../../fesm2015/zone-patch-rxjs.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-rxjs",
"main": "../../bundles/zone-patch-rxjs.umd.js",
"fesm2015": "../../fesm2015/zone-patch-rxjs.js",
"es2015": "../../fesm2015/zone-patch-rxjs.js",
"module": "../../fesm2015/zone-patch-rxjs.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-socket-io.min",
"main": "../../bundles/zone-patch-socket-io.umd.min.js",
"fesm2015": "../../fesm2015/zone-patch-socket-io.min.js",
"es2015": "../../fesm2015/zone-patch-socket-io.min.js",
"module": "../../fesm2015/zone-patch-socket-io.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-socket-io",
"main": "../../bundles/zone-patch-socket-io.umd.js",
"fesm2015": "../../fesm2015/zone-patch-socket-io.js",
"es2015": "../../fesm2015/zone-patch-socket-io.js",
"module": "../../fesm2015/zone-patch-socket-io.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-user-media.min",
"main": "../../bundles/zone-patch-user-media.umd.min.js",
"fesm2015": "../../fesm2015/zone-patch-user-media.min.js",
"es2015": "../../fesm2015/zone-patch-user-media.min.js",
"module": "../../fesm2015/zone-patch-user-media.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-patch-user-media",
"main": "../../bundles/zone-patch-user-media.umd.js",
"fesm2015": "../../fesm2015/zone-patch-user-media.js",
"es2015": "../../fesm2015/zone-patch-user-media.js",
"module": "../../fesm2015/zone-patch-user-media.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-testing-bundle.min",
"main": "../../bundles/zone-testing-bundle.umd.min.js",
"fesm2015": "../../fesm2015/zone-testing-bundle.min.js",
"es2015": "../../fesm2015/zone-testing-bundle.min.js",
"module": "../../fesm2015/zone-testing-bundle.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-testing-bundle",
"main": "../../bundles/zone-testing-bundle.umd.js",
"fesm2015": "../../fesm2015/zone-testing-bundle.js",
"es2015": "../../fesm2015/zone-testing-bundle.js",
"module": "../../fesm2015/zone-testing-bundle.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-testing-node-bundle.min",
"main": "../../bundles/zone-testing-node-bundle.umd.min.js",
"fesm2015": "../../fesm2015/zone-testing-node-bundle.min.js",
"es2015": "../../fesm2015/zone-testing-node-bundle.min.js",
"module": "../../fesm2015/zone-testing-node-bundle.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-testing-node-bundle",
"main": "../../bundles/zone-testing-node-bundle.umd.js",
"fesm2015": "../../fesm2015/zone-testing-node-bundle.js",
"es2015": "../../fesm2015/zone-testing-node-bundle.js",
"module": "../../fesm2015/zone-testing-node-bundle.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-testing.min",
"main": "../../bundles/zone-testing.umd.min.js",
"fesm2015": "../../fesm2015/zone-testing.min.js",
"es2015": "../../fesm2015/zone-testing.min.js",
"module": "../../fesm2015/zone-testing.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone-testing",
"main": "../../bundles/zone-testing.umd.js",
"fesm2015": "../../fesm2015/zone-testing.js",
"es2015": "../../fesm2015/zone-testing.js",
"module": "../../fesm2015/zone-testing.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone.min",
"main": "../../bundles/zone.umd.min.js",
"fesm2015": "../../fesm2015/zone.min.js",
"es2015": "../../fesm2015/zone.min.js",
"module": "../../fesm2015/zone.min.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone",
"main": "../../bundles/zone.umd.js",
"fesm2015": "../../fesm2015/zone.js",
"es2015": "../../fesm2015/zone.js",
"module": "../../fesm2015/zone.js"
}

View File

@ -1,7 +0,0 @@
{
"name": "zone.js/zone_externs",
"main": "../../zone_externs.js",
"fesm2015": "../../zone_externs.js",
"es2015": "../../zone_externs.js",
"module": "../../zone_externs.js"
}

View File

@ -182,7 +182,7 @@ describe('Zone.js npm_package', () => {
});
});
describe('dist file list', () => {
describe('bundles file list', () => {
it('should contain all files', () => {
const expected = [
'async-test.js',
@ -277,114 +277,86 @@ describe('Zone.js npm_package', () => {
describe('backward compatible check', () => {
it('should contain all original folders in /dist', () => {
const list = shx.ls('./dist').stdout.split('\n').sort().slice(1);
const expected = [
'async-test',
'async-test.min',
'fake-async-test',
'fake-async-test.min',
'jasmine-patch',
'jasmine-patch.min',
'long-stack-trace-zone',
'long-stack-trace-zone.min',
'mocha-patch',
'mocha-patch.min',
'proxy',
'proxy.min',
'sync-test',
'sync-test.min',
'task-tracking',
'task-tracking.min',
'webapis-media-query',
'webapis-media-query.min',
'webapis-notification',
'webapis-notification.min',
'webapis-rtc-peer-connection',
'webapis-rtc-peer-connection.min',
'webapis-shadydom',
'webapis-shadydom.min',
'wtf',
'wtf.min',
'zone-bluebird',
'zone-bluebird.min',
'zone-error',
'zone-error.min',
'zone-legacy',
'zone-legacy.min',
'zone-mix',
'zone-mix.min',
'zone-node',
'zone-node.min',
'zone-patch-canvas',
'zone-patch-canvas.min',
'zone-patch-cordova',
'zone-patch-cordova.min',
'zone-patch-electron',
'zone-patch-electron.min',
'zone-patch-fetch',
'zone-patch-fetch.min',
'zone-patch-jsonp',
'zone-patch-jsonp.min',
'zone-patch-message-port',
'zone-patch-message-port.min',
'zone-patch-promise-test',
'zone-patch-promise-test.min',
'zone-patch-resize-observer',
'zone-patch-resize-observer.min',
'zone-patch-rxjs-fake-async',
'zone-patch-rxjs-fake-async.min',
'zone-patch-rxjs',
'zone-patch-rxjs.min',
'zone-patch-socket-io',
'zone-patch-socket-io.min',
'zone-patch-user-media',
'zone-patch-user-media.min',
'zone-testing-bundle',
'zone-testing-bundle.min',
'zone-testing-node-bundle',
'zone-testing-node-bundle.min',
'zone-testing',
'zone-testing.min',
'zone',
'zone.min',
'zone_externs',
'zone-evergreen',
'zone-evergreen.min',
'zone-evergreen-testing-bundle',
'zone-evergreen-testing-bundle.min',
'async-test.js',
'async-test.min.js',
'fake-async-test.js',
'fake-async-test.min.js',
'jasmine-patch.js',
'jasmine-patch.min.js',
'long-stack-trace-zone.js',
'long-stack-trace-zone.min.js',
'mocha-patch.js',
'mocha-patch.min.js',
'proxy.js',
'proxy.min.js',
'sync-test.js',
'sync-test.min.js',
'task-tracking.js',
'task-tracking.min.js',
'webapis-media-query.js',
'webapis-media-query.min.js',
'webapis-notification.js',
'webapis-notification.min.js',
'webapis-rtc-peer-connection.js',
'webapis-rtc-peer-connection.min.js',
'webapis-shadydom.js',
'webapis-shadydom.min.js',
'wtf.js',
'wtf.min.js',
'zone_externs.js',
'zone-bluebird.js',
'zone-bluebird.min.js',
'zone-error.js',
'zone-error.min.js',
'zone-evergreen.js',
'zone-evergreen.min.js',
'zone-evergreen-testing-bundle.js',
'zone-evergreen-testing-bundle.min.js',
'zone-legacy.js',
'zone-legacy.min.js',
'zone-mix.js',
'zone-mix.min.js',
'zone-node.js',
'zone-node.min.js',
'zone-patch-canvas.js',
'zone-patch-canvas.min.js',
'zone-patch-cordova.js',
'zone-patch-cordova.min.js',
'zone-patch-electron.js',
'zone-patch-electron.min.js',
'zone-patch-fetch.js',
'zone-patch-fetch.min.js',
'zone-patch-jsonp.js',
'zone-patch-jsonp.min.js',
'zone-patch-message-port.js',
'zone-patch-message-port.min.js',
'zone-patch-promise-test.js',
'zone-patch-promise-test.min.js',
'zone-patch-resize-observer.js',
'zone-patch-resize-observer.min.js',
'zone-patch-rxjs-fake-async.js',
'zone-patch-rxjs-fake-async.min.js',
'zone-patch-rxjs.js',
'zone-patch-rxjs.min.js',
'zone-patch-socket-io.js',
'zone-patch-socket-io.min.js',
'zone-patch-user-media.js',
'zone-patch-user-media.min.js',
'zone-testing-bundle.js',
'zone-testing-bundle.min.js',
'zone-testing-node-bundle.js',
'zone-testing-node-bundle.min.js',
'zone-testing.js',
'zone-testing.min.js',
'zone.js',
'zone.js.d.ts',
'zone.api.extensions.ts',
'zone.configurations.api.ts',
'zone.min.js',
].sort();
checkInSubFolder('./dist', () => {
const list = shx.ls('./').stdout.split('\n').sort().slice(1);
expect(list.length).toBe(expected.length);
for (let i = 0; i < list.length; i++) {
expect(list[i]).toEqual(expected[i]);
const packageJson = shx.cat(`${list[i]}/package.json`);
if (list[i].indexOf('_externs') !== -1) {
expect(packageJson).toContain(`"name": "zone.js/${list[i]}"`);
expect(packageJson).toContain(`"main": "../../${list[i]}.js"`);
expect(packageJson).toContain(`"fesm2015": "../../${list[i]}.js"`);
expect(packageJson).toContain(`"es2015": "../../${list[i]}.js"`);
expect(packageJson).toContain(`"module": "../../${list[i]}.js"`);
continue;
}
if (list[i].indexOf('evergreen') === -1) {
const umdMinName = list[i].indexOf('.min') === -1 ?
`${list[i]}.umd` :
`${list[i].substring(0, list[i].indexOf('.min'))}.umd.min`;
expect(packageJson).toContain(`"name": "zone.js/${list[i]}"`);
expect(packageJson).toContain(`"main": "../../bundles/${umdMinName}.js"`);
expect(packageJson).toContain(`"fesm2015": "../../fesm2015/${list[i]}.js"`);
expect(packageJson).toContain(`"es2015": "../../fesm2015/${list[i]}.js"`);
expect(packageJson).toContain(`"module": "../../fesm2015/${list[i]}.js"`);
} else {
const removeEvergreen = list[i].replace('-evergreen', '');
expect(packageJson).toContain(`"name": "zone.js/${list[i]}"`);
expect(packageJson).toContain(`"main": "../../fesm2015/${removeEvergreen}.js"`);
expect(packageJson).toContain(`"fesm2015": "../../fesm2015/${removeEvergreen}.js"`);
expect(packageJson).toContain(`"es2015": "../../fesm2015/${removeEvergreen}.js"`);
expect(packageJson).toContain(`"module": "../../fesm2015/${removeEvergreen}.js"`);
}
}
});
expect(list).toEqual(expected);
});
});
});