kit
kit copied to clipboard
feat: Improve external dependency handling for non-standard project structures (adapter-node)
This PR enhances the Rollup configuration to better handle projects where package.json isn't located in the same directory (my case).
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
- [x] This message body should clearly illustrate what problems it solves.
- [x] Ideally, include a test that fails without this PR but passes with it.
Tests
- [ ] Run the tests with
pnpm testand lint the project withpnpm lintandpnpm check
Changesets
- [x] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.
Edits
- [x] Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.
⚠️ No Changeset found
Latest commit: d42607b0ae8682352ce4996f791b80e6cfd69fa4
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
New features should include an explanation of why they are necessary (why does your package.json need to be located elsewhere) and documentation for the new feature. It's hard to review without this context
In my specific case, I'm not just working with an one SvelteKit application, and I can't use a monorepo approach (it would add unnecessary complexity). Everything works perfectly until it gets to the build stage. The adapter fails with an error because it can't find the package.json which is located one level up. The adapter definitely shouldn't prevent us from having structure like
/app/...
/package.json
Please open an issue with a reproduction of your problem.
Please open an issue with a reproduction of your problem.
The problem is that the adapter's code hardcodes the path to package.json when parsing dependencies. When the project has this structure:
app/...
package.json
the build fails with an error since it can't locate the package.json file
There's still not really enough information here to understand your problem. This should really include an issue with a reproduction
Closing this as it sounds clear that a monorepo is the correct approach, and no reproduction or clarifying information was given