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

feat(typescript): add allow_js support to ts_project #2260

Merged
merged 1 commit into from
Oct 29, 2020
Merged

feat(typescript): add allow_js support to ts_project #2260

merged 1 commit into from
Oct 29, 2020

Conversation

mattinsler
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

The current behavior for ts_project is to ignore .js files and not generate .d.ts files from them.

Issue Number: N/A

What is the new behavior?

As of TypeScript 3.7, tsc can now create .d.ts files from .js files.

The new behavior is allow the user to pass allow_js to ts_project in order to expect .d.ts files from tsc.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@google-cla
Copy link

google-cla bot commented Oct 29, 2020

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Oct 29, 2020
@alexeagle
Copy link
Collaborator

alexeagle commented Oct 29, 2020

Fantastic PR, thank you! Could you try to satisfy the Google CLA bot please? I think it's my obligation to keep clean Intellectual Property in this repo. Maybe the email on the commit doesn't match the one that signed it.
(If you've signed the CLA and the bot is just busted I can merge around it)

"$(locations :types)",
"$(locations :tsconfig)",
],
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use generated_file_test here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree it would be better, but not enough to nitpick and make more work for casual contributors

@mattinsler
Copy link
Contributor Author

@googlebot I fixed it

@google-cla google-cla bot added cla: yes and removed cla: no labels Oct 29, 2020
@alexeagle alexeagle merged commit 12571ee into bazel-contrib:stable Oct 29, 2020
lencioni added a commit to lencioni/rules_nodejs that referenced this pull request Jan 6, 2021
As of TypeScript v2.9, `tsc` can read and extract types from `.json`
files by using the `resolveJsonModule` option.

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#new---resolvejsonmodule

The new behavior allows people to pass `resolve_json_module` to
`ts_project` in order to expect `.json` files from `tsc`.

This change was modeled after the previous `allow_js` work in bazel-contrib#2260.

Fixes bazel-contrib#2365
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