Skip to content

fix(typescript): update documentation now that ts_project is recommended#2548

Merged
alexeagle merged 1 commit into
bazel-contrib:stablefrom
alexeagle:no_ts_library
Mar 24, 2021
Merged

fix(typescript): update documentation now that ts_project is recommended#2548
alexeagle merged 1 commit into
bazel-contrib:stablefrom
alexeagle:no_ts_library

Conversation

@alexeagle

Copy link
Copy Markdown
Collaborator

We don't deprecate ts_library yet

Comment thread packages/typescript/_README.md Outdated
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

Comment thread packages/typescript/_README.md Outdated

### 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Link to provider docs?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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...

Comment thread packages/typescript/_README.md Outdated
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(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Did you mean ts_project?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

oops!

@alexeagle
alexeagle merged commit a8d8b0f into bazel-contrib:stable Mar 24, 2021
@alexeagle
alexeagle deleted the no_ts_library branch March 24, 2021 20:29
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.

2 participants