-
-
Couldn't load subscription status.
- Fork 1.4k
Open
Description
Description
Turn the user’s package.json into an npm workspace, containing the user project and the ./wasp/* generated projects.
- Projects refer to one another through workspace dependencies instead of path aliases, copying files, or relative
../../..paths. - Dependencies are installed once overall, not once per
package.json - Versions are resolved taking into account all of the ranges, not just the current
package.json, and de-duplicated. package-lock.jsonalso locks the versions in the generated project, instead of upgrading them to the latest allowable version every time.
Edge cases to look for: what happens when the generated projects…
- don’t exist yet?
- need to be recreated?
- have just been recreated?
- we’ve updated the Wasp version?
- is there a situation in which we’d have out-of-sync generated projects or dependencies?
Warning
Apparently, npm doesn't allow multiple subprojects with the same name in the same workspace. We generate the same projects at .wasp/out/ and .wasp/build, so we need to find a solution or workaround.
Steps
- Check Wasp behaves correctly with
package.json#workspaces - Check that dependencies are correctly shared
- Edit the starter
package.json's to have theworkspaceskey - Add a check for
workspacesin the compiler - Adapt
wasp depscommand - Test that dependency checking logic inside waspc still works correctly
- Add a migration guide and documentation
Related issues
- Figure out Wasp's package-lock.json story #559
- Improve how we handle user's npm deps (by aliasing wasp deps) #1644
- Solve double installation issue in restructuring #1640
- Rethink how framework code uses user's code #1854
- Investigate NPM workspaces and our dependency setup #1838
- Probably solves Improve how we detect whether an NPM install is necessary #1845
- Fix dependency version checking #1859
- Ensure the different generated packages are using the same transitive dependencies #2726
Metadata
Metadata
Assignees
Labels
No labels