@vendure-platform/create 0.2.1-nightly.202605191555 → 0.2.2
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/CHANGELOG.md +22 -0
- package/README.md +11 -0
- package/dist/add-to-existing.d.ts +80 -0
- package/dist/add-to-existing.js +508 -0
- package/dist/add-to-existing.js.map +1 -0
- package/dist/assets/storefront/next.config.ts +1 -19
- package/dist/assets/storefront/package.json +1 -3
- package/dist/assets/storefront/src/components/commerce/packaging-unit-selector.tsx +6 -1
- package/dist/assets/storefront/src/components/commerce/product-info.tsx +4 -4
- package/dist/assets/storefront/src/graphql-env.d.ts +25 -22
- package/dist/assets/storefront/src/lib/vendure/queries.ts +6 -0
- package/dist/assets/storefront/src/schema.graphql +204 -111
- package/dist/assets/templates/README.md.hbs +5 -0
- package/dist/assets/templates/bunfig.toml.hbs +17 -0
- package/dist/assets/templates/env.hbs +5 -2
- package/dist/assets/templates/environment.d.ts.hbs +3 -0
- package/dist/assets/templates/gitignore.hbs +6 -0
- package/dist/assets/templates/npmrc.hbs +2 -0
- package/dist/assets/templates/populate.ts.hbs +1 -14
- package/dist/assets/templates/server-package.json.hbs +6 -6
- package/dist/assets/templates/vendure-config.ts.hbs +9 -3
- package/dist/bin/run.js +27 -0
- package/dist/bin/run.js.map +1 -1
- package/dist/cli.js +34 -1
- package/dist/cli.js.map +1 -1
- package/dist/scaffold-shared.js +15 -5
- package/dist/scaffold-shared.js.map +1 -1
- package/dist/scaffolder.js +8 -3
- package/dist/scaffolder.js.map +1 -1
- package/dist/sort-package-json.d.ts +12 -0
- package/dist/sort-package-json.js +26 -0
- package/dist/sort-package-json.js.map +1 -0
- package/dist/storefront-copier.d.ts +12 -0
- package/dist/storefront-copier.js +38 -8
- package/dist/storefront-copier.js.map +1 -1
- package/dist/template-renderer.d.ts +63 -1
- package/dist/template-renderer.js +81 -5
- package/dist/template-renderer.js.map +1 -1
- package/dist/types.d.ts +32 -0
- package/package.json +4 -4
- package/dist/assets/demo-data/assets/branding/logo.svg +0 -4
- package/dist/assets/demo-data/assets/images/absorbent-pad.webp +0 -0
- package/dist/assets/demo-data/assets/images/adjustable-wrench.webp +0 -0
- package/dist/assets/demo-data/assets/images/anchor-bolt.webp +0 -0
- package/dist/assets/demo-data/assets/images/angle-grinder.webp +0 -0
- package/dist/assets/demo-data/assets/images/barrier-tape.webp +0 -0
- package/dist/assets/demo-data/assets/images/bench-grinder.webp +0 -0
- package/dist/assets/demo-data/assets/images/bracket.webp +0 -0
- package/dist/assets/demo-data/assets/images/broom.webp +0 -0
- package/dist/assets/demo-data/assets/images/bucket.webp +0 -0
- package/dist/assets/demo-data/assets/images/cable-gland.webp +0 -0
- package/dist/assets/demo-data/assets/images/cable-tie.webp +0 -0
- package/dist/assets/demo-data/assets/images/cable-tray.webp +0 -0
- package/dist/assets/demo-data/assets/images/cable.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-base-kit.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-cowl-bird-guard.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-cowl-open.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-storm-collar.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-wall-bracket.webp +0 -0
- package/dist/assets/demo-data/assets/images/circular-saw.webp +0 -0
- package/dist/assets/demo-data/assets/images/cleaning-spray.webp +0 -0
- package/dist/assets/demo-data/assets/images/conduit.webp +0 -0
- package/dist/assets/demo-data/assets/images/cordless-drill.webp +0 -0
- package/dist/assets/demo-data/assets/images/drill-bits.webp +0 -0
- package/dist/assets/demo-data/assets/images/dust-mask.webp +0 -0
- package/dist/assets/demo-data/assets/images/ear-defenders.webp +0 -0
- package/dist/assets/demo-data/assets/images/ear-plugs.webp +0 -0
- package/dist/assets/demo-data/assets/images/extension-lead.webp +0 -0
- package/dist/assets/demo-data/assets/images/eye-wash-station.webp +0 -0
- package/dist/assets/demo-data/assets/images/face-shield.webp +0 -0
- package/dist/assets/demo-data/assets/images/file-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/first-aid-kit.webp +0 -0
- package/dist/assets/demo-data/assets/images/floor-sign.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-bend-45.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-bend-90.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-section-1000mm.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-section-250mm.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-section-500mm.webp +0 -0
- package/dist/assets/demo-data/assets/images/fuse.webp +0 -0
- package/dist/assets/demo-data/assets/images/glove-dispenser.webp +0 -0
- package/dist/assets/demo-data/assets/images/grinding-disc.webp +0 -0
- package/dist/assets/demo-data/assets/images/hacksaw.webp +0 -0
- package/dist/assets/demo-data/assets/images/hammer.webp +0 -0
- package/dist/assets/demo-data/assets/images/hand-sanitiser.webp +0 -0
- package/dist/assets/demo-data/assets/images/head-torch.webp +0 -0
- package/dist/assets/demo-data/assets/images/heat-gun.webp +0 -0
- package/dist/assets/demo-data/assets/images/hex-bolt.webp +0 -0
- package/dist/assets/demo-data/assets/images/hex-key-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/hex-nut.webp +0 -0
- package/dist/assets/demo-data/assets/images/hi-vis-jacket.webp +0 -0
- package/dist/assets/demo-data/assets/images/hi-vis-vest.webp +0 -0
- package/dist/assets/demo-data/assets/images/hose-clamp.webp +0 -0
- package/dist/assets/demo-data/assets/images/impact-driver.webp +0 -0
- package/dist/assets/demo-data/assets/images/jigsaw.webp +0 -0
- package/dist/assets/demo-data/assets/images/junction-box.webp +0 -0
- package/dist/assets/demo-data/assets/images/knee-pads.webp +0 -0
- package/dist/assets/demo-data/assets/images/machine-screw.webp +0 -0
- package/dist/assets/demo-data/assets/images/made-to-order-configurable-chimney.webp +0 -0
- package/dist/assets/demo-data/assets/images/mallet.webp +0 -0
- package/dist/assets/demo-data/assets/images/mcb.webp +0 -0
- package/dist/assets/demo-data/assets/images/mop.webp +0 -0
- package/dist/assets/demo-data/assets/images/paper-towels.webp +0 -0
- package/dist/assets/demo-data/assets/images/pipe-wrench.webp +0 -0
- package/dist/assets/demo-data/assets/images/pliers-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/pry-bar.webp +0 -0
- package/dist/assets/demo-data/assets/images/rcd.webp +0 -0
- package/dist/assets/demo-data/assets/images/reciprocating-saw.webp +0 -0
- package/dist/assets/demo-data/assets/images/rivet.webp +0 -0
- package/dist/assets/demo-data/assets/images/roof-flashing-high-pitch.webp +0 -0
- package/dist/assets/demo-data/assets/images/roof-flashing-low-pitch.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-boots.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-glasses.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-harness.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-helmet.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-sign.webp +0 -0
- package/dist/assets/demo-data/assets/images/sanding-disc.webp +0 -0
- package/dist/assets/demo-data/assets/images/saw-blade.webp +0 -0
- package/dist/assets/demo-data/assets/images/screwdriver-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/screwdriver.webp +0 -0
- package/dist/assets/demo-data/assets/images/self-tapping-screw.webp +0 -0
- package/dist/assets/demo-data/assets/images/socket-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/socket.webp +0 -0
- package/dist/assets/demo-data/assets/images/spanner-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/spanner.webp +0 -0
- package/dist/assets/demo-data/assets/images/spill-kit.webp +0 -0
- package/dist/assets/demo-data/assets/images/spirit-level.webp +0 -0
- package/dist/assets/demo-data/assets/images/switch.webp +0 -0
- package/dist/assets/demo-data/assets/images/tape-measure.webp +0 -0
- package/dist/assets/demo-data/assets/images/terminal-block.webp +0 -0
- package/dist/assets/demo-data/assets/images/threaded-rod.webp +0 -0
- package/dist/assets/demo-data/assets/images/torque-wrench.webp +0 -0
- package/dist/assets/demo-data/assets/images/utility-knife.webp +0 -0
- package/dist/assets/demo-data/assets/images/wall-pass-sleeve.webp +0 -0
- package/dist/assets/demo-data/assets/images/wall-plug.webp +0 -0
- package/dist/assets/demo-data/assets/images/washer.webp +0 -0
- package/dist/assets/demo-data/assets/images/waste-bin.webp +0 -0
- package/dist/assets/demo-data/assets/images/wire-connector.webp +0 -0
- package/dist/assets/demo-data/assets/images/wire-cutters.webp +0 -0
- package/dist/assets/demo-data/assets/images/wood-screw.webp +0 -0
- package/dist/assets/demo-data/assets/images/work-gloves.webp +0 -0
- package/dist/assets/demo-data/assets/images/work-light.webp +0 -0
- package/dist/assets/demo-data/assets/initial-data.json +0 -667
- package/dist/assets/demo-data/assets/products.csv +0 -779
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## 0.2.2 (2026-05-22)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- publish CLI publicly with two-token onboarding flow ([#322](https://github.com/vendurehq/vendure-platform/pull/322))
|
|
6
|
+
- Add 'add to existing project' onboarding flow ([#318](https://github.com/vendurehq/vendure-platform/pull/318))
|
|
7
|
+
|
|
8
|
+
## 0.2.1 (2026-05-20)
|
|
9
|
+
|
|
10
|
+
_Initial release._
|
|
11
|
+
|
|
12
|
+
### 🚀 Features
|
|
13
|
+
|
|
14
|
+
- deliver standalone storefront to EE customers (EE-104) ([#290](https://github.com/vendurehq/vendure-platform/pull/290))
|
|
15
|
+
|
|
16
|
+
### 🩹 Fixes
|
|
17
|
+
|
|
18
|
+
- scaffolder cleanup pass after Nigel review ([#314](https://github.com/vendurehq/vendure-platform/pull/314))
|
|
19
|
+
- pin typeorm to ^0.3.27 in scaffolded server template ([#313](https://github.com/vendurehq/vendure-platform/pull/313))
|
|
20
|
+
- land all issues found during end-to-end create-flow testing (EE-153) ([#304](https://github.com/vendurehq/vendure-platform/pull/304))
|
|
21
|
+
- wire up private registry scope mapping + actionable 401 hint (EE-151) ([#300](https://github.com/vendurehq/vendure-platform/pull/300))
|
|
22
|
+
- target ^3.6.2 stable for @vendure packages in scaffolder template ([#243](https://github.com/vendurehq/vendure-platform/pull/243))
|
package/README.md
CHANGED
|
@@ -23,6 +23,8 @@ npx @vendure-platform/create my-project \
|
|
|
23
23
|
|------|-------------|---------|
|
|
24
24
|
| `--plugins <list>` | Comma-separated optional plugin keys | (interactive prompt) |
|
|
25
25
|
| `--company <name>` | Company name for branding | (derived from project name) |
|
|
26
|
+
| `--registry-token <token>` | Vendure private-registry npm auth token (baked into `.npmrc`) | (interactive prompt) |
|
|
27
|
+
| `--license-token <token>` | Vendure Platform server-side license token (written to `.env`) | (interactive prompt) |
|
|
26
28
|
| `--no-storefront` | Skip the Next.js storefront | included |
|
|
27
29
|
| `--github` | Create a private GitHub repo via `gh` CLI | no |
|
|
28
30
|
| `--github-org <org>` | GitHub organization for the repo (only used with `--github`) | `vendurehq` |
|
|
@@ -32,6 +34,15 @@ npx @vendure-platform/create my-project \
|
|
|
32
34
|
|
|
33
35
|
When `--plugins` and `--company` are both provided, the CLI runs in non-interactive mode.
|
|
34
36
|
|
|
37
|
+
## Tokens: registry vs license
|
|
38
|
+
|
|
39
|
+
The Vendure Enterprise Portal issues **two distinct tokens** with different purposes — keep them straight:
|
|
40
|
+
|
|
41
|
+
- **Registry token** — npm auth token for the private registry. Lets `${pm} install` download `@vendure-platform/*` packages. The CLI writes it into the project `.npmrc` as `_authToken`. `.npmrc` is gitignored.
|
|
42
|
+
- **License token** — checked at server boot by the License Guard plugin. The CLI writes it into `.env` as `VENDURE_PLATFORM_LICENSE_TOKEN`.
|
|
43
|
+
|
|
44
|
+
They are not interchangeable. Pass each via its dedicated flag (`--registry-token`, `--license-token`) or paste each at its own interactive prompt. Either can be skipped (blank input) if you want to add it later.
|
|
45
|
+
|
|
35
46
|
## Plugin Tiers
|
|
36
47
|
|
|
37
48
|
Plugins fall into three tiers (mirroring `@vendure-platform/plugin-meta`):
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for the `add` subcommand. Mirrors the create CLI's `ScaffoldOptions`
|
|
3
|
+
* but minimal — we only need the plugin selection. Everything else is derived
|
|
4
|
+
* from the project we're patching.
|
|
5
|
+
*/
|
|
6
|
+
export interface AddToExistingOptions {
|
|
7
|
+
/** Directory of the existing Vendure project. Defaults to cwd. */
|
|
8
|
+
projectDir: string;
|
|
9
|
+
/** Plugin keys to include (optional/requires-config). Core plugins are always added. */
|
|
10
|
+
selectedPlugins: string[];
|
|
11
|
+
/** Print actions without writing files. */
|
|
12
|
+
dryRun: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Vendure private-registry npm auth token. When supplied, written as
|
|
15
|
+
* `_authToken` into the project `.npmrc` (literal value) so
|
|
16
|
+
* `${pm} install` can pull `@vendure-platform/*` packages without any
|
|
17
|
+
* pre-existing `~/.npmrc` setup. The project `.gitignore` is updated to
|
|
18
|
+
* ignore `.npmrc` so the literal token never gets committed.
|
|
19
|
+
*
|
|
20
|
+
* Distinct from `licenseToken`. When omitted, only the scope mapping is
|
|
21
|
+
* written and the user is expected to have `~/.npmrc` set up, or to
|
|
22
|
+
* re-run with `--registry-token` later.
|
|
23
|
+
*/
|
|
24
|
+
registryToken?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Vendure Platform server-side license token. When supplied, written as
|
|
27
|
+
* `VENDURE_PLATFORM_LICENSE_TOKEN` into `.env` (filling an empty
|
|
28
|
+
* existing value, never overwriting a non-empty one). Read at boot by
|
|
29
|
+
* the License Guard plugin.
|
|
30
|
+
*
|
|
31
|
+
* Distinct from `registryToken`.
|
|
32
|
+
*/
|
|
33
|
+
licenseToken?: string;
|
|
34
|
+
}
|
|
35
|
+
interface DetectedProject {
|
|
36
|
+
projectDir: string;
|
|
37
|
+
/** Path to `package.json` of the project we'll patch. */
|
|
38
|
+
packageJsonPath: string;
|
|
39
|
+
/** Resolved path to `vendure-config.ts`, or `null` if we can't find one. */
|
|
40
|
+
vendureConfigPath: string | null;
|
|
41
|
+
/** Whether `@vendure/core` was found in `package.json` dependencies. */
|
|
42
|
+
hasVendureCore: boolean;
|
|
43
|
+
/** Resolved path to `.env`, may not exist yet. */
|
|
44
|
+
envPath: string;
|
|
45
|
+
/** Resolved path to `.npmrc`, may not exist yet. */
|
|
46
|
+
npmrcPath: string;
|
|
47
|
+
/** Resolved path to `.gitignore`, may not exist yet. */
|
|
48
|
+
gitignorePath: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Detect the layout of an existing Vendure project.
|
|
52
|
+
*
|
|
53
|
+
* We look for `@vendure/core` in `package.json` and a `vendure-config.ts` file
|
|
54
|
+
* somewhere under `src/`. We don't enforce a specific layout — if we can't
|
|
55
|
+
* find the config we just skip the snippet step and tell the user.
|
|
56
|
+
*/
|
|
57
|
+
export declare function detectExistingProject(projectDir: string): Promise<DetectedProject>;
|
|
58
|
+
/**
|
|
59
|
+
* Apply the safe-to-modify changes:
|
|
60
|
+
* 1. Add `@vendure-platform/platform` and any selected requires-config
|
|
61
|
+
* plugin packages to `package.json` dependencies.
|
|
62
|
+
* 2. Append missing env vars to `.env` (idempotent — never overwrite values).
|
|
63
|
+
* 3. Ensure `.npmrc` declares the `@vendure-platform` scope.
|
|
64
|
+
* 4. Write a `vendure-platform-snippet.md` next to the config containing
|
|
65
|
+
* the exact import + spread to paste into `vendure-config.ts`.
|
|
66
|
+
*
|
|
67
|
+
* Returns a checklist of next steps to print at the end.
|
|
68
|
+
*/
|
|
69
|
+
export declare function applyAddToExisting(detected: DetectedProject, options: AddToExistingOptions): Promise<string[]>;
|
|
70
|
+
export declare function runAddToExistingCli(flags: {
|
|
71
|
+
plugins?: string;
|
|
72
|
+
dryRun?: boolean;
|
|
73
|
+
registryToken?: string;
|
|
74
|
+
licenseToken?: string;
|
|
75
|
+
}): Promise<AddToExistingOptions>;
|
|
76
|
+
/**
|
|
77
|
+
* Top-level entry point — wired up from `bin/run.ts`.
|
|
78
|
+
*/
|
|
79
|
+
export declare function addToExisting(options: AddToExistingOptions): Promise<void>;
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.detectExistingProject = detectExistingProject;
|
|
37
|
+
exports.applyAddToExisting = applyAddToExisting;
|
|
38
|
+
exports.runAddToExistingCli = runAddToExistingCli;
|
|
39
|
+
exports.addToExisting = addToExisting;
|
|
40
|
+
const fs = __importStar(require("fs-extra"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const p = __importStar(require("@clack/prompts"));
|
|
43
|
+
const plugin_registry_1 = require("./plugin-registry");
|
|
44
|
+
const registry_1 = require("./registry");
|
|
45
|
+
const template_renderer_1 = require("./template-renderer");
|
|
46
|
+
const SNIPPET_FILENAME = 'vendure-platform-snippet.md';
|
|
47
|
+
/**
|
|
48
|
+
* Detect the layout of an existing Vendure project.
|
|
49
|
+
*
|
|
50
|
+
* We look for `@vendure/core` in `package.json` and a `vendure-config.ts` file
|
|
51
|
+
* somewhere under `src/`. We don't enforce a specific layout — if we can't
|
|
52
|
+
* find the config we just skip the snippet step and tell the user.
|
|
53
|
+
*/
|
|
54
|
+
async function detectExistingProject(projectDir) {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
const packageJsonPath = path.join(projectDir, 'package.json');
|
|
57
|
+
if (!(await fs.pathExists(packageJsonPath))) {
|
|
58
|
+
throw new Error(`No package.json found at ${packageJsonPath}. Run this from your Vendure project root.`);
|
|
59
|
+
}
|
|
60
|
+
const pkg = await fs.readJson(packageJsonPath);
|
|
61
|
+
const deps = { ...((_a = pkg.dependencies) !== null && _a !== void 0 ? _a : {}), ...((_b = pkg.devDependencies) !== null && _b !== void 0 ? _b : {}) };
|
|
62
|
+
const hasVendureCore = '@vendure/core' in deps;
|
|
63
|
+
// Search a few likely locations for vendure-config.ts. Customers vary —
|
|
64
|
+
// some use src/, some use server/src/. We try the common spots; if we
|
|
65
|
+
// can't find one we surface that to the user but keep going.
|
|
66
|
+
const configCandidates = [
|
|
67
|
+
path.join(projectDir, 'src', 'vendure-config.ts'),
|
|
68
|
+
path.join(projectDir, 'server', 'src', 'vendure-config.ts'),
|
|
69
|
+
path.join(projectDir, 'src', 'vendure-config.js'),
|
|
70
|
+
];
|
|
71
|
+
let vendureConfigPath = null;
|
|
72
|
+
for (const candidate of configCandidates) {
|
|
73
|
+
if (await fs.pathExists(candidate)) {
|
|
74
|
+
vendureConfigPath = candidate;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
projectDir,
|
|
80
|
+
packageJsonPath,
|
|
81
|
+
vendureConfigPath,
|
|
82
|
+
hasVendureCore,
|
|
83
|
+
envPath: path.join(projectDir, '.env'),
|
|
84
|
+
npmrcPath: path.join(projectDir, '.npmrc'),
|
|
85
|
+
gitignorePath: path.join(projectDir, '.gitignore'),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Apply the safe-to-modify changes:
|
|
90
|
+
* 1. Add `@vendure-platform/platform` and any selected requires-config
|
|
91
|
+
* plugin packages to `package.json` dependencies.
|
|
92
|
+
* 2. Append missing env vars to `.env` (idempotent — never overwrite values).
|
|
93
|
+
* 3. Ensure `.npmrc` declares the `@vendure-platform` scope.
|
|
94
|
+
* 4. Write a `vendure-platform-snippet.md` next to the config containing
|
|
95
|
+
* the exact import + spread to paste into `vendure-config.ts`.
|
|
96
|
+
*
|
|
97
|
+
* Returns a checklist of next steps to print at the end.
|
|
98
|
+
*/
|
|
99
|
+
async function applyAddToExisting(detected, options) {
|
|
100
|
+
const { selectedPlugins, dryRun, registryToken, licenseToken } = options;
|
|
101
|
+
const resolvedKeys = (0, plugin_registry_1.resolveActivePluginKeys)(selectedPlugins);
|
|
102
|
+
const resolvedPlugins = resolvedKeys.map((k) => (0, plugin_registry_1.getPlugin)(k));
|
|
103
|
+
const versionSpec = (0, template_renderer_1.resolvePluginVersionSpec)();
|
|
104
|
+
const checklist = [];
|
|
105
|
+
// 1. package.json — add `@vendure-platform/platform` AND each resolved
|
|
106
|
+
// plugin's package as a direct dep. Listing only `platform` would
|
|
107
|
+
// work on npm/bun (which hoist transitives) but break under
|
|
108
|
+
// pnpm strict mode, and would also leave the user's snippet
|
|
109
|
+
// imports like `import { SqlAnalyticsStrategy } from
|
|
110
|
+
// '@vendure-platform/advanced-search'` looking at an undeclared
|
|
111
|
+
// dependency. This matches what the fresh-scaffold flow writes.
|
|
112
|
+
//
|
|
113
|
+
// We intentionally do NOT add `@vendure-platform/data-populator`,
|
|
114
|
+
// `integration`, or `scenario-default` here — those are
|
|
115
|
+
// scaffold-specific (used by the generated populate.ts boot code)
|
|
116
|
+
// and irrelevant to an existing project the user is patching.
|
|
117
|
+
const pluginPackageNames = resolvedPlugins.map((p) => p.packageName);
|
|
118
|
+
const addedDeps = await patchPackageJson(detected.packageJsonPath, versionSpec, pluginPackageNames, dryRun);
|
|
119
|
+
if (addedDeps.length > 0) {
|
|
120
|
+
const summary = addedDeps.length === 1
|
|
121
|
+
? addedDeps[0]
|
|
122
|
+
: `${addedDeps.length} packages (${addedDeps[0]}, …)`;
|
|
123
|
+
checklist.push(`Added ${summary} at ${versionSpec} to package.json — run \`npm install\` (or your package manager equivalent).`);
|
|
124
|
+
}
|
|
125
|
+
// 2. .env — append missing env vars from selected plugins. If we have a
|
|
126
|
+
// license token, seed it as the default value for VENDURE_PLATFORM_LICENSE_TOKEN
|
|
127
|
+
// so the user doesn't have to paste it twice.
|
|
128
|
+
const envAdditions = collectEnvAdditions(resolvedPlugins, licenseToken);
|
|
129
|
+
const appendedCount = await appendMissingEnvVars(detected.envPath, envAdditions, dryRun);
|
|
130
|
+
if (appendedCount > 0) {
|
|
131
|
+
checklist.push(`Appended ${appendedCount} env var(s) to .env — fill in real values before booting.`);
|
|
132
|
+
}
|
|
133
|
+
// 2a. Recovery path: if the user previously ran `create add` without a
|
|
134
|
+
// token (leaving `VENDURE_PLATFORM_LICENSE_TOKEN=` empty in .env)
|
|
135
|
+
// and is now re-running with a token, fill that empty value in.
|
|
136
|
+
// Never overwrite a non-empty value — that's still the user's
|
|
137
|
+
// intentional setting.
|
|
138
|
+
if (licenseToken) {
|
|
139
|
+
const filled = await fillEmptyLicenseTokenInEnv(detected.envPath, licenseToken, dryRun);
|
|
140
|
+
if (filled) {
|
|
141
|
+
checklist.push(`Filled in the empty VENDURE_PLATFORM_LICENSE_TOKEN value in .env.`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// 3. .npmrc — declare the @vendure-platform scope, and (if a registry
|
|
145
|
+
// token was provided) the `_authToken` line so `${pm} install` works
|
|
146
|
+
// without any `~/.npmrc` setup. The token is the literal value, not
|
|
147
|
+
// env-var indirection — npm cannot read `.env` during install, so
|
|
148
|
+
// indirection would only work when the user manually exports the env
|
|
149
|
+
// var. The project `.gitignore` is updated below to keep this file
|
|
150
|
+
// untracked.
|
|
151
|
+
const npmrcResult = await ensureNpmrcScopeAndAuth(detected.npmrcPath, registryToken, dryRun);
|
|
152
|
+
if (npmrcResult.scopeAdded || npmrcResult.authAdded) {
|
|
153
|
+
const bits = [];
|
|
154
|
+
if (npmrcResult.scopeAdded)
|
|
155
|
+
bits.push('scope');
|
|
156
|
+
if (npmrcResult.authAdded)
|
|
157
|
+
bits.push('auth token');
|
|
158
|
+
checklist.push(`Updated .npmrc (${bits.join(' + ')}).`);
|
|
159
|
+
}
|
|
160
|
+
// 3a. .gitignore — make sure .npmrc never gets committed. We do this
|
|
161
|
+
// unconditionally (even without a token) so future runs that add a
|
|
162
|
+
// token to the existing scope-only .npmrc don't accidentally commit
|
|
163
|
+
// it. Without a token in play the entry is harmless either way.
|
|
164
|
+
const gitignoreAdded = await ensureGitignoreEntry(detected.gitignorePath, '.npmrc', dryRun);
|
|
165
|
+
if (gitignoreAdded) {
|
|
166
|
+
checklist.push(`Added .npmrc to .gitignore so any future registry token never gets committed.`);
|
|
167
|
+
}
|
|
168
|
+
// 4. vendure-platform-snippet.md — generate paste-in instructions
|
|
169
|
+
const snippet = renderConfigSnippet(resolvedPlugins, resolvedKeys);
|
|
170
|
+
const snippetPath = detected.vendureConfigPath
|
|
171
|
+
? path.join(path.dirname(detected.vendureConfigPath), SNIPPET_FILENAME)
|
|
172
|
+
: path.join(detected.projectDir, SNIPPET_FILENAME);
|
|
173
|
+
if (!dryRun) {
|
|
174
|
+
await fs.writeFile(snippetPath, snippet);
|
|
175
|
+
}
|
|
176
|
+
checklist.push(`Wrote ${path.relative(detected.projectDir, snippetPath)} — copy the snippet into your vendure-config.ts.`);
|
|
177
|
+
// 5. Downstream reminders (not automated)
|
|
178
|
+
checklist.push('Generate and run a migration for the new platform entities.');
|
|
179
|
+
checklist.push('Rebuild the dashboard if you serve a pre-built artefact.');
|
|
180
|
+
checklist.push('Grant new permissions to existing admin roles via Settings → Roles.');
|
|
181
|
+
return checklist;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Add `@vendure-platform/platform` plus each resolved plugin package to
|
|
185
|
+
* `package.json` dependencies (idempotent — already-present packages are
|
|
186
|
+
* left at their existing version, never downgraded). Returns the list of
|
|
187
|
+
* packages we actually added so the caller can report a useful checklist
|
|
188
|
+
* line and skip the message entirely when nothing changed.
|
|
189
|
+
*/
|
|
190
|
+
async function patchPackageJson(packageJsonPath, versionSpec, pluginPackageNames, dryRun) {
|
|
191
|
+
var _a;
|
|
192
|
+
const pkg = await fs.readJson(packageJsonPath);
|
|
193
|
+
(_a = pkg.dependencies) !== null && _a !== void 0 ? _a : (pkg.dependencies = {});
|
|
194
|
+
// Sort so the checklist message is deterministic and the platform
|
|
195
|
+
// meta-package always lands first (it's the "headline" dep).
|
|
196
|
+
const allPackages = ['@vendure-platform/platform', ...pluginPackageNames]
|
|
197
|
+
.filter((name, i, arr) => arr.indexOf(name) === i);
|
|
198
|
+
const added = [];
|
|
199
|
+
for (const name of allPackages) {
|
|
200
|
+
if (!pkg.dependencies[name]) {
|
|
201
|
+
pkg.dependencies[name] = versionSpec;
|
|
202
|
+
added.push(name);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (added.length > 0 && !dryRun) {
|
|
206
|
+
await fs.writeJson(packageJsonPath, pkg, { spaces: 2 });
|
|
207
|
+
}
|
|
208
|
+
return added;
|
|
209
|
+
}
|
|
210
|
+
function collectEnvAdditions(plugins, licenseToken) {
|
|
211
|
+
// Always include the license guard vars even if the plugin isn't selected
|
|
212
|
+
// — they're required for boot.
|
|
213
|
+
const additions = [
|
|
214
|
+
{ name: 'VENDURE_PLATFORM_LICENSE_TOKEN', defaultValue: licenseToken !== null && licenseToken !== void 0 ? licenseToken : '' },
|
|
215
|
+
{ name: 'VENDURE_PLATFORM_LICENSE_GUARD_LOCAL_DEV', defaultValue: '1' },
|
|
216
|
+
];
|
|
217
|
+
for (const pl of plugins) {
|
|
218
|
+
for (const v of pl.envVars) {
|
|
219
|
+
if (!additions.some((a) => a.name === v.name)) {
|
|
220
|
+
additions.push(v);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return additions;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Find a `VENDURE_PLATFORM_LICENSE_TOKEN=` line with an empty value and
|
|
228
|
+
* fill it in with `token`. Used to recover from a previous `create add` run
|
|
229
|
+
* that didn't have a token to hand.
|
|
230
|
+
*
|
|
231
|
+
* - `VENDURE_PLATFORM_LICENSE_TOKEN=` → updated to `=<token>`
|
|
232
|
+
* - `VENDURE_PLATFORM_LICENSE_TOKEN=preexisting`→ left alone
|
|
233
|
+
* - `# VENDURE_PLATFORM_LICENSE_TOKEN=` → left alone (commented out)
|
|
234
|
+
*
|
|
235
|
+
* Returns `true` if the file was modified.
|
|
236
|
+
*/
|
|
237
|
+
async function fillEmptyLicenseTokenInEnv(envPath, token, dryRun) {
|
|
238
|
+
if (!(await fs.pathExists(envPath)))
|
|
239
|
+
return false;
|
|
240
|
+
const existing = await fs.readFile(envPath, 'utf8');
|
|
241
|
+
const lines = existing.split('\n');
|
|
242
|
+
let modified = false;
|
|
243
|
+
const TOKEN_KEY = 'VENDURE_PLATFORM_LICENSE_TOKEN';
|
|
244
|
+
for (let i = 0; i < lines.length; i++) {
|
|
245
|
+
const trimmed = lines[i].trim();
|
|
246
|
+
if (trimmed.startsWith('#'))
|
|
247
|
+
continue;
|
|
248
|
+
if (trimmed === `${TOKEN_KEY}=`) {
|
|
249
|
+
lines[i] = `${TOKEN_KEY}=${token}`;
|
|
250
|
+
modified = true;
|
|
251
|
+
// Only fill the first occurrence — dotenv reads top-down and any
|
|
252
|
+
// subsequent line would be a duplicate the user authored deliberately.
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (modified && !dryRun) {
|
|
257
|
+
await fs.writeFile(envPath, lines.join('\n'));
|
|
258
|
+
}
|
|
259
|
+
return modified;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Append any env vars from `additions` that aren't already declared in
|
|
263
|
+
* `.env`. Idempotent — never overwrites or duplicates an existing key.
|
|
264
|
+
* Returns the count of keys actually appended, so callers can decide
|
|
265
|
+
* whether to surface a "we did something" message.
|
|
266
|
+
*/
|
|
267
|
+
async function appendMissingEnvVars(envPath, additions, dryRun) {
|
|
268
|
+
let existing = '';
|
|
269
|
+
if (await fs.pathExists(envPath)) {
|
|
270
|
+
existing = await fs.readFile(envPath, 'utf8');
|
|
271
|
+
}
|
|
272
|
+
const existingKeys = new Set(existing
|
|
273
|
+
.split('\n')
|
|
274
|
+
.map((line) => { var _a; return (_a = line.split('=')[0]) === null || _a === void 0 ? void 0 : _a.trim(); })
|
|
275
|
+
.filter((k) => Boolean(k) && !k.startsWith('#')));
|
|
276
|
+
const toAdd = additions.filter((a) => !existingKeys.has(a.name));
|
|
277
|
+
if (toAdd.length === 0)
|
|
278
|
+
return 0;
|
|
279
|
+
const header = '\n# Added by @vendure-platform/create add\n';
|
|
280
|
+
const block = toAdd.map((a) => `${a.name}=${a.defaultValue}`).join('\n') + '\n';
|
|
281
|
+
if (!dryRun) {
|
|
282
|
+
const trailing = existing.endsWith('\n') || existing === '' ? '' : '\n';
|
|
283
|
+
await fs.writeFile(envPath, existing + trailing + header + block);
|
|
284
|
+
}
|
|
285
|
+
return toAdd.length;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Ensure the project-level `.npmrc` declares both the `@vendure-platform`
|
|
289
|
+
* scope and (when a registry token is supplied) a registry-scoped
|
|
290
|
+
* `_authToken` line. The registry token is the npm auth token from the
|
|
291
|
+
* Enterprise Portal — distinct from the server-side license token, which
|
|
292
|
+
* lives in `.env` and is handled by the env-writing path.
|
|
293
|
+
*
|
|
294
|
+
* The auth line uses the **literal token value**, not env-var indirection.
|
|
295
|
+
* npm reads `.npmrc` at install time and only resolves `${VAR}` against the
|
|
296
|
+
* process environment — it doesn't load `.env` files. Env-var indirection
|
|
297
|
+
* would therefore only work when the user has manually exported the var,
|
|
298
|
+
* which defeats the point of bundling the token at scaffold time. Project
|
|
299
|
+
* `.gitignore` is updated separately to keep this file untracked.
|
|
300
|
+
*
|
|
301
|
+
* Idempotent: lines that already exist are left alone.
|
|
302
|
+
*/
|
|
303
|
+
async function ensureNpmrcScopeAndAuth(npmrcPath, registryToken, dryRun) {
|
|
304
|
+
const registryUrl = (0, registry_1.getRegistryUrl)();
|
|
305
|
+
const registryHost = (0, registry_1.getRegistryHostname)();
|
|
306
|
+
const scopeLine = `@vendure-platform:registry=${registryUrl}`;
|
|
307
|
+
// `npm login` writes the auth-token line with a leading `//` and a
|
|
308
|
+
// trailing slash before `:_authToken`. We match that convention so a
|
|
309
|
+
// subsequent `npm login` / `npm logout` rewrite cleanly.
|
|
310
|
+
const authLineKey = `//${registryHost}/:_authToken=`;
|
|
311
|
+
let existing = '';
|
|
312
|
+
if (await fs.pathExists(npmrcPath)) {
|
|
313
|
+
existing = await fs.readFile(npmrcPath, 'utf8');
|
|
314
|
+
}
|
|
315
|
+
const hasScope = existing.includes('@vendure-platform:registry=');
|
|
316
|
+
const hasAuth = existing.includes(authLineKey);
|
|
317
|
+
const linesToAdd = [];
|
|
318
|
+
if (!hasScope)
|
|
319
|
+
linesToAdd.push(scopeLine);
|
|
320
|
+
if (registryToken && !hasAuth)
|
|
321
|
+
linesToAdd.push(`${authLineKey}${registryToken}`);
|
|
322
|
+
if (linesToAdd.length === 0) {
|
|
323
|
+
return { scopeAdded: false, authAdded: false };
|
|
324
|
+
}
|
|
325
|
+
const trailing = existing === '' || existing.endsWith('\n') ? '' : '\n';
|
|
326
|
+
if (!dryRun) {
|
|
327
|
+
await fs.writeFile(npmrcPath, existing + trailing + linesToAdd.join('\n') + '\n');
|
|
328
|
+
}
|
|
329
|
+
return {
|
|
330
|
+
scopeAdded: !hasScope,
|
|
331
|
+
authAdded: Boolean(registryToken) && !hasAuth,
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Ensure `entry` appears as its own line in `.gitignore`. Skips if the entry
|
|
336
|
+
* (or a less-specific glob that would match it) is already present. Creates
|
|
337
|
+
* the file when missing.
|
|
338
|
+
*/
|
|
339
|
+
async function ensureGitignoreEntry(gitignorePath, entry, dryRun) {
|
|
340
|
+
let existing = '';
|
|
341
|
+
if (await fs.pathExists(gitignorePath)) {
|
|
342
|
+
existing = await fs.readFile(gitignorePath, 'utf8');
|
|
343
|
+
}
|
|
344
|
+
const lines = existing.split('\n').map((l) => l.trim());
|
|
345
|
+
if (lines.includes(entry) || lines.includes(`/${entry}`)) {
|
|
346
|
+
return false;
|
|
347
|
+
}
|
|
348
|
+
const trailing = existing === '' || existing.endsWith('\n') ? '' : '\n';
|
|
349
|
+
if (!dryRun) {
|
|
350
|
+
await fs.writeFile(gitignorePath, existing + trailing + entry + '\n');
|
|
351
|
+
}
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
354
|
+
function renderConfigSnippet(plugins, resolvedKeys) {
|
|
355
|
+
const imports = [`import { VendurePlatform } from '@vendure-platform/platform';`];
|
|
356
|
+
const optionsBlocks = [];
|
|
357
|
+
for (const pl of plugins) {
|
|
358
|
+
if (pl.platformImports)
|
|
359
|
+
imports.push(...pl.platformImports);
|
|
360
|
+
if (pl.platformOptionsBlock) {
|
|
361
|
+
optionsBlocks.push(` ${pl.platformOptionsBlock},`);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
// Plugins that are optional but the user didn't pick → emit `key: false`
|
|
365
|
+
const disabledKeys = plugin_registry_1.pluginRegistry
|
|
366
|
+
.filter((pl) => pl.tier === 'optional' && !resolvedKeys.includes(pl.key))
|
|
367
|
+
.map((pl) => pl.key);
|
|
368
|
+
for (const key of disabledKeys) {
|
|
369
|
+
const platformKey = (0, plugin_registry_1.getPlugin)(key).platformKey;
|
|
370
|
+
optionsBlocks.push(` ${platformKey}: false,`);
|
|
371
|
+
}
|
|
372
|
+
const importsText = imports.join('\n');
|
|
373
|
+
const optionsText = optionsBlocks.length === 0
|
|
374
|
+
? ' // All optional plugins enabled with default config'
|
|
375
|
+
: optionsBlocks.join('\n');
|
|
376
|
+
return `# Adding Vendure Platform to vendure-config.ts
|
|
377
|
+
|
|
378
|
+
Paste these changes into your existing \`vendure-config.ts\`.
|
|
379
|
+
|
|
380
|
+
## 1. Imports
|
|
381
|
+
|
|
382
|
+
Add to the top of the file (after your existing imports):
|
|
383
|
+
|
|
384
|
+
\`\`\`ts
|
|
385
|
+
${importsText}
|
|
386
|
+
\`\`\`
|
|
387
|
+
|
|
388
|
+
## 2. Plugins array
|
|
389
|
+
|
|
390
|
+
Spread \`VendurePlatform.init({...})\` into the \`plugins\` array — typically
|
|
391
|
+
between \`DefaultJobQueuePlugin\` and \`DashboardPlugin\`:
|
|
392
|
+
|
|
393
|
+
\`\`\`ts
|
|
394
|
+
...VendurePlatform.init({
|
|
395
|
+
${optionsText}
|
|
396
|
+
}),
|
|
397
|
+
\`\`\`
|
|
398
|
+
|
|
399
|
+
## 3. Order process
|
|
400
|
+
|
|
401
|
+
If \`approvalWorkflows\` is enabled (default), VendurePlatform will append
|
|
402
|
+
\`approvalOrderProcess\` to your order process chain and override
|
|
403
|
+
\`arrangingPaymentRequiresContents\` and \`checkAllItemsBeforeCancel\`. If you
|
|
404
|
+
have custom order process handlers they are preserved; the flags above are
|
|
405
|
+
not.
|
|
406
|
+
|
|
407
|
+
See https://docs.platform.vendure.io for the full reference.
|
|
408
|
+
`;
|
|
409
|
+
}
|
|
410
|
+
async function runAddToExistingCli(flags) {
|
|
411
|
+
var _a;
|
|
412
|
+
const projectDir = process.cwd();
|
|
413
|
+
const detected = await detectExistingProject(projectDir);
|
|
414
|
+
if (!detected.hasVendureCore) {
|
|
415
|
+
p.log.warn('No @vendure/core dependency found in package.json. Continuing anyway — make sure this is the right directory.');
|
|
416
|
+
}
|
|
417
|
+
if (!detected.vendureConfigPath) {
|
|
418
|
+
p.log.warn('No vendure-config.ts found under src/ or server/src/. The snippet file will be written to the project root.');
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
p.log.info(`Detected vendure-config.ts at ${path.relative(projectDir, detected.vendureConfigPath)}`);
|
|
422
|
+
}
|
|
423
|
+
const hasIntro = flags.plugins === undefined ||
|
|
424
|
+
flags.registryToken === undefined ||
|
|
425
|
+
flags.licenseToken === undefined;
|
|
426
|
+
if (hasIntro) {
|
|
427
|
+
p.intro('Add Vendure Platform to existing project');
|
|
428
|
+
}
|
|
429
|
+
let selectedPlugins;
|
|
430
|
+
if (flags.plugins !== undefined) {
|
|
431
|
+
selectedPlugins = flags.plugins
|
|
432
|
+
.split(',')
|
|
433
|
+
.map((k) => k.trim())
|
|
434
|
+
.filter(Boolean);
|
|
435
|
+
}
|
|
436
|
+
else {
|
|
437
|
+
const pluginOptions = plugin_registry_1.pluginRegistry
|
|
438
|
+
.filter((pl) => pl.tier === 'optional' || pl.tier === 'requires-config')
|
|
439
|
+
.sort((a, b) => {
|
|
440
|
+
if (a.category !== b.category)
|
|
441
|
+
return a.category.localeCompare(b.category);
|
|
442
|
+
return a.displayName.localeCompare(b.displayName);
|
|
443
|
+
})
|
|
444
|
+
.map((pl) => ({
|
|
445
|
+
label: `${pl.displayName} (${pl.category})`,
|
|
446
|
+
value: pl.key,
|
|
447
|
+
hint: pl.tier === 'requires-config' ? 'needs configuration' : undefined,
|
|
448
|
+
}));
|
|
449
|
+
const initialValues = plugin_registry_1.pluginRegistry.filter((pl) => pl.tier === 'optional').map((pl) => pl.key);
|
|
450
|
+
const answer = await p.multiselect({
|
|
451
|
+
message: 'Optional plugins to include (core plugins are always installed):',
|
|
452
|
+
options: pluginOptions,
|
|
453
|
+
initialValues,
|
|
454
|
+
required: false,
|
|
455
|
+
});
|
|
456
|
+
if (typeof answer === 'symbol') {
|
|
457
|
+
p.cancel('Cancelled.');
|
|
458
|
+
process.exit(0);
|
|
459
|
+
}
|
|
460
|
+
selectedPlugins = answer;
|
|
461
|
+
}
|
|
462
|
+
// Two separate prompts: registry token (for .npmrc — needed by `${pm}
|
|
463
|
+
// install`) and license token (for .env — read at server boot). The
|
|
464
|
+
// Enterprise Portal issues these as two distinct values with different
|
|
465
|
+
// rotation policies, so we never collapse them.
|
|
466
|
+
const registryToken = await promptForOptionalToken(flags.registryToken, 'Vendure private-registry npm auth token (from https://enterprise.vendure.io). Used by your package manager (npm/bun/pnpm) at install time. Leave blank to skip:');
|
|
467
|
+
const licenseToken = await promptForOptionalToken(flags.licenseToken, 'Vendure Platform license token (server-side, written to .env). Leave blank to skip:');
|
|
468
|
+
return {
|
|
469
|
+
projectDir,
|
|
470
|
+
selectedPlugins,
|
|
471
|
+
dryRun: (_a = flags.dryRun) !== null && _a !== void 0 ? _a : false,
|
|
472
|
+
registryToken,
|
|
473
|
+
licenseToken,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Pre-resolve from a flag if given, otherwise interactively prompt with a
|
|
478
|
+
* masked password input. Empty / whitespace-only answers normalise to
|
|
479
|
+
* `undefined` so downstream "if a token was supplied" checks read cleanly.
|
|
480
|
+
*/
|
|
481
|
+
async function promptForOptionalToken(flagValue, message) {
|
|
482
|
+
const fromFlag = flagValue === null || flagValue === void 0 ? void 0 : flagValue.trim();
|
|
483
|
+
if (fromFlag !== undefined) {
|
|
484
|
+
return fromFlag === '' ? undefined : fromFlag;
|
|
485
|
+
}
|
|
486
|
+
const answer = await p.password({ message });
|
|
487
|
+
if (typeof answer === 'symbol') {
|
|
488
|
+
p.cancel('Cancelled.');
|
|
489
|
+
process.exit(0);
|
|
490
|
+
}
|
|
491
|
+
const trimmed = answer.trim();
|
|
492
|
+
return trimmed === '' ? undefined : trimmed;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Top-level entry point — wired up from `bin/run.ts`.
|
|
496
|
+
*/
|
|
497
|
+
async function addToExisting(options) {
|
|
498
|
+
const detected = await detectExistingProject(options.projectDir);
|
|
499
|
+
const alwaysOn = plugin_registry_1.ALWAYS_ACTIVE_KEYS.map((k) => (0, plugin_registry_1.getPlugin)(k).displayName);
|
|
500
|
+
if (alwaysOn.length > 0) {
|
|
501
|
+
p.log.info(`Always-on core plugins: ${alwaysOn.join(', ')}`);
|
|
502
|
+
}
|
|
503
|
+
const checklist = await applyAddToExisting(detected, options);
|
|
504
|
+
const numbered = checklist.map((line, i) => `${i + 1}. ${line}`).join('\n');
|
|
505
|
+
p.note(numbered, options.dryRun ? 'Dry run — would do:' : 'Next steps');
|
|
506
|
+
p.outro(options.dryRun ? 'Dry run complete — no files written.' : 'Done.');
|
|
507
|
+
}
|
|
508
|
+
//# sourceMappingURL=add-to-existing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-to-existing.js","sourceRoot":"","sources":["../src/add-to-existing.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,sDAmCC;AAaD,gDA8FC;AA0QD,kDA8EC;AAwBD,sCAUC;AA5kBD,6CAA+B;AAC/B,2CAA6B;AAC7B,kDAAoC;AACpC,uDAA2G;AAC3G,yCAAiE;AACjE,2DAA+D;AAG/D,MAAM,gBAAgB,GAAG,6BAA6B,CAAC;AAqDv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