Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
b4e1769
WIP initial implementation
infomiho Jul 22, 2025
8b708bb
Apply the SDK location hack to the libs
infomiho Jul 22, 2025
49d979c
Include libs in the built CLI
infomiho Jul 22, 2025
a352e57
Merge branch 'main' into templates-to-libs
infomiho Jul 28, 2025
97a6838
Add build config. Copy libs in the Dockerfile.
infomiho Jul 28, 2025
121901f
Update todoApp package-lock.json
infomiho Jul 28, 2025
4e248ae
Merge branch 'main' into templates-to-libs
infomiho Jul 29, 2025
ac9d038
Fixes libs deps install in Dockerfile
infomiho Jul 29, 2025
3840e58
Move to using npm pack
infomiho Jul 30, 2025
db8aaeb
Formatting
infomiho Jul 30, 2025
ac55723
Client entry point experiment
infomiho Jul 30, 2025
6dfc790
Fix copy command
infomiho Jul 30, 2025
7a84ae8
Formatting
infomiho Jul 30, 2025
e8c955a
Refactor code
infomiho Jul 31, 2025
f0cfe95
Cleanup
infomiho Jul 31, 2025
2f77c1c
Merge branch 'main' into templates-to-libs
infomiho Aug 11, 2025
36b720c
Install script update
infomiho Aug 11, 2025
083fecb
Append hash to tarball path
infomiho Aug 11, 2025
9a70244
Exclude auth lib from Vite optimizations
infomiho Aug 11, 2025
b450ef2
Test auth client code, test using peerDependencies.
infomiho Aug 11, 2025
00e6fbf
Migrate to tsdown
infomiho Aug 11, 2025
90eab52
Refactor unit tests
infomiho Aug 11, 2025
6b6b2f7
Move typeVersions comment
infomiho Aug 11, 2025
3c818cd
d.ts sourcemap. cleanup.
infomiho Aug 11, 2025
7e76f65
PR comments
infomiho Aug 11, 2025
43aaac5
Refactor
infomiho Aug 11, 2025
1073098
Update shell scripts
infomiho Aug 12, 2025
828b096
Use newtype
infomiho Aug 12, 2025
aa05550
Fix unit tests
infomiho Aug 12, 2025
c4099d5
Update exports to be explict about sdk and server exports
infomiho Aug 12, 2025
82f258c
Refactor WaspLib to have the checksum from creation
infomiho Aug 12, 2025
c3454d7
Copy libs to both out and build dir
infomiho Aug 12, 2025
22958f5
Update the README
infomiho Aug 13, 2025
9f3a53a
Update README and WaspLib to clarify library versioning and improve S…
infomiho Aug 13, 2025
a06e101
Remove redundant copying of libs to the build directory
infomiho Aug 13, 2025
1e1d36c
Merge branch 'main' into templates-to-libs
infomiho Aug 14, 2025
190e789
PR comments
infomiho Aug 14, 2025
fb548b0
Fix Dockerfile consistency
infomiho Aug 14, 2025
48dfe49
Comment dots, scripts cleanup.
infomiho Aug 14, 2025
58fe09a
Formatting
infomiho Aug 14, 2025
bd54fb4
Merge branch 'main' into templates-to-libs
infomiho Aug 14, 2025
ef0182b
Improve Tarball module
infomiho Aug 14, 2025
8851649
WaspLibs comment
infomiho Aug 14, 2025
9fc9e17
Add WaspLib comment
infomiho Aug 14, 2025
8a4ce86
Define SDK package name
infomiho Aug 14, 2025
a88c972
Unit tests helper
infomiho Aug 14, 2025
5bd2680
PR comments
infomiho Aug 14, 2025
4f0a8e7
Naming
infomiho Aug 14, 2025
211a04b
Update unit tests
infomiho Aug 14, 2025
03066ee
Move getting WaspLibs out of AppSpec
infomiho Aug 14, 2025
ae1255b
Ignore `tgz` files in e2e tests (#3078)
infomiho Sep 9, 2025
b9ace98
Merge branch 'main' into templates-to-libs
infomiho Sep 9, 2025
f50e54b
Fix unit tests
infomiho Sep 9, 2025
2478372
Merge branch 'main' into templates-to-libs
infomiho Sep 10, 2025
cd5347c
Remove typesVersions since it's redundant now
infomiho Sep 10, 2025
438314a
Rename from @wasp.sh/{libs-auth => lib-auth}
infomiho Sep 10, 2025
10803d4
Improve password tests
infomiho Sep 10, 2025
52fe7f2
Add Reader monad to Generator to use WaspLibs more easily
infomiho Sep 11, 2025
f2df493
Replace explicit copying of libs with generating copy file drafts
infomiho Sep 11, 2025
b234395
PR comments
infomiho Sep 11, 2025
669faca
Merge branch 'main' into templates-to-libs
infomiho Sep 24, 2025
4e6ddbb
Merge branch 'main' into templates-to-libs
infomiho Sep 26, 2025
5f3078e
PR comments
infomiho Sep 26, 2025
b0417a3
Named empty waspLibs list
infomiho Sep 27, 2025
a695db1
Update package copying scripts safety
infomiho Sep 27, 2025
cd6940b
Rename npm dep making fn
infomiho Sep 27, 2025
5771e1f
Update libs README
infomiho Sep 27, 2025
4b5a1c7
Simplify makeWaspLib
infomiho Sep 27, 2025
133e837
Return CI note for the packages README
infomiho Sep 27, 2025
bcab437
Update tsconfig to be more general
infomiho Sep 30, 2025
f1a21e0
Use ESM only profile for arethetypeswrong
infomiho Sep 30, 2025
563c00c
Fix formatting
infomiho Oct 2, 2025
7c08e2d
Merge branch 'main' into templates-to-libs
infomiho Oct 3, 2025
e2d5eda
Update unit tests
infomiho Oct 3, 2025
12b925a
Include `files` note in the README
infomiho Oct 3, 2025
0fae11c
Drop `types` to allow `@types/` packages to be used
infomiho Oct 3, 2025
ac02cca
Update package.json to replace 'import' with 'default' in exports
infomiho Oct 3, 2025
6ecacc3
Use `attw` as dev dep instead of through npx
infomiho Oct 3, 2025
075cc77
Add build:libs command to `run` script
infomiho Oct 3, 2025
1587964
Add note about adding new libs to AvailableLibs module
infomiho Oct 3, 2025
279d1b4
Cleanup Auth.tsx
infomiho Oct 3, 2025
38fdbe0
Update cookies import and formatting
infomiho Oct 3, 2025
0bec41e
Update comment in makeWaspLib to clarify why we append the checksum
infomiho Oct 3, 2025
68a4035
Update README paths
infomiho Oct 3, 2025
500f574
Remove libs/ dir from Git
infomiho Oct 3, 2025
2dc8399
Rename sanitizePackageNameAsNpmPackTarball to packageNameToTarballPrefix
infomiho Oct 3, 2025
97f1a49
Fix typos and improve clarity in WaspLib documentation
infomiho Oct 3, 2025
d07b368
Improve packages install script
infomiho Oct 3, 2025
e4eb6dc
Update libs versioning info in the README
infomiho Oct 6, 2025
e27c122
Make cleanup safer in package copying scripts
infomiho Oct 6, 2025
4a92a58
Update waspc README to mention the libs
infomiho Oct 6, 2025
f976fd3
Merge branch 'main' into templates-to-libs
infomiho Oct 9, 2025
2b20ffe
Merge branch 'main' into templates-to-libs
infomiho Nov 4, 2025
8221ba4
Merge branch 'main' into templates-to-libs
infomiho Nov 4, 2025
5624759
Encode assumption about where the libs are located
infomiho Nov 4, 2025
07b4e7b
Merge branch 'main' into templates-to-libs
infomiho Nov 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci-waspc-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ jobs:
npm ci
npm test

- name: Compile TS packages and move it into the Cabal data dir
- name: Compile TS packages and move them into the Cabal data dir
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-15-intel'
run: ./tools/install_packages_to_data_dir.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be using ./run instead of the script in all cases?

Copy link
Contributor Author

@infomiho infomiho Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked about this in the Discord a couple of months ago and we agreed we want to use run in the CI. I never created a GIthub issue for it, thanks for the reminder! I'd tackle it in a separate PR.

Here's the issue: #3230


- name: Compile Wasp libs and move them into the Cabal data dir
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-13'
run: ./tools/install_libs_to_data_dir.sh

- name: Build external dependencies
run: cabal build --enable-tests --enable-benchmarks --only-dependencies

Expand Down
155 changes: 84 additions & 71 deletions examples/kitchen-sink/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion waspc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ Check `src/Wasp/Analyzer.hs` for more details.
AppSpec is passed to the Generator, which based on it decides how to generate a web app.
Output of Generator is a list of FileDrafts, where each FileDraft explains how to create a file on the disk.
Therefore, Generator doesn't generate anything itself, instead it provides instructions (FileDrafts) on how to generate the web app.
FileDrafts are using mustache templates a lot (they can be found in `data/Generator/templates`).
FileDrafts are using mustache templates a lot (they can be found in `data/Generator/templates`). Alongside mustache templates,
generated apps use internal npm packages (WaspLibs) that contain core logic and are unit tested. WaspLibs are bundled with Wasp
and installed into generated apps (see [WaspLibs](#wasplibs) for more details).

Generator is split into three generators, for the three main parts of the web app: WebAppGenerator, ServerGenerator and DbGenerator.

Expand All @@ -236,6 +238,7 @@ On any changes you do to the source code of Wasp, Wasp project gets recompiled,
- `cli/exe/` -> thin executable wrapper around cli library code
- `tests/`, `e2e-tests/`, `cli/tests/`, `waspls/tests/`, `starters-e2e-tests` -> tests
- `data/Generator/templates/` -> mustache templates for the generated client/server.
- `libs/` -> internal npm packages (WaspLibs) that are bundled with Wasp and copied into generated apps (see [WaspLibs](#wasplibs) for more details)
- `data/Cli/starters/` -> starter templates for new projects

### Typescript packages
Expand All @@ -245,6 +248,10 @@ On any changes you do to the source code of Wasp, Wasp project gets recompiled,
In order for `waspc`'s Haskell code to correctly use these TS packages (and to also have them correctly bundled when generating the release tarball), they need to be correctly installed/built in the `waspc_datadir` dir.
To do so in development, run `./run build:packages` when any changes are made to these packages. We also run it in CI when building the release.

### WaspLibs

WaspLibs are internal npm packages located under [`libs/`](libs/) and are bundled with Wasp and installed into generated apps. A more detailed description of WaspLibs can be found in the [`libs/README.md`](libs/README.md).

## Tests

For tests in Haskell we are using [**Tasty**](https://github.com/UnkindPartition/tasty) testing framework. Tasty lets us combine different types of tests into a single test suite.
Expand Down
13 changes: 8 additions & 5 deletions waspc/cli/src/Wasp/Cli/Command/Deps.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import Wasp.Cli.Terminal (title)
import qualified Wasp.ExternalConfig.Npm.Dependency as Npm.Dependency
import qualified Wasp.Generator.NpmDependencies as N
import qualified Wasp.Generator.ServerGenerator as ServerGenerator
import qualified Wasp.Generator.WaspLibs.AvailableLibs as WaspLibs.AvailableLibs
import qualified Wasp.Generator.WaspLibs.WaspLib as WaspLib
import qualified Wasp.Generator.WebAppGenerator as WebAppGenerator
import Wasp.Project (analyzeWaspProject)
import qualified Wasp.Util.Terminal as Term
Expand All @@ -27,24 +29,25 @@ deps = do
(throwError . CommandError "Determining dependencies failed due to a compilation error in your Wasp project" . unwords)
return
appSpecOrAnalyzerErrors
waspLibs <- liftIO WaspLibs.AvailableLibs.makeWaspLibs

liftIO $ putStrLn $ depsMessage appSpec
liftIO $ putStrLn $ depsMessage appSpec waspLibs

depsMessage :: AppSpec -> String
depsMessage appSpec =
depsMessage :: AppSpec -> [WaspLib.WaspLib] -> String
depsMessage appSpec waspLibs =
unlines $
[ "",
title "Below are listed the dependencies that Wasp uses in your project. You can import and use these directly in the code as if you specified them yourself, but you can't change their versions.",
""
]
++ printDeps
"Server dependencies:"
( N.dependencies $ N.fromWasp $ ServerGenerator.npmDepsFromWasp appSpec
( N.dependencies $ N.fromWasp $ ServerGenerator.npmDepsFromWasp appSpec waspLibs
)
++ [""]
++ printDeps
"Server devDependencies:"
( N.devDependencies $ N.fromWasp $ ServerGenerator.npmDepsFromWasp appSpec
( N.devDependencies $ N.fromWasp $ ServerGenerator.npmDepsFromWasp appSpec waspLibs
)
++ [""]
++ printDeps
Expand Down
Loading
Loading