fix(typescript): update documentation now that ts_project is recommended#2548
Merged
Conversation
alexeagle
force-pushed
the
no_ts_library
branch
from
March 23, 2021 03:14
b1a8220 to
3de859d
Compare
mattem
approved these changes
Mar 24, 2021
| Then call it, using the [`npm_package_bin`](Built-ins#npm_package_bin) documentation. | ||
|
|
||
| Here is an example: | ||
| https://github.com/bazelbuild/rules_nodejs/blob/stable/internal/node/test/BUILD.bazel#L491-L507 |
Collaborator
There was a problem hiding this comment.
nit: don't link to the lines as they will likely change and we'll forget to update the docs
"An example of using tsc directly can be seen in the nodejs tests BUILD.bazel file"
Collaborator
Author
There was a problem hiding this comment.
I'd like to point to the right spot in the file too, it's very long. I pinned to 3.2.2 rather than stable so we don't break the link
|
|
||
| ### ts_project | ||
|
|
||
| `ts_project` simply runs `tsc --project`, with Bazel knowing which outputs to expect based on the TypeScript compiler options, and with interoperability with other TypeScript rules via a Bazel Provider (DeclarationInfo) that transmits the type information. |
Collaborator
Author
There was a problem hiding this comment.
yeah - it's so hard to get the links right tho, so they work in both markdown and on the rendered docsite, let's try...
| Here, `//path/to/other:library` is another target in your repo that produces TypeScript typings (for example, another `ts_project` rule). To use third-party libraries from npm, first install them (likely using `npm_install` or `yarn_install` rules) then add those to the `deps` as well: | ||
|
|
||
| ```starlark | ||
| ts_library( |
We don't deprecated ts_library yet
alexeagle
force-pushed
the
no_ts_library
branch
from
March 24, 2021 18:07
3de859d to
48fc45b
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We don't deprecate ts_library yet