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: support specifying the tsconfig in svelte-package #11698

Merged

Conversation

quentinderoubaix
Copy link
Contributor

@quentinderoubaix quentinderoubaix commented Jan 21, 2024

closes #9373

Adds the option tsconfig to svelte-package, allowing to specify which tsconfig / jsconfig to use during the packaging.


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

Copy link

changeset-bot bot commented Jan 21, 2024

🦋 Changeset detected

Latest commit: dec5793

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/package Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@benmccann
Copy link
Member

I don't understand why this is necessary or why it would apply only to svelte package

@quentinderoubaix
Copy link
Contributor Author

quentinderoubaix commented Jan 23, 2024

I don't understand why this is necessary or why it would apply only to svelte package

Hi @benmccann, thanks for checking this PR !

In the context of a monorepo where two svelte libraries coexist, (example of a headless widget library and a styled widget library depending on the headless), I would like to be able to have aliases in the default tsconfig.json, to navigate easier in the code in my IDE.
However, if I create aliases directly in the tsconfig.json, svelte-package seems to add .d.ts files in the dependency workspace source folder.

I have set up a project to showcase the behavior here.

Being able to able to run svelte-package with an option tsconfig would allow to separate the tsconfig for IDE code navigation from the build tsconfig, avoiding the issue above.
svelte-check also allows this option, so this would make things consistent

What do you think ?

@quentinderoubaix
Copy link
Contributor Author

hi @benmccann @dummdidumm, a little reminder on this

@quentinderoubaix
Copy link
Contributor Author

hi @benmccann @dummdidumm

sorry to chase again, is there anything I need to update / clarify for this ?
the linked issue #9373 was tagged as ready to implement, but maybe it needs to be re-discussed ?

@eltigerchino eltigerchino added the pkg:svelte-package Issues related to svelte-package label Feb 16, 2024
@quentinderoubaix
Copy link
Contributor Author

image

@dummdidumm
Copy link
Member

Sorry for being silent for so long - I'm currently focused on Svelte 5. I'll look into this soon, I promise!

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

Thank you!

@dummdidumm dummdidumm merged commit b3c0105 into sveltejs:main Mar 6, 2024
12 checks passed
@github-actions github-actions bot mentioned this pull request Mar 6, 2024
@quentinderoubaix quentinderoubaix deleted the tsconfig-option-for-package branch March 6, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:svelte-package Issues related to svelte-package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

option to specify the tsconfig.json in svelte-package
4 participants