fix(zone.js): add missing types field in package.json (#38585)

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.

PR Close #38585
This commit is contained in:
JiaLiPassion
2020-08-26 17:12:04 +09:00
committed by Andrew Kushnir
parent 6acea54f62
commit 27cc56b359
8 changed files with 84 additions and 35 deletions

View File

@ -40,20 +40,18 @@ describe('Zone.js npm_package', () => {
it('should contain module resolution mappings', () => {
expect(shx.grep('"main":', packageJson)).toContain(`zone.umd.js`);
});
it('should contain typings', () => {
expect(shx.grep('"typings":', packageJson)).toContain(`./zone.d.ts`);
});
});
describe('check npm_package root folder', () => {
describe('typescript support', () => {
it('should have an zone.js.d.ts file', () => {
expect(shx.cat('zone.js.d.ts')).toContain('declare const');
});
it('should have an zone.api.extensions.ts file', () => {
expect(shx.cat('zone.api.extensions.ts')).toContain('EventTarget');
});
it('should have an zone.configurations.api.ts file', () => {
expect(shx.cat('zone.configurations.api.ts')).toContain('ZoneGlobalConfigurations');
it('should have an zone.d.ts file', () => {
expect(shx.cat('zone.d.ts')).toContain('declare const');
expect(shx.cat('zone.d.ts')).toContain('interface EventTarget');
expect(shx.cat('zone.d.ts')).toContain('ZoneGlobalConfigurations');
});
});