@doswiftly/storefront-operations 22.8.0 → 22.9.0
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 +1 -1
- package/CHANGELOG.md +58 -0
- package/fragments.graphql +1 -0
- package/llms-full.txt +2 -1
- package/operations.json +2 -2
- package/package.json +1 -1
- package/schema.graphql +5 -0
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.
|
|
30
|
+
- **Schema version**: 22.9.0
|
|
31
31
|
- **Queries**: 52
|
|
32
32
|
- **Mutations**: 44
|
|
33
33
|
- **Fragments**: 105
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 22.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 36c28ff: Add `customerNote` to the storefront `Order` type — the note a buyer left at checkout (delivery instructions, gift message, etc.). It is selected by the order fragment, so it is available on every order query, and is `null` when the buyer left no note.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
// Order confirmation / detail page
|
|
11
|
+
const note = order.customerNote;
|
|
12
|
+
if (note) {
|
|
13
|
+
return <p className="order-note">{note}</p>;
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
- a399d36: Image loader now produces clean image URLs (no internal storage prefix) on custom domains.
|
|
18
|
+
|
|
19
|
+
**Why**: when your storefront is served from its own image domain, the built `<Image>` URLs no longer carry the `/s/{shopId}` storage prefix (`https://img.yourshop.com/_next/static/media/hero.webp?width=256` instead of `.../s/{shopId}/_next/...`). The stored object is unchanged — the platform restores the prefix toward storage — so this is purely a nicer public URL. Branding-friendly, and one fewer internal detail in the markup.
|
|
20
|
+
|
|
21
|
+
**This is automatic — no code change.** The common `createImageLoader()` setup reads the flag from the platform-injected env var, so clean URLs simply turn on when your storefront is served from a custom domain configured for them:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
// lib/image-loader.ts — unchanged; clean URLs turn on automatically.
|
|
25
|
+
import { createImageLoader } from "@doswiftly/storefront-sdk/next";
|
|
26
|
+
export default createImageLoader();
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Additive (backward-compatible)**:
|
|
30
|
+
1. `ImageLoaderConfig` gains an optional `cleanUrl?: boolean` (defaults to `false`).
|
|
31
|
+
2. `createImageLoader()` reads it automatically from `NEXT_PUBLIC_ASSET_CLEAN_URL`.
|
|
32
|
+
|
|
33
|
+
When `cleanUrl` is off (the default), URLs keep the `/s/{shopId}` prefix exactly as before — existing storefronts are unaffected. The boolean is also accepted by the low-level `buildImageLoaderUrl` for non-`<Image>` usage (e.g. CSS backgrounds) or tests:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { buildImageLoaderUrl } from "@doswiftly/storefront-sdk";
|
|
37
|
+
buildImageLoaderUrl(
|
|
38
|
+
{ shopId, version, cleanUrl: true, cdnBase: "https://img.yourshop.com" },
|
|
39
|
+
{ src: "/hero.webp", width: 256 },
|
|
40
|
+
);
|
|
41
|
+
// → https://img.yourshop.com/public/hero.webp?width=256&v=<version>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Migration checklist for existing storefronts**:
|
|
45
|
+
- [ ] None required — the default behavior is unchanged. Re-deploy to pick up clean URLs once your custom domain is configured.
|
|
46
|
+
|
|
47
|
+
## 22.8.1
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- 61a2841: Fix: images imported in code are optimized again when your build serves static assets from a CDN domain.
|
|
52
|
+
|
|
53
|
+
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.
|
|
54
|
+
|
|
55
|
+
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.
|
|
56
|
+
|
|
57
|
+
No API changes — update the package and redeploy.
|
|
58
|
+
|
|
59
|
+
(`@doswiftly/storefront-operations` is version-synced with the SDK; no operation changes.)
|
|
60
|
+
|
|
3
61
|
## 22.8.0
|
|
4
62
|
|
|
5
63
|
### Minor Changes
|
package/fragments.graphql
CHANGED
package/llms-full.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DoSwiftly Storefront Operations — Full Reference
|
|
2
2
|
|
|
3
|
-
> Schema version: **22.
|
|
3
|
+
> Schema version: **22.9.0**
|
|
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
|
|
@@ -3052,6 +3052,7 @@ fragment Order on Order {
|
|
|
3052
3052
|
...MailingAddress
|
|
3053
3053
|
}
|
|
3054
3054
|
itemCount
|
|
3055
|
+
customerNote
|
|
3055
3056
|
discountAllocations {
|
|
3056
3057
|
discountCode
|
|
3057
3058
|
amount {
|
package/operations.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion": "22.
|
|
2
|
+
"schemaVersion": "22.9.0",
|
|
3
3
|
"queries": [
|
|
4
4
|
{
|
|
5
5
|
"name": "Shop",
|
|
@@ -2154,7 +2154,7 @@
|
|
|
2154
2154
|
"MailingAddress",
|
|
2155
2155
|
"Money"
|
|
2156
2156
|
],
|
|
2157
|
-
"body": "fragment Order on Order {\n id\n orderNumber\n accessToken\n totals {\n total {\n ...Money\n }\n subtotal {\n ...Money\n }\n totalTax {\n ...Money\n }\n totalShipping {\n ...Money\n }\n }\n status\n paymentStatus\n fulfillmentStatus\n processedAt\n confirmedAt\n cancelledAt\n expiredAt\n shippingAddress {\n ...MailingAddress\n }\n itemCount\n discountAllocations {\n discountCode\n amount {\n ...Money\n }\n }\n canCreatePayment\n paymentMethodType\n}",
|
|
2157
|
+
"body": "fragment Order on Order {\n id\n orderNumber\n accessToken\n totals {\n total {\n ...Money\n }\n subtotal {\n ...Money\n }\n totalTax {\n ...Money\n }\n totalShipping {\n ...Money\n }\n }\n status\n paymentStatus\n fulfillmentStatus\n processedAt\n confirmedAt\n cancelledAt\n expiredAt\n shippingAddress {\n ...MailingAddress\n }\n itemCount\n customerNote\n discountAllocations {\n discountCode\n amount {\n ...Money\n }\n }\n canCreatePayment\n paymentMethodType\n}",
|
|
2158
2158
|
"onType": "Order"
|
|
2159
2159
|
},
|
|
2160
2160
|
{
|
package/package.json
CHANGED
package/schema.graphql
CHANGED
|
@@ -4656,6 +4656,11 @@ type Order implements Node {
|
|
|
4656
4656
|
"""
|
|
4657
4657
|
confirmedAt: DateTime
|
|
4658
4658
|
|
|
4659
|
+
"""
|
|
4660
|
+
The note the buyer left at checkout (delivery instructions, gift message, etc.). Null when no note was provided.
|
|
4661
|
+
"""
|
|
4662
|
+
customerNote: String
|
|
4663
|
+
|
|
4659
4664
|
"""
|
|
4660
4665
|
Per-code discount allocations on the order (parity with `Cart.discountAllocations`). One entry per code that reduced the price; empty when no discount applied. The sum of `amount` equals the order-level discount.
|
|
4661
4666
|
"""
|