@doswiftly/storefront-operations 22.6.0 → 22.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -27,7 +27,7 @@ consumer's `codegen.ts` references this package's `.graphql` files as
27
27
  live in the consumer's repo.
28
28
 
29
29
  <!-- AUTOGEN:STATS:BEGIN — auto-regenerated, do not edit by hand -->
30
- - **Schema version**: 22.6.0
30
+ - **Schema version**: 22.8.1
31
31
  - **Queries**: 52
32
32
  - **Mutations**: 44
33
33
  - **Fragments**: 105
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # Changelog
2
2
 
3
+ ## 22.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 61a2841: Fix: images imported in code are optimized again when your build serves static assets from a CDN domain.
8
+
9
+ An image you import in code (`import hero from './hero.webp'`) becomes a content-hashed file under `/_next/static/media/`. When your build serves static assets from a CDN domain (`assetPrefix` / `getAssetPrefix()`), Next.js rewrites the `<Image>` `src` to an absolute CDN URL before the loader runs. The loader did not recognize that form, so every `srcset` entry pointed at the full-size original — no resizing or format negotiation.
10
+
11
+ The loader now recognizes code-imported images in that absolute form and routes them through the image CDN, so each `srcset` width is resized again — the same behavior as a build without `assetPrefix`. Product images and `public/` images were never affected.
12
+
13
+ No API changes — update the package and redeploy.
14
+
15
+ (`@doswiftly/storefront-operations` is version-synced with the SDK; no operation changes.)
16
+
17
+ ## 22.8.0
18
+
19
+ ### Minor Changes
20
+
21
+ - 9039ba1: Add `getAssetPrefix()` for serving your build's static assets from a CDN domain.
22
+
23
+ **Why**: A build's JavaScript, CSS, and font files (`/_next/static/*`) are content-hashed and immutable. Serving them from a CDN domain — rather than your app origin — makes them cache-friendly and keeps them off your storefront server's request path.
24
+
25
+ **Additive (backward-compatible)**: a new export from `@doswiftly/storefront-sdk/next`. Nothing changes until you opt in.
26
+
27
+ **Usage** — add two lines to `next.config`:
28
+
29
+ ```ts
30
+ // next.config.ts
31
+ import { getAssetPrefix } from "@doswiftly/storefront-sdk/next";
32
+
33
+ const nextConfig = {
34
+ assetPrefix: getAssetPrefix(),
35
+ crossOrigin: "anonymous",
36
+ // ...your existing config
37
+ };
38
+ export default nextConfig;
39
+ ```
40
+
41
+ `getAssetPrefix()` returns the CDN base injected by the deploy pipeline (namespaced to your shop), or `undefined` in development and on deploys without a CDN configured — so `next dev` and un-provisioned deploys keep serving assets from the app origin. Pair it with `crossOrigin: 'anonymous'`: the assets then load cross-origin and the CDN sends the matching CORS header (required for fonts).
42
+
43
+ **Migration checklist for existing storefronts**:
44
+ - [ ] Add `assetPrefix: getAssetPrefix()` and `crossOrigin: 'anonymous'` to `next.config`.
45
+ - [ ] Redeploy — the next build's static assets are served from the CDN.
46
+
47
+ (`@doswiftly/storefront-operations` is version-synced with the SDK; no operation changes in this release.)
48
+
3
49
  ## 22.6.0
4
50
 
5
51
  ### Minor Changes
package/llms-full.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # DoSwiftly Storefront Operations — Full Reference
2
2
 
3
- > Schema version: **22.6.0**
3
+ > Schema version: **22.8.1**
4
4
  > 52 queries · 44 mutations · 105 fragments
5
5
 
6
6
  Auto-generated from `.graphql` source files. Do not edit by hand — this file is
package/operations.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "schemaVersion": "22.6.0",
2
+ "schemaVersion": "22.8.1",
3
3
  "queries": [
4
4
  {
5
5
  "name": "Shop",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doswiftly/storefront-operations",
3
- "version": "22.6.0",
3
+ "version": "22.8.1",
4
4
  "description": "GraphQL operations for DoSwiftly Storefront - SSOT from backend",
5
5
  "homepage": "https://doswiftly.pl",
6
6
  "publishConfig": {