diff --git a/.gitignore b/.gitignore index 027f314d..ee56f769 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ dist/** .DS_Store /.eslintcache hooks/ +package-lock.json diff --git a/package.json b/package.json index 8ff735a3..f575206b 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "devDependencies": { "@biomejs/biome": "1.8.3", "@changesets/cli": "^2.27.7", - "@types/node": "22.2.0", + "@types/node": "22.3.0", "@types/react": "18.3.3", "@types/react-dom": "18.3.0", "cross-env": "7.0.3", @@ -35,12 +35,12 @@ "react-dom": "18.3.1", "rimraf": "6.0.1", "tsup": "8.2.4", - "turbo": "2.0.12", + "turbo": "2.0.13", "typescript": "5.5.4" }, "optionalDependencies": { "@esbuild/darwin-x64": "^0.23.0", - "turbo-darwin-arm64": "^2.0.12" + "turbo-darwin-arm64": "^2.0.13" }, "engines": { "node": ">=18" diff --git a/packages/hydrogen/src/types.ts b/packages/hydrogen/src/types.ts index 22489aa9..8d1167e5 100644 --- a/packages/hydrogen/src/types.ts +++ b/packages/hydrogen/src/types.ts @@ -288,6 +288,43 @@ export type RootRouteData = { [key: string]: any } +export type OptionDisplayType = + | 'dropdown' + | 'button' + | 'color' + | 'variant-image' + | 'custom-image' +export type OptionSize = 'sm' | 'md' | 'lg' +export type OptionShape = 'square' | 'round' | 'circle' + +export type OptionData = { + id: string + name: string + displayName: string + type: OptionDisplayType + size: OptionSize + shape: OptionShape +} + +export type SwatchesConfigs = { + options: OptionData[] + swatches: { + colors: ColorSwatch[] + images: ImageSwatch[] + } +} + +export type ColorSwatch = { + id: string + name: string + value: string +} +export type ImageSwatch = { + id: string + name: string + value: WeaverseImage | string +} + export type WeaverseProduct = WeaverseResourcePickerData export type WeaverseCollection = WeaverseResourcePickerData export type WeaverseBlog = WeaverseResourcePickerData diff --git a/packages/hydrogen/src/utils.ts b/packages/hydrogen/src/utils.ts index e652e87a..66673863 100644 --- a/packages/hydrogen/src/utils.ts +++ b/packages/hydrogen/src/utils.ts @@ -94,7 +94,7 @@ export function generateDataFromSchema({ */ export function resizeShopifyImage(imageURL: string, size: string): string { try { - if (size === 'original') { + if (!imageURL.includes('cdn.shopify.com') || size === 'original') { return imageURL } let [, path, ext] = imageURL.match(/(.*\/[\w-_.]+)\.(\w{2,4})/) diff --git a/templates/pilot b/templates/pilot index 6de49f7e..26aba083 160000 --- a/templates/pilot +++ b/templates/pilot @@ -1 +1 @@ -Subproject commit 6de49f7eddbfe58e24378ffb6ec7a91201800954 +Subproject commit 26aba08320cf2ff5f2f8f10c078f6c341b858979