-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Move embedded npm packages to the waspc data dir #3500
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
Open
cprecioso
wants to merge
7
commits into
main
Choose a base branch
from
cprecioso/move-data-packages
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5ad86f6 to
bc36686
Compare
fdb7a21 to
5af53ef
Compare
@wasp.sh/wasp-cli
@wasp.sh/wasp-cli-darwin-arm64-unknown
@wasp.sh/wasp-cli-darwin-x64-unknown
@wasp.sh/wasp-cli-linux-x64-glibc
@wasp.sh/wasp-cli-linux-x64-musl
commit: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Moves npm packages from
waspc/packages/*towaspc/data/packages/*, removes the scripts that copied them from the former to the latter, and updates scripts and documentation that pointed to the old location.Motivation
We embed npm packages as part of the CLI functionality (wasp deploy, tsconfig, studio, etc). These lived in
waspc/packages, and we had a script to copy them towaspc/data/packages, where they were actually picked up by the build.The reason to have this two-stage system was to enable us to remove node_modules when we copied to the data dir, so that we wouldn't ship that folder to users (the CLI does an
npm installon these packages on first run).This solution proved to be ineffective, as we were bundling them anyway. I realized that and updated the packaging script to read and follow the Cabal data file globs, which already filtered out the node_modules. (#3483)
This means that the initial copy step from
waspc/packagestowaspc/data/packagesis now redundant, so we can eliminate it and simplify the process.Why were we bundling
node_modulesinto the binary even though we filtered them at the copy step?In the build process, we are nonetheless calling
npm installon the packages in their new location, recreating thenode_modulesfolder. The packaging script would then just blindly copy them into the final tarball.Type of change
Checklist
Checklist not applicable I did test the final built artifacts in a Wasp project and run every command that depends on an embedded package, successfully.
Show it anyway
I tested my change in a Wasp app to verify that it works as intended.
🧪 Tests and apps:
examples/kitchen-sink/e2e-tests.waspc/data/Cli/templates, as needed.examples/, as needed.examples/tutorials) I updated the tutorial in the docs (and vice versa).📜 Documentation:
web/docs/.🆕 Changelog: (if change is more than just code/docs improvement)
waspc/ChangeLog.mdwith a user-friendly description of the change.web/docs/migration-guides/.versioninwaspc/waspc.cabalto reflect the changes I introduced.