Skip to content

Commit

Permalink
deps: update to Hydrogen 2024.10
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-phan committed Nov 6, 2024
1 parent 53146c5 commit dcde30f
Show file tree
Hide file tree
Showing 14 changed files with 2,032 additions and 2,293 deletions.
3 changes: 0 additions & 3 deletions .lefthook/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ call_lefthook()
elif command -v mint >/dev/null 2>&1
then
mint run csjones/lefthook-plugin "$@"
elif command -v npx >/dev/null 2>&1
then
npx lefthook "$@"
else
echo "Can't find lefthook in PATH"
fi
Expand Down
3 changes: 0 additions & 3 deletions .lefthook/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ call_lefthook()
elif command -v mint >/dev/null 2>&1
then
mint run csjones/lefthook-plugin "$@"
elif command -v npx >/dev/null 2>&1
then
npx lefthook "$@"
else
echo "Can't find lefthook in PATH"
fi
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@
"ci": "biome ci --changed"
},
"devDependencies": {
"@biomejs/biome": "^1.9.2",
"@changesets/cli": "^2.27.8",
"@types/node": "22.7.0",
"@types/react": "18.3.9",
"@types/react-dom": "18.3.0",
"@biomejs/biome": "^1.9.4",
"@changesets/cli": "^2.27.9",
"@types/node": "22.9.0",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"cross-env": "7.0.3",
"lefthook": "^1.7.16",
"lefthook": "^1.8.2",
"react": "18.3.1",
"react-dom": "18.3.1",
"rimraf": "6.0.1",
"tsup": "8.3.0",
"turbo": "2.1.2",
"typescript": "5.6.2"
"tsup": "8.3.5",
"turbo": "2.2.3",
"typescript": "5.6.3"
},
"optionalDependencies": {
"@esbuild/darwin-x64": "^0.24.0",
"turbo-darwin-arm64": "^2.1.2"
"turbo-darwin-arm64": "^2.2.3"
},
"engines": {
"node": ">=18"
},
"packageManager": "pnpm@9.11.0"
"packageManager": "pnpm@9.12.3"
}
2 changes: 2 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @weaverse/core

## 4.0.0

## 3.4.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@weaverse/core",
"author": "Weaverse Team",
"description": "Weaverse Core",
"version": "3.4.2",
"version": "4.0.0",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
10 changes: 10 additions & 0 deletions packages/hydrogen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @weaverse/hydrogen

## 4.0.0

### Major Changes

- update for Shopify Hydrogen v2024.10

### Patch Changes

- @weaverse/react@4.0.0

## 3.4.2

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/hydrogen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@weaverse/hydrogen",
"author": "Weaverse Team",
"description": "Components, hooks, and utilities for building Shopify Hydrogen websites with Weaverse",
"version": "3.4.2",
"version": "4.0.0",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -41,7 +41,7 @@
]
},
"dependencies": {
"@weaverse/react": "3.4.2",
"@weaverse/react": "4.0.0",
"react-error-boundary": "^4.0.13"
},
"peerDependencies": {
Expand Down
40 changes: 24 additions & 16 deletions packages/hydrogen/src/weaverse-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class WeaverseClient {
}
}

fetchWithCache = async <T>(
fetchWithCache = async <T extends object>(
url: string,
options: FetchWithCacheOptions = {},
) => {
Expand All @@ -96,21 +96,29 @@ export class WeaverseClient {
throw new Error(`Failed to fetch data from ${url}`, { cause: err })
}
}
let res = this.withCache(cacheKey, strategy, async () => {
let response = await fetch(url, {
...reqInit,
headers: {
'Cache-Control': generateCacheControlHeader(strategy),
...reqInit.headers,
},
})
if (!response.ok) {
let error = await response.text()
let { status, statusText } = response
throw new Error(`${status} ${statusText} ${error}`, { cause: error })
}
return await response.json<T>()
})
let res = this.withCache.run(
{
cacheKey,
cacheStrategy: strategy,
// @ts-expect-error
shouldCacheResult: (result) => result?.data,
},
async () => {
let response = await fetch(url, {
...reqInit,
headers: {
'Cache-Control': generateCacheControlHeader(strategy),
...reqInit.headers,
},
})
if (!response.ok) {
let error = await response.text()
let { status, statusText } = response
throw new Error(`${status} ${statusText} ${error}`, { cause: error })
}
return await response.json<T>()
},
)
return res as Promise<T>
}

Expand Down
6 changes: 6 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @weaverse/react

## 4.0.0

### Patch Changes

- @weaverse/core@4.0.0

## 3.4.2

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@weaverse/react",
"author": "Weaverse Team",
"description": "React bindings for Weaverse",
"version": "3.4.2",
"version": "4.0.0",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -39,7 +39,7 @@
"react-dom": ">=18"
},
"dependencies": {
"@weaverse/core": "3.4.2",
"@weaverse/core": "4.0.0",
"clsx": "^2.1.1"
}
}
6 changes: 6 additions & 0 deletions packages/shopify/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @weaverse/shopify

## 4.0.0

### Patch Changes

- @weaverse/react@4.0.0

## 3.4.2

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/shopify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@weaverse/shopify",
"author": "Weaverse Team",
"description": "Weaverse Components for Shopify Online Store 2.0 Section builder",
"version": "3.4.2",
"version": "4.0.0",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -47,7 +47,7 @@
"dependencies": {
"@radix-ui/react-dialog": "^1.1.1",
"@stitches/react": "^1.2.8",
"@weaverse/react": "3.4.2",
"@weaverse/react": "4.0.0",
"keen-slider": "^6.8.6"
}
}
Loading

0 comments on commit dcde30f

Please sign in to comment.