Skip to content

Commit a8ef5a4

Browse files
authored
Merge branch 'main' into main
2 parents 69e01a3 + 0fc2980 commit a8ef5a4

File tree

20 files changed

+1694
-1192
lines changed

20 files changed

+1694
-1192
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- run: corepack enable
4646
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4747
with:
48-
node-version: 18
48+
node-version: 20
4949
cache: "pnpm"
5050

5151
- name: 📦 Install dependencies

docs/app/app.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export default defineAppConfig({
1616
},
1717
},
1818
},
19+
github: {
20+
rootDir: 'docs',
21+
},
1922
socials: {
2023
nuxt: 'https://nuxt.com',
2124
x: 'https://x.com/nuxt_js',
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: Shopify
3+
description: Nuxt Image integration with Shopify CDN.
4+
links:
5+
- label: Source
6+
icon: i-simple-icons-github
7+
to: https://github.com/nuxt/image/blob/main/src/runtime/providers/shopify.ts
8+
size: xs
9+
---
10+
11+
Integration between [Shopify CDN](https://cdn.shopify.com/) and Nuxt Image.
12+
13+
To use this provider, you just need to pass the image URL from the Storefront API response to the `src` prop.
14+
15+
Configure the provider in your `nuxt.config.ts` (optional):
16+
17+
```ts [nuxt.config.ts]
18+
export default defineNuxtConfig({
19+
image: {
20+
shopify: {
21+
baseURL: 'https://cdn.shopify.com/',
22+
}
23+
}
24+
})
25+
```
26+
27+
## Modifiers
28+
29+
The Shopify CDN provider supports the following default modifiers:
30+
31+
- `width`
32+
- `height`
33+
- `format`
34+
- `quality`
35+
36+
Additionally, the following modifiers are supported:
37+
38+
- `padColor`
39+
- `crop`
40+
- `cropLeft`
41+
- `cropTop`
42+
- `cropWidth`
43+
- `cropHeight`
44+
45+
### Format
46+
47+
The `format` modifier is supported.
48+
49+
```vue
50+
<NuxtImg src="..." width="300" height="300" modifiers="{ format: 'gif' }" />
51+
```
52+
53+
### Quality
54+
55+
The `quality` modifier is supported.
56+
57+
```vue
58+
<NuxtImg src="..." width="300" height="300" modifiers="{ quality: 10 }" />
59+
```
60+
61+
### Crop
62+
63+
The `crop` modifier is supported with the following values:
64+
65+
- `center`
66+
- `top`
67+
- `bottom`
68+
- `left`
69+
- `right`
70+
- `region`
71+
72+
```vue
73+
<NuxtImg src="..." width="300" height="300" modifiers="{ crop: 'center' }" />
74+
```
75+
76+
#### Crop Region
77+
78+
The `crop` modifier can also be used to crop an image to a specific region.
79+
80+
```vue
81+
<NuxtImg
82+
src="..."
83+
width="300"
84+
height="300"
85+
modifiers="{
86+
crop: 'region',
87+
cropLeft: 100,
88+
cropTop: 100,
89+
cropWidth: 450,
90+
cropHeight: 300
91+
}"
92+
/>
93+
```
94+
95+
### Pad color
96+
97+
The `padColor` modifier can be used to pad an image with a background color. Must be a hex color value.
98+
99+
```vue
100+
<NuxtImg src="..." width="300" height="300" modifiers="{ padColor: 'ff0000' }" />
101+
```

docs/content/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ orientation: horizontal
156156
- prepr
157157
- prismic
158158
- sanity
159+
- shopify
159160
- storyblok
160161
- strapi
161162
- twicpics

docs/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
},
77
"dependencies": {
88
"@nuxt/image": "link:..",
9-
"@nuxt/ui-pro": "^3.1.3",
10-
"better-sqlite3": "^12.0.0",
11-
"docus": "^3.0.4",
12-
"nuxt": "^3.17.5",
13-
"tailwindcss": "^4.1.10"
9+
"@nuxt/ui-pro": "^3.2.0",
10+
"better-sqlite3": "^12.2.0",
11+
"docus": "^3.0.5",
12+
"nuxt": "^3.17.6",
13+
"tailwindcss": "^4.1.11"
1414
}
1515
}

docs/public/providers/shopify.svg

Lines changed: 26 additions & 0 deletions
Loading

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
},
99
"dependencies": {
1010
"@nuxt/image": "latest",
11-
"nuxt": "3.17.5"
11+
"nuxt": "3.17.6"
1212
}
1313
}

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"test:types": "vue-tsc --noEmit && nuxt typecheck playground && nuxt typecheck example"
4040
},
4141
"dependencies": {
42-
"@nuxt/kit": "^3.17.5",
42+
"@nuxt/kit": "^3.17.6",
4343
"consola": "^3.4.2",
4444
"defu": "^6.1.4",
4545
"h3": "^1.15.3",
@@ -51,27 +51,27 @@
5151
"ufo": "^1.6.1"
5252
},
5353
"devDependencies": {
54-
"@nuxt/eslint-config": "1.4.1",
54+
"@nuxt/eslint-config": "1.5.2",
5555
"@nuxt/module-builder": "1.0.1",
56-
"@nuxt/schema": "3.17.5",
57-
"@nuxt/test-utils": "^3.19.1",
58-
"@types/node": "^22.15.32",
56+
"@nuxt/schema": "3.17.6",
57+
"@nuxt/test-utils": "^3.19.2",
58+
"@types/node": "^22.16.2",
5959
"@types/semver": "^7.7.0",
60-
"@unhead/vue": "^2.0.10",
60+
"@unhead/vue": "^2.0.12",
6161
"@vitest/coverage-v8": "^3.2.4",
6262
"@vue/test-utils": "^2.4.6",
63-
"changelogen": "^0.6.1",
64-
"eslint": "9.29.0",
63+
"changelogen": "^0.6.2",
64+
"eslint": "9.30.1",
6565
"happy-dom": "^18.0.1",
6666
"installed-check": "^9.3.0",
6767
"ipx": "^3.0.3",
6868
"jiti": "2.4.2",
69-
"knip": "^5.61.2",
70-
"nitropack": "^2.11.12",
71-
"nuxt": "^3.17.5",
69+
"knip": "^5.61.3",
70+
"nitropack": "^2.11.13",
71+
"nuxt": "^3.17.6",
7272
"ofetch": "^1.4.1",
73-
"pkg-pr-new": "^0.0.53",
74-
"playwright-core": "^1.53.1",
73+
"pkg-pr-new": "^0.0.54",
74+
"playwright-core": "^1.53.2",
7575
"semver": "^7.7.2",
7676
"tinyexec": "^1.0.1",
7777
"tinyglobby": "^0.2.14",
@@ -80,16 +80,16 @@
8080
"vitest": "^3.2.4",
8181
"vitest-environment-nuxt": "^1.0.1",
8282
"vue": "3.5.17",
83-
"vue-tsc": "^2.2.10"
83+
"vue-tsc": "^3.0.1"
8484
},
8585
"optionalDependencies": {
8686
"ipx": "^3.0.3"
8787
},
88-
"packageManager": "pnpm@10.12.2",
88+
"packageManager": "pnpm@10.13.1",
8989
"resolutions": {
9090
"@nuxt/image": "workspace:*",
91-
"@nuxt/schema": "3.17.5",
92-
"@types/node": "^22.15.32",
91+
"@nuxt/schema": "3.17.6",
92+
"@types/node": "^22.16.2",
9393
"vue": "3.5.17"
9494
},
9595
"engines": {

playground/nuxt.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ export default defineNuxtConfig({
9696
sanity: {
9797
projectId: 'zp7mbokg',
9898
},
99+
shopify: {
100+
baseURL: 'https://cdn.shopify.com/',
101+
},
99102
strapi: {
100103
baseURL: 'http://localhost:1337/uploads/',
101104
},

playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
},
99
"devDependencies": {
1010
"@nuxt/image": "latest",
11-
"nuxt": "3.17.5"
11+
"nuxt": "3.17.6"
1212
}
1313
}

0 commit comments

Comments
 (0)