@thorprovider/storefront 0.13.1 → 0.13.3
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OrderDetailActionId, OrderDocument } from '@thorprovider/blocks/ports'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Host capability gate for the order-detail route.
|
|
@@ -9,7 +9,7 @@ import type { OrderActionId, OrderDocument } from '@thorprovider/blocks/ports'
|
|
|
9
9
|
* can really serve: project actions through it, and register exactly one handler
|
|
10
10
|
* per entry in the route panel.
|
|
11
11
|
*/
|
|
12
|
-
export const ORDER_DETAIL_HOST_ACTIONS: readonly
|
|
12
|
+
export const ORDER_DETAIL_HOST_ACTIONS: readonly OrderDetailActionId[] = [
|
|
13
13
|
'reorder',
|
|
14
14
|
'invoice',
|
|
15
15
|
'track',
|
|
@@ -33,16 +33,16 @@ export const ORDER_DETAIL_SUPPORT_HREF = '/contact'
|
|
|
33
33
|
*/
|
|
34
34
|
export function orderDetailHostActions(
|
|
35
35
|
supportHref: string = ORDER_DETAIL_SUPPORT_HREF,
|
|
36
|
-
): readonly
|
|
36
|
+
): readonly OrderDetailActionId[] {
|
|
37
37
|
if (supportHref !== '') return ORDER_DETAIL_HOST_ACTIONS
|
|
38
38
|
return ORDER_DETAIL_HOST_ACTIONS.filter((action) => action !== 'support')
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/** Project an authorised action set through the host's real capabilities. */
|
|
42
42
|
export function projectHostActions(
|
|
43
|
-
actions: readonly
|
|
43
|
+
actions: readonly OrderDetailActionId[],
|
|
44
44
|
supportHref: string = ORDER_DETAIL_SUPPORT_HREF,
|
|
45
|
-
):
|
|
45
|
+
): OrderDetailActionId[] {
|
|
46
46
|
const served = orderDetailHostActions(supportHref)
|
|
47
47
|
return actions.filter((action) => served.includes(action))
|
|
48
48
|
}
|
|
@@ -5,7 +5,7 @@ import { useRouter } from 'next/navigation'
|
|
|
5
5
|
import { AfterSalesFlow } from '@thorprovider/blocks'
|
|
6
6
|
import { OrderDetail as OrderDetailSurface } from '@thorprovider/blocks'
|
|
7
7
|
import type { AfterSalesCaseType, AfterSalesRequest, OrderDetailProps } from '@thorprovider/blocks'
|
|
8
|
-
import type {
|
|
8
|
+
import type { OrderDetailActionId, OrderDetailSnapshot, OrderDocument } from '@thorprovider/blocks/ports'
|
|
9
9
|
|
|
10
10
|
import { ports } from '../../ports'
|
|
11
11
|
import { reorderOrderAction } from '../../actions'
|
|
@@ -98,7 +98,7 @@ export function AccountOrderDetailPanel({ props }: PanelProps) {
|
|
|
98
98
|
router.push('/account/orders')
|
|
99
99
|
}, [router])
|
|
100
100
|
|
|
101
|
-
const onAction = async (action:
|
|
101
|
+
const onAction = async (action: OrderDetailActionId) => {
|
|
102
102
|
switch (action) {
|
|
103
103
|
case 'reorder': {
|
|
104
104
|
if (busy) return
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thorprovider/storefront",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.3",
|
|
4
4
|
"description": "Deterministic storefront scaffolder and installable OpenCode skill suite for Thor Commerce (Next.js, @thorprovider/blocks, @thorprovider/adapters, Medusa)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "bin/storefront.js",
|
package/scripts/candidate.mjs
CHANGED
|
@@ -433,10 +433,15 @@ export function verifyRegistryArtifact({
|
|
|
433
433
|
|
|
434
434
|
/**
|
|
435
435
|
* `npm publish` returns before every registry edge serves the artifacts. A
|
|
436
|
-
* mirror that is still replicating answers 404 for a version that exists, so
|
|
437
|
-
*
|
|
436
|
+
* mirror that is still replicating answers 404 for a version that exists, so a
|
|
437
|
+
* freshly published pin can look unpublished for a moment.
|
|
438
|
+
*
|
|
439
|
+
* This window stays short on purpose: `create` runs interactively, and a pin
|
|
440
|
+
* that is genuinely missing must fail in seconds, not minutes. The release gate
|
|
441
|
+
* does not rely on it — `scripts/release/wait-for-registry.mjs` holds the run
|
|
442
|
+
* until every pin resolves before acceptance starts.
|
|
438
443
|
*/
|
|
439
|
-
export const REGISTRY_RETRY = Object.freeze({ attempts:
|
|
444
|
+
export const REGISTRY_RETRY = Object.freeze({ attempts: 2, delayMs: 2000 })
|
|
440
445
|
|
|
441
446
|
const defaultSleep = (ms) => new Promise((done) => setTimeout(done, ms))
|
|
442
447
|
|