Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typescript): exclude typescript lib declarations in... #875

Merged

Conversation

gregmagolan
Copy link
Collaborator

@gregmagolan gregmagolan commented Jun 19, 2019

...node_module_library transitive_declarations as the including of these .d.ts is controlled by compilerOptions libs (except for typescript.d.ts and tsserverlibrary.d.ts which are imported standardly)
. Including all of the can cause typings conflicts.

Unblocks angular/angular#31019

@gregmagolan gregmagolan changed the title fix(typescript): exclude typescript lib declarations in fix(typescript): exclude typescript lib declarations in... Jun 19, 2019
@gregmagolan gregmagolan force-pushed the exclude-typescript-lib-declarations branch 2 times, most recently from 4eba737 to c34fdfc Compare June 19, 2019 19:34
gregmagolan added a commit to gregmagolan/rules_nodejs that referenced this pull request Jun 19, 2019
Verify that typescript/lib/typescript.d.ts and typescript/lib/tsserverlibrary.d.ts are available since we must exclude all other typescript/lib/*.d.ts which are controlled by the compilerOptions.libs config.
See bazel-contrib#875 for more details.
...node_module_library transitive_declarations as the including /node_modules/typescript/lib/lib.*.d.ts is controlled by compilerOptions libs. Including all of the can cause typings conflicts.

Test coverage also added for this that verifies that typescript/lib/typescript.d.ts and typescript/lib/tsserverlibrary.d.ts are available since we must exclude other typescript/lib/ .d.ts files which are controlled by the compilerOptions.libs config. Also verify that libs not specified such as lib.webworkder.d.ts in compileOptions.libs config are not included in the compilation unit. See bazel-contrib#875 for more details.
...in generated ts_library tsconfig. This fixes an issue where the @bazel/tsetse plugin values in a user's config would always be overridden by ts_library and not honoured. Also remove disable_tsetse_for_external test as we no longer doing this.
@gregmagolan gregmagolan force-pushed the exclude-typescript-lib-declarations branch from 8aed890 to 0bc6660 Compare June 19, 2019 21:58
@gregmagolan
Copy link
Collaborator Author

Fix for

packages/service-worker/worker/src/service-worker.d.ts:30:15 - error TS2300: Duplicate identifier 'Client'.

30 declare class Client {
                 ~~~~~~

  external/npm/node_modules/typescript/lib/lib.webworker.d.ts:694:11
    694 interface Client {
                  ~~~~~~
    'Client' was also declared here.
  external/npm/node_modules/typescript/lib/lib.webworker.d.ts:701:13
    701 declare var Client: {
                    ~~~~~~
    and here.

included and test coverage as well

Copy link
Collaborator

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, I convinced myself that the disable_tsetse stuff is no longer needed.

@alexeagle alexeagle merged commit 2e128ce into bazel-contrib:master Jun 19, 2019
alexeagle pushed a commit that referenced this pull request Jun 19, 2019
...node_module_library transitive_declarations as the including /node_modules/typescript/lib/lib.*.d.ts is controlled by compilerOptions libs. Including all of the can cause typings conflicts.

Test coverage also added for this that verifies that typescript/lib/typescript.d.ts and typescript/lib/tsserverlibrary.d.ts are available since we must exclude other typescript/lib/ .d.ts files which are controlled by the compilerOptions.libs config. Also verify that libs not specified such as lib.webworkder.d.ts in compileOptions.libs config are not included in the compilation unit. See #875 for more details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants