@vendure-platform/create 1.0.1 → 1.0.2-nightly.202610261747.151.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/README.md +1 -1
- package/dist/assets/storefront/package.json +1 -1
- package/dist/assets/storefront/src/app/[locale]/account/approvals/page.tsx +5 -7
- package/dist/assets/storefront/src/lib/approvals.ts +32 -0
- package/dist/assets/templates/AGENTS.md.hbs +1 -1
- package/dist/assets/templates/README.md.hbs +4 -4
- package/dist/assets/templates/bunfig.toml.hbs +4 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -174,7 +174,7 @@ See the [Quick Start](https://docs.vendure.io/vendure-platform/getting-started/q
|
|
|
174
174
|
## Sharp dependency
|
|
175
175
|
|
|
176
176
|
Fresh scaffolds declare `sharp` as a server dependency in every edition. The
|
|
177
|
-
pin matches Platform's `@vendure-platform/giftcards` and satisfies
|
|
177
|
+
pin matches Platform's `@vendure-platform/giftcards` and satisfies the Vendure Framework's
|
|
178
178
|
`@vendure/asset-server-plugin` range. This lets Bun and npm share one sharp
|
|
179
179
|
version across both consumers. Without the direct dependency, Bun can choose
|
|
180
180
|
a newer version for the asset server and keep the exact gift cards pin,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@radix-ui/react-toggle": "^1.1.10",
|
|
38
38
|
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
39
39
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
40
|
-
"@vendure-platform/storefront-client": "^1.0.1",
|
|
40
|
+
"@vendure-platform/storefront-client": "^1.0.2-nightly.202610261747.151.1",
|
|
41
41
|
"class-variance-authority": "^0.7.1",
|
|
42
42
|
"clsx": "^2.1.1",
|
|
43
43
|
"cmdk": "^1.1.1",
|
|
@@ -8,6 +8,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
|
|
8
8
|
import { ResultOf } from '@/graphql';
|
|
9
9
|
import { Link, redirect } from '@/i18n/navigation';
|
|
10
10
|
import { pinRootLocale } from '@/i18n/server';
|
|
11
|
+
import { splitApprovalRequests } from '@/lib/approvals';
|
|
11
12
|
import { formatDateTime } from '@/lib/format';
|
|
12
13
|
import { getActiveCustomer } from '@/lib/vendure/actions';
|
|
13
14
|
import { client } from '@/lib/vendure/api';
|
|
@@ -277,14 +278,11 @@ async function ApprovalsContent({ params }: { params: Promise<{ locale: string }
|
|
|
277
278
|
);
|
|
278
279
|
}
|
|
279
280
|
|
|
280
|
-
//
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
const pendingApprovals = allRequests.filter((r) =>
|
|
285
|
-
r.decisions?.some((d) => d.decision === 'PENDING' && d.customer?.id === activeCustomer.id),
|
|
281
|
+
// Pending: open requests where I still have a pending decision. Everything else is history.
|
|
282
|
+
const { pending: pendingApprovals, history: pastAndOther } = splitApprovalRequests(
|
|
283
|
+
allRequests,
|
|
284
|
+
activeCustomer.id,
|
|
286
285
|
);
|
|
287
|
-
const pastAndOther = allRequests.filter((r) => !pendingApprovals.includes(r));
|
|
288
286
|
|
|
289
287
|
// Only fetch order summaries for pending approvals (history rows don't need them)
|
|
290
288
|
const orderMap = await fetchOrderSummaries(pendingApprovals);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ResultOf } from '@/graphql';
|
|
2
|
+
import type { GetMyApprovalRequestsQuery } from '@/lib/vendure/queries';
|
|
3
|
+
|
|
4
|
+
type ApprovalRequest = NonNullable<
|
|
5
|
+
ResultOf<typeof GetMyApprovalRequestsQuery>['myApprovalRequests']
|
|
6
|
+
>['items'][number];
|
|
7
|
+
|
|
8
|
+
export type ApprovalRequestStatus = ApprovalRequest['status'];
|
|
9
|
+
export type ApprovalDecisionValue = ApprovalRequest['decisions'][number]['decision'];
|
|
10
|
+
|
|
11
|
+
interface ApprovalRequestLike {
|
|
12
|
+
status: ApprovalRequestStatus;
|
|
13
|
+
decisions?: Array<{ decision: ApprovalDecisionValue; customer?: { id: string } | null }> | null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Splits requests into those the customer can still decide and the rest.
|
|
18
|
+
* Mirrors `canDecide` in approval-workflows: the request is open (PENDING or IN_PROGRESS)
|
|
19
|
+
* and the customer has a PENDING decision. A resolved request can keep PENDING decisions
|
|
20
|
+
* that its workflow no longer reads, so the status check is required.
|
|
21
|
+
*/
|
|
22
|
+
export function splitApprovalRequests<T extends ApprovalRequestLike>(
|
|
23
|
+
requests: T[],
|
|
24
|
+
customerId: string,
|
|
25
|
+
): { pending: T[]; history: T[] } {
|
|
26
|
+
const pending = requests.filter(
|
|
27
|
+
(r) =>
|
|
28
|
+
(r.status === 'PENDING' || r.status === 'IN_PROGRESS') &&
|
|
29
|
+
r.decisions?.some((d) => d.decision === 'PENDING' && d.customer?.id === customerId),
|
|
30
|
+
);
|
|
31
|
+
return { pending, history: requests.filter((r) => !pending.includes(r)) };
|
|
32
|
+
}
|
|
@@ -38,7 +38,7 @@ docker compose up -d
|
|
|
38
38
|
Run `npx vendure dev` or `bunx vendure dev` from the workspace root or inside
|
|
39
39
|
`server/`. Both select the server project and its linked development credential.
|
|
40
40
|
From the root, `vendure dev --project server` selects the server explicitly.
|
|
41
|
-
|
|
41
|
+
The Vendure CLI loads the Platform CLI plugin from `server/package.json`.
|
|
42
42
|
|
|
43
43
|
## Production commands
|
|
44
44
|
|
|
@@ -31,14 +31,14 @@ The storefront will be available at `http://localhost:3001`.
|
|
|
31
31
|
Run `npx vendure dev` or `bunx vendure dev` from the workspace root or inside
|
|
32
32
|
`server/`. Both select the server project and its linked development credential.
|
|
33
33
|
From the root, `vendure dev --project server` selects the server explicitly.
|
|
34
|
-
|
|
34
|
+
The Vendure CLI loads the Platform CLI plugin from `server/package.json`.
|
|
35
35
|
Changes under `src/gql/` in the server project do not restart the server or worker.
|
|
36
36
|
|
|
37
37
|
## Updating packages
|
|
38
38
|
|
|
39
|
-
Update `@vendure/*` and `@vendure-platform/*` together.
|
|
39
|
+
Update `@vendure/*` and `@vendure-platform/*` together. Vendure Framework packages use an exact
|
|
40
40
|
version pin. Before an upgrade, set all existing `@vendure/*` entries in the root
|
|
41
|
-
and `server/package.json` to the same compatible
|
|
41
|
+
and `server/package.json` to the same compatible Vendure Framework build. Update both Vendure CLI
|
|
42
42
|
entries. Then run from the workspace root:
|
|
43
43
|
|
|
44
44
|
| Package manager | Command |
|
|
@@ -47,7 +47,7 @@ entries. Then run from the workspace root:
|
|
|
47
47
|
| Bun | `bun update --recursive` |
|
|
48
48
|
| pnpm | `pnpm --recursive --include-workspace-root update` |
|
|
49
49
|
|
|
50
|
-
A plain root `bun update` can update Platform release tags while keeping
|
|
50
|
+
A plain root `bun update` can update Platform release tags while keeping the Vendure Framework at
|
|
51
51
|
its locked server-workspace version. Review and commit the updated manifests and
|
|
52
52
|
lockfile together. See the [Platform upgrade guide](https://docs.vendure.io/vendure-platform/platform/upgrading)
|
|
53
53
|
for older scaffolds and verification steps.
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
# seconds ago. The default `0` is fine for most projects, but if you (or your
|
|
6
6
|
# org's global `~/.bunfig.toml`) sets it to e.g. `604800` (7 days), then
|
|
7
7
|
# `@vendure-platform/*` releases would be blocked for a week after each
|
|
8
|
-
# Vendure Platform ship. A Platform release can also pin a
|
|
8
|
+
# Vendure Platform ship. A Platform release can also pin a Vendure Framework release of
|
|
9
9
|
# the same day. The excludes list below bypasses the check for every
|
|
10
|
-
# Vendure Platform and Vendure
|
|
10
|
+
# Vendure Platform and Vendure Framework package this scaffold consumes
|
|
11
11
|
# (directly or transitively), so a fresh `bun install` works immediately
|
|
12
|
-
# after a release.
|
|
12
|
+
# after a release. Vendure Framework means `@vendure/*` plus the `@vendure-io/*`
|
|
13
13
|
# packages of the Dashboard. Bun 1.4.2 matches each entry by exact package
|
|
14
|
-
# name and does not expand `@vendure/*`, so add a new
|
|
14
|
+
# name and does not expand `@vendure/*`, so add a new Vendure Framework package here by
|
|
15
15
|
# name. The age rule still applies to every other package.
|
|
16
16
|
#
|
|
17
17
|
# See https://bun.com/docs/runtime/bunfig#install-minimumreleaseage
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure-platform/create",
|
|
3
|
-
"version": "1.0.1",
|
|
3
|
+
"version": "1.0.2-nightly.202610261747.151.1",
|
|
4
4
|
"description": "CLI tool to scaffold a Vendure demo project with Vendure Platform plugins",
|
|
5
5
|
"vendurePlugin": {
|
|
6
6
|
"slug": "create",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@clack/prompts": "^0.10.0",
|
|
52
52
|
"@vendure/cli": "3.8.0",
|
|
53
|
-
"@vendure-platform/console-auth": "1.0.1",
|
|
54
|
-
"@vendure-platform/plugin-meta": "1.0.1",
|
|
53
|
+
"@vendure-platform/console-auth": "1.0.2-nightly.202610261747.151.1",
|
|
54
|
+
"@vendure-platform/plugin-meta": "1.0.2-nightly.202610261747.151.1",
|
|
55
55
|
"commander": "^13.1.0",
|
|
56
56
|
"fs-extra": "^11.3.0",
|
|
57
57
|
"handlebars": "^4.7.8",
|