@propeller-commerce/create-propeller-shop 0.5.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/dist/bin/create-propeller-shop.js +733 -0
- package/dist/bin/create-propeller-shop.js.map +1 -0
- package/dist/bin/propeller.js +203 -0
- package/dist/bin/propeller.js.map +1 -0
- package/dist/chunk-UMI3HB67.js +129 -0
- package/dist/chunk-UMI3HB67.js.map +1 -0
- package/package.json +50 -0
- package/templates/shop-next/b2c-trim.json +11 -0
- package/templates/shop-next/overlay/README.template.md +86 -0
- package/templates/shop-next/overlay/package.patch.json +9 -0
- package/templates/shop-next/template.json +11 -0
- package/templates/shop-nuxt/b2c-trim.json +11 -0
- package/templates/shop-nuxt/overlay/README.template.md +98 -0
- package/templates/shop-nuxt/overlay/package.patch.json +9 -0
- package/templates/shop-nuxt/template.json +11 -0
- package/templates/shop-vue/b2c-trim.json +11 -0
- package/templates/shop-vue/overlay/README.template.md +83 -0
- package/templates/shop-vue/overlay/package.patch.json +9 -0
- package/templates/shop-vue/template.json +11 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# {{shopName}}
|
|
2
|
+
|
|
3
|
+
Scaffolded with [`create-propeller-shop`](https://github.com/propeller-commerce/propeller-v2-accelerator) at template version `{{templateVersion}}`.
|
|
4
|
+
|
|
5
|
+
| Setting | Value |
|
|
6
|
+
|----------------|-------------------|
|
|
7
|
+
| Stack | Next.js (React) |
|
|
8
|
+
| Shop mode | `{{shopMode}}` |
|
|
9
|
+
| Portal mode | `{{portalMode}}` |
|
|
10
|
+
| Default locale | `{{defaultLocale}}` |
|
|
11
|
+
| Currency | `{{currency}}` (`{{currencyCode}}`) |
|
|
12
|
+
| CMS adapter | `{{cmsAdapterDisplay}}` |
|
|
13
|
+
|
|
14
|
+
## Getting started
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cp .env.example .env.local # fill in API URL + AUTH_SECRET
|
|
18
|
+
npm install
|
|
19
|
+
npm run dev # http://localhost:3000
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Run `npm run doctor` after every dependency bump to confirm `propeller.json` still matches what's installed.
|
|
23
|
+
|
|
24
|
+
## Directory layout
|
|
25
|
+
|
|
26
|
+
This shop is the **frontend** half of a two-tree deployment:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
{{shopName}}/
|
|
30
|
+
frontend/ # ← you are here
|
|
31
|
+
cms/ # CMS backend (Strapi / Propeller-CMS), installed separately
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The CMS install instructions live in `../cms/README.md`.
|
|
35
|
+
|
|
36
|
+
## Mode-specific surface
|
|
37
|
+
|
|
38
|
+
{{#if isB2B}}
|
|
39
|
+
This shop is B2B-only:
|
|
40
|
+
|
|
41
|
+
- Register form forces `Contact` registration (no picker shown).
|
|
42
|
+
- `/account/quotes`, `/account/quote-requests`, `/account/authorization-requests`, `/account/authorization-settings`, `/account/price-requests` are present and accessible.
|
|
43
|
+
- Company switcher is visible in the header for logged-in Contacts.
|
|
44
|
+
{{/if}}
|
|
45
|
+
{{#if isB2C}}
|
|
46
|
+
This shop is B2C-only:
|
|
47
|
+
|
|
48
|
+
- Register form forces `Customer` registration (no picker shown).
|
|
49
|
+
- The B2B-only routes (`/account/quotes`, etc.) are **not scaffolded** — requests return Next's default 404.
|
|
50
|
+
- No company switcher.
|
|
51
|
+
{{/if}}
|
|
52
|
+
{{#if isHybrid}}
|
|
53
|
+
This shop is **hybrid** (B2B + B2C in one deployment):
|
|
54
|
+
|
|
55
|
+
- Register form shows the Contact / Customer picker.
|
|
56
|
+
- The B2B-only routes are scaffolded and gated at runtime: a `Customer` hitting `/account/quotes` gets a 404. A `Contact` sees them.
|
|
57
|
+
- Company switcher renders for logged-in Contacts; hidden for Customers.
|
|
58
|
+
{{/if}}
|
|
59
|
+
|
|
60
|
+
## CMS
|
|
61
|
+
|
|
62
|
+
{{#if cmsAdapter}}
|
|
63
|
+
This shop is configured to use the **`{{cmsAdapter}}`** CMS adapter. The home page and any `/<slug>` route fetches a `CmsPage` from the adapter and renders its blocks. If the adapter returns null, the home page falls back to the built-in `<HomeFallback>` component and other slugs return 404.
|
|
64
|
+
|
|
65
|
+
The adapter package itself is not yet pinned in `package.json` — install it manually:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# strapi adapter (or substitute the propeller-cms one)
|
|
69
|
+
npm install --install-links file:../../propeller-v2-accelerator/packages/cms-adapter-{{cmsAdapter}}
|
|
70
|
+
# once published to npm:
|
|
71
|
+
# npm install propeller-v2-cms-adapter-{{cmsAdapter}}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Then set `CMS_URL` (+ optional `CMS_TOKEN`) in `.env.local`.
|
|
75
|
+
{{else}}
|
|
76
|
+
This shop was scaffolded **without a CMS adapter**. The home page renders the built-in `<HomeFallback>` component and any `/<slug>` route returns 404 unless you add a static page yourself.
|
|
77
|
+
|
|
78
|
+
To add a CMS later: install `propeller-v2-cms-adapter-strapi` (or another adapter), set `cms.adapter` in `propeller.json`, set `CMS_URL` in `.env.local`, then run `npm run doctor` to verify.
|
|
79
|
+
{{/if}}
|
|
80
|
+
|
|
81
|
+
## Upgrade path
|
|
82
|
+
|
|
83
|
+
This shop owns its code outright after scaffolding. To pull in new template
|
|
84
|
+
fixes, see `propeller upgrade` (Phase B — sketched, not yet shipped). Any
|
|
85
|
+
file you've modified that you want protected from future upgrades should be
|
|
86
|
+
listed in `propeller.json -> customisations.ejected`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "propeller-shop-template-next",
|
|
3
|
+
"stack": "next",
|
|
4
|
+
"version": "0.2.0",
|
|
5
|
+
"description": "Next 16 + React shop template for Propeller Commerce.",
|
|
6
|
+
"propellerCompat": {
|
|
7
|
+
"propeller-v2-react-ui": ">=0.2.0",
|
|
8
|
+
"propeller-v2-core-ui": ">=0.2.0",
|
|
9
|
+
"propeller-v2-cms-react": ">=0.1.0"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Paths (relative to the scaffolded frontend/) to delete when mode === 'b2c'. Nuxt's file-based routing auto-detects routes from the pages tree, so deleting the file is enough — no router patch needed.",
|
|
3
|
+
"remove": [
|
|
4
|
+
"app/pages/account/authorization-requests.vue",
|
|
5
|
+
"app/pages/account/authorization-settings.vue",
|
|
6
|
+
"app/pages/account/price-requests.vue",
|
|
7
|
+
"app/pages/account/quote-requests",
|
|
8
|
+
"app/pages/account/quotes",
|
|
9
|
+
"app/pages/authorization-request-sent"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# {{shopName}}
|
|
2
|
+
|
|
3
|
+
Scaffolded with [`create-propeller-shop`](https://github.com/propeller-commerce/propeller-v2-accelerator) at template version `{{templateVersion}}`.
|
|
4
|
+
|
|
5
|
+
| Setting | Value |
|
|
6
|
+
|----------------|-------------------|
|
|
7
|
+
| Stack | Nuxt 3 (SSR) |
|
|
8
|
+
| Shop mode | `{{shopMode}}` |
|
|
9
|
+
| Portal mode | `{{portalMode}}` |
|
|
10
|
+
| Default locale | `{{defaultLocale}}` |
|
|
11
|
+
| Currency | `{{currency}}` (`{{currencyCode}}`) |
|
|
12
|
+
| CMS adapter | `{{cmsAdapterDisplay}}` |
|
|
13
|
+
|
|
14
|
+
## Getting started
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cp .env.example .env # fill in the backend endpoint + API keys
|
|
18
|
+
npm install
|
|
19
|
+
npm run dev # http://localhost:3000
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Run `npm run doctor` after every dependency bump to confirm `propeller.json` still matches what's installed.
|
|
23
|
+
|
|
24
|
+
## Directory layout
|
|
25
|
+
|
|
26
|
+
This shop is the **frontend** half of a two-tree deployment:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
{{shopName}}/
|
|
30
|
+
frontend/ # ← you are here
|
|
31
|
+
cms/ # CMS backend (Strapi / Propeller-CMS), installed separately
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The CMS install instructions live in `../cms/README.md`.
|
|
35
|
+
|
|
36
|
+
## Architecture
|
|
37
|
+
|
|
38
|
+
This is a **Nuxt 3 SSR consumer** of the `propeller-v2-vue-ui` Vue component package. The same package powers the SPA-only `propeller-vue` consumer; the Nuxt build adds server-side rendering, hybrid islands, and a Nitro-backed anonymous data cache.
|
|
39
|
+
|
|
40
|
+
- **Tier 1 (per-request) wiring**: `app/plugins/propeller.ts` installs the `propellerVue` plugin with a per-request `GraphQLClient` (server uses `securityMode: 'direct'` with the API key; client uses `securityMode: 'proxy'` against `/api/graphql` so secrets never reach the browser).
|
|
41
|
+
- **Tier 2 (per-scope) wiring**: `app/app.vue` renders `<PropellerProvider>` with reactive `user`, `companyId`, `language`, `includeTax`, `portalMode` props derived from Pinia stores. Components read from this provider via `useInfraProps`, with explicit prop overrides taking precedence.
|
|
42
|
+
- **Hybrid SSR catalog pages**: `category/[id]/[slug]`, `cluster/[clusterId]/[slug]`, `product/[productId]/[slug]`, `search` each call `useFetch('/api/catalog/...')` server-side and hydrate the interactive grid/filters/toolbar client-side inside `<ClientOnly>` (the package's interactive components aren't designed for server-only render).
|
|
43
|
+
- **Anonymous data cache**: `server/utils/cache.ts:cachedSdkFetch` wraps Nitro's `useStorage('cache')` with per-entity tags (`product:42`, `category:13`, `catalog` umbrella). Authenticated requests bypass via the cookie read in `getServerInfra()`. `POST /api/revalidate` (secret-gated) busts by tag.
|
|
44
|
+
|
|
45
|
+
## Mode-specific surface
|
|
46
|
+
|
|
47
|
+
{{#if isB2B}}
|
|
48
|
+
This shop is B2B-only:
|
|
49
|
+
|
|
50
|
+
- Register form forces `Contact` registration (no picker shown).
|
|
51
|
+
- `/account/quotes`, `/account/quote-requests`, `/account/authorization-requests`, `/account/authorization-settings`, `/account/price-requests` are present and accessible.
|
|
52
|
+
- Company switcher is visible in the header for logged-in Contacts.
|
|
53
|
+
{{/if}}
|
|
54
|
+
{{#if isB2C}}
|
|
55
|
+
This shop is B2C-only:
|
|
56
|
+
|
|
57
|
+
- Register form forces `Customer` registration (no picker shown).
|
|
58
|
+
- The B2B-only routes (`/account/quotes`, etc.) are **not present** — pages return Nuxt's 404 view.
|
|
59
|
+
- No company switcher.
|
|
60
|
+
{{/if}}
|
|
61
|
+
{{#if isHybrid}}
|
|
62
|
+
This shop is **hybrid** (B2B + B2C in one deployment):
|
|
63
|
+
|
|
64
|
+
- Register form shows the Contact / Customer picker.
|
|
65
|
+
- The B2B-only routes are present and gated at runtime: a `Customer` hitting `/account/quotes` is redirected by `requireUserMode`. A `Contact` sees them.
|
|
66
|
+
- Company switcher renders for logged-in Contacts; hidden for Customers.
|
|
67
|
+
{{/if}}
|
|
68
|
+
|
|
69
|
+
## CMS
|
|
70
|
+
|
|
71
|
+
{{#if cmsAdapter}}
|
|
72
|
+
This shop is configured to use the **`{{cmsAdapter}}`** CMS adapter. The home page and any `/<slug>` route fetches a `CmsPage` from the adapter and renders its blocks. If the adapter returns null, the home page falls back to the built-in static homepage and other slugs return 404.
|
|
73
|
+
|
|
74
|
+
The adapter package itself is not yet pinned in `package.json` — install it manually:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npm install --install-links file:../../propeller-v2-accelerator/packages/cms-adapter-{{cmsAdapter}}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Then set `CMS_URL` (+ optional `CMS_TOKEN`) in `.env`.
|
|
81
|
+
{{else}}
|
|
82
|
+
This shop was scaffolded **without a CMS adapter**. The home page renders the built-in static layout and any `/<slug>` route returns 404 unless you add a static route yourself.
|
|
83
|
+
|
|
84
|
+
To add a CMS later: install `propeller-v2-cms-adapter-strapi` (or another adapter), set `cms.adapter` in `propeller.json`, set `CMS_URL` in `.env`, then run `npm run doctor` to verify.
|
|
85
|
+
{{/if}}
|
|
86
|
+
|
|
87
|
+
## Caching contract
|
|
88
|
+
|
|
89
|
+
Anonymous catalog GraphQL fetches go through `server/utils/cache.ts:cachedSdkFetch` with per-entity tags from `server/utils/tags.ts`. TTL is `ANONYMOUS_CACHE_TTL_SECONDS = 300`. Logged-in users bypass via the cookie read in `getServerInfra()`. `POST /api/revalidate` with header `x-revalidate-secret: $REVALIDATE_SECRET` and body `{ "tag": "..." }` busts by tag; `{ "tag": "*" }` wipes everything under the `catalog` umbrella.
|
|
90
|
+
|
|
91
|
+
The cache key (`stableStringify(vars)`) depends on **stable variable order** in the `build…Input` blocks of `server/utils/fetchers.ts`. Don't reorder casually — Nitro hashes the request shape byte-for-byte.
|
|
92
|
+
|
|
93
|
+
## Upgrade path
|
|
94
|
+
|
|
95
|
+
This shop owns its code outright after scaffolding. To pull in new template
|
|
96
|
+
fixes, see `propeller upgrade` (Phase B — sketched, not yet shipped). Any
|
|
97
|
+
file you've modified that you want protected from future upgrades should be
|
|
98
|
+
listed in `propeller.json -> customisations.ejected`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "propeller-shop-template-nuxt",
|
|
3
|
+
"stack": "nuxt",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "Nuxt 3 SSR shop template for Propeller Commerce.",
|
|
6
|
+
"propellerCompat": {
|
|
7
|
+
"propeller-v2-vue-ui": ">=0.3.0",
|
|
8
|
+
"propeller-v2-core-ui": ">=0.2.0",
|
|
9
|
+
"propeller-v2-cms-vue": ">=0.1.0"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Paths (relative to the scaffolded frontend/) to delete when mode === 'b2c'. The boilerplate ships every view by default; b2c shops trim the b2b-only ones. NOTE: trimming a view file leaves the router still importing it — the templated src/router/index.template.ts (if any) or a router patch must drop the matching routes for the b2c build to compile. For now propeller-vue routes are folder-imported, so deletion alone is enough.",
|
|
3
|
+
"remove": [
|
|
4
|
+
"src/views/account/AuthorizationRequestsView.vue",
|
|
5
|
+
"src/views/account/AuthorizationSettingsView.vue",
|
|
6
|
+
"src/views/account/PriceRequestsView.vue",
|
|
7
|
+
"src/views/account/QuoteRequestsView.vue",
|
|
8
|
+
"src/views/account/QuotesView.vue",
|
|
9
|
+
"src/views/account/QuoteDetailView.vue"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# {{shopName}}
|
|
2
|
+
|
|
3
|
+
Scaffolded with [`create-propeller-shop`](https://github.com/propeller-commerce/propeller-v2-accelerator) at template version `{{templateVersion}}`.
|
|
4
|
+
|
|
5
|
+
| Setting | Value |
|
|
6
|
+
|----------------|-------------------|
|
|
7
|
+
| Stack | Vue 3 + Vite SSR |
|
|
8
|
+
| Shop mode | `{{shopMode}}` |
|
|
9
|
+
| Portal mode | `{{portalMode}}` |
|
|
10
|
+
| Default locale | `{{defaultLocale}}` |
|
|
11
|
+
| Currency | `{{currency}}` (`{{currencyCode}}`) |
|
|
12
|
+
| CMS adapter | `{{cmsAdapterDisplay}}` |
|
|
13
|
+
|
|
14
|
+
## Getting started
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cp .env.example .env.local # fill in API URL + AUTH_SECRET
|
|
18
|
+
npm install
|
|
19
|
+
npm run dev # http://localhost:5173
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Run `npm run doctor` after every dependency bump to confirm `propeller.json` still matches what's installed.
|
|
23
|
+
|
|
24
|
+
## Directory layout
|
|
25
|
+
|
|
26
|
+
This shop is the **frontend** half of a two-tree deployment:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
{{shopName}}/
|
|
30
|
+
frontend/ # ← you are here
|
|
31
|
+
cms/ # CMS backend (Strapi / Propeller-CMS), installed separately
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The CMS install instructions live in `../cms/README.md`.
|
|
35
|
+
|
|
36
|
+
## Mode-specific surface
|
|
37
|
+
|
|
38
|
+
{{#if isB2B}}
|
|
39
|
+
This shop is B2B-only:
|
|
40
|
+
|
|
41
|
+
- Register form forces `Contact` registration (no picker shown).
|
|
42
|
+
- `/account/quotes`, `/account/quote-requests`, `/account/authorization-requests`, `/account/authorization-settings`, `/account/price-requests` are present and accessible.
|
|
43
|
+
- Company switcher is visible in the header for logged-in Contacts.
|
|
44
|
+
{{/if}}
|
|
45
|
+
{{#if isB2C}}
|
|
46
|
+
This shop is B2C-only:
|
|
47
|
+
|
|
48
|
+
- Register form forces `Customer` registration (no picker shown).
|
|
49
|
+
- The B2B-only routes (`/account/quotes`, etc.) are **not registered** in the router — requests return Vue Router's `not-found` view.
|
|
50
|
+
- No company switcher.
|
|
51
|
+
{{/if}}
|
|
52
|
+
{{#if isHybrid}}
|
|
53
|
+
This shop is **hybrid** (B2B + B2C in one deployment):
|
|
54
|
+
|
|
55
|
+
- Register form shows the Contact / Customer picker.
|
|
56
|
+
- The B2B-only routes are registered and gated at runtime: a `Customer` hitting `/account/quotes` is redirected to the 404 view by `requireUserMode`. A `Contact` sees them.
|
|
57
|
+
- Company switcher renders for logged-in Contacts; hidden for Customers.
|
|
58
|
+
{{/if}}
|
|
59
|
+
|
|
60
|
+
## CMS
|
|
61
|
+
|
|
62
|
+
{{#if cmsAdapter}}
|
|
63
|
+
This shop is configured to use the **`{{cmsAdapter}}`** CMS adapter. The home page and any `/<slug>` route fetches a `CmsPage` from the adapter and renders its blocks. If the adapter returns null, the home page falls back to the built-in static homepage and other slugs return 404.
|
|
64
|
+
|
|
65
|
+
The adapter package itself is not yet pinned in `package.json` — install it manually:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm install --install-links file:../../propeller-v2-accelerator/packages/cms-adapter-{{cmsAdapter}}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Then set `CMS_URL` (+ optional `CMS_TOKEN`) in `.env.local`.
|
|
72
|
+
{{else}}
|
|
73
|
+
This shop was scaffolded **without a CMS adapter**. The home page renders the built-in static layout and any `/<slug>` route returns 404 unless you add a static route yourself.
|
|
74
|
+
|
|
75
|
+
To add a CMS later: install `propeller-v2-cms-adapter-strapi` (or another adapter), set `cms.adapter` in `propeller.json`, set `CMS_URL` in `.env.local`, then run `npm run doctor` to verify.
|
|
76
|
+
{{/if}}
|
|
77
|
+
|
|
78
|
+
## Upgrade path
|
|
79
|
+
|
|
80
|
+
This shop owns its code outright after scaffolding. To pull in new template
|
|
81
|
+
fixes, see `propeller upgrade` (Phase B — sketched, not yet shipped). Any
|
|
82
|
+
file you've modified that you want protected from future upgrades should be
|
|
83
|
+
listed in `propeller.json -> customisations.ejected`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "propeller-shop-template-vue",
|
|
3
|
+
"stack": "vue",
|
|
4
|
+
"version": "0.3.0",
|
|
5
|
+
"description": "Vue 3 + Vite SSR shop template for Propeller Commerce.",
|
|
6
|
+
"propellerCompat": {
|
|
7
|
+
"propeller-v2-vue-ui": ">=0.2.0",
|
|
8
|
+
"propeller-v2-core-ui": ">=0.2.0",
|
|
9
|
+
"propeller-v2-cms-vue": ">=0.1.0"
|
|
10
|
+
}
|
|
11
|
+
}
|