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(learn): add article for publishing a typescript package #7279

Open
wants to merge 33 commits into
base: main
Choose a base branch
from

Conversation

JakobJingleheimer
Copy link
Member

@JakobJingleheimer JakobJingleheimer commented Nov 23, 2024

Description

Document the recommended way to publish a typescript package

Validation

Related Issues

nodejs/typescript#19

Depends on #7229

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npm run format to ensure the code follows the style guide.
  • I have run npm run test to check if all tests are passing.
  • I have run npx turbo build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

Copy link

vercel bot commented Nov 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Feb 2, 2025 2:15pm

@AugustinMauroy
Copy link
Member

AugustinMauroy commented Dec 29, 2024

Jacob you should:

apps/site/pages/en/learn/typescript/publishing.md Outdated Show resolved Hide resolved
apps/site/pages/en/learn/typescript/publishing.md Outdated Show resolved Hide resolved
apps/site/pages/en/learn/typescript/publishing.md Outdated Show resolved Hide resolved
apps/site/pages/en/learn/typescript/publishing.md Outdated Show resolved Hide resolved
@JakobJingleheimer

This comment was marked as outdated.

Co-authored-by: Augustin Mauroy <[email protected]>
Signed-off-by: Jacob Smith <[email protected]>
@JakobJingleheimer JakobJingleheimer marked this pull request as ready for review January 8, 2025 19:20
@JakobJingleheimer JakobJingleheimer requested a review from a team as a code owner January 8, 2025 19:20
@jakebailey
Copy link

All of the threads about it appear to have been marked "resolved", but I really can't express enough how much I do not like the idea of having a src dir but then also tell tsc to dump its output into the package root above src. There are so many downsides with that approach, and I have never seen that in the wild in any TypeScript project.

I do not think a publishing guide we'd write for our own website would suggest something like it. And in a future release, we are expecting to simplfiy tsc --init and have it pre-populate tsconfig.json with rootDir=./src, outDir=./dist (microsoft/TypeScript#58420). That is the least problematic way to do it (both for TS's handling but also when dealing with other tools).

I would even prefer not having a src dir and just letting the JS files be dumped next to the TS, becuase that would be easier to explain / avoid problems with than the mismatch.

@JakobJingleheimer
Copy link
Member Author

@jakebailey I don't understand: there are examples with src/ + test/ + dist/. Here are screenshots from the deployed article:

image image

@AugustinMauroy do you have any idea why the vertical line characters are rendering weirdly?

vertical line characters off-centre

@jakebailey
Copy link

I don't understand: there are examples with src/ + test/ + dist/. Here are screenshots from the deployed article:

There's one example as a tree, yes, but that is not the tsconfig provided in the post, which the one people are going to copy without really understanding the impliciations (since dist is not mentioned anywhere else except the ASCII diagram). The npmignore doesn't reflect dist, and still don't handle .mts/.cts.

@JakobJingleheimer
Copy link
Member Author

not the tsconfig provided in the post, […]. The npmignore doesn't reflect dist, and still don't handle .mts/.cts.

Ahh, I'll add those (hopefully either tomorrow or Sunday).

@AugustinMauroy
Copy link
Member

@AugustinMauroy do you have any idea why the vertical line characters are rendering weirdly?

Strange I'll dedicate time on that

@JakobJingleheimer

This comment was marked as resolved.

@AugustinMauroy

This comment was marked as resolved.

@JakobJingleheimer

This comment was marked as resolved.

@AugustinMauroy
Copy link
Member

Bump for codetab, I'll open an issue because it's an error on our side not on shiky or your docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.