Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
67 changes: 24 additions & 43 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,26 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 24

- name: 📥 Install pnpm
uses: pnpm/action-setup@v3

- name: ⎔ Setup Bun
uses: oven-sh/setup-bun@v2
with:
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v4
name: Setup pnpm cache
bun-version: "1.3.3"

- name: 📦 Cache Bun dependencies
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
${{ runner.os }}-bun-

- name: Install dependencies
run: pnpm install --no-frozen-lockfile
run: bun install

- name: Setup Biome
uses: biomejs/setup-biome@v2

- name: Run Biome
run: biome ci .

Expand All @@ -60,30 +50,21 @@ jobs:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 24

- name: 📥 Install pnpm
uses: pnpm/action-setup@v3
- name: ⎔ Setup Bun
uses: oven-sh/setup-bun@v2
with:
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
bun-version: "1.3.3"

- uses: actions/cache@v4
name: Setup pnpm cache
- name: 📦 Cache Bun dependencies
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
${{ runner.os }}-bun-

- name: Install dependencies
run: pnpm install --no-frozen-lockfile
run: bun install

- name: 🔎 Type check
run: npm run typecheck --if-present
run: bun run typecheck
4 changes: 3 additions & 1 deletion .lefthook/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ call_lefthook()
elif lefthook -h >/dev/null 2>&1
then
lefthook "$@"
elif /Users/paul/Workspace/weaverse-project/weaverse/node_modules/lefthook-darwin-arm64/bin/lefthook -h >/dev/null 2>&1
then
/Users/paul/Workspace/weaverse-project/weaverse/node_modules/lefthook-darwin-arm64/bin/lefthook "$@"
else
dir="$(git rev-parse --show-toplevel)"
osArch=$(uname | tr '[:upper:]' '[:lower:]')
Expand All @@ -32,7 +35,6 @@ call_lefthook()
elif test -f "$dir/node_modules/lefthook/bin/index.js"
then
"$dir/node_modules/lefthook/bin/index.js" "$@"

elif go tool lefthook -h >/dev/null 2>&1
then
go tool lefthook "$@"
Expand Down
4 changes: 3 additions & 1 deletion .lefthook/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ call_lefthook()
elif lefthook -h >/dev/null 2>&1
then
lefthook "$@"
elif /Users/paul/Workspace/weaverse-project/weaverse/node_modules/lefthook-darwin-arm64/bin/lefthook -h >/dev/null 2>&1
then
/Users/paul/Workspace/weaverse-project/weaverse/node_modules/lefthook-darwin-arm64/bin/lefthook "$@"
else
dir="$(git rev-parse --show-toplevel)"
osArch=$(uname | tr '[:upper:]' '[:lower:]')
Expand All @@ -32,7 +35,6 @@ call_lefthook()
elif test -f "$dir/node_modules/lefthook/bin/index.js"
then
"$dir/node_modules/lefthook/bin/index.js" "$@"

elif go tool lefthook -h >/dev/null 2>&1
then
go tool lefthook "$@"
Expand Down
5 changes: 0 additions & 5 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
@weaverse:registry=https://registry.npmjs.com
progress=false
node-linker=hoisted
enable-pre-post-scripts=true
package-manager-strict=false
link-workspace-packages=true
28 changes: 14 additions & 14 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Project Overview

This is the **Weaverse SDKs monorepo** - a collection of SDKs for integrating modern React/JamStack frameworks (Shopify Hydrogen, React Router, Next.js) with the Weaverse Headless CMS. The project uses pnpm for package management, Turbo for build orchestration, and Biome for code quality.
This is the **Weaverse SDKs monorepo** - a collection of SDKs for integrating modern React/JamStack frameworks (Shopify Hydrogen, React Router, Next.js) with the Weaverse Headless CMS. The project uses bun for package management, Turbo for build orchestration, and Biome for code quality.

## Essential Commands

Expand Down Expand Up @@ -44,13 +44,13 @@ npm run changeset # Create a changeset for release
```

### Package Management
**Important**: This project uses pnpm 10.15.0 for dependency installation (enforced), but npm for running scripts.
**Important**: This project uses bun 1.3.3 for dependency installation (enforced), but npm for running scripts.

```bash
pnpm install # Install dependencies (enforced via packageManager field)
npm run <script> # Run package.json scripts (NOT pnpm run)
pnpm changeset version # Version packages based on changesets
pnpm changeset publish # Publish to npm registry
bun install # Install dependencies (enforced via packageManager field)
npm run <script> # Run package.json scripts (NOT bun run)
bun changeset version # Version packages based on changesets
bun changeset publish # Publish to npm registry
```

## Architecture Overview
Expand Down Expand Up @@ -148,8 +148,8 @@ export let schema = createSchema({
The project uses Changesets for releases with version synchronization:

1. Create changeset: `npm run changeset`
2. Version packages: `pnpm changeset version`
3. Publish to npm: `pnpm changeset publish`
2. Version packages: `bun changeset version`
3. Publish to npm: `bun changeset publish`
4. Commit and push to main branch
5. Create GitHub release

Expand All @@ -171,8 +171,8 @@ The `@weaverse/schema` package is versioned independently.

### Environment Requirements

- **Node.js**: >= 18 (core), >= 20 (hydrogen), >= 22 (monorepo scripts)
- **pnpm**: 10.15.0 (enforced via packageManager field in package.json)
- **Node.js**: >= 18 (core), >= 20 (hydrogen), >= 18 (monorepo scripts)
- **bun**: 1.3.3 (enforced via packageManager field in package.json)
- **Git**: Required for version control and pre-commit hooks

### Version Compatibility
Expand Down Expand Up @@ -252,7 +252,7 @@ npm test # Run Playwright E2E tests
3. **Version Synchronization**: Fixed group packages must be versioned together
4. **Breaking Changes**: Follow semver and document in changesets
5. **Local Development**: Use `npm run dev:pkg` for proper local development setup
6. **Package Manager Mixing**: Always use pnpm for installs (enforced), npm for scripts
6. **Package Manager Mixing**: Always use bun for installs (enforced), npm for scripts
7. **Type Definitions**: Schema-related types belong in `@weaverse/schema`, not individual packages
8. **Template Dependencies**: Don't include templates in package builds (excluded via Biome config)
9. **Schema Property Name**: Always use `settings` not `inspector` in component schemas
Expand Down Expand Up @@ -280,7 +280,7 @@ Error: Cannot find module '@weaverse/core'
**Solution**: Ensure all packages are built in the correct order
```bash
npm run clean
pnpm install
bun install
npm run build
```

Expand Down Expand Up @@ -314,14 +314,14 @@ npm run biome:fix
**Solution**: Ensure you have npm publish permissions and are logged in
```bash
npm login
pnpm changeset publish
bun changeset publish
```

**Problem**: Version mismatch in fixed group packages
**Solution**: The changeset configuration ensures synchronized versions for core, react, and hydrogen packages. Check `.changeset/config.json` if issues persist.

### Common Errors

- **ENOENT errors**: Usually indicate missing dependencies - run `pnpm install`
- **ENOENT errors**: Usually indicate missing dependencies - run `bun install`
- **Permission errors**: May need to clear npm cache: `npm cache clean --force`
- **Version mismatch**: Check `package.json` for correct peer dependency versions
Loading
Loading