-
-
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
[package] remove tooling specific settings in publishConfig
from generated package.json
#5848
Conversation
🦋 Changeset detectedLatest commit: e745544 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 |
Thank you! PR looks good, two things:
|
@dummdidumm Thanks! |
publishConfig.directory
(if it exists) from generated package.jsonpublishConfig
from generated package.json
thanks! |
hi @boyeborg I noticed that you are using
We want to use this in monorepo, so in the top level
the question is how can I use |
@futantan I'm not too familiar with how changeset work, but the way we do it is to add this to the
By having the |
I know you're currently doing a big rewrite. This is not an important fix, no rush in merging it.
Closes #5830
TL;DR: Removes
publishConfig.directory
from the generated package.json when using the package command. This setting is usually added to tell monorepo tools or publishing tools where you're package is located, i.e. the output directory of the package command. Copying that over to the generated package.json file does not make contextual sense, since the referenced directory don't exist, and breaks some monorepo tools.I work in several monorepos where we have a wokspace based setup (usually using pnpm). In those monorepos we have several svelte packages created by the SvelteKit package command. Usually when you run this setup, you can use the workspace protocol to locally link one of those packages to an application living inside your monorepo (e.g. linking the charting package to the admin dashboard app). However, since SvelteKit's package command generates a new folder structure with its own package.json file, this does not work out of the box. PNPM has however recently added a feature (or fixed an old one, depending on how you look at it) that fixes this problem. It allows you to add a new location for your outputted package within the original package.json file using the
publishConfig.directory
key. By setting that to the package command's output directory, pnpm will link everything correctly. However, the package command copies thepublishConfig.directory
setting to the generated package.json file as well. This might cause some issues, since the referenced directory does not exist. It only exist in context of the original package.json. If you for example try to publish the package, you might get errors when the publishing tool does not find the referenced directory.This PR tries to fix that potential issue by explicitly removing the
publishConfig.directory
key from the generated package.json file if it exists. However, this might not always yield the expected result. There might exist cases where you want to use that setting in the generated package that I haven't thought of.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0