| 
									
										
										
										
											2019-06-01 00:56:07 +09:00
										 |  |  | """
 | 
					
						
							|  |  |  | Describe all the output bundles in the zone.js npm package | 
					
						
							|  |  |  | by mapping the bundle name to the source location. | 
					
						
							|  |  |  | """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | _DIR = "//packages/zone.js/lib:" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
											  
											
												feat(zone.js): upgrade zone.js to angular package format(APF) (#36540)
Close #35157
In the current version of zone.js, zone.js uses it's own package format, and it is not following the rule
of Angualr package format(APF), so it is not easily to be consumed by Angular CLI or other bundle tools.
For example, zone.js npm package has two bundles,
1. zone.js/dist/zone.js, this is a `es5` bundle.
2. zone.js/dist/zone-evergreen.js, this is a `es2015` bundle.
And Angular CLI has to add some hard-coding code to handle this case, ohttps://github.com/angular/angular-cli/blob/5376a8b1392ac7bd252782d8474161ce03a4d1cb/packages/schematics/angular/application/files/src/polyfills.ts.template#L55-L58
This PR upgrade zone.js npm package format to follow APF rule, https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/edit#heading=h.k0mh3o8u5hx
The updated points are:
1. in package.json, update all bundle related properties
```
  "main": "./bundles/zone.umd.js",
  "module": "./fesm2015/zone.js",
  "es2015": "./fesm2015/zone.js",
  "fesm2015": "./fesm2015/zone.js",
```
2. re-organize dist folder, for example for `zone.js` bundle, now we have
```
  dist/
      bundles/
             zone.js            // this is the es5 bundle
      fesm2015/
             zone.js            // this is the es2015 bundle (in the old version is `zone-evergreen.js`)
```
3. have several sub-packages.
1. `zone-testing`, provide zone-testing bundles include zone.js and testing libraries
2. `zone-node`, provide zone.js implemention for NodeJS
3. `zone-mix`, provide zone.js patches for both Browser and NodeJS
All those sub-packages will have their own `package.json` and the bundle will reference `bundles(es5)` and `fesm2015(es2015)`.
4. keep backward compatibility, still keep the `zone.js/dist` folder, and all bundles will be redirected to `zone.js/bundles` or `zone.js/fesm2015` folders.
PR Close #36540
											
										 
											2020-05-17 10:53:03 +09:00
										 |  |  | BUNDLES_ENTRY_POINTS = { | 
					
						
							|  |  |  |     "zone": { | 
					
						
							|  |  |  |         "es5": _DIR + "browser/rollup-legacy-main", | 
					
						
							|  |  |  |         "es2015": _DIR + "browser/rollup-main", | 
					
						
							|  |  |  |         "rollup": "global-es2015", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-mix": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "mix/rollup-mix", | 
					
						
							|  |  |  |         "rollup": "global-es2015", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-node": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "node/rollup-main", | 
					
						
							|  |  |  |         "rollup": "global-es2015", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "async-test": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "testing/async-testing", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "fake-async-test": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "testing/fake-async", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "long-stack-trace-zone": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "zone-spec/long-stack-trace", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "proxy": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "zone-spec/proxy", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-patch-rxjs-fake-async": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "zone-spec/proxy", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "sync-test": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "zone-spec/sync-test", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "task-tracking": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "zone-spec/task-tracking", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "wtf": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "zone-spec/wtf", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-error": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "common/error-rewrite", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-legacy": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "browser/browser-legacy", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-bluebird": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "extra/bluebird", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-patch-canvas": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "browser/canvas", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-patch-cordova": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "extra/cordova", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-patch-electron": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "extra/electron", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-patch-fetch": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "common/fetch", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "jasmine-patch": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "jasmine/jasmine", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-patch-jsonp": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "extra/jsonp", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "webapis-media-query": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "browser/webapis-media-query", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "mocha-patch": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "mocha/mocha", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "webapis-notification": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "browser/webapis-notification", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-patch-promise-test": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "testing/promise-testing", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-patch-resize-observer": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "browser/webapis-resize-observer", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "webapis-rtc-peer-connection": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "browser/webapis-rtc-peer-connection", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-patch-rxjs": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "rxjs/rxjs", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "webapis-shadydom": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "browser/shadydom", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-patch-socket-io": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "extra/socket-io", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-patch-message-port": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "browser/message-port", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-patch-user-media": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "browser/webapis-user-media", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-testing": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "testing/zone-testing", | 
					
						
							|  |  |  |         "rollup": "es5", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-testing-bundle": { | 
					
						
							|  |  |  |         "es5": _DIR + "browser/rollup-legacy-test-main", | 
					
						
							|  |  |  |         "es2015": _DIR + "browser/rollup-test-main", | 
					
						
							|  |  |  |         "rollup": "global-es2015", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "zone-testing-node-bundle": { | 
					
						
							|  |  |  |         "entrypoint": _DIR + "node/rollup-test-main", | 
					
						
							|  |  |  |         "rollup": "global-es2015", | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2019-06-01 00:56:07 +09:00
										 |  |  | } |