Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	pnpm-lock.yaml
  • Loading branch information
paul-phan committed Aug 15, 2024
2 parents 3768a20 + 1fea7ea commit 450790b
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ dist/**
.DS_Store
/.eslintcache
hooks/
package-lock.json
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down
37 changes: 37 additions & 0 deletions packages/hydrogen/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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})/)
Expand Down
2 changes: 1 addition & 1 deletion templates/pilot
Submodule pilot updated from 6de49f to 26aba0

0 comments on commit 450790b

Please sign in to comment.