Files
5568301223 test: expand node monorepo test coverage (#361)
* docs: add monorepo support section to Node.js documentation

Addresses user questions about monorepo support by documenting that
Railpack automatically handles npm/pnpm/yarn workspaces and Turborepo
configurations with links to example projects.

* test: improve monorepo example tests to verify workspace functionality

Enhanced integration tests for monorepo examples to properly test that
workspace package linking and dependencies work correctly:

**node-npm-workspaces:**
- Root now imports and uses functions from pkg-a and pkg-b workspace packages
- pkg-a uses its dependency (abbrev) to demonstrate transitive deps work
- pkg-b exports a simple function
- Updated to ES modules for consistency
- Test now verifies all workspace packages load and execute correctly

**node-pnpm-workspaces:**
- Root now imports and uses functions from pkg-a and pkg-b workspace packages
- pkg-a uses its dependency (abbrev) to demonstrate transitive deps work
- pkg-b exports a simple function
- Updated to ES modules for consistency
- Test now verifies all workspace packages load and execute correctly

**node-turborepo:**
- Changed from justBuild to httpCheck since this is a Next.js web server
- Added start script to root package.json to run the web app
- Test now verifies the built app starts and responds to HTTP requests
- This properly tests that the @repo/ui workspace package is built and linked

These changes ensure that monorepo builds are actually testing workspace
functionality, not just that the root package builds in isolation.

Fixes #332

* feat: add yarn workspaces and full-stack monorepo examples

Added two new monorepo examples to complete coverage:

**node-yarn-workspaces:**
- Demonstrates yarn workspaces with workspace package imports
- Uses the packageManager field for corepack
- Similar structure to npm/pnpm workspace examples for consistency
- Tests that workspace packages load and transitive dependencies work

**node-monorepo-fullstack:**
- Real-world example with Express API + frontend + shared package
- Shows how to share code (@monorepo/shared) between API and web packages
- API uses Express and shared utilities/constants
- Frontend demonstrates importing shared code
- Uses HTTP checks to verify API endpoints work correctly
- Demonstrates common full-stack monorepo pattern

Updated documentation to link to the yarn workspaces example and added
a note about the full-stack example for users looking for a more
realistic monorepo setup.

Addresses #332

* fix: format pkg-b package.json properly

Fixed uglified JSON that was created with echo instead of proper editing.

* fix: add yarn.lock and workspace deps to yarn-workspaces example

- Added yarn.lock file required by yarn 4
- Added workspace package dependencies (pkg-a, pkg-b) to root package.json
- Yarn requires lockfile to exist and won't create one in CI mode

* fix: update yarn.lock with correct workspace references

- Added workspace:* aliases to pkg-a and pkg-b entries
- Removed unused transitive dependencies that aren't in package.json
- Yarn requires both the workspace:* and workspace:packages/* forms

* docs: add lockfile guidelines to CLAUDE.md

Never manually update lockfiles - always use the package manager to
generate them properly with correct checksums.

* fix: add workspace deps to pnpm-workspaces package.json

ES module imports require workspace packages to be listed as dependencies
in the root package.json for Node.js to resolve them correctly.

* fix: generate yarn.lock with proper checksums using yarn

Used yarn install via corepack to generate proper yarn.lock with real
checksums instead of manually creating fake ones. Also includes Yarn PnP
files (.pnp.cjs, .pnp.loader.mjs, .yarn/) generated by yarn 4.

* fix: regenerate lockfiles using package managers

Regenerated pnpm-lock.yaml and yarn install-state.gz using the actual
package managers (pnpm and yarn via corepack) instead of manual edits.

- pnpm-lock.yaml: Updated for new workspace dependencies
- .yarn/install-state.gz: Regenerated by yarn install

* fix: remove Yarn PnP files and add .gitignore

Yarn PnP files (.pnp.cjs, .pnp.loader.mjs, .yarn/install-state.gz) should
not be committed as they contain environment-specific paths. They will be
generated during yarn install at build time.

Added .gitignore matching the pattern used in node-yarn-3 example.

* test: update snapshots

* refactor: merge the more realistic monorepo example into existing npm workspaces example

* build: ignore example claude folders

* test: snapshot update

* test: improve unit tests for node workspaces

* docs: deslop AI documentation

* test: improve turborepo example

* test: update snapshots

* test: update unit test for changed monorepo structure

* test: update snapshot

---------

Co-authored-by: Hanzo Dev <[email protected]>
2026-01-17 08:40:43 -07:00

324 lines
11 KiB
YAML

# This file is generated by running "yarn install" inside your project.
# Manual changes might be lost - proceed with caution!
__metadata:
version: 8
cacheKey: 10c0
"abbrev@npm:^3.0.0":
version: 3.0.1
resolution: "abbrev@npm:3.0.1"
checksum: 10c0/21ba8f574ea57a3106d6d35623f2c4a9111d9ee3e9a5be47baed46ec2457d2eac46e07a5c4a60186f88cb98abbe3e24f2d4cca70bc2b12f1692523e2209a9ccf
languageName: node
linkType: hard
"ansi-regex@npm:^3.0.0":
version: 3.0.1
resolution: "ansi-regex@npm:3.0.1"
checksum: 10c0/d108a7498b8568caf4a46eea4f1784ab4e0dfb2e3f3938c697dee21443d622d765c958f2b7e2b9f6b9e55e2e2af0584eaa9915d51782b89a841c28e744e7a167
languageName: node
linkType: hard
"ansi-regex@npm:^5.0.1":
version: 5.0.1
resolution: "ansi-regex@npm:5.0.1"
checksum: 10c0/9a64bb8627b434ba9327b60c027742e5d17ac69277960d041898596271d992d4d52ba7267a63ca10232e29f6107fc8a835f6ce8d719b88c5f8493f8254813737
languageName: node
linkType: hard
"ansi-styles@npm:^4.0.0":
version: 4.3.0
resolution: "ansi-styles@npm:4.3.0"
dependencies:
color-convert: "npm:^2.0.1"
checksum: 10c0/895a23929da416f2bd3de7e9cb4eabd340949328ab85ddd6e484a637d8f6820d485f53933446f5291c3b760cbc488beb8e88573dd0f9c7daf83dccc8fe81b041
languageName: node
linkType: hard
"camelcase@npm:^5.0.0":
version: 5.3.1
resolution: "camelcase@npm:5.3.1"
checksum: 10c0/92ff9b443bfe8abb15f2b1513ca182d16126359ad4f955ebc83dc4ddcc4ef3fdd2c078bc223f2673dc223488e75c99b16cc4d056624374b799e6a1555cf61b23
languageName: node
linkType: hard
"cliui@npm:^6.0.0":
version: 6.0.0
resolution: "cliui@npm:6.0.0"
dependencies:
string-width: "npm:^4.2.0"
strip-ansi: "npm:^6.0.0"
wrap-ansi: "npm:^6.2.0"
checksum: 10c0/35229b1bb48647e882104cac374c9a18e34bbf0bace0e2cf03000326b6ca3050d6b59545d91e17bfe3705f4a0e2988787aa5cde6331bf5cbbf0164732cef6492
languageName: node
linkType: hard
"color-convert@npm:^2.0.1":
version: 2.0.1
resolution: "color-convert@npm:2.0.1"
dependencies:
color-name: "npm:~1.1.4"
checksum: 10c0/37e1150172f2e311fe1b2df62c6293a342ee7380da7b9cfdba67ea539909afbd74da27033208d01d6d5cfc65ee7868a22e18d7e7648e004425441c0f8a15a7d7
languageName: node
linkType: hard
"color-name@npm:~1.1.4":
version: 1.1.4
resolution: "color-name@npm:1.1.4"
checksum: 10c0/a1a3f914156960902f46f7f56bc62effc6c94e84b2cae157a526b1c1f74b677a47ec602bf68a61abfa2b42d15b7c5651c6dbe72a43af720bc588dff885b10f95
languageName: node
linkType: hard
"cowsay@npm:^1.6.0":
version: 1.6.0
resolution: "cowsay@npm:1.6.0"
dependencies:
get-stdin: "npm:8.0.0"
string-width: "npm:~2.1.1"
strip-final-newline: "npm:2.0.0"
yargs: "npm:15.4.1"
bin:
cowsay: cli.js
cowthink: cli.js
checksum: 10c0/6233b0c64e71c3f64ce33a358de9e95649479df25f1b5abf605d1252e155dd44de743e66a545c810c20e1da754b4b7bfea22e401dccc27579748416d8ce6c055
languageName: node
linkType: hard
"decamelize@npm:^1.2.0":
version: 1.2.0
resolution: "decamelize@npm:1.2.0"
checksum: 10c0/85c39fe8fbf0482d4a1e224ef0119db5c1897f8503bcef8b826adff7a1b11414972f6fef2d7dec2ee0b4be3863cf64ac1439137ae9e6af23a3d8dcbe26a5b4b2
languageName: node
linkType: hard
"emoji-regex@npm:^8.0.0":
version: 8.0.0
resolution: "emoji-regex@npm:8.0.0"
checksum: 10c0/b6053ad39951c4cf338f9092d7bfba448cdfd46fe6a2a034700b149ac9ffbc137e361cbd3c442297f86bed2e5f7576c1b54cc0a6bf8ef5106cc62f496af35010
languageName: node
linkType: hard
"find-up@npm:^4.1.0":
version: 4.1.0
resolution: "find-up@npm:4.1.0"
dependencies:
locate-path: "npm:^5.0.0"
path-exists: "npm:^4.0.0"
checksum: 10c0/0406ee89ebeefa2d507feb07ec366bebd8a6167ae74aa4e34fb4c4abd06cf782a3ce26ae4194d70706f72182841733f00551c209fe575cb00bd92104056e78c1
languageName: node
linkType: hard
"get-caller-file@npm:^2.0.1":
version: 2.0.5
resolution: "get-caller-file@npm:2.0.5"
checksum: 10c0/c6c7b60271931fa752aeb92f2b47e355eac1af3a2673f47c9589e8f8a41adc74d45551c1bc57b5e66a80609f10ffb72b6f575e4370d61cc3f7f3aaff01757cde
languageName: node
linkType: hard
"get-stdin@npm:8.0.0":
version: 8.0.0
resolution: "get-stdin@npm:8.0.0"
checksum: 10c0/b71b72b83928221052f713b3b6247ebf1ceaeb4ef76937778557537fd51ad3f586c9e6a7476865022d9394b39b74eed1dc7514052fa74d80625276253571b76f
languageName: node
linkType: hard
"is-fullwidth-code-point@npm:^2.0.0":
version: 2.0.0
resolution: "is-fullwidth-code-point@npm:2.0.0"
checksum: 10c0/e58f3e4a601fc0500d8b2677e26e9fe0cd450980e66adb29d85b6addf7969731e38f8e43ed2ec868a09c101a55ac3d8b78902209269f38c5286bc98f5bc1b4d9
languageName: node
linkType: hard
"is-fullwidth-code-point@npm:^3.0.0":
version: 3.0.0
resolution: "is-fullwidth-code-point@npm:3.0.0"
checksum: 10c0/bb11d825e049f38e04c06373a8d72782eee0205bda9d908cc550ccb3c59b99d750ff9537982e01733c1c94a58e35400661f57042158ff5e8f3e90cf936daf0fc
languageName: node
linkType: hard
"locate-path@npm:^5.0.0":
version: 5.0.0
resolution: "locate-path@npm:5.0.0"
dependencies:
p-locate: "npm:^4.1.0"
checksum: 10c0/33a1c5247e87e022f9713e6213a744557a3e9ec32c5d0b5efb10aa3a38177615bf90221a5592674857039c1a0fd2063b82f285702d37b792d973e9e72ace6c59
languageName: node
linkType: hard
"p-limit@npm:^2.2.0":
version: 2.3.0
resolution: "p-limit@npm:2.3.0"
dependencies:
p-try: "npm:^2.0.0"
checksum: 10c0/8da01ac53efe6a627080fafc127c873da40c18d87b3f5d5492d465bb85ec7207e153948df6b9cbaeb130be70152f874229b8242ee2be84c0794082510af97f12
languageName: node
linkType: hard
"p-locate@npm:^4.1.0":
version: 4.1.0
resolution: "p-locate@npm:4.1.0"
dependencies:
p-limit: "npm:^2.2.0"
checksum: 10c0/1b476ad69ad7f6059744f343b26d51ce091508935c1dbb80c4e0a2f397ffce0ca3a1f9f5cd3c7ce19d7929a09719d5c65fe70d8ee289c3f267cd36f2881813e9
languageName: node
linkType: hard
"p-try@npm:^2.0.0":
version: 2.2.0
resolution: "p-try@npm:2.2.0"
checksum: 10c0/c36c19907734c904b16994e6535b02c36c2224d433e01a2f1ab777237f4d86e6289fd5fd464850491e940379d4606ed850c03e0f9ab600b0ebddb511312e177f
languageName: node
linkType: hard
"path-exists@npm:^4.0.0":
version: 4.0.0
resolution: "path-exists@npm:4.0.0"
checksum: 10c0/8c0bd3f5238188197dc78dced15207a4716c51cc4e3624c44fc97acf69558f5ebb9a2afff486fe1b4ee148e0c133e96c5e11a9aa5c48a3006e3467da070e5e1b
languageName: node
linkType: hard
"pkg-a@workspace:*, pkg-a@workspace:packages/pkg-a":
version: 0.0.0-use.local
resolution: "pkg-a@workspace:packages/pkg-a"
dependencies:
abbrev: "npm:^3.0.0"
languageName: unknown
linkType: soft
"pkg-b@workspace:*, pkg-b@workspace:packages/pkg-b":
version: 0.0.0-use.local
resolution: "pkg-b@workspace:packages/pkg-b"
languageName: unknown
linkType: soft
"require-directory@npm:^2.1.1":
version: 2.1.1
resolution: "require-directory@npm:2.1.1"
checksum: 10c0/83aa76a7bc1531f68d92c75a2ca2f54f1b01463cb566cf3fbc787d0de8be30c9dbc211d1d46be3497dac5785fe296f2dd11d531945ac29730643357978966e99
languageName: node
linkType: hard
"require-main-filename@npm:^2.0.0":
version: 2.0.0
resolution: "require-main-filename@npm:2.0.0"
checksum: 10c0/db91467d9ead311b4111cbd73a4e67fa7820daed2989a32f7023785a2659008c6d119752d9c4ac011ae07e537eb86523adff99804c5fdb39cd3a017f9b401bb6
languageName: node
linkType: hard
"set-blocking@npm:^2.0.0":
version: 2.0.0
resolution: "set-blocking@npm:2.0.0"
checksum: 10c0/9f8c1b2d800800d0b589de1477c753492de5c1548d4ade52f57f1d1f5e04af5481554d75ce5e5c43d4004b80a3eb714398d6907027dc0534177b7539119f4454
languageName: node
linkType: hard
"string-width@npm:^4.1.0, string-width@npm:^4.2.0":
version: 4.2.3
resolution: "string-width@npm:4.2.3"
dependencies:
emoji-regex: "npm:^8.0.0"
is-fullwidth-code-point: "npm:^3.0.0"
strip-ansi: "npm:^6.0.1"
checksum: 10c0/1e525e92e5eae0afd7454086eed9c818ee84374bb80328fc41217ae72ff5f065ef1c9d7f72da41de40c75fa8bb3dee63d92373fd492c84260a552c636392a47b
languageName: node
linkType: hard
"string-width@npm:~2.1.1":
version: 2.1.1
resolution: "string-width@npm:2.1.1"
dependencies:
is-fullwidth-code-point: "npm:^2.0.0"
strip-ansi: "npm:^4.0.0"
checksum: 10c0/e5f2b169fcf8a4257a399f95d069522f056e92ec97dbdcb9b0cdf14d688b7ca0b1b1439a1c7b9773cd79446cbafd582727279d6bfdd9f8edd306ea5e90e5b610
languageName: node
linkType: hard
"strip-ansi@npm:^4.0.0":
version: 4.0.0
resolution: "strip-ansi@npm:4.0.0"
dependencies:
ansi-regex: "npm:^3.0.0"
checksum: 10c0/d75d9681e0637ea316ddbd7d4d3be010b1895a17e885155e0ed6a39755ae0fd7ef46e14b22162e66a62db122d3a98ab7917794e255532ab461bb0a04feb03e7d
languageName: node
linkType: hard
"strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1":
version: 6.0.1
resolution: "strip-ansi@npm:6.0.1"
dependencies:
ansi-regex: "npm:^5.0.1"
checksum: 10c0/1ae5f212a126fe5b167707f716942490e3933085a5ff6c008ab97ab2f272c8025d3aa218b7bd6ab25729ca20cc81cddb252102f8751e13482a5199e873680952
languageName: node
linkType: hard
"strip-final-newline@npm:2.0.0":
version: 2.0.0
resolution: "strip-final-newline@npm:2.0.0"
checksum: 10c0/bddf8ccd47acd85c0e09ad7375409d81653f645fda13227a9d459642277c253d877b68f2e5e4d819fe75733b0e626bac7e954c04f3236f6d196f79c94fa4a96f
languageName: node
linkType: hard
"which-module@npm:^2.0.0":
version: 2.0.1
resolution: "which-module@npm:2.0.1"
checksum: 10c0/087038e7992649eaffa6c7a4f3158d5b53b14cf5b6c1f0e043dccfacb1ba179d12f17545d5b85ebd94a42ce280a6fe65d0cbcab70f4fc6daad1dfae85e0e6a3e
languageName: node
linkType: hard
"wrap-ansi@npm:^6.2.0":
version: 6.2.0
resolution: "wrap-ansi@npm:6.2.0"
dependencies:
ansi-styles: "npm:^4.0.0"
string-width: "npm:^4.1.0"
strip-ansi: "npm:^6.0.0"
checksum: 10c0/baad244e6e33335ea24e86e51868fe6823626e3a3c88d9a6674642afff1d34d9a154c917e74af8d845fd25d170c4ea9cf69a47133c3f3656e1252b3d462d9f6c
languageName: node
linkType: hard
"y18n@npm:^4.0.0":
version: 4.0.3
resolution: "y18n@npm:4.0.3"
checksum: 10c0/308a2efd7cc296ab2c0f3b9284fd4827be01cfeb647b3ba18230e3a416eb1bc887ac050de9f8c4fd9e7856b2e8246e05d190b53c96c5ad8d8cb56dffb6f81024
languageName: node
linkType: hard
"yargs-parser@npm:^18.1.2":
version: 18.1.3
resolution: "yargs-parser@npm:18.1.3"
dependencies:
camelcase: "npm:^5.0.0"
decamelize: "npm:^1.2.0"
checksum: 10c0/25df918833592a83f52e7e4f91ba7d7bfaa2b891ebf7fe901923c2ee797534f23a176913ff6ff7ebbc1cc1725a044cc6a6539fed8bfd4e13b5b16376875f9499
languageName: node
linkType: hard
"yargs@npm:15.4.1":
version: 15.4.1
resolution: "yargs@npm:15.4.1"
dependencies:
cliui: "npm:^6.0.0"
decamelize: "npm:^1.2.0"
find-up: "npm:^4.1.0"
get-caller-file: "npm:^2.0.1"
require-directory: "npm:^2.1.1"
require-main-filename: "npm:^2.0.0"
set-blocking: "npm:^2.0.0"
string-width: "npm:^4.2.0"
which-module: "npm:^2.0.0"
y18n: "npm:^4.0.0"
yargs-parser: "npm:^18.1.2"
checksum: 10c0/f1ca680c974333a5822732825cca7e95306c5a1e7750eb7b973ce6dc4f97a6b0a8837203c8b194f461969bfe1fb1176d1d423036635285f6010b392fa498ab2d
languageName: node
linkType: hard
"yarn-workspaces@workspace:.":
version: 0.0.0-use.local
resolution: "yarn-workspaces@workspace:."
dependencies:
cowsay: "npm:^1.6.0"
pkg-a: "workspace:*"
pkg-b: "workspace:*"
languageName: unknown
linkType: soft