@vendure-platform/create 0.1.0 → 0.2.1-nightly.202605190703
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 +37 -27
- package/dist/assets/storefront/.env.example +14 -14
- package/dist/assets/storefront/messages/de.json +2 -3
- package/dist/assets/storefront/messages/en.json +2 -3
- package/dist/assets/storefront/next.config.ts +22 -21
- package/dist/assets/storefront/package.json +75 -75
- package/dist/assets/storefront/public/scenarios/customer/logo.svg +4 -0
- package/dist/assets/storefront/src/app/[locale]/layout.tsx +0 -4
- package/dist/assets/storefront/src/app/[locale]/sign-in/login-form.tsx +70 -102
- package/dist/assets/storefront/src/app/[locale]/sign-in/page.tsx +2 -3
- package/dist/assets/storefront/src/config/scenario-meta.ts +3 -7
- package/dist/assets/storefront/src/config/scenario.ts +14 -30
- package/dist/assets/storefront/src/graphql-env.d.ts +456 -0
- package/dist/assets/storefront/src/scenarios/customer/branding.ts +142 -0
- package/dist/assets/storefront/src/scenarios/customer/hero.tsx +76 -0
- package/dist/assets/storefront/src/scenarios/{default → customer}/index.ts +3 -3
- package/dist/assets/storefront/src/scenarios/{default → customer}/meta.ts +1 -1
- package/dist/assets/storefront/src/schema.graphql +5852 -0
- package/dist/assets/storefront/tsconfig.json +17 -8
- package/dist/assets/templates/README.md.hbs +1 -1
- package/dist/assets/templates/docker-compose.yml.hbs +0 -4
- package/dist/assets/templates/env.hbs +13 -7
- package/dist/assets/templates/environment.d.ts.hbs +1 -5
- package/dist/assets/templates/npmrc.hbs +1 -1
- package/dist/assets/templates/populate.ts.hbs +17 -0
- package/dist/assets/templates/server-package.json.hbs +3 -2
- package/dist/bin/run.js +17 -3
- package/dist/bin/run.js.map +1 -1
- package/dist/cli.d.ts +6 -1
- package/dist/cli.js +147 -25
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/plugin-registry.d.ts +43 -6
- package/dist/plugin-registry.js +139 -421
- package/dist/plugin-registry.js.map +1 -1
- package/dist/registry.d.ts +18 -0
- package/dist/registry.js +29 -0
- package/dist/registry.js.map +1 -0
- package/dist/scaffold-shared.d.ts +19 -0
- package/dist/scaffold-shared.js +114 -0
- package/dist/scaffold-shared.js.map +1 -0
- package/dist/scaffold-storefront-only.d.ts +6 -0
- package/dist/scaffold-storefront-only.js +101 -0
- package/dist/scaffold-storefront-only.js.map +1 -0
- package/dist/scaffolder.js +22 -42
- package/dist/scaffolder.js.map +1 -1
- package/dist/storefront-copier.d.ts +26 -3
- package/dist/storefront-copier.js +63 -12
- package/dist/storefront-copier.js.map +1 -1
- package/dist/template-renderer.d.ts +24 -7
- package/dist/template-renderer.js +32 -64
- package/dist/template-renderer.js.map +1 -1
- package/dist/types.d.ts +46 -27
- package/package.json +3 -1
- package/dist/assets/storefront/.env.local +0 -1
- package/dist/assets/storefront/public/scenarios/b2b-wholesale/hero/hero-bg.webp +0 -0
- package/dist/assets/storefront/public/scenarios/b2b-wholesale/logo.svg +0 -4
- package/dist/assets/storefront/public/scenarios/default/logo.svg +0 -4
- package/dist/assets/storefront/public/scenarios/kaminpro/hero/hero-bg.webp +0 -0
- package/dist/assets/storefront/public/scenarios/kaminpro/logo.svg +0 -7
- package/dist/assets/storefront/src/components/shared/scenario-paused.tsx +0 -80
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/branding.ts +0 -180
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/hero.tsx +0 -122
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/index.ts +0 -21
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/meta.ts +0 -3
- package/dist/assets/storefront/src/scenarios/default/branding.ts +0 -148
- package/dist/assets/storefront/src/scenarios/default/hero.tsx +0 -107
- package/dist/assets/storefront/src/scenarios/kaminpro/auth-gate.tsx +0 -36
- package/dist/assets/storefront/src/scenarios/kaminpro/branding.ts +0 -238
- package/dist/assets/storefront/src/scenarios/kaminpro/cart-items.tsx +0 -359
- package/dist/assets/storefront/src/scenarios/kaminpro/hero.tsx +0 -123
- package/dist/assets/storefront/src/scenarios/kaminpro/index.ts +0 -50
- package/dist/assets/storefront/src/scenarios/kaminpro/meta.ts +0 -9
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/banners.tsx +0 -21
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/bom-basket.tsx +0 -221
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/btn.tsx +0 -38
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/chip.tsx +0 -35
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/config-header.tsx +0 -72
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/field-row.tsx +0 -126
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/info-dot.tsx +0 -38
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/login-notice.tsx +0 -81
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/module-panel.tsx +0 -144
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/quote-dialog.tsx +0 -110
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/schematic.tsx +0 -674
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/why-panel.tsx +0 -66
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/configurator-pdp.tsx +0 -43
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/configurator-shell.tsx +0 -320
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/lib/data.ts +0 -150
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/lib/types.ts +0 -30
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/styles.css +0 -104
- package/dist/assets/storefront/src/scenarios/kaminpro/shop-by-system.tsx +0 -97
- package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/decision-tree.ts +0 -261
- package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/page.tsx +0 -21
- package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/wizard.tsx +0 -600
- package/dist/assets/storefront/src/schema.graphql.placeholder +0 -5
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "ES2017",
|
|
4
|
-
"lib": [
|
|
4
|
+
"lib": [
|
|
5
|
+
"dom",
|
|
6
|
+
"dom.iterable",
|
|
7
|
+
"esnext"
|
|
8
|
+
],
|
|
5
9
|
"allowJs": true,
|
|
6
10
|
"skipLibCheck": true,
|
|
7
11
|
"strict": true,
|
|
@@ -24,14 +28,19 @@
|
|
|
24
28
|
}
|
|
25
29
|
],
|
|
26
30
|
"paths": {
|
|
27
|
-
"@/*": [
|
|
31
|
+
"@/*": [
|
|
32
|
+
"./src/*"
|
|
33
|
+
]
|
|
28
34
|
}
|
|
29
35
|
},
|
|
30
|
-
"include": [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
"include": [
|
|
37
|
+
"next-env.d.ts",
|
|
38
|
+
"**/*.ts",
|
|
39
|
+
"**/*.tsx",
|
|
40
|
+
".next/types/**/*.ts",
|
|
41
|
+
".next/dev/types/**/*.ts"
|
|
42
|
+
],
|
|
43
|
+
"exclude": [
|
|
44
|
+
"node_modules"
|
|
36
45
|
]
|
|
37
46
|
}
|
|
@@ -5,7 +5,7 @@ A Vendure e-commerce demo project for **{{companyName}}**, scaffolded with `@ven
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
7
|
- Node.js >= 22
|
|
8
|
-
- Docker & Docker Compose (for PostgreSQL
|
|
8
|
+
- Docker & Docker Compose (for PostgreSQL and Typesense)
|
|
9
9
|
|
|
10
10
|
## Setup
|
|
11
11
|
|
|
@@ -10,7 +10,6 @@ services:
|
|
|
10
10
|
volumes:
|
|
11
11
|
- postgres-data:/var/lib/postgresql/data
|
|
12
12
|
|
|
13
|
-
{{#ifPlugin "advanced-search"}}
|
|
14
13
|
typesense:
|
|
15
14
|
image: typesense/typesense:28.0
|
|
16
15
|
environment:
|
|
@@ -21,9 +20,6 @@ services:
|
|
|
21
20
|
volumes:
|
|
22
21
|
- typesense-data:/data
|
|
23
22
|
|
|
24
|
-
{{/ifPlugin}}
|
|
25
23
|
volumes:
|
|
26
24
|
postgres-data:
|
|
27
|
-
{{#ifPlugin "advanced-search"}}
|
|
28
25
|
typesense-data:
|
|
29
|
-
{{/ifPlugin}}
|
|
@@ -13,25 +13,31 @@ COOKIE_SECRET=change-me-in-production
|
|
|
13
13
|
SUPERADMIN_USERNAME=superadmin
|
|
14
14
|
SUPERADMIN_PASSWORD=superadmin
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
# Vendure Platform License
|
|
17
|
+
# Get a token from the Enterprise Portal: https://enterprise.vendure.io
|
|
18
|
+
# Leave VENDURE_PLATFORM_LICENSE_TOKEN empty for local development; the
|
|
19
|
+
# VENDURE_PLATFORM_LICENSE_GUARD_LOCAL_DEV=1 flag below enables the no-token
|
|
20
|
+
# soft mode that lets you populate, run dev, and explore the platform without
|
|
21
|
+
# enforcement. The flag is only ever read when no token is configured — once
|
|
22
|
+
# you set a real token, the soft-mode code path is no longer reachable.
|
|
23
|
+
VENDURE_PLATFORM_LICENSE_TOKEN=
|
|
24
|
+
VENDURE_PLATFORM_LICENSE_GUARD_LOCAL_DEV=1
|
|
25
|
+
|
|
17
26
|
# Advanced Search (Typesense)
|
|
18
27
|
TYPESENSE_API_KEY=your-typesense-api-key
|
|
19
28
|
TYPESENSE_HOST=localhost
|
|
20
29
|
TYPESENSE_PORT=8110
|
|
21
30
|
TYPESENSE_PROTOCOL=http
|
|
22
31
|
|
|
23
|
-
|
|
32
|
+
# Workflow Engine
|
|
33
|
+
WORKFLOW_ENGINE_SCHEMA=dbos
|
|
34
|
+
|
|
24
35
|
{{#ifPlugin "sso"}}
|
|
25
36
|
# SSO (Google OIDC)
|
|
26
37
|
GOOGLE_CLIENT_ID=
|
|
27
38
|
GOOGLE_CLIENT_SECRET=
|
|
28
39
|
VENDURE_HOST=http://localhost:3500
|
|
29
40
|
|
|
30
|
-
{{/ifPlugin}}
|
|
31
|
-
{{#ifPlugin "workflow-engine"}}
|
|
32
|
-
# Workflow Engine
|
|
33
|
-
WORKFLOW_ENGINE_SCHEMA=dbos
|
|
34
|
-
|
|
35
41
|
{{/ifPlugin}}
|
|
36
42
|
{{#ifPlugin "audit-trail"}}
|
|
37
43
|
# Audit Trail
|
|
@@ -11,20 +11,16 @@ declare namespace NodeJS {
|
|
|
11
11
|
COOKIE_SECRET?: string;
|
|
12
12
|
SUPERADMIN_USERNAME?: string;
|
|
13
13
|
SUPERADMIN_PASSWORD?: string;
|
|
14
|
-
{{#ifPlugin "advanced-search"}}
|
|
15
14
|
TYPESENSE_API_KEY?: string;
|
|
16
15
|
TYPESENSE_HOST?: string;
|
|
17
16
|
TYPESENSE_PORT?: string;
|
|
18
17
|
TYPESENSE_PROTOCOL?: string;
|
|
19
|
-
|
|
18
|
+
WORKFLOW_ENGINE_SCHEMA?: string;
|
|
20
19
|
{{#ifPlugin "sso"}}
|
|
21
20
|
GOOGLE_CLIENT_ID?: string;
|
|
22
21
|
GOOGLE_CLIENT_SECRET?: string;
|
|
23
22
|
VENDURE_HOST?: string;
|
|
24
23
|
{{/ifPlugin}}
|
|
25
|
-
{{#ifPlugin "workflow-engine"}}
|
|
26
|
-
WORKFLOW_ENGINE_SCHEMA?: string;
|
|
27
|
-
{{/ifPlugin}}
|
|
28
24
|
{{#ifPlugin "audit-trail"}}
|
|
29
25
|
AUDIT_LOG_SCHEMA?: string;
|
|
30
26
|
{{/ifPlugin}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
@vendure-platform:registry={{registryUrl}}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
runPopulators,
|
|
8
8
|
DataPopulator,
|
|
9
9
|
} from '@vendure-platform/data-populator';
|
|
10
|
+
import { bootstrap } from '@vendure-platform/platform';
|
|
10
11
|
import { defaultScenario } from '@vendure-platform/scenario-default';
|
|
11
12
|
import { customPopulator } from './custom-populate';
|
|
12
13
|
import { config } from './vendure-config';
|
|
@@ -21,6 +22,22 @@ runPopulators({
|
|
|
21
22
|
schemas: ['audit_trail'],
|
|
22
23
|
{{/ifPlugin}}
|
|
23
24
|
checkCoreDataExists,
|
|
25
|
+
// Use Vendure Platform's bootstrap (not @vendure/core's) so platform
|
|
26
|
+
// plugins initialise correctly during population.
|
|
27
|
+
//
|
|
28
|
+
// If you enable the DBOS-backed job queue (`WorkflowEnginePlugin.init({
|
|
29
|
+
// enableJobQueue: true })`), wrap this with `JobQueueService.start()`
|
|
30
|
+
// and call `drainJobQueue(app)` in `afterAll` so populate-time jobs
|
|
31
|
+
// (search reindex, collection filters) are dispatched in this process
|
|
32
|
+
// rather than left for later recovery. To avoid hammering Typesense
|
|
33
|
+
// with hundreds of per-variant update jobs while populators run, also
|
|
34
|
+
// set `advancedSearch.bufferUpdates` to `true` for the populate
|
|
35
|
+
// process only (e.g. `bufferUpdates: process.argv[1]?.endsWith(
|
|
36
|
+
// 'populate.js')`) and flush via `app.get(SearchJobBufferService)
|
|
37
|
+
// .runPendingSearchUpdates()` in `afterAll` (after any explicit
|
|
38
|
+
// reindex). Buffering at runtime would defer search visibility of
|
|
39
|
+
// admin edits until a manual flush, which is rarely what you want.
|
|
40
|
+
bootstrap,
|
|
24
41
|
}).catch((err) => {
|
|
25
42
|
console.error('Population failed:', err);
|
|
26
43
|
process.exit(1);
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "concurrently --kill-others npm:dev:*",
|
|
7
|
-
"dev:server": "ts-node src/index.ts",
|
|
7
|
+
"dev:server": "node --require ts-node/register src/index.ts",
|
|
8
8
|
"dev:dashboard": "vite --clearScreen false",
|
|
9
9
|
"build": "tsc",
|
|
10
10
|
"build:dashboard": "vite build",
|
|
11
11
|
"start": "node dist/index.js",
|
|
12
|
-
"populate": "ts-node src/populate.ts"
|
|
12
|
+
"populate": "node --require ts-node/register src/populate.ts"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@vendure/core": "^3.6.2",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"@vendure/testing": "^3.6.2",
|
|
19
19
|
"typeorm": "*",
|
|
20
20
|
"@vendure-platform/data-populator": "nightly",
|
|
21
|
+
"@vendure-platform/integration": "nightly",
|
|
21
22
|
"@vendure-platform/scenario-default": "nightly",
|
|
22
23
|
"@vendure-platform/platform": "nightly",
|
|
23
24
|
"dotenv": "^16.4.7"{{pluginDependencies}}
|
package/dist/bin/run.js
CHANGED
|
@@ -39,6 +39,7 @@ const path = __importStar(require("path"));
|
|
|
39
39
|
const commander_1 = require("commander");
|
|
40
40
|
const cli_1 = require("../cli");
|
|
41
41
|
const scaffolder_1 = require("../scaffolder");
|
|
42
|
+
const scaffold_storefront_only_1 = require("../scaffold-storefront-only");
|
|
42
43
|
function getVersion() {
|
|
43
44
|
const pkgPath = path.join(__dirname, '..', '..', 'package.json');
|
|
44
45
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
@@ -46,18 +47,22 @@ function getVersion() {
|
|
|
46
47
|
}
|
|
47
48
|
const program = new commander_1.Command()
|
|
48
49
|
.name('create-vendure-platform')
|
|
49
|
-
.description('Scaffold a Vendure
|
|
50
|
+
.description('Scaffold a Vendure project with Vendure Platform plugins, or a standalone storefront')
|
|
50
51
|
.version(getVersion(), '-v, --version')
|
|
51
52
|
.argument('[project-name]', 'Name of the project to create')
|
|
52
53
|
.option('--plugins <list>', 'Comma-separated list of plugin keys to include')
|
|
53
54
|
.option('--company <name>', 'Company name for the demo project')
|
|
54
55
|
.option('--no-storefront', 'Skip the Next.js storefront')
|
|
55
56
|
.option('--github', 'Create a GitHub repository')
|
|
56
|
-
.option('--github-org <org>', 'GitHub organization (
|
|
57
|
+
.option('--github-org <org>', 'GitHub organization (only used with --github)', 'vendurehq')
|
|
57
58
|
.option('--no-github', 'Do not create a GitHub repository')
|
|
58
|
-
.option('--no-install', 'Skip
|
|
59
|
+
.option('--no-install', 'Skip dependency install')
|
|
59
60
|
.option('--no-git', 'Skip git init')
|
|
60
61
|
.option('--dry-run', 'Show what would be created without writing files')
|
|
62
|
+
.option('--storefront-only', 'Scaffold just the Next.js storefront, no server or plugins')
|
|
63
|
+
.option('--api-url <url>', 'Vendure Shop API URL (storefront-only mode)')
|
|
64
|
+
.option('--scenario <name>', 'Storefront scenario (storefront-only mode; default: customer)')
|
|
65
|
+
.option('--pm <bun|npm|pnpm>', 'Package manager used for the install step (default: bun)')
|
|
61
66
|
.action(async (projectName, opts) => {
|
|
62
67
|
const flags = {
|
|
63
68
|
plugins: opts.plugins,
|
|
@@ -68,7 +73,16 @@ const program = new commander_1.Command()
|
|
|
68
73
|
install: opts.install,
|
|
69
74
|
git: opts.git,
|
|
70
75
|
dryRun: opts.dryRun,
|
|
76
|
+
storefrontOnly: opts.storefrontOnly,
|
|
77
|
+
apiUrl: opts.apiUrl,
|
|
78
|
+
scenario: opts.scenario,
|
|
79
|
+
pm: opts.pm,
|
|
71
80
|
};
|
|
81
|
+
if (flags.storefrontOnly) {
|
|
82
|
+
const options = await (0, cli_1.runStorefrontOnlyCli)(projectName, flags);
|
|
83
|
+
await (0, scaffold_storefront_only_1.scaffoldStorefrontOnly)(options);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
72
86
|
const options = await (0, cli_1.runCli)(projectName, flags);
|
|
73
87
|
await (0, scaffolder_1.scaffold)(options);
|
|
74
88
|
});
|
package/dist/bin/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/bin/run.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,uCAAyB;AACzB,2CAA6B;AAC7B,yCAAoC;AACpC,
|
|
1
|
+
{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|
|
|
1
|
-
import { ScaffoldOptions, CliFlags } from './types';
|
|
1
|
+
import { ScaffoldOptions, StorefrontOnlyOptions, CliFlags } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Run the CLI in storefront-only mode. Returns options for `scaffoldStorefrontOnly`.
|
|
4
|
+
* Interactive prompts kick in for any value not provided via flags.
|
|
5
|
+
*/
|
|
6
|
+
export declare function runStorefrontOnlyCli(projectNameArg?: string, flags?: CliFlags): Promise<StorefrontOnlyOptions>;
|
|
2
7
|
/**
|
|
3
8
|
* Run the CLI to gather scaffold options.
|
|
4
9
|
* If all required flags are provided, skips interactive prompts entirely.
|
package/dist/cli.js
CHANGED
|
@@ -33,10 +33,29 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.runStorefrontOnlyCli = runStorefrontOnlyCli;
|
|
36
37
|
exports.runCli = runCli;
|
|
37
38
|
const p = __importStar(require("@clack/prompts"));
|
|
38
39
|
const plugin_registry_1 = require("./plugin-registry");
|
|
39
|
-
const
|
|
40
|
+
const PACKAGE_MANAGERS = ['bun', 'npm', 'pnpm'];
|
|
41
|
+
function validatePackageManager(pm) {
|
|
42
|
+
if (!pm)
|
|
43
|
+
return 'bun';
|
|
44
|
+
if (PACKAGE_MANAGERS.includes(pm))
|
|
45
|
+
return pm;
|
|
46
|
+
throw new Error(`Invalid --pm value "${pm}". Must be one of: ${PACKAGE_MANAGERS.join(', ')}`);
|
|
47
|
+
}
|
|
48
|
+
function validateApiUrl(url) {
|
|
49
|
+
if (!url)
|
|
50
|
+
return undefined;
|
|
51
|
+
try {
|
|
52
|
+
new URL(url);
|
|
53
|
+
return url;
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
throw new Error(`Invalid --api-url value "${url}": not a valid URL`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
40
59
|
function validateProjectName(name) {
|
|
41
60
|
if (name.trim().length === 0)
|
|
42
61
|
return 'Project name is required';
|
|
@@ -44,12 +63,125 @@ function validateProjectName(name) {
|
|
|
44
63
|
return 'Project name may only contain letters, numbers, dots, hyphens, and underscores';
|
|
45
64
|
}
|
|
46
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Build the option list for the plugin multiselect.
|
|
68
|
+
*
|
|
69
|
+
* Core plugins (`tier: 'core'` or `'core-requires-config'`) are always active
|
|
70
|
+
* under `VendurePlatform.init()` and therefore hidden from the prompt — only
|
|
71
|
+
* `optional` and `requires-config` plugins appear here. Each option is
|
|
72
|
+
* labelled `"<displayName> (<category>)"`, with a `"needs configuration"`
|
|
73
|
+
* hint on `requires-config` entries so users understand they only activate
|
|
74
|
+
* when picked.
|
|
75
|
+
*
|
|
76
|
+
* Entries are sorted by category, then display name, so related plugins sit
|
|
77
|
+
* together in the list.
|
|
78
|
+
*/
|
|
79
|
+
function buildPluginOptions() {
|
|
80
|
+
return plugin_registry_1.pluginRegistry
|
|
81
|
+
.filter((pl) => pl.tier === 'optional' || pl.tier === 'requires-config')
|
|
82
|
+
.sort((a, b) => {
|
|
83
|
+
if (a.category !== b.category)
|
|
84
|
+
return a.category.localeCompare(b.category);
|
|
85
|
+
return a.displayName.localeCompare(b.displayName);
|
|
86
|
+
})
|
|
87
|
+
.map((pl) => ({
|
|
88
|
+
label: `${pl.displayName} (${pl.category})`,
|
|
89
|
+
value: pl.key,
|
|
90
|
+
hint: pl.tier === 'requires-config' ? 'needs configuration' : undefined,
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
/** Plugin keys that should be pre-selected in the prompt (all `optional` ones). */
|
|
94
|
+
function defaultSelectedKeys() {
|
|
95
|
+
return plugin_registry_1.pluginRegistry.filter((pl) => pl.tier === 'optional').map((pl) => pl.key);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Run the CLI in storefront-only mode. Returns options for `scaffoldStorefrontOnly`.
|
|
99
|
+
* Interactive prompts kick in for any value not provided via flags.
|
|
100
|
+
*/
|
|
101
|
+
async function runStorefrontOnlyCli(projectNameArg, flags) {
|
|
102
|
+
var _a, _b, _c;
|
|
103
|
+
const packageManager = validatePackageManager(flags === null || flags === void 0 ? void 0 : flags.pm);
|
|
104
|
+
const apiUrl = validateApiUrl(flags === null || flags === void 0 ? void 0 : flags.apiUrl);
|
|
105
|
+
const scenario = (_a = flags === null || flags === void 0 ? void 0 : flags.scenario) !== null && _a !== void 0 ? _a : 'customer';
|
|
106
|
+
// Non-interactive if project name and api-url are both supplied
|
|
107
|
+
if (projectNameArg && apiUrl) {
|
|
108
|
+
const validation = validateProjectName(projectNameArg);
|
|
109
|
+
if (validation) {
|
|
110
|
+
p.log.error(`Error: ${validation}`);
|
|
111
|
+
process.exit(1);
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
projectName: projectNameArg,
|
|
115
|
+
apiUrl,
|
|
116
|
+
scenario,
|
|
117
|
+
packageManager,
|
|
118
|
+
skipInstall: (flags === null || flags === void 0 ? void 0 : flags.install) === false,
|
|
119
|
+
skipGit: (flags === null || flags === void 0 ? void 0 : flags.git) === false,
|
|
120
|
+
dryRun: (_b = flags === null || flags === void 0 ? void 0 : flags.dryRun) !== null && _b !== void 0 ? _b : false,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
p.intro('create-vendure-platform (storefront-only)');
|
|
124
|
+
if (projectNameArg) {
|
|
125
|
+
const validation = validateProjectName(projectNameArg);
|
|
126
|
+
if (validation) {
|
|
127
|
+
p.cancel(validation);
|
|
128
|
+
process.exit(1);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const answers = await p.group({
|
|
132
|
+
projectName: () => {
|
|
133
|
+
if (projectNameArg)
|
|
134
|
+
return Promise.resolve(projectNameArg);
|
|
135
|
+
return p.text({
|
|
136
|
+
message: 'Project name:',
|
|
137
|
+
validate: validateProjectName,
|
|
138
|
+
});
|
|
139
|
+
},
|
|
140
|
+
apiUrl: () => {
|
|
141
|
+
if (apiUrl)
|
|
142
|
+
return Promise.resolve(apiUrl);
|
|
143
|
+
return p.text({
|
|
144
|
+
message: 'Vendure Shop API URL (leave blank to use http://localhost:3500/shop-api):',
|
|
145
|
+
placeholder: 'https://shop.example.com/shop-api',
|
|
146
|
+
validate: (value) => {
|
|
147
|
+
if (!value)
|
|
148
|
+
return undefined;
|
|
149
|
+
try {
|
|
150
|
+
new URL(value);
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
return 'Must be a valid URL';
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
installDeps: () => p.confirm({
|
|
159
|
+
message: `Install dependencies with ${packageManager}?`,
|
|
160
|
+
initialValue: true,
|
|
161
|
+
}),
|
|
162
|
+
}, {
|
|
163
|
+
onCancel: () => {
|
|
164
|
+
p.cancel('Setup cancelled.');
|
|
165
|
+
process.exit(0);
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
return {
|
|
169
|
+
projectName: answers.projectName,
|
|
170
|
+
apiUrl: answers.apiUrl || undefined,
|
|
171
|
+
scenario,
|
|
172
|
+
packageManager,
|
|
173
|
+
skipInstall: !answers.installDeps,
|
|
174
|
+
skipGit: (flags === null || flags === void 0 ? void 0 : flags.git) === false,
|
|
175
|
+
dryRun: (_c = flags === null || flags === void 0 ? void 0 : flags.dryRun) !== null && _c !== void 0 ? _c : false,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
47
178
|
/**
|
|
48
179
|
* Run the CLI to gather scaffold options.
|
|
49
180
|
* If all required flags are provided, skips interactive prompts entirely.
|
|
50
181
|
*/
|
|
51
182
|
async function runCli(projectNameArg, flags) {
|
|
52
183
|
var _a, _b, _c;
|
|
184
|
+
const packageManager = validatePackageManager(flags === null || flags === void 0 ? void 0 : flags.pm);
|
|
53
185
|
// Non-interactive mode: all required fields provided via flags
|
|
54
186
|
if (projectNameArg && (flags === null || flags === void 0 ? void 0 : flags.company) && (flags === null || flags === void 0 ? void 0 : flags.plugins) !== undefined) {
|
|
55
187
|
const validation = validateProjectName(projectNameArg);
|
|
@@ -67,6 +199,7 @@ async function runCli(projectNameArg, flags) {
|
|
|
67
199
|
includeStorefront: (_a = flags.storefront) !== null && _a !== void 0 ? _a : true,
|
|
68
200
|
createGithubRepo: (_b = flags.github) !== null && _b !== void 0 ? _b : false,
|
|
69
201
|
githubOrg: flags.githubOrg,
|
|
202
|
+
packageManager,
|
|
70
203
|
skipInstall: flags.install === false,
|
|
71
204
|
skipGit: flags.git === false,
|
|
72
205
|
dryRun: (_c = flags.dryRun) !== null && _c !== void 0 ? _c : false,
|
|
@@ -81,12 +214,8 @@ async function runCli(projectNameArg, flags) {
|
|
|
81
214
|
process.exit(1);
|
|
82
215
|
}
|
|
83
216
|
}
|
|
84
|
-
const pluginOptions =
|
|
85
|
-
|
|
86
|
-
.map((pl) => ({
|
|
87
|
-
label: `${pl.displayName} (${pl.category})`,
|
|
88
|
-
value: pl.key,
|
|
89
|
-
}));
|
|
217
|
+
const pluginOptions = buildPluginOptions();
|
|
218
|
+
const initialPluginValues = defaultSelectedKeys();
|
|
90
219
|
const answers = await p.group({
|
|
91
220
|
projectName: () => {
|
|
92
221
|
if (projectNameArg)
|
|
@@ -110,29 +239,17 @@ async function runCli(projectNameArg, flags) {
|
|
|
110
239
|
});
|
|
111
240
|
},
|
|
112
241
|
selectedPlugins: () => p.multiselect({
|
|
113
|
-
message: '
|
|
242
|
+
message: 'Optional plugins to include (core plugins are always installed):',
|
|
114
243
|
options: pluginOptions,
|
|
115
|
-
initialValues:
|
|
244
|
+
initialValues: initialPluginValues,
|
|
245
|
+
required: false,
|
|
116
246
|
}),
|
|
117
247
|
includeStorefront: () => p.confirm({
|
|
118
248
|
message: 'Include the Next.js storefront?',
|
|
119
249
|
initialValue: true,
|
|
120
250
|
}),
|
|
121
|
-
createGithubRepo: () => p.confirm({
|
|
122
|
-
message: 'Create a GitHub repository?',
|
|
123
|
-
initialValue: false,
|
|
124
|
-
}),
|
|
125
|
-
githubOrg: ({ results }) => {
|
|
126
|
-
if (!results.createGithubRepo)
|
|
127
|
-
return Promise.resolve(undefined);
|
|
128
|
-
return p.text({
|
|
129
|
-
message: 'GitHub organization:',
|
|
130
|
-
defaultValue: DEFAULT_GITHUB_ORG,
|
|
131
|
-
placeholder: DEFAULT_GITHUB_ORG,
|
|
132
|
-
});
|
|
133
|
-
},
|
|
134
251
|
installDeps: () => p.confirm({
|
|
135
|
-
message:
|
|
252
|
+
message: `Install dependencies with ${packageManager}?`,
|
|
136
253
|
initialValue: true,
|
|
137
254
|
}),
|
|
138
255
|
}, {
|
|
@@ -141,13 +258,18 @@ async function runCli(projectNameArg, flags) {
|
|
|
141
258
|
process.exit(0);
|
|
142
259
|
},
|
|
143
260
|
});
|
|
261
|
+
// GitHub repo creation is not exposed as an interactive prompt — it's an
|
|
262
|
+
// internal-demo workflow. Trigger it via `--github [--github-org <org>]`
|
|
263
|
+
// (in fully-non-interactive mode, see the early return at the top of this
|
|
264
|
+
// function).
|
|
144
265
|
return {
|
|
145
266
|
projectName: answers.projectName,
|
|
146
267
|
companyName: answers.companyName,
|
|
147
268
|
selectedPlugins: answers.selectedPlugins,
|
|
148
269
|
includeStorefront: answers.includeStorefront,
|
|
149
|
-
createGithubRepo:
|
|
150
|
-
githubOrg:
|
|
270
|
+
createGithubRepo: false,
|
|
271
|
+
githubOrg: undefined,
|
|
272
|
+
packageManager,
|
|
151
273
|
skipInstall: !answers.installDeps,
|
|
152
274
|
};
|
|
153
275
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,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,EAAE,GAAG,EAAE;YACX,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;YAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;KACJ,CAAC,CAAC;IAEH,yEAAyE;IACzE,yEAAyE;IACzE,0EAA0E;IAC1E,aAAa;IACb,OAAO;QACH,WAAW,EAAE,OAAO,CAAC,WAAqB;QAC1C,WAAW,EAAE,OAAO,CAAC,WAAqB;QAC1C,eAAe,EAAE,OAAO,CAAC,eAA2B;QACpD,iBAAiB,EAAE,OAAO,CAAC,iBAA4B;QACvD,gBAAgB,EAAE,KAAK;QACvB,SAAS,EAAE,SAAS;QACpB,cAAc;QACd,WAAW,EAAE,CAAE,OAAO,CAAC,WAAuB;KACjD,CAAC;AACN,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { scaffold, TEMPLATE_FILES } from './scaffolder';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
2
|
+
export { scaffoldStorefrontOnly } from './scaffold-storefront-only';
|
|
3
|
+
export { pluginRegistry, INTERNAL_PACKAGES, resolveActivePluginKeys, ALWAYS_ACTIVE_KEYS, SELECTABLE_KEYS, getPlugin, } from './plugin-registry';
|
|
4
|
+
export { runCli, runStorefrontOnlyCli } from './cli';
|
|
5
|
+
export { ScaffoldOptions, StorefrontOnlyOptions, PluginDefinition, ScaffolderPluginExtras, EnvVar, CliFlags, PackageManager, } from './types';
|
|
6
|
+
export type { PluginKey, PluginTier, PluginCategory, PluginMeta, PluginMetaKey, } from '@vendure-platform/plugin-meta';
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runCli = exports.
|
|
3
|
+
exports.runStorefrontOnlyCli = exports.runCli = exports.getPlugin = exports.SELECTABLE_KEYS = exports.ALWAYS_ACTIVE_KEYS = exports.resolveActivePluginKeys = exports.INTERNAL_PACKAGES = exports.pluginRegistry = exports.scaffoldStorefrontOnly = exports.TEMPLATE_FILES = exports.scaffold = void 0;
|
|
4
4
|
var scaffolder_1 = require("./scaffolder");
|
|
5
5
|
Object.defineProperty(exports, "scaffold", { enumerable: true, get: function () { return scaffolder_1.scaffold; } });
|
|
6
6
|
Object.defineProperty(exports, "TEMPLATE_FILES", { enumerable: true, get: function () { return scaffolder_1.TEMPLATE_FILES; } });
|
|
7
|
+
var scaffold_storefront_only_1 = require("./scaffold-storefront-only");
|
|
8
|
+
Object.defineProperty(exports, "scaffoldStorefrontOnly", { enumerable: true, get: function () { return scaffold_storefront_only_1.scaffoldStorefrontOnly; } });
|
|
7
9
|
var plugin_registry_1 = require("./plugin-registry");
|
|
8
10
|
Object.defineProperty(exports, "pluginRegistry", { enumerable: true, get: function () { return plugin_registry_1.pluginRegistry; } });
|
|
9
|
-
Object.defineProperty(exports, "
|
|
10
|
-
Object.defineProperty(exports, "
|
|
11
|
+
Object.defineProperty(exports, "INTERNAL_PACKAGES", { enumerable: true, get: function () { return plugin_registry_1.INTERNAL_PACKAGES; } });
|
|
12
|
+
Object.defineProperty(exports, "resolveActivePluginKeys", { enumerable: true, get: function () { return plugin_registry_1.resolveActivePluginKeys; } });
|
|
13
|
+
Object.defineProperty(exports, "ALWAYS_ACTIVE_KEYS", { enumerable: true, get: function () { return plugin_registry_1.ALWAYS_ACTIVE_KEYS; } });
|
|
14
|
+
Object.defineProperty(exports, "SELECTABLE_KEYS", { enumerable: true, get: function () { return plugin_registry_1.SELECTABLE_KEYS; } });
|
|
15
|
+
Object.defineProperty(exports, "getPlugin", { enumerable: true, get: function () { return plugin_registry_1.getPlugin; } });
|
|
11
16
|
var cli_1 = require("./cli");
|
|
12
17
|
Object.defineProperty(exports, "runCli", { enumerable: true, get: function () { return cli_1.runCli; } });
|
|
18
|
+
Object.defineProperty(exports, "runStorefrontOnlyCli", { enumerable: true, get: function () { return cli_1.runStorefrontOnlyCli; } });
|
|
13
19
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2CAAwD;AAA/C,sGAAA,QAAQ,OAAA;AAAE,4GAAA,cAAc,OAAA;AACjC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2CAAwD;AAA/C,sGAAA,QAAQ,OAAA;AAAE,4GAAA,cAAc,OAAA;AACjC,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA;AAC/B,qDAO2B;AANvB,iHAAA,cAAc,OAAA;AACd,oHAAA,iBAAiB,OAAA;AACjB,0HAAA,uBAAuB,OAAA;AACvB,qHAAA,kBAAkB,OAAA;AAClB,kHAAA,eAAe,OAAA;AACf,4GAAA,SAAS,OAAA;AAEb,6BAAqD;AAA5C,6FAAA,MAAM,OAAA;AAAE,2GAAA,oBAAoB,OAAA"}
|
|
@@ -1,10 +1,47 @@
|
|
|
1
1
|
import { PluginDefinition } from './types';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The full registry consumed by the scaffolder: the shared `PluginMeta` from
|
|
4
|
+
* `@vendure-platform/plugin-meta` joined with the local scaffolder extras.
|
|
5
|
+
*
|
|
6
|
+
* This list contains only plugins that `VendurePlatform` manages. Plugins
|
|
7
|
+
* that exist in the monorepo but are never registered via
|
|
8
|
+
* `VendurePlatform.init()` (e.g. `@vendure-platform/integration`,
|
|
9
|
+
* `@vendure-platform/platform` itself, `@vendure-platform/demo-center`) are
|
|
10
|
+
* acknowledged in `INTERNAL_PACKAGES` below so the CI testbed-coverage script
|
|
11
|
+
* can see them — they're not part of this registry.
|
|
12
|
+
*/
|
|
13
|
+
export declare const pluginRegistry: ReadonlyArray<PluginDefinition>;
|
|
14
|
+
/**
|
|
15
|
+
* Acknowledged plugin packages that intentionally do NOT participate in
|
|
16
|
+
* `VendurePlatform.init()` and therefore don't appear in `pluginRegistry`:
|
|
17
|
+
*
|
|
18
|
+
* - `@vendure-platform/platform`: the umbrella package itself. Imported
|
|
19
|
+
* directly by the generated `vendure-config.ts`.
|
|
20
|
+
* - `@vendure-platform/integration`: integration sub-plugins consumed by
|
|
21
|
+
* `VendurePlatform`'s `INTEGRATION_MAP`. Wired automatically.
|
|
22
|
+
* - `@vendure-platform/demo-center`: internal-only, used by the official
|
|
23
|
+
* Vendure demo server. Never scaffolded into customer projects.
|
|
24
|
+
*
|
|
25
|
+
* Each entry is annotated with an `// @internal-package` sentinel comment
|
|
26
|
+
* that `.github/scripts/check-testbed-coverage.js` greps for to confirm a
|
|
27
|
+
* `@VendurePlugin`-decorated package is intentionally internal rather than
|
|
28
|
+
* missing from the registry. Don't rename or remove the sentinel without
|
|
29
|
+
* also updating the script.
|
|
30
|
+
*/
|
|
31
|
+
export declare const INTERNAL_PACKAGES: ReadonlyArray<{
|
|
32
|
+
packageName: string;
|
|
33
|
+
}>;
|
|
3
34
|
export declare function getPlugin(key: string): PluginDefinition | undefined;
|
|
35
|
+
/** Plugin keys that are always active under `VendurePlatform`, regardless of selection. */
|
|
36
|
+
export declare const ALWAYS_ACTIVE_KEYS: ReadonlyArray<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Plugin keys that are eligible to appear in the interactive selection prompt:
|
|
39
|
+
* everything except the always-active core plugins.
|
|
40
|
+
*/
|
|
41
|
+
export declare const SELECTABLE_KEYS: ReadonlyArray<string>;
|
|
4
42
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
43
|
+
* Compute the set of plugin keys whose options/imports/env vars should be
|
|
44
|
+
* emitted into the generated project — always-active core plus the user's
|
|
45
|
+
* selected optional / requires-config plugins. Result preserves registry order.
|
|
7
46
|
*/
|
|
8
|
-
export declare function
|
|
9
|
-
/** B2B suite preset: the core B2B plugins */
|
|
10
|
-
export declare const B2B_SUITE_KEYS: string[];
|
|
47
|
+
export declare function resolveActivePluginKeys(selected: ReadonlyArray<string>): string[];
|