@forgecart/cli 1.1.0 → 2.1.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/forgecart.d.ts +2 -0
- package/dist/bin/forgecart.js +4 -0
- package/dist/bin/forgecart.js.map +1 -0
- package/dist/src/cli.d.ts +14 -1
- package/dist/src/cli.js +30 -15
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/init.d.ts +39 -2
- package/dist/src/commands/init.js +173 -301
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/placeholders.d.ts +19 -0
- package/dist/src/commands/placeholders.js +109 -0
- package/dist/src/commands/placeholders.js.map +1 -0
- package/dist/src/output.d.ts +11 -0
- package/dist/src/output.js +16 -0
- package/dist/src/output.js.map +1 -0
- package/package.json +21 -11
- package/templates/storefront/.env.example +12 -0
- package/templates/storefront/.forgecartignore +2 -0
- package/templates/storefront/Procfile +1 -0
- package/templates/storefront/README.md +87 -0
- package/templates/storefront/next.config.js +14 -0
- package/templates/storefront/package.json +25 -0
- package/templates/storefront/postcss.config.js +6 -0
- package/templates/storefront/src/app/cart/page.tsx +88 -0
- package/templates/storefront/src/app/globals.css +13 -0
- package/templates/storefront/src/app/layout.tsx +32 -0
- package/templates/storefront/src/app/page.tsx +49 -0
- package/templates/storefront/src/app/products/[slug]/not-found.tsx +20 -0
- package/templates/storefront/src/app/products/[slug]/page.tsx +61 -0
- package/templates/storefront/src/app/products/page.tsx +27 -0
- package/templates/storefront/src/components/Header.tsx +47 -0
- package/templates/storefront/src/components/ProductCard.tsx +40 -0
- package/templates/storefront/src/components/ProductPurchase.tsx +91 -0
- package/templates/storefront/src/lib/cart-actions.ts +148 -0
- package/templates/storefront/src/lib/cart-context.tsx +88 -0
- package/templates/storefront/src/lib/forgecart.ts +187 -0
- package/{dist/templates/storefront-additions → templates/storefront}/tailwind.config.js +1 -1
- package/templates/storefront/tsconfig.json +23 -0
- package/LICENSE +0 -21
- package/README.md +0 -179
- package/bin/forgecart.js +0 -3
- package/dist/package.json +0 -50
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/commands/delete.d.ts +0 -3
- package/dist/src/commands/delete.d.ts.map +0 -1
- package/dist/src/commands/delete.js +0 -60
- package/dist/src/commands/delete.js.map +0 -1
- package/dist/src/commands/deploy.d.ts +0 -3
- package/dist/src/commands/deploy.d.ts.map +0 -1
- package/dist/src/commands/deploy.js +0 -243
- package/dist/src/commands/deploy.js.map +0 -1
- package/dist/src/commands/env.d.ts +0 -3
- package/dist/src/commands/env.d.ts.map +0 -1
- package/dist/src/commands/env.js +0 -158
- package/dist/src/commands/env.js.map +0 -1
- package/dist/src/commands/init.d.ts.map +0 -1
- package/dist/src/commands/list.d.ts +0 -3
- package/dist/src/commands/list.d.ts.map +0 -1
- package/dist/src/commands/list.js +0 -65
- package/dist/src/commands/list.js.map +0 -1
- package/dist/src/commands/login.d.ts +0 -3
- package/dist/src/commands/login.d.ts.map +0 -1
- package/dist/src/commands/login.js +0 -120
- package/dist/src/commands/login.js.map +0 -1
- package/dist/src/commands/logs.d.ts +0 -3
- package/dist/src/commands/logs.d.ts.map +0 -1
- package/dist/src/commands/logs.js +0 -88
- package/dist/src/commands/logs.js.map +0 -1
- package/dist/src/commands/scale.d.ts +0 -3
- package/dist/src/commands/scale.d.ts.map +0 -1
- package/dist/src/commands/scale.js +0 -49
- package/dist/src/commands/scale.js.map +0 -1
- package/dist/src/commands/status.d.ts +0 -3
- package/dist/src/commands/status.d.ts.map +0 -1
- package/dist/src/commands/status.js +0 -90
- package/dist/src/commands/status.js.map +0 -1
- package/dist/src/commands/whoami.d.ts +0 -3
- package/dist/src/commands/whoami.d.ts.map +0 -1
- package/dist/src/commands/whoami.js +0 -59
- package/dist/src/commands/whoami.js.map +0 -1
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -5
- package/dist/src/index.js.map +0 -1
- package/dist/src/lib/api-client.d.ts +0 -34
- package/dist/src/lib/api-client.d.ts.map +0 -1
- package/dist/src/lib/api-client.js +0 -141
- package/dist/src/lib/api-client.js.map +0 -1
- package/dist/src/lib/archive.d.ts +0 -9
- package/dist/src/lib/archive.d.ts.map +0 -1
- package/dist/src/lib/archive.js +0 -118
- package/dist/src/lib/archive.js.map +0 -1
- package/dist/src/lib/config-updater.d.ts +0 -10
- package/dist/src/lib/config-updater.d.ts.map +0 -1
- package/dist/src/lib/config-updater.js +0 -34
- package/dist/src/lib/config-updater.js.map +0 -1
- package/dist/src/lib/config.d.ts +0 -53
- package/dist/src/lib/config.d.ts.map +0 -1
- package/dist/src/lib/config.js +0 -162
- package/dist/src/lib/config.js.map +0 -1
- package/dist/src/lib/env-sync.d.ts +0 -44
- package/dist/src/lib/env-sync.d.ts.map +0 -1
- package/dist/src/lib/env-sync.js +0 -207
- package/dist/src/lib/env-sync.js.map +0 -1
- package/dist/src/lib/logger.d.ts +0 -15
- package/dist/src/lib/logger.d.ts.map +0 -1
- package/dist/src/lib/logger.js +0 -54
- package/dist/src/lib/logger.js.map +0 -1
- package/dist/src/lib/nx-generator.d.ts +0 -22
- package/dist/src/lib/nx-generator.d.ts.map +0 -1
- package/dist/src/lib/nx-generator.js +0 -345
- package/dist/src/lib/nx-generator.js.map +0 -1
- package/dist/src/lib/standalone.d.ts +0 -28
- package/dist/src/lib/standalone.d.ts.map +0 -1
- package/dist/src/lib/standalone.js +0 -107
- package/dist/src/lib/standalone.js.map +0 -1
- package/dist/src/types/index.d.ts +0 -80
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/types/index.js +0 -14
- package/dist/src/types/index.js.map +0 -1
- package/dist/src/utils/spinner.d.ts +0 -16
- package/dist/src/utils/spinner.d.ts.map +0 -1
- package/dist/src/utils/spinner.js +0 -88
- package/dist/src/utils/spinner.js.map +0 -1
- package/dist/src/utils/validation.d.ts +0 -12
- package/dist/src/utils/validation.d.ts.map +0 -1
- package/dist/src/utils/validation.js +0 -82
- package/dist/src/utils/validation.js.map +0 -1
- package/dist/templates/application-additions/.forgecartignore +0 -37
- package/dist/templates/application-additions/Procfile +0 -1
- package/dist/templates/application-additions/src/app/app.module.ts +0 -16
- package/dist/templates/application-additions/src/services/forgecart.service.ts +0 -62
- package/dist/templates/application-additions/src/services/index.ts +0 -2
- package/dist/templates/application-additions/src/services/product-event-listener.service.ts +0 -150
- package/dist/templates/application-e2e-additions/src/support/global-setup.ts +0 -16
- package/dist/templates/application-e2e-additions/src/support/test-setup.ts +0 -9
- package/dist/templates/storefront-additions/.forgecartignore +0 -64
- package/dist/templates/storefront-additions/Procfile +0 -1
- package/dist/templates/storefront-additions/package.json +0 -11
- package/dist/templates/storefront-additions/postcss.config.js +0 -5
- package/dist/templates/storefront-additions/src/app/cart/page.tsx +0 -77
- package/dist/templates/storefront-additions/src/app/global.css +0 -1
- package/dist/templates/storefront-additions/src/app/layout.tsx +0 -25
- package/dist/templates/storefront-additions/src/app/page.tsx +0 -43
- package/dist/templates/storefront-additions/src/components/AddToCartButton.tsx +0 -29
- package/dist/templates/storefront-additions/src/components/CartItem.tsx +0 -82
- package/dist/templates/storefront-additions/src/components/Header.tsx +0 -42
- package/dist/templates/storefront-additions/src/components/ProductCard.tsx +0 -57
- package/dist/templates/storefront-additions/src/components/QuantitySelector.tsx +0 -35
- package/dist/templates/storefront-additions/src/context/CartContext.tsx +0 -158
- package/dist/templates/storefront-additions/src/lib/forgecart.ts +0 -22
- package/dist/templates/storefront-e2e-additions/playwright.config.ts +0 -26
- package/dist/templates/storefront-e2e-additions/src/example.spec.ts +0 -11
- package/dist/templates/workspace/.nxignore +0 -2
- package/templates/application-additions/.forgecartignore +0 -37
- package/templates/application-additions/Procfile +0 -1
- package/templates/application-additions/src/app/app.module.ts +0 -16
- package/templates/application-additions/src/services/forgecart.service.ts +0 -62
- package/templates/application-additions/src/services/index.ts +0 -2
- package/templates/application-additions/src/services/product-event-listener.service.ts +0 -150
- package/templates/application-e2e-additions/src/support/global-setup.ts +0 -16
- package/templates/application-e2e-additions/src/support/test-setup.ts +0 -9
- package/templates/storefront-additions/.forgecartignore +0 -64
- package/templates/storefront-additions/Procfile +0 -1
- package/templates/storefront-additions/package.json +0 -11
- package/templates/storefront-additions/postcss.config.js +0 -5
- package/templates/storefront-additions/src/app/cart/page.tsx +0 -77
- package/templates/storefront-additions/src/app/global.css +0 -1
- package/templates/storefront-additions/src/app/layout.tsx +0 -25
- package/templates/storefront-additions/src/app/page.tsx +0 -43
- package/templates/storefront-additions/src/components/AddToCartButton.tsx +0 -29
- package/templates/storefront-additions/src/components/CartItem.tsx +0 -82
- package/templates/storefront-additions/src/components/Header.tsx +0 -42
- package/templates/storefront-additions/src/components/ProductCard.tsx +0 -57
- package/templates/storefront-additions/src/components/QuantitySelector.tsx +0 -35
- package/templates/storefront-additions/src/context/CartContext.tsx +0 -158
- package/templates/storefront-additions/src/lib/forgecart.ts +0 -22
- package/templates/storefront-additions/tailwind.config.js +0 -8
- package/templates/storefront-e2e-additions/playwright.config.ts +0 -26
- package/templates/storefront-e2e-additions/src/example.spec.ts +0 -11
- package/templates/workspace/.nxignore +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forgecart.js","sourceRoot":"","sources":["../../bin/forgecart.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,KAAK,GAAG,EAAE,CAAC"}
|
package/dist/src/cli.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
/** CLI version, kept in sync with `package.json`. */
|
|
3
|
+
export declare const CLI_VERSION = "2.0.0";
|
|
4
|
+
/**
|
|
5
|
+
* Build the `forgecart` commander program with the full command surface.
|
|
6
|
+
*
|
|
7
|
+
* `init` is fully implemented; the remaining commands are registered with their
|
|
8
|
+
* exact options/arguments but announce that they arrive with the publish
|
|
9
|
+
* pipeline.
|
|
10
|
+
*/
|
|
2
11
|
export declare function createProgram(): Command;
|
|
3
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Parse argv and execute the program. Any thrown error is surfaced on stderr and
|
|
14
|
+
* the process exits with a non-zero status. Errors are never swallowed.
|
|
15
|
+
*/
|
|
16
|
+
export declare function run(argv?: string[]): Promise<void>;
|
package/dist/src/cli.js
CHANGED
|
@@ -1,32 +1,47 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import {
|
|
3
|
-
import { createDeployCommand } from './commands/
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { createInitCommand } from './commands/init.js';
|
|
3
|
+
import { createDeleteCommand, createDeployCommand, createEnvCommand, createInitApplicationCommand, createListCommand, createLogsCommand, createScaleCommand, createStatusCommand, createWhoamiCommand, } from './commands/placeholders.js';
|
|
4
|
+
import { printError } from './output.js';
|
|
5
|
+
/** CLI version, kept in sync with `package.json`. */
|
|
6
|
+
export const CLI_VERSION = '2.0.0';
|
|
7
|
+
/**
|
|
8
|
+
* Build the `forgecart` commander program with the full command surface.
|
|
9
|
+
*
|
|
10
|
+
* `init` is fully implemented; the remaining commands are registered with their
|
|
11
|
+
* exact options/arguments but announce that they arrive with the publish
|
|
12
|
+
* pipeline.
|
|
13
|
+
*/
|
|
12
14
|
export function createProgram() {
|
|
13
15
|
const program = new Command();
|
|
14
16
|
program
|
|
15
17
|
.name('forgecart')
|
|
16
|
-
.description('CLI
|
|
17
|
-
.version(
|
|
18
|
-
// Add commands
|
|
19
|
-
program.addCommand(createLoginCommand());
|
|
18
|
+
.description('CLI for scaffolding and operating ForgeCart channel storefronts')
|
|
19
|
+
.version(CLI_VERSION);
|
|
20
20
|
program.addCommand(createInitCommand());
|
|
21
21
|
program.addCommand(createInitApplicationCommand());
|
|
22
22
|
program.addCommand(createDeployCommand());
|
|
23
23
|
program.addCommand(createListCommand());
|
|
24
24
|
program.addCommand(createStatusCommand());
|
|
25
|
+
program.addCommand(createLogsCommand());
|
|
25
26
|
program.addCommand(createDeleteCommand());
|
|
26
27
|
program.addCommand(createScaleCommand());
|
|
27
28
|
program.addCommand(createEnvCommand());
|
|
28
|
-
program.addCommand(createLogsCommand());
|
|
29
29
|
program.addCommand(createWhoamiCommand());
|
|
30
30
|
return program;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Parse argv and execute the program. Any thrown error is surfaced on stderr and
|
|
34
|
+
* the process exits with a non-zero status. Errors are never swallowed.
|
|
35
|
+
*/
|
|
36
|
+
export async function run(argv = process.argv) {
|
|
37
|
+
const program = createProgram();
|
|
38
|
+
try {
|
|
39
|
+
await program.parseAsync(argv);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
43
|
+
printError(`Error: ${message}`);
|
|
44
|
+
process.exitCode = 1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
32
47
|
//# sourceMappingURL=cli.js.map
|
package/dist/src/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAC5B,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,qDAAqD;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,OA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C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,41 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
/** Default shop API base. Overridable via `--api-url`. */
|
|
3
|
+
export declare const DEFAULT_SHOP_API_URL = "https://api.forgecart.com";
|
|
4
|
+
/**
|
|
5
|
+
* Environment variable naming a dependency-warmed storefront template — a copy
|
|
6
|
+
* of the bundled template with `node_modules` (and the generated
|
|
7
|
+
* `package-lock.json`) already installed. The workspace-pod image bakes one at
|
|
8
|
+
* build time (`docker/workspace-pod/Dockerfile`) and exports this variable so a
|
|
9
|
+
* pod scaffold copies warm dependencies instead of paying a cold `npm install`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const WORKSPACE_TEMPLATE_DIR_ENV = "WORKSPACE_TEMPLATE_DIR";
|
|
12
|
+
/**
|
|
13
|
+
* Marker file, relative to the scaffolded storefront root, recording that
|
|
14
|
+
* `node_modules` was copied fully installed from a warmed template whose
|
|
15
|
+
* manifest matches this CLI's bundled template. Orchestrators (the agent's
|
|
16
|
+
* `ChannelWorkspaceService`) skip their `npm install` step when the marker is
|
|
17
|
+
* present right after a fresh scaffold; its absence always falls back to a
|
|
18
|
+
* regular install, so older images and cold scaffolds keep working unchanged.
|
|
19
|
+
*/
|
|
20
|
+
export declare const DEPS_READY_MARKER_PATH = ".forgecart/deps-ready.json";
|
|
21
|
+
/** Resolved options for `forgecart init`. */
|
|
22
|
+
export interface InitOptions {
|
|
23
|
+
/** Channel token (required). */
|
|
24
|
+
token?: string;
|
|
25
|
+
/** Shop API base URL. */
|
|
26
|
+
apiUrl: string;
|
|
27
|
+
/** Whether to also scaffold a NestJS application (planned for a later phase). */
|
|
28
|
+
application?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Run `forgecart init`.
|
|
32
|
+
*
|
|
33
|
+
* Resolves the target directory, scaffolds the storefront from the warmed
|
|
34
|
+
* template when one is available (see {@link resolveScaffoldPlan}) or the
|
|
35
|
+
* bundled template otherwise, writes the ForgeCart config and `.env.local`, and
|
|
36
|
+
* prints next steps. Throws a clear Error on any failure (missing token,
|
|
37
|
+
* missing template, copy failure).
|
|
38
|
+
*/
|
|
39
|
+
export declare function runInit(name: string | undefined, options: InitOptions): Promise<void>;
|
|
40
|
+
/** Build the `init [name]` command. */
|
|
2
41
|
export declare function createInitCommand(): Command;
|
|
3
|
-
export declare function createInitApplicationCommand(): Command;
|
|
4
|
-
//# sourceMappingURL=init.d.ts.map
|