-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
@sveltejs/package
Customize behavior of copying package.json
and other essential files to the output directory when packaging a Svelte library
#6864
Conversation
🦋 Changeset detectedLatest commit: 2e08668 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@sveltejs/package
Customize behavior of copying package.json
and other essential files to the output directory when packaging a Svelte library
fyi: the test fail in create-svelte is unrelated to this issue and a fix for that is pending in #6866 |
Not 100% sure about the API yet but it's definitely going in the right direction. In the meantime, could you remove some of the unnecessary files from the tests? We don't need to have multiple Svelte files in there, copying them over and generating types for them is already checked in other tests. It should be enough to just have one |
Any updates on this? I would love to have this merged into the package itself. |
@dummdidumm is attempting to deploy a commit to the Svelte Team on Vercel. A member of the Team first needs to authorize it. |
975d01c
to
d2182af
Compare
The failing test seems to be unrelated to |
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
This resolves #6824.
For context, I'm building a cross-framework component library so I've set up a standard package structure for each framework in my monorepo with npm workspaces.
I'm using Vite with
@sveltejs/package
to develop and build my components. However,@sveltejs/package
breaks my toolchain because it creates a copy ofpackage.json
in mydist
folder.npm workspaces picks up both the original
package.json
anddist/package.json
, causing other dependent packages to break due to the duplication.This PR adds a
metadata
filter function to allow disabling the copy feature for metadata files likepackage.json
and other whitelisted essential files.Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
All existing tests for
@sveltejs/package
pass and I added a test for the new config option.Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0