Skip to content

Conversation

@cprecioso
Copy link
Member

@cprecioso cprecioso commented Dec 15, 2025

Description

Moves npm packages from waspc/packages/* to waspc/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 to waspc/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 install on 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/packages to waspc/data/packages is now redundant, so we can eliminate it and simplify the process.

Why were we bundling node_modules into the binary even though we filtered them at the copy step?

In the build process, we are nonetheless calling npm install on the packages in their new location, recreating the node_modules folder. The packaging script would then just blindly copy them into the final tarball.

Type of change

  • 🔧 Just code/docs improvement
  • 🐞 Bug fix
  • 🚀 New/improved feature
  • 💥 Breaking 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:

    • I added unit tests for my change.
    • (if you fixed a bug) I added a regression test for the bug I fixed.
    • (if you added/updated a feature) I added/updated e2e tests in examples/kitchen-sink/e2e-tests.
    • (if you added/updated a feature) I updated the starter templates in waspc/data/Cli/templates, as needed.
    • (if you added/updated a feature) I updated the example apps in examples/, as needed.
      • (if you updated examples/tutorials) I updated the tutorial in the docs (and vice versa).
  • 📜 Documentation:

    • (if you added/updated a feature) I added/updated the documentation in web/docs/.
  • 🆕 Changelog: (if change is more than just code/docs improvement)

    • I updated waspc/ChangeLog.md with a user-friendly description of the change.
    • (if you did a breaking change) I added a step to the current migration guide in web/docs/migration-guides/.
    • I bumped the version in waspc/waspc.cabal to reflect the changes I introduced.

@cprecioso cprecioso self-assigned this Dec 15, 2025
@cprecioso cprecioso force-pushed the cprecioso/move-data-packages branch from 5ad86f6 to bc36686 Compare December 15, 2025 16:31
Base automatically changed from push-yvpvopwlurqz to main December 16, 2025 13:27
@cprecioso cprecioso force-pushed the cprecioso/move-data-packages branch from fdb7a21 to 5af53ef Compare December 16, 2025 13:42
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 17, 2025

Open in StackBlitz

@wasp.sh/wasp-cli

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli@3500

@wasp.sh/wasp-cli-darwin-arm64-unknown

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-darwin-arm64-unknown@3500

@wasp.sh/wasp-cli-darwin-x64-unknown

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-darwin-x64-unknown@3500

@wasp.sh/wasp-cli-linux-x64-glibc

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-linux-x64-glibc@3500

@wasp.sh/wasp-cli-linux-x64-musl

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-linux-x64-musl@3500

commit: c709c34

@cprecioso cprecioso marked this pull request as ready for review December 18, 2025 10:01
@cprecioso cprecioso changed the title Move npm packages to data Move embedded npm packages to the waspc data dri Dec 18, 2025
@cprecioso cprecioso changed the title Move embedded npm packages to the waspc data dri Move embedded npm packages to the waspc data dir Dec 18, 2025
@cprecioso cprecioso linked an issue Dec 18, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop copying packages to data

2 participants