Skip to content

Commit e467180

Browse files
authored
Merge branch 'main' into lorenzo/change-use-resize-observer
2 parents 2b00610 + cb087e9 commit e467180

39 files changed

Lines changed: 247 additions & 203 deletions

.changeset/enforce-calver-local.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ CALVER_PACKAGES.forEach((pkgName) => {
143143
if (!opts.skipChangesets) {
144144
console.log('\n🦋 Running changeset version...');
145145
if (opts.dryRun) {
146-
console.log(' [DRY RUN] Would run: npx @changesets/cli version');
146+
console.log(' [DRY RUN] Would run: pnpm exec @changesets/cli version');
147147
} else {
148-
execSync('npx @changesets/cli version', {stdio: 'inherit'});
148+
execSync('pnpm exec @changesets/cli version', {stdio: 'inherit'});
149149
}
150150
} else {
151151
console.log('\n⏭️ Skipping changeset version');

.claude/commands/apis-version-update.md

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Before starting, verify:
100100

101101
#### Step 3a: Generate New Types in hydrogen-react
102102
1. Navigate to `packages/hydrogen-react/`
103-
2. Run: `npm run graphql-types`
103+
2. Run: `pnpm run graphql-types`
104104
3. **IMPORTANT**: Return to the root directory: `cd ../..`
105105
4. This will fetch the latest schemas and generate:
106106
- `src/storefront-api-types.d.ts` - TypeScript types for SFAPI
@@ -123,14 +123,14 @@ ls -la packages/hydrogen-react/*.schema.json
123123

124124
```bash
125125
cd packages/hydrogen-react
126-
npm run build
126+
pnpm run build
127127
cd ../..
128128
```
129129

130130
**Common Build Issues & Solutions:**
131131
- **Network timeout**: Retry the graphql-types command
132132
- **TypeScript errors**: Expected at this stage, continue with process
133-
- **Missing dependencies**: Run `npm install` from root directory
133+
- **Missing dependencies**: Run `pnpm install` from root directory
134134
- **Permission errors**: Check file permissions or try with sudo
135135
- **Build hangs**: Kill process and retry, might be resource issue
136136

@@ -142,7 +142,7 @@ ls -la packages/hydrogen-react/dist/types/storefront-api-types.d.ts
142142

143143
#### Step 3c: Build All Packages
144144
```bash
145-
npm run build:pkg
145+
pnpm run build:pkg
146146
```
147147

148148
**Validation**: Verify build completes without errors:
@@ -156,7 +156,7 @@ npm run build:pkg
156156
**TODO TRACKING**: Mark Step 4 complete, add and mark Step 5 as in_progress.
157157
Run the documentation build to update any auto-generated docs:
158158
```bash
159-
npm run build-docs --workspace=@shopify/hydrogen-react
159+
pnpm run build-docs --workspace=@shopify/hydrogen-react
160160
```
161161
This will update generated documentation based on component changes.
162162

@@ -170,18 +170,18 @@ This will update generated documentation based on component changes.
170170
After building packages, regenerate the skeleton template's GraphQL types:
171171
```bash
172172
cd templates/skeleton
173-
npm run codegen
173+
pnpm run codegen
174174
cd ../..
175175
```
176-
**Note**: This step MUST be done after `npm run build:pkg` as the skeleton depends on the built hydrogen-react types.
176+
**Note**: This step MUST be done after `pnpm run build:pkg` as the skeleton depends on the built hydrogen-react types.
177177

178178
**Validation**: Verify these files were regenerated:
179179
- `templates/skeleton/storefrontapi.generated.d.ts`
180180
- `templates/skeleton/customer-accountapi.generated.d.ts`
181181

182182
**Common Issues**:
183183
- If you see errors about unknown types (e.g., `LanguageCode`), this indicates breaking changes in the API that need to be addressed
184-
- The skeleton codegen depends on the built packages, so ensure `npm run build:pkg` completed successfully first
184+
- The skeleton codegen depends on the built packages, so ensure `pnpm run build:pkg` completed successfully first
185185

186186
**✅ CHECKPOINT**: Pause and ask the user to confirm before moving to the next task.
187187
**Summary**: Regenerated skeleton template's GraphQL types. Note any codegen errors that may indicate breaking API changes.
@@ -218,13 +218,13 @@ find . -name "*test*" -o -name "*spec*" | xargs grep -l "$OLD_VERSION"
218218
**Validation**: After updating all references, run initial validation and capture all errors:
219219
```bash
220220
# Capture TypeScript errors
221-
npm run typecheck 2>&1 | tee typecheck_errors.log
221+
pnpm run typecheck 2>&1 | tee typecheck_errors.log
222222

223223
# Capture test failures
224-
npm test 2>&1 | tee test_failures.log
224+
pnpm test 2>&1 | tee test_failures.log
225225

226226
# Capture lint issues (usually less critical)
227-
npm run lint 2>&1 | tee lint_issues.log
227+
pnpm run lint 2>&1 | tee lint_issues.log
228228
```
229229
**Important**: Save these error logs - they will be analyzed and included in the PR description for visibility.
230230

@@ -533,7 +533,7 @@ query CustomerWithNewField {
533533
### 1. Run Type Generation
534534
```bash
535535
cd packages/hydrogen-react
536-
npm run graphql-types
536+
pnpm run graphql-types
537537
cd ../..
538538
```
539539
- Verify no errors occur
@@ -545,7 +545,7 @@ cd ../..
545545

546546
### 2. Build Documentation
547547
```bash
548-
npm run build-docs --workspace=@shopify/hydrogen-react
548+
pnpm run build-docs --workspace=@shopify/hydrogen-react
549549
```
550550

551551
**✅ CHECKPOINT**: Pause and ask the user to confirm before moving to the next task.
@@ -568,34 +568,34 @@ grep -r "YYYY-MM" --include="*.ts" --include="*.tsx" --include="*.js" --include=
568568
#### Step 4a: Test hydrogen-react types
569569
```bash
570570
cd packages/hydrogen-react
571-
npm run typecheck
571+
pnpm run typecheck
572572
cd ../..
573573
```
574574

575575
#### Step 4b: Test hydrogen package types
576576
```bash
577577
cd packages/hydrogen
578-
npm run typecheck
578+
pnpm run typecheck
579579
cd ../..
580580
```
581581

582582
**Common Issues and Solutions**:
583583
- If you see `Cannot find module '@shopify/hydrogen-react/storefront-api-types'`:
584-
- Ensure you ran `npm run build` in `packages/hydrogen-react` first
584+
- Ensure you ran `pnpm run build` in `packages/hydrogen-react` first
585585
- Verify `packages/hydrogen-react/dist/types/storefront-api-types.d.ts` exists
586586
- If typecheck fails with many errors, the packages may need rebuilding:
587587
```bash
588588
cd packages/hydrogen-react
589-
npm run graphql-types
590-
npm run build
589+
pnpm run graphql-types
590+
pnpm run build
591591
cd ../..
592-
npm run build:pkg
592+
pnpm run build:pkg
593593
```
594594

595595
#### Step 4c: Run Full Test Suite
596596
```bash
597-
npm test
598-
npm run lint
597+
pnpm test
598+
pnpm run lint
599599
```
600600

601601
**✅ CHECKPOINT**: Pause and ask the user to confirm before moving to the next task.
@@ -605,7 +605,7 @@ npm run lint
605605

606606
1. **Type Resolution Failures**: The hydrogen package depends on built types from hydrogen-react
607607
- **Problem**: `Cannot find module '@shopify/hydrogen-react/storefront-api-types'`
608-
- **Solution**: ALWAYS build hydrogen-react (`npm run build`) after generating types and before building other packages
608+
- **Solution**: ALWAYS build hydrogen-react (`pnpm run build`) after generating types and before building other packages
609609
- **Order matters**: graphql-types → build hydrogen-react → build all packages
610610

611611
2. **Missing API feature implementations**: Always check the API changelog for new features that need implementation
@@ -614,7 +614,7 @@ npm run lint
614614

615615
4. **Version consistency**: SFAPI and CAAPI versions MUST match for quarterly releases
616616

617-
5. **Generated files**: Never manually edit generated type files - always use `npm run graphql-types`
617+
5. **Generated files**: Never manually edit generated type files - always use `pnpm run graphql-types`
618618

619619
6. **Test updates**: Tests must be updated to work with new API versions
620620

@@ -693,7 +693,7 @@ For each issue discovered, provide:
693693
**Summary**: Customer Account API queries fail with "Unknown type LanguageCode" error
694694

695695
**Details**:
696-
- Discovered during: `npm run codegen` in templates/skeleton
696+
- Discovered during: `pnpm run codegen` in templates/skeleton
697697
- Error locations:
698698
- app/graphql/customer-account/CustomerAddressMutations.ts:6:16
699699
- app/graphql/customer-account/CustomerDetailsQuery.ts:2:36
@@ -1215,19 +1215,19 @@ See [`API_CHANGES_REPORT_YYYY-MM.md`](./API_CHANGES_REPORT_YYYY-MM.md) for compl
12151215
- [ ] Tests: Add coverage for cart warning features
12161216
12171217
### Build & Documentation Status
1218-
- [ ] `npm run typecheck` - Currently: Failed (X errors)
1219-
- [ ] `npm run test` - Currently: Failed (Y failures)
1220-
- [ ] `npm run build:pkg` - Currently: Pass/Fail
1218+
- [ ] `pnpm run typecheck` - Currently: Failed (X errors)
1219+
- [ ] `pnpm run test` - Currently: Failed (Y failures)
1220+
- [ ] `pnpm run build:pkg` - Currently: Pass/Fail
12211221
- [ ] Skeleton builds - Currently: Pass/Fail
12221222
- [ ] API version references updated
12231223
- [ ] Examples use new API version
12241224
- [ ] JSDoc comments updated
12251225
12261226
[IF no validation errors, include:]
12271227
## Build & Documentation Status
1228-
- [x] `npm run typecheck` - Passing
1229-
- [x] `npm run test` - All tests passing
1230-
- [x] `npm run build:pkg` - Successful
1228+
- [x] `pnpm run typecheck` - Passing
1229+
- [x] `pnpm run test` - All tests passing
1230+
- [x] `pnpm run build:pkg` - Successful
12311231
- [x] Skeleton builds - Successful
12321232
- [x] API version references updated
12331233
- [x] Examples use new API version
@@ -1513,7 +1513,7 @@ echo "PR description generated: $OUTPUT_FILE"
15131513
- [ ] Asked user about Cloudflare Workers compat date
15141514
- [ ] Type generation completed successfully
15151515
- [ ] hydrogen-react built successfully (critical for type resolution)
1516-
- [ ] Documentation built with `npm run build-docs --workspace=@shopify/hydrogen-react`
1516+
- [ ] Documentation built with `pnpm run build-docs --workspace=@shopify/hydrogen-react`
15171517
- [ ] No references to old API versions remain
15181518
- [ ] All tests pass with new API versions
15191519
- [ ] Build completes successfully
@@ -1550,45 +1550,45 @@ curl --silent --request POST \
15501550
15511551
# 2. Generate new types in hydrogen-react
15521552
cd packages/hydrogen-react
1553-
npm run graphql-types
1553+
pnpm run graphql-types
15541554
15551555
# 3. BUILD HYDROGEN-REACT (CRITICAL - DO NOT SKIP)
1556-
npm run build
1556+
pnpm run build
15571557
cd ../..
15581558
15591559
# 4. Verify hydrogen-react types are built
15601560
ls -la packages/hydrogen-react/dist/types/storefront-api-types.d.ts
15611561
15621562
# 5. Build all packages
1563-
npm run build:pkg
1563+
pnpm run build:pkg
15641564
15651565
# 6. Build documentation
1566-
npm run build-docs --workspace=@shopify/hydrogen-react
1566+
pnpm run build-docs --workspace=@shopify/hydrogen-react
15671567
15681568
# 7. Regenerate skeleton types
15691569
cd templates/skeleton
1570-
npm run codegen
1570+
pnpm run codegen
15711571
cd ../..
15721572
15731573
# 8. Search for old versions and update (replace YYYY-MM with actual old version)
15741574
grep -r "YYYY-MM" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx"
15751575
# Update all found references
15761576
15771577
# 9. Verify type checking works (CRITICAL VALIDATION)
1578-
cd packages/hydrogen-react && npm run typecheck && cd ../..
1579-
cd packages/hydrogen && npm run typecheck && cd ../..
1578+
cd packages/hydrogen-react && pnpm run typecheck && cd ../..
1579+
cd packages/hydrogen && pnpm run typecheck && cd ../..
15801580
15811581
# 10. Run full validation suite
1582-
npm run typecheck
1583-
npm run lint
1584-
npm test
1582+
pnpm run typecheck
1583+
pnpm run lint
1584+
pnpm test
15851585
# Keep track of any errors for final review
15861586
15871587
# 11. Format the code
1588-
npm run format
1588+
pnpm run format
15891589
15901590
# 12. Create changeset
1591-
npm run changeset add
1591+
pnpm run changeset add
15921592
15931593
# 13. Commit changes
15941594
git add -A

.claude/commands/changelog-update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ git show COMMIT_HASH --name-only | grep templates/skeleton | grep -v "CHANGELOG.
200200
````bash
201201
echo <<EOF | base64 -w 0
202202
```diff
203-
npx codemod remix/2/react-router/upgrade
203+
pnpm dlx codemod remix/2/react-router/upgrade
204204
````
205205
206206
- **Use git diff format** with `+` and `-` prefixes for changes

.claude/commands/fix-cookbook-recipe.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ The cookbook system applies patches to the skeleton template (`templates/skeleto
2323

2424
```bash
2525
cd cookbook
26-
SHOPIFY_HYDROGEN_FLAG_LOCKFILE_CHECK=false npx ts-node src/index.ts validate --recipe {name}
26+
SHOPIFY_HYDROGEN_FLAG_LOCKFILE_CHECK=false pnpm exec ts-node src/index.ts validate --recipe {name}
2727
```
2828

2929
If `$ARGUMENTS` is `all`, run without `--recipe` to validate everything:
3030
```bash
31-
SHOPIFY_HYDROGEN_FLAG_LOCKFILE_CHECK=false npx ts-node src/index.ts validate
31+
SHOPIFY_HYDROGEN_FLAG_LOCKFILE_CHECK=false pnpm exec ts-node src/index.ts validate
3232
```
3333

3434
### 2. Classify the validation output
@@ -62,7 +62,7 @@ These occur after patches apply. They may indicate the recipe's code changes are
6262
❌ README.md validateReadmeExists: README.md not found
6363
❌ LLM prompt validateLlmPromptExists: LLM prompt not found
6464
```
65-
Fix by running `npm run cookbook -- render --recipe {name}` for README, or creating the LLM prompt file.
65+
Fix by running `pnpm run cookbook -- render --recipe {name}` for README, or creating the LLM prompt file.
6666

6767
### 3. If validation passes with no errors, skip to Phase 4
6868

@@ -83,7 +83,7 @@ rm -f {any ingredient files listed in recipe.yaml}
8383

8484
```bash
8585
cd cookbook
86-
npx ts-node src/index.ts apply --recipe {name} 2>&1
86+
pnpm exec ts-node src/index.ts apply --recipe {name} 2>&1
8787
```
8888

8989
The command will fail with "PATCH CONFLICTS DETECTED" if there are `.orig` files, but the patches DO apply (just with offsets). That's exactly what we want.
@@ -146,7 +146,7 @@ Edit `recipe.yaml` directly:
146146
```bash
147147
# Regenerate README
148148
cd cookbook
149-
npx ts-node src/index.ts render --recipe {name}
149+
pnpm exec ts-node src/index.ts render --recipe {name}
150150

151151
# For missing LLM prompts, check if other recipes have them as reference
152152
ls llms/
@@ -158,7 +158,7 @@ Run validation again to confirm the fix:
158158

159159
```bash
160160
cd cookbook
161-
SHOPIFY_HYDROGEN_FLAG_LOCKFILE_CHECK=false npx ts-node src/index.ts validate --recipe {name}
161+
SHOPIFY_HYDROGEN_FLAG_LOCKFILE_CHECK=false pnpm exec ts-node src/index.ts validate --recipe {name}
162162
```
163163

164164
**Expected success output:**

.claude/commands/shopify-cli-update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ EOF
227227

228228
a. **Decrypt webhook URL**
229229
```bash
230-
npm run decrypt
230+
pnpm run decrypt
231231
```
232232
- If this fails, abort and notify user
233233
- The webhook URL is stored in `secrets.ejson` as `slack_cli_release_request_webhook_url`

.claude/skills/e2e-test-writing/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Examples:
4545
## Verification Commands
4646

4747
```bash
48-
npx playwright test --project=skeleton
48+
pnpm exec playwright test --project=skeleton
4949
```
5050

5151
Use narrower test paths during iteration, then run the appropriate full project suite before finishing.

.claude/skills/hydrogen-dev-workflow/SKILL.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ To test anything in Hydrogen that requires a customer login (order history, acco
2020
1. **Start the dev server with the customer account push flag:**
2121
```bash
2222
# Using npm
23-
npm run dev -- --customer-account-push
23+
pnpm run dev -- --customer-account-push
2424

2525
# Using Hydrogen CLI directly (h2 is the Hydrogen CLI binary)
2626
h2 dev --customer-account-push
2727
```
28-
Note the `--` separator when using `npm run dev`.
28+
Note the `--` separator when using `pnpm run dev`.
2929

3030
2. **Place a test order** using the [bogus gateway test payment details](https://help.shopify.com/en/manual/checkout-settings/test-orders/payments-test-mode#bogus-gateway-test-payment-details).
3131

@@ -46,8 +46,8 @@ Each recipe has two layers that need to stay in sync:
4646
**Generated documentation** (`cookbook/recipes/{name}/README.md` and `cookbook/llms/{name}.prompt.md`): These files are **auto-generated** from the ingredient source files. They inline the full route source code, so if you fix the ingredient `.tsx` files, you MUST also regenerate the docs:
4747

4848
```bash
49-
npm run cookbook -- render --recipe {name}
50-
npm run cookbook -- validate --recipe {name}
49+
pnpm run cookbook -- render --recipe {name}
50+
pnpm run cookbook -- validate --recipe {name}
5151
```
5252

5353
Both the `README.md` and `llms/{name}.prompt.md` must be committed as part of the same fix. Failing to regenerate means the docs teach the wrong pattern even after the ingredient files are correct.
@@ -74,7 +74,7 @@ Recipe patch files can break when the skeleton template changes. Two approaches:
7474
The best way to upgrade a Hydrogen storefront is the [`upgrade` CLI command](https://shopify.dev/docs/api/shopify-cli/hydrogen/hydrogen-upgrade):
7575

7676
```bash
77-
npx shopify hydrogen upgrade
77+
pnpm exec shopify hydrogen upgrade
7878
```
7979

8080
This command:

0 commit comments

Comments
 (0)