-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(zone.js): add missing types field in package.json
Close #38584 In zone.js 0.11.1, the `types` field is missing in the `package.json`, the reason is in zone.js 0.11.0, the `files` field is used to specify the types, but it cause the npm package not contain any bundles issue, so zone.js 0.11.1 remove the `files` field, which cause the `type` definition gone. This PR concat the `zone.js.d.ts`, `zone.configurations.api.ts`, `zone.api.extensions.ts` types into a single `zone.d.ts` file.
- Loading branch information
1 parent
26f2820
commit 470d555
Showing
8 changed files
with
84 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
build | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "typings", | ||
"version": "1.0.0", | ||
"description": "typing test package to test zone.js.d.ts", | ||
"scripts": { | ||
"test": "tsc -p ." | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@types/node": "12.11.1", | ||
"domino": "^2.1.6", | ||
"zone.js": "file:../../../../dist/bin/packages/zone.js/npm_package" | ||
}, | ||
"devDependencies": { | ||
"typescript": "~4.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"compilerOptions": { | ||
"forceConsistentCasingInFileNames": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"experimentalDecorators": true, | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"outDir": "./build", | ||
"rootDir": ".", | ||
"target": "es5", | ||
"noEmitOnError": false, | ||
"stripInternal": false, | ||
"strict": true, | ||
"lib": [ | ||
"es5", | ||
"dom", | ||
"es2015.collection", | ||
"es2015.iterable", | ||
"es2015.promise", | ||
], | ||
}, | ||
"files": [ | ||
"./type.test.ts", | ||
"./node_modules/zone.js/zone.d.ts" | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as domino from 'domino'; | ||
require('zone.js/bundles/zone.umd'); | ||
|
||
// Zone public API should be included | ||
Zone.current.fork({name: 'testZone'}).run(() => {}); | ||
|
||
// Zone extra APIs for EventTarget should be available | ||
const w = domino.createWindow('<h1>Hello zone.js</h1>'); | ||
const h1 = w.document.querySelector('h1'); | ||
const listener = () => {}; | ||
h1!.addEventListener('click', listener); | ||
const clickListeners = h1!.eventListeners!('click'); | ||
if (!clickListeners || clickListeners.length === 0 || clickListeners[0] !== listener) { | ||
throw new Error('eventListeners not work!!!'); | ||
} | ||
|
||
const globalZoneConfig = w as ZoneGlobalConfigurations; | ||
globalZoneConfig.__Zone_disable_EventEmitter = true; |