quidproquo-cli 0.1.6 → 0.1.8
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/docker/dev-server/Dockerfile +7 -9
- package/lib/commonjs/cli/commandMenu.d.ts +2 -0
- package/lib/commonjs/cli/commandMenu.js +81 -0
- package/lib/commonjs/cli/commandMenu.js.map +1 -0
- package/lib/commonjs/cli/commandRegistry.d.ts +10 -0
- package/lib/commonjs/cli/commandRegistry.js +131 -0
- package/lib/commonjs/cli/commandRegistry.js.map +1 -0
- package/lib/commonjs/cli/runCli.js +49 -49
- package/lib/commonjs/cli/runCli.js.map +1 -1
- package/lib/commonjs/commands/clearResources.d.ts +1 -0
- package/lib/commonjs/commands/clearResources.js +36 -0
- package/lib/commonjs/commands/clearResources.js.map +1 -0
- package/lib/commonjs/commands/go.js +3 -1
- package/lib/commonjs/commands/go.js.map +1 -1
- package/lib/commonjs/commands/goDev.js +23 -122
- package/lib/commonjs/commands/goDev.js.map +1 -1
- package/lib/commonjs/commands/goDevApi.d.ts +1 -0
- package/lib/commonjs/commands/goDevApi.js +110 -0
- package/lib/commonjs/commands/goDevApi.js.map +1 -0
- package/lib/commonjs/commands/goDevWeb.d.ts +4 -1
- package/lib/commonjs/commands/goDevWeb.js +4 -2
- package/lib/commonjs/commands/goDevWeb.js.map +1 -1
- package/lib/commonjs/commands/goDocker.js +3 -1
- package/lib/commonjs/commands/goDocker.js.map +1 -1
- package/lib/commonjs/commands/hooks.js +23 -5
- package/lib/commonjs/commands/hooks.js.map +1 -1
- package/lib/commonjs/lib/clearResourcesPlan.d.ts +15 -0
- package/lib/commonjs/lib/clearResourcesPlan.js +80 -0
- package/lib/commonjs/lib/clearResourcesPlan.js.map +1 -0
- package/lib/commonjs/lib/deployPrompts.d.ts +1 -0
- package/lib/commonjs/lib/deployPrompts.js +40 -2
- package/lib/commonjs/lib/deployPrompts.js.map +1 -1
- package/lib/commonjs/lib/devServerEntry.js +3 -0
- package/lib/commonjs/lib/devServerEntry.js.map +1 -1
- package/lib/commonjs/lib/hooks.d.ts +2 -1
- package/lib/commonjs/lib/hooks.js +100 -5
- package/lib/commonjs/lib/hooks.js.map +1 -1
- package/lib/commonjs/lib/killStaleListeners.d.ts +3 -0
- package/lib/commonjs/lib/killStaleListeners.js +170 -0
- package/lib/commonjs/lib/killStaleListeners.js.map +1 -0
- package/lib/commonjs/lib/prompts.d.ts +10 -0
- package/lib/commonjs/lib/prompts.js +15 -1
- package/lib/commonjs/lib/prompts.js.map +1 -1
- package/lib/commonjs/lib/qpqConfigs.d.ts +1 -0
- package/lib/commonjs/lib/qpqConfigs.js +9 -1
- package/lib/commonjs/lib/qpqConfigs.js.map +1 -1
- package/lib/commonjs/lib/resolveAppSelection.js +1 -1
- package/lib/commonjs/lib/resolveAppSelection.js.map +1 -1
- package/lib/commonjs/lib/runTasks.d.ts +5 -0
- package/lib/commonjs/lib/runTasks.js +82 -1
- package/lib/commonjs/lib/runTasks.js.map +1 -1
- package/lib/commonjs/lib/typeWatcher.d.ts +2 -0
- package/lib/commonjs/lib/typeWatcher.js +59 -0
- package/lib/commonjs/lib/typeWatcher.js.map +1 -0
- package/lib/commonjs/platforms/aws/cdkApp.js +5 -1
- package/lib/commonjs/platforms/aws/cdkApp.js.map +1 -1
- package/lib/commonjs/platforms/aws/clearResources.d.ts +2 -0
- package/lib/commonjs/platforms/aws/clearResources.js +167 -0
- package/lib/commonjs/platforms/aws/clearResources.js.map +1 -0
- package/lib/commonjs/platforms/aws/go.js +15 -1
- package/lib/commonjs/platforms/aws/go.js.map +1 -1
- package/lib/commonjs/platforms/aws/goDocker.js +76 -8
- package/lib/commonjs/platforms/aws/goDocker.js.map +1 -1
- package/lib/commonjs/platforms/aws/index.js +2 -0
- package/lib/commonjs/platforms/aws/index.js.map +1 -1
- package/lib/commonjs/platforms/docker/go.js +2 -2
- package/lib/commonjs/platforms/docker/go.js.map +1 -1
- package/lib/commonjs/platforms/types.d.ts +2 -0
- package/lib/commonjs/platforms/types.js.map +1 -1
- package/lib/esm/cli/commandMenu.d.ts +2 -0
- package/lib/esm/cli/commandMenu.js +67 -0
- package/lib/esm/cli/commandMenu.js.map +1 -0
- package/lib/esm/cli/commandRegistry.d.ts +10 -0
- package/lib/esm/cli/commandRegistry.js +115 -0
- package/lib/esm/cli/commandRegistry.js.map +1 -0
- package/lib/esm/cli/runCli.js +49 -49
- package/lib/esm/cli/runCli.js.map +1 -1
- package/lib/esm/commands/clearResources.d.ts +1 -0
- package/lib/esm/commands/clearResources.js +23 -0
- package/lib/esm/commands/clearResources.js.map +1 -0
- package/lib/esm/commands/go.js +3 -2
- package/lib/esm/commands/go.js.map +1 -1
- package/lib/esm/commands/goDev.js +24 -120
- package/lib/esm/commands/goDev.js.map +1 -1
- package/lib/esm/commands/goDevApi.d.ts +1 -0
- package/lib/esm/commands/goDevApi.js +94 -0
- package/lib/esm/commands/goDevApi.js.map +1 -0
- package/lib/esm/commands/goDevWeb.d.ts +4 -1
- package/lib/esm/commands/goDevWeb.js +4 -2
- package/lib/esm/commands/goDevWeb.js.map +1 -1
- package/lib/esm/commands/goDocker.js +3 -2
- package/lib/esm/commands/goDocker.js.map +1 -1
- package/lib/esm/commands/hooks.js +21 -6
- package/lib/esm/commands/hooks.js.map +1 -1
- package/lib/esm/lib/clearResourcesPlan.d.ts +15 -0
- package/lib/esm/lib/clearResourcesPlan.js +66 -0
- package/lib/esm/lib/clearResourcesPlan.js.map +1 -0
- package/lib/esm/lib/deployPrompts.d.ts +1 -0
- package/lib/esm/lib/deployPrompts.js +38 -1
- package/lib/esm/lib/deployPrompts.js.map +1 -1
- package/lib/esm/lib/devServerEntry.js +3 -0
- package/lib/esm/lib/devServerEntry.js.map +1 -1
- package/lib/esm/lib/hooks.d.ts +2 -1
- package/lib/esm/lib/hooks.js +97 -5
- package/lib/esm/lib/hooks.js.map +1 -1
- package/lib/esm/lib/killStaleListeners.d.ts +3 -0
- package/lib/esm/lib/killStaleListeners.js +161 -0
- package/lib/esm/lib/killStaleListeners.js.map +1 -0
- package/lib/esm/lib/prompts.d.ts +10 -0
- package/lib/esm/lib/prompts.js +12 -0
- package/lib/esm/lib/prompts.js.map +1 -1
- package/lib/esm/lib/qpqConfigs.d.ts +1 -0
- package/lib/esm/lib/qpqConfigs.js +7 -0
- package/lib/esm/lib/qpqConfigs.js.map +1 -1
- package/lib/esm/lib/resolveAppSelection.js +1 -1
- package/lib/esm/lib/resolveAppSelection.js.map +1 -1
- package/lib/esm/lib/runTasks.d.ts +5 -0
- package/lib/esm/lib/runTasks.js +80 -0
- package/lib/esm/lib/runTasks.js.map +1 -1
- package/lib/esm/lib/typeWatcher.d.ts +2 -0
- package/lib/esm/lib/typeWatcher.js +51 -0
- package/lib/esm/lib/typeWatcher.js.map +1 -0
- package/lib/esm/platforms/aws/cdkApp.js +5 -1
- package/lib/esm/platforms/aws/cdkApp.js.map +1 -1
- package/lib/esm/platforms/aws/clearResources.d.ts +2 -0
- package/lib/esm/platforms/aws/clearResources.js +151 -0
- package/lib/esm/platforms/aws/clearResources.js.map +1 -0
- package/lib/esm/platforms/aws/go.js +16 -2
- package/lib/esm/platforms/aws/go.js.map +1 -1
- package/lib/esm/platforms/aws/goDocker.js +77 -9
- package/lib/esm/platforms/aws/goDocker.js.map +1 -1
- package/lib/esm/platforms/aws/index.js +2 -0
- package/lib/esm/platforms/aws/index.js.map +1 -1
- package/lib/esm/platforms/docker/go.js +2 -2
- package/lib/esm/platforms/docker/go.js.map +1 -1
- package/lib/esm/platforms/types.d.ts +2 -0
- package/lib/esm/platforms/types.js.map +1 -1
- package/package.json +12 -10
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
# Runtime image for `qpq go` on the docker platform: the QPQ dev server
|
|
2
|
-
# (a full local platform emulation —
|
|
2
|
+
# (a full local platform emulation — JSON-file KVS, file storage, queues,
|
|
3
3
|
# websockets) hosting every service of the app, plus the pre-built views.
|
|
4
4
|
#
|
|
5
|
-
# The server bundle externalizes bare packages (native modules
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
# trixie (glibc 2.41): sqlite3's prebuilt binaries are built against glibc
|
|
10
|
-
# 2.38, which bookworm-based node:24-slim (glibc 2.36) can't load.
|
|
5
|
+
# The server bundle externalizes bare packages (native modules must load from
|
|
6
|
+
# a real install), so runtime deps are npm-installed in the image, then the
|
|
7
|
+
# locally-built quidproquo packages are overlaid so the image runs the same
|
|
8
|
+
# qpq code the bundle was built against.
|
|
11
9
|
FROM node:24-trixie-slim
|
|
12
10
|
|
|
13
11
|
WORKDIR /app
|
|
@@ -41,8 +39,8 @@ ENV NODE_ENV=production
|
|
|
41
39
|
# api / websocket / file-storage secure urls
|
|
42
40
|
EXPOSE 8080 8888 3001
|
|
43
41
|
|
|
44
|
-
# Emulated platform state (
|
|
45
|
-
# to persist it across container restarts.
|
|
42
|
+
# Emulated platform state (KVS JSON files + file storage) lives here — mount
|
|
43
|
+
# a volume to persist it across container restarts.
|
|
46
44
|
VOLUME /app/.qpq-runtime
|
|
47
45
|
|
|
48
46
|
CMD ["node", "server/main.js"]
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.promptCommandFromMenu = void 0;
|
|
13
|
+
// Interactive drill-down for a bare `qpq`: the colon-separated command names
|
|
14
|
+
// form a tree (go, go:dev, go:dev:api, ...). Each menu level renders its
|
|
15
|
+
// options as the full command line they resolve to (`qpq go:dev:api`) with
|
|
16
|
+
// the command's summary alongside, groups shown as `qpq go:??`, and drilling
|
|
17
|
+
// continues until the user picks a runnable leaf. Rows are deliberately left
|
|
18
|
+
// unstyled so inquirer's active-item highlight colours the whole row.
|
|
19
|
+
const prompts_1 = require("../lib/prompts");
|
|
20
|
+
const lastSegment = (name) => name.split(':').slice(-1)[0];
|
|
21
|
+
// The first path segment of `name` below `prefix` ('' means the tree root).
|
|
22
|
+
const childSegment = (name, prefix) => name.slice(prefix ? prefix.length + 1 : 0).split(':')[0];
|
|
23
|
+
const runRow = (command) => ({
|
|
24
|
+
label: `qpq ${command.name}`,
|
|
25
|
+
summary: command.summary,
|
|
26
|
+
value: { kind: 'run', command },
|
|
27
|
+
});
|
|
28
|
+
const buildRows = (commands, prefix) => {
|
|
29
|
+
var _a;
|
|
30
|
+
const exact = prefix ? commands.find((command) => command.name === prefix) : undefined;
|
|
31
|
+
const deeper = commands.filter((command) => command.name !== prefix && (!prefix || command.name.startsWith(`${prefix}:`)));
|
|
32
|
+
const segments = [...new Set(deeper.map((command) => childSegment(command.name, prefix)))];
|
|
33
|
+
const groupRows = [];
|
|
34
|
+
const leafRows = [];
|
|
35
|
+
for (const segment of segments) {
|
|
36
|
+
const segmentPrefix = prefix ? `${prefix}:${segment}` : segment;
|
|
37
|
+
const subtree = deeper.filter((command) => command.name === segmentPrefix || command.name.startsWith(`${segmentPrefix}:`));
|
|
38
|
+
if (subtree.length === 1 && subtree[0].name === segmentPrefix) {
|
|
39
|
+
leafRows.push(runRow(subtree[0]));
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
// A group's summary is its own runnable command's summary when it has
|
|
43
|
+
// one, otherwise a listing of what's inside.
|
|
44
|
+
const groupSummary = (_a = subtree.find((command) => command.name === segmentPrefix)) === null || _a === void 0 ? void 0 : _a.summary;
|
|
45
|
+
groupRows.push({
|
|
46
|
+
label: `qpq ${segmentPrefix}:??`,
|
|
47
|
+
summary: groupSummary !== null && groupSummary !== void 0 ? groupSummary : subtree.map((command) => lastSegment(command.name)).join(', '),
|
|
48
|
+
value: { kind: 'drill', prefix: segmentPrefix },
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// The current prefix's own command (run what this menu is named after)
|
|
53
|
+
// leads, then groups, then the remaining runnable commands.
|
|
54
|
+
const rows = [...(exact ? [runRow(exact)] : []), ...groupRows, ...leafRows];
|
|
55
|
+
if (prefix) {
|
|
56
|
+
rows.push({ label: '(back)', value: { kind: 'back' } });
|
|
57
|
+
}
|
|
58
|
+
return rows;
|
|
59
|
+
};
|
|
60
|
+
// Align the rows into two columns: the command line, then its summary.
|
|
61
|
+
const toChoices = (rows) => {
|
|
62
|
+
const columnWidth = Math.max(...rows.map((row) => row.label.length)) + 2;
|
|
63
|
+
return rows.map((row) => ({
|
|
64
|
+
name: row.summary ? `${row.label.padEnd(columnWidth)}${row.summary}` : row.label,
|
|
65
|
+
value: row.value,
|
|
66
|
+
short: row.label,
|
|
67
|
+
}));
|
|
68
|
+
};
|
|
69
|
+
// Walk the menu until a runnable command is picked.
|
|
70
|
+
const promptCommandFromMenu = (commands) => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
|
+
let prefix = '';
|
|
72
|
+
for (;;) {
|
|
73
|
+
const picked = yield (0, prompts_1.promptSelectDetailed)('Run:', toChoices(buildRows(commands, prefix)));
|
|
74
|
+
if (picked.kind === 'run') {
|
|
75
|
+
return picked.command;
|
|
76
|
+
}
|
|
77
|
+
prefix = picked.kind === 'drill' ? picked.prefix : prefix.split(':').slice(0, -1).join(':');
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
exports.promptCommandFromMenu = promptCommandFromMenu;
|
|
81
|
+
//# sourceMappingURL=commandMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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IACzF,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,SAAS,CAAC;QACR,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAoB,EAAa,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAEtG,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB,CAAC;QAED,MAAM,GAAG,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9F,CAAC;AACH,CAAC,CAAA,CAAC;AAZW,QAAA,qBAAqB,yBAYhC","sourcesContent":["// Interactive drill-down for a bare `qpq`: the colon-separated command names\n// form a tree (go, go:dev, go:dev:api, ...). Each menu level renders its\n// options as the full command line they resolve to (`qpq go:dev:api`) with\n// the command's summary alongside, groups shown as `qpq go:??`, and drilling\n// continues until the user picks a runnable leaf. Rows are deliberately left\n// unstyled so inquirer's active-item highlight colours the whole row.\nimport { promptSelectDetailed } from '../lib/prompts';\nimport { CliCommand } from './commandRegistry';\n\ntype MenuChoice = { kind: 'run'; command: CliCommand } | { kind: 'drill'; prefix: string } | { kind: 'back' };\n\ntype MenuRow = { label: string; summary?: string; value: MenuChoice };\n\nconst lastSegment = (name: string): string => name.split(':').slice(-1)[0];\n\n// The first path segment of `name` below `prefix` ('' means the tree root).\nconst childSegment = (name: string, prefix: string): string => name.slice(prefix ? prefix.length + 1 : 0).split(':')[0];\n\nconst runRow = (command: CliCommand): MenuRow => ({\n label: `qpq ${command.name}`,\n summary: command.summary,\n value: { kind: 'run', command },\n});\n\nconst buildRows = (commands: CliCommand[], prefix: string): MenuRow[] => {\n const exact = prefix ? commands.find((command) => command.name === prefix) : undefined;\n const deeper = commands.filter((command) => command.name !== prefix && (!prefix || command.name.startsWith(`${prefix}:`)));\n const segments = [...new Set(deeper.map((command) => childSegment(command.name, prefix)))];\n\n const groupRows: MenuRow[] = [];\n const leafRows: MenuRow[] = [];\n\n for (const segment of segments) {\n const segmentPrefix = prefix ? `${prefix}:${segment}` : segment;\n const subtree = deeper.filter((command) => command.name === segmentPrefix || command.name.startsWith(`${segmentPrefix}:`));\n\n if (subtree.length === 1 && subtree[0].name === segmentPrefix) {\n leafRows.push(runRow(subtree[0]));\n } else {\n // A group's summary is its own runnable command's summary when it has\n // one, otherwise a listing of what's inside.\n const groupSummary = subtree.find((command) => command.name === segmentPrefix)?.summary;\n groupRows.push({\n label: `qpq ${segmentPrefix}:??`,\n summary: groupSummary ?? subtree.map((command) => lastSegment(command.name)).join(', '),\n value: { kind: 'drill', prefix: segmentPrefix },\n });\n }\n }\n\n // The current prefix's own command (run what this menu is named after)\n // leads, then groups, then the remaining runnable commands.\n const rows = [...(exact ? [runRow(exact)] : []), ...groupRows, ...leafRows];\n\n if (prefix) {\n rows.push({ label: '(back)', value: { kind: 'back' } });\n }\n\n return rows;\n};\n\n// Align the rows into two columns: the command line, then its summary.\nconst toChoices = (rows: MenuRow[]): { name: string; value: MenuChoice; short?: string }[] => {\n const columnWidth = Math.max(...rows.map((row) => row.label.length)) + 2;\n\n return rows.map((row) => ({\n name: row.summary ? `${row.label.padEnd(columnWidth)}${row.summary}` : row.label,\n value: row.value,\n short: row.label,\n }));\n};\n\n// Walk the menu until a runnable command is picked.\nexport const promptCommandFromMenu = async (commands: CliCommand[]): Promise<CliCommand> => {\n let prefix = '';\n\n for (;;) {\n const picked = await promptSelectDetailed<MenuChoice>('Run:', toChoices(buildRows(commands, prefix)));\n\n if (picked.kind === 'run') {\n return picked.command;\n }\n\n prefix = picked.kind === 'drill' ? picked.prefix : prefix.split(':').slice(0, -1).join(':');\n }\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type CliCommand = {
|
|
2
|
+
name: string;
|
|
3
|
+
usageArgs?: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
usageExtra?: string[];
|
|
6
|
+
promptArgs?: () => Promise<string[]>;
|
|
7
|
+
run: (commandArgv: string[]) => Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
export declare const cliCommands: CliCommand[];
|
|
10
|
+
export declare const buildUsage: () => string;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.buildUsage = exports.cliCommands = void 0;
|
|
13
|
+
// Single source of truth for every qpq command: its name, the one-line
|
|
14
|
+
// summary (shared by `qpq help` and the interactive menu) and a runner.
|
|
15
|
+
//
|
|
16
|
+
// Command modules are required lazily inside each runner so a simple
|
|
17
|
+
// `qpq help` doesn't pay for the whole toolchain, and so ts-node can be
|
|
18
|
+
// registered before any command module (or anything it requires) loads.
|
|
19
|
+
const prompts_1 = require("../lib/prompts");
|
|
20
|
+
// `qpq hooks` needs a hook name; when launched from the menu there is no
|
|
21
|
+
// argv to pass it in, so ask.
|
|
22
|
+
const promptHookName = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
+
return [
|
|
24
|
+
yield (0, prompts_1.promptText)('Hook name (runs qpq:<name>, or plain <name>, in every app/package that defines it):'),
|
|
25
|
+
];
|
|
26
|
+
});
|
|
27
|
+
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
28
|
+
exports.cliCommands = [
|
|
29
|
+
{
|
|
30
|
+
name: 'go',
|
|
31
|
+
usageArgs: '[svc] [stack]',
|
|
32
|
+
summary: 'Deploy services (interactive; platform from deploy.config.json, default aws).',
|
|
33
|
+
usageExtra: [
|
|
34
|
+
'Pass positional args to skip prompts, e.g. qpq go all all — svc is',
|
|
35
|
+
"'all' | comma-list | account | domain | bootstrap; stack is all|inf|api|web|views.",
|
|
36
|
+
"A full 'all all' (or 'all api') deploy also publishes federated backends.",
|
|
37
|
+
],
|
|
38
|
+
run: (a) => require('../commands/go').goCommand(a),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'go:docker',
|
|
42
|
+
summary: 'Same as go (incl. positional args), but deploys in parallel via docker',
|
|
43
|
+
run: (a) => require('../commands/goDocker').goDockerCommand(a),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'go:dev',
|
|
47
|
+
summary: 'Run the full local dev stack (api + web) in one process',
|
|
48
|
+
run: (a) => require('../commands/goDev').goDevCommand(a),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'go:dev:api',
|
|
52
|
+
summary: 'Run the local API dev server (hot reload)',
|
|
53
|
+
run: (a) => require('../commands/goDevApi').goDevApiCommand(a),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'go:dev:web',
|
|
57
|
+
summary: 'Run every views microfrontend dev server',
|
|
58
|
+
run: (a) => require('../commands/goDevWeb').goDevWebCommand(a),
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'teardown',
|
|
62
|
+
summary: 'Destroy web/api/inf stacks for selected services (interactive)',
|
|
63
|
+
run: (a) => require('../commands/teardown').teardownCommand(a),
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'clear-resources',
|
|
67
|
+
summary: 'Empty selected buckets/tables (data only, stacks untouched; interactive)',
|
|
68
|
+
run: (a) => require('../commands/clearResources').clearResourcesCommand(a),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'synth',
|
|
72
|
+
usageArgs: '[service]',
|
|
73
|
+
summary: 'Synth QPQ configs to dist/apps/<app>/infrastructure',
|
|
74
|
+
run: (a) => require('../commands/synth').synthCommand(a),
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'prep',
|
|
78
|
+
summary: 'Regenerate apps/<app>/tsconfig.federated.json',
|
|
79
|
+
run: (a) => require('../commands/prep').prepCommand(a),
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'publish',
|
|
83
|
+
summary: 'Build + upload + deploy federated remotes',
|
|
84
|
+
run: (a) => require('../commands/publish').publishCommand(a),
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'publish:build',
|
|
88
|
+
summary: 'Build federated remotes locally',
|
|
89
|
+
run: (a) => require('../commands/publish').publishBuildCommand(a),
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'publish:upload',
|
|
93
|
+
summary: 'Upload built version dirs (nothing goes live)',
|
|
94
|
+
run: (a) => require('../commands/publish').publishUploadCommand(a),
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'publish:deploy',
|
|
98
|
+
summary: 'Flip manifests to the uploaded versions',
|
|
99
|
+
run: (a) => require('../commands/publish').publishDeployCommand(a),
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'hooks',
|
|
103
|
+
usageArgs: '<name>',
|
|
104
|
+
summary: 'Run qpq:<name> (or plain <name>) in every app/package that defines it (dependency ordered, parallel; --jobs=N)',
|
|
105
|
+
promptArgs: promptHookName,
|
|
106
|
+
run: (a) => require('../commands/hooks').hooksCommand(a),
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
110
|
+
// Width of the "name [args]" column in the usage text.
|
|
111
|
+
const usageColumnWidth = 17;
|
|
112
|
+
const buildUsage = () => {
|
|
113
|
+
const commandLines = exports.cliCommands.flatMap((command) => {
|
|
114
|
+
var _a;
|
|
115
|
+
const nameAndArgs = command.usageArgs ? `${command.name} ${command.usageArgs}` : command.name;
|
|
116
|
+
const extraLines = ((_a = command.usageExtra) !== null && _a !== void 0 ? _a : []).map((line) => ` ${''.padEnd(usageColumnWidth)}${line}`);
|
|
117
|
+
return [` ${nameAndArgs.padEnd(usageColumnWidth)}${command.summary}`, ...extraLines];
|
|
118
|
+
});
|
|
119
|
+
return [
|
|
120
|
+
'qpq — build, dev and deploy orchestration for QPQ apps',
|
|
121
|
+
'',
|
|
122
|
+
'Usage: qpq <command> [--app <name>] [--env <name>] [--platform <name>]',
|
|
123
|
+
' qpq (no command opens an interactive menu)',
|
|
124
|
+
'',
|
|
125
|
+
'Commands:',
|
|
126
|
+
...commandLines,
|
|
127
|
+
'',
|
|
128
|
+
].join('\n');
|
|
129
|
+
};
|
|
130
|
+
exports.buildUsage = buildUsage;
|
|
131
|
+
//# sourceMappingURL=commandRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandRegistry.js","sourceRoot":"","sources":["../../../src/cli/commandRegistry.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAAuE;AACvE,wEAAwE;AACxE,EAAE;AACF,qEAAqE;AACrE,wEAAwE;AACxE,wEAAwE;AACxE,4CAA4C;AAe5C,yEAAyE;AACzE,8BAA8B;AAC9B,MAAM,cAAc,GAAG,GAA4B,EAAE;IAAC,OAAA;QACpD,MAAM,IAAA,oBAAU,EAAC,qFAAqF,CAAC;KACxG,CAAA;EAAA,CAAC;AAEF,0DAA0D;AAC7C,QAAA,WAAW,GAAiB;IACvC;QACE,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,eAAe;QAC1B,OAAO,EAAE,+EAA+E;QACxF,U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AAgB,GAAG,EAAE,CAAC;AAErB,MAAM,UAAU,GAAG,GAAW,EAAE;IACrC,MAAM,YAAY,GAAG,mBAAW,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;;QACnD,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;QAC9F,MAAM,UAAU,GAAG,CAAC,MAAA,OAAO,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;QACvG,OAAO,CAAC,KAAK,WAAW,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,GAAG,UAAU,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,wDAAwD;QACxD,EAAE;QACF,wEAAwE;QACxE,8DAA8D;QAC9D,EAAE;QACF,WAAW;QACX,GAAG,YAAY;QACf,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC,CAAC;AAjBW,QAAA,UAAU,cAiBrB","sourcesContent":["// Single source of truth for every qpq command: its name, the one-line\n// summary (shared by `qpq help` and the interactive menu) and a runner.\n//\n// Command modules are required lazily inside each runner so a simple\n// `qpq help` doesn't pay for the whole toolchain, and so ts-node can be\n// registered before any command module (or anything it requires) loads.\nimport { promptText } from '../lib/prompts';\n\nexport type CliCommand = {\n name: string;\n // Argument hint shown in the usage text, e.g. '[svc] [stack]'.\n usageArgs?: string;\n summary: string;\n // Extra usage-only detail lines, indented under the summary.\n usageExtra?: string[];\n // Menu-only: commands that need a positional argument (which the menu has\n // no argv to carry) gather it here before running.\n promptArgs?: () => Promise<string[]>;\n run: (commandArgv: string[]) => Promise<void>;\n};\n\n// `qpq hooks` needs a hook name; when launched from the menu there is no\n// argv to pass it in, so ask.\nconst promptHookName = async (): Promise<string[]> => [\n await promptText('Hook name (runs qpq:<name>, or plain <name>, in every app/package that defines it):'),\n];\n\n/* eslint-disable @typescript-eslint/no-require-imports */\nexport const cliCommands: CliCommand[] = [\n {\n name: 'go',\n usageArgs: '[svc] [stack]',\n summary: 'Deploy services (interactive; platform from deploy.config.json, default aws).',\n usageExtra: [\n 'Pass positional args to skip prompts, e.g. qpq go all all — svc is',\n \"'all' | comma-list | account | domain | bootstrap; stack is all|inf|api|web|views.\",\n \"A full 'all all' (or 'all api') deploy also publishes federated backends.\",\n ],\n run: (a) => require('../commands/go').goCommand(a),\n },\n {\n name: 'go:docker',\n summary: 'Same as go (incl. positional args), but deploys in parallel via docker',\n run: (a) => require('../commands/goDocker').goDockerCommand(a),\n },\n {\n name: 'go:dev',\n summary: 'Run the full local dev stack (api + web) in one process',\n run: (a) => require('../commands/goDev').goDevCommand(a),\n },\n {\n name: 'go:dev:api',\n summary: 'Run the local API dev server (hot reload)',\n run: (a) => require('../commands/goDevApi').goDevApiCommand(a),\n },\n {\n name: 'go:dev:web',\n summary: 'Run every views microfrontend dev server',\n run: (a) => require('../commands/goDevWeb').goDevWebCommand(a),\n },\n {\n name: 'teardown',\n summary: 'Destroy web/api/inf stacks for selected services (interactive)',\n run: (a) => require('../commands/teardown').teardownCommand(a),\n },\n {\n name: 'clear-resources',\n summary: 'Empty selected buckets/tables (data only, stacks untouched; interactive)',\n run: (a) => require('../commands/clearResources').clearResourcesCommand(a),\n },\n {\n name: 'synth',\n usageArgs: '[service]',\n summary: 'Synth QPQ configs to dist/apps/<app>/infrastructure',\n run: (a) => require('../commands/synth').synthCommand(a),\n },\n {\n name: 'prep',\n summary: 'Regenerate apps/<app>/tsconfig.federated.json',\n run: (a) => require('../commands/prep').prepCommand(a),\n },\n {\n name: 'publish',\n summary: 'Build + upload + deploy federated remotes',\n run: (a) => require('../commands/publish').publishCommand(a),\n },\n {\n name: 'publish:build',\n summary: 'Build federated remotes locally',\n run: (a) => require('../commands/publish').publishBuildCommand(a),\n },\n {\n name: 'publish:upload',\n summary: 'Upload built version dirs (nothing goes live)',\n run: (a) => require('../commands/publish').publishUploadCommand(a),\n },\n {\n name: 'publish:deploy',\n summary: 'Flip manifests to the uploaded versions',\n run: (a) => require('../commands/publish').publishDeployCommand(a),\n },\n {\n name: 'hooks',\n usageArgs: '<name>',\n summary: 'Run qpq:<name> (or plain <name>) in every app/package that defines it (dependency ordered, parallel; --jobs=N)',\n promptArgs: promptHookName,\n run: (a) => require('../commands/hooks').hooksCommand(a),\n },\n];\n/* eslint-enable @typescript-eslint/no-require-imports */\n\n// Width of the \"name [args]\" column in the usage text.\nconst usageColumnWidth = 17;\n\nexport const buildUsage = (): string => {\n const commandLines = cliCommands.flatMap((command) => {\n const nameAndArgs = command.usageArgs ? `${command.name} ${command.usageArgs}` : command.name;\n const extraLines = (command.usageExtra ?? []).map((line) => ` ${''.padEnd(usageColumnWidth)}${line}`);\n return [` ${nameAndArgs.padEnd(usageColumnWidth)}${command.summary}`, ...extraLines];\n });\n\n return [\n 'qpq — build, dev and deploy orchestration for QPQ apps',\n '',\n 'Usage: qpq <command> [--app <name>] [--env <name>] [--platform <name>]',\n ' qpq (no command opens an interactive menu)',\n '',\n 'Commands:',\n ...commandLines,\n '',\n ].join('\\n');\n};\n"]}
|
|
@@ -10,24 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.runCli = void 0;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
Usage: qpq <command> [--app <name>] [--env <name>] [--platform <name>]
|
|
16
|
-
|
|
17
|
-
Commands:
|
|
18
|
-
go Deploy services (interactive; platform from deploy.config.json, default aws)
|
|
19
|
-
go:docker Same as go, but deploys in parallel via docker
|
|
20
|
-
go:dev Run the local dev server (hot reload)
|
|
21
|
-
go:dev:web Run every views microfrontend dev server
|
|
22
|
-
teardown Destroy web/api/inf stacks for selected services (interactive)
|
|
23
|
-
synth [service] Synth QPQ configs to dist/apps/<app>/infrastructure
|
|
24
|
-
prep Regenerate apps/<app>/tsconfig.federated.json
|
|
25
|
-
publish Build + upload + deploy federated remotes
|
|
26
|
-
publish:build Build federated remotes locally
|
|
27
|
-
publish:upload Upload built version dirs (nothing goes live)
|
|
28
|
-
publish:deploy Flip manifests to the uploaded versions
|
|
29
|
-
hooks <name> Run qpq:<name> in every app that defines it
|
|
30
|
-
`;
|
|
13
|
+
const commandMenu_1 = require("./commandMenu");
|
|
14
|
+
const commandRegistry_1 = require("./commandRegistry");
|
|
31
15
|
// Service infrastructure.ts files (and app config fragments) are TypeScript —
|
|
32
16
|
// register ts-node's transpile-only require hook so the CLI can require them
|
|
33
17
|
// directly, using the consumer root's tsconfig.json ts-node settings.
|
|
@@ -41,44 +25,60 @@ const registerTsNode = () => {
|
|
|
41
25
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
42
26
|
require('ts-node').register({ transpileOnly: true });
|
|
43
27
|
};
|
|
28
|
+
// Inquirer throws ExitPromptError on ctrl-c; treat that as a quiet exit
|
|
29
|
+
// rather than a command failure.
|
|
30
|
+
const isPromptExit = (error) => error instanceof Error && error.name === 'ExitPromptError';
|
|
31
|
+
// Bare `qpq` on a terminal: drill through the command menu, gathering any
|
|
32
|
+
// arguments the picked command needs. Returns null when the user bails out.
|
|
33
|
+
const resolveCommandInteractively = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
try {
|
|
35
|
+
const command = yield (0, commandMenu_1.promptCommandFromMenu)(commandRegistry_1.cliCommands);
|
|
36
|
+
const commandArgv = command.promptArgs ? yield command.promptArgs() : [];
|
|
37
|
+
return { command, commandArgv };
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (isPromptExit(error)) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
44
46
|
const runCli = (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
-
const [
|
|
46
|
-
if (
|
|
47
|
-
console.log(
|
|
47
|
+
const [commandName, ...argvRest] = argv;
|
|
48
|
+
if (commandName === 'help' || commandName === '--help') {
|
|
49
|
+
console.log((0, commandRegistry_1.buildUsage)());
|
|
48
50
|
return;
|
|
49
51
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
publish: (a) => require('../commands/publish').publishCommand(a),
|
|
64
|
-
'publish:build': (a) => require('../commands/publish').publishBuildCommand(a),
|
|
65
|
-
'publish:upload': (a) => require('../commands/publish').publishUploadCommand(a),
|
|
66
|
-
'publish:deploy': (a) => require('../commands/publish').publishDeployCommand(a),
|
|
67
|
-
hooks: (a) => require('../commands/hooks').hooksCommand(a),
|
|
68
|
-
};
|
|
69
|
-
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
70
|
-
const run = commands[command];
|
|
71
|
-
if (!run) {
|
|
72
|
-
console.error(`Unknown command: ${command}`);
|
|
73
|
-
console.log(usage);
|
|
74
|
-
process.exitCode = 1;
|
|
75
|
-
return;
|
|
52
|
+
let command;
|
|
53
|
+
let commandArgv = [];
|
|
54
|
+
if (!commandName) {
|
|
55
|
+
// Only prompt on a real terminal; piped/CI invocations get the usage text.
|
|
56
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
57
|
+
console.log((0, commandRegistry_1.buildUsage)());
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const resolved = yield resolveCommandInteractively();
|
|
61
|
+
if (!resolved) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
({ command, commandArgv } = resolved);
|
|
76
65
|
}
|
|
66
|
+
else {
|
|
67
|
+
command = commandRegistry_1.cliCommands.find((c) => c.name === commandName);
|
|
68
|
+
commandArgv = argvRest;
|
|
69
|
+
if (!command) {
|
|
70
|
+
console.error(`Unknown command: ${commandName}`);
|
|
71
|
+
console.log((0, commandRegistry_1.buildUsage)());
|
|
72
|
+
process.exitCode = 1;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
registerTsNode();
|
|
77
77
|
try {
|
|
78
|
-
yield run(commandArgv);
|
|
78
|
+
yield command.run(commandArgv);
|
|
79
79
|
}
|
|
80
80
|
catch (error) {
|
|
81
|
-
console.error(`qpq ${command} failed:`, error);
|
|
81
|
+
console.error(`qpq ${command.name} failed:`, error);
|
|
82
82
|
process.exitCode = 1;
|
|
83
83
|
}
|
|
84
84
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runCli.js","sourceRoot":"","sources":["../../../src/cli/runCli.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"runCli.js","sourceRoot":"","sources":["../../../src/cli/runCli.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAsD;AACtD,uDAAwE;AAExE,8EAA8E;AAC9E,6EAA6E;AAC7E,sEAAsE;AACtE,EAAE;AACF,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,mEAAmE;AACnE,4EAA4E;AAC5E,MAAM,cAAc,GAAG,GAAS,EAAE;IAChC,iEAAiE;IACjE,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,wEAAwE;AACxE,iCAAiC;AACjC,MAAM,YAAY,GAAG,CAAC,KAAc,EAAW,EAAE,CAAC,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,CAAC;AAE7G,0EAA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,CAAC,CAAC;IACxC,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,6BAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;QAC1D,WAAW,GAAG,QAAQ,CAAC;QAEvB,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,oBAAoB,WAAW,EAAE,CAAC,CAAC;YACjD,OAAO,CAAC,GAAG,CAAC,IAAA,4BAAU,GAAE,CAAC,CAAC;YAC1B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;IACH,CAAC;IAED,cAAc,EAAE,CAAC;IAEjB,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,IAAI,UAAU,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC,CAAA,CAAC;AA7CW,QAAA,MAAM,UA6CjB","sourcesContent":["import { promptCommandFromMenu } from './commandMenu';\nimport { buildUsage, CliCommand, cliCommands } from './commandRegistry';\n\n// Service infrastructure.ts files (and app config fragments) are TypeScript —\n// register ts-node's transpile-only require hook so the CLI can require them\n// directly, using the consumer root's tsconfig.json ts-node settings.\n//\n// CONTRACT: JavaScript apps (create-qpq-app --language javascript) also lean\n// on this hook — their tsconfig.json ts-node block sets allowJs (so their\n// ESM-syntax infrastructure.js compiles at require time) and scope/scopeDir\n// (so the hook never touches quidproquo libs outside the app). Any\n// replacement for ts-node here must honour those consumer tsconfig options.\nconst registerTsNode = (): void => {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n require('ts-node').register({ transpileOnly: true });\n};\n\n// Inquirer throws ExitPromptError on ctrl-c; treat that as a quiet exit\n// rather than a command failure.\nconst isPromptExit = (error: unknown): boolean => error instanceof Error && error.name === 'ExitPromptError';\n\n// Bare `qpq` on a terminal: drill through the command menu, gathering any\n// arguments the picked command needs. Returns null when the user bails out.\nconst resolveCommandInteractively = async (): Promise<{ command: CliCommand; commandArgv: string[] } | null> => {\n try {\n const command = await promptCommandFromMenu(cliCommands);\n const commandArgv = command.promptArgs ? await command.promptArgs() : [];\n\n return { command, commandArgv };\n } catch (error) {\n if (isPromptExit(error)) {\n return null;\n }\n\n throw error;\n }\n};\n\nexport const runCli = async (argv: string[]): Promise<void> => {\n const [commandName, ...argvRest] = argv;\n\n if (commandName === 'help' || commandName === '--help') {\n console.log(buildUsage());\n return;\n }\n\n let command: CliCommand | undefined;\n let commandArgv: string[] = [];\n\n if (!commandName) {\n // Only prompt on a real terminal; piped/CI invocations get the usage text.\n if (!process.stdin.isTTY || !process.stdout.isTTY) {\n console.log(buildUsage());\n return;\n }\n\n const resolved = await resolveCommandInteractively();\n\n if (!resolved) {\n return;\n }\n\n ({ command, commandArgv } = resolved);\n } else {\n command = cliCommands.find((c) => c.name === commandName);\n commandArgv = argvRest;\n\n if (!command) {\n console.error(`Unknown command: ${commandName}`);\n console.log(buildUsage());\n process.exitCode = 1;\n return;\n }\n }\n\n registerTsNode();\n\n try {\n await command.run(commandArgv);\n } catch (error) {\n console.error(`qpq ${command.name} failed:`, error);\n process.exitCode = 1;\n }\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const clearResourcesCommand: (argv: string[]) => Promise<void>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.clearResourcesCommand = void 0;
|
|
13
|
+
// `qpq clear-resources` — interactively EMPTY selected data resources (storage
|
|
14
|
+
// drive buckets, key value store tables) without touching the stacks: the
|
|
15
|
+
// "reset my data" counterpart to `qpq teardown`. Resolves the app +
|
|
16
|
+
// environment the same way as go/teardown, enumerates the app's owned
|
|
17
|
+
// resources from its live qpq configs, multi-selects what to empty (with a
|
|
18
|
+
// typed confirmation — this deletes stored data), then hands off to the
|
|
19
|
+
// platform driver.
|
|
20
|
+
const clearResourcesPlan_1 = require("../lib/clearResourcesPlan");
|
|
21
|
+
const deployEnv_1 = require("../lib/deployEnv");
|
|
22
|
+
const resolveAppSelection_1 = require("../lib/resolveAppSelection");
|
|
23
|
+
const platforms_1 = require("../platforms");
|
|
24
|
+
const clearResourcesCommand = (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
+
const appName = yield (0, resolveAppSelection_1.resolveAppSelection)({ argv, envVar: 'DEPLOY_APP_NAME' });
|
|
26
|
+
const { platform } = yield (0, deployEnv_1.resolveDeployEnvironment)(argv, appName);
|
|
27
|
+
const driver = (0, platforms_1.getPlatformDriver)(platform);
|
|
28
|
+
if (!driver.clearResources) {
|
|
29
|
+
console.error(`The '${platform}' platform has no clear-resources strategy.`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
const plan = yield (0, clearResourcesPlan_1.promptClearResourcesPlan)(appName);
|
|
33
|
+
yield driver.clearResources(appName, plan);
|
|
34
|
+
});
|
|
35
|
+
exports.clearResourcesCommand = clearResourcesCommand;
|
|
36
|
+
//# sourceMappingURL=clearResources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearResources.js","sourceRoot":"","sources":["../../../src/commands/clearResources.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+EAA+E;AAC/E,0EAA0E;AAC1E,oEAAoE;AACpE,sEAAsE;AACtE,2EAA2E;AAC3E,wEAAwE;AACxE,mBAAmB;AACnB,kEAAqE;AACrE,gDAA4D;AAC5D,oEAAiE;AACjE,4CAAiD;AAE1C,MAAM,qBAAqB,GAAG,CAAO,IAAc,EAAiB,EAAE;IAC3E,MAAM,OAAO,GAAG,MAAM,IAAA,yCAAmB,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAC/E,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAA,oCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,IAAA,6BAAiB,EAAC,QAAQ,CAAC,CAAC;IAE3C,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;QAC3B,OAAO,CAAC,KAAK,CAAC,QAAQ,QAAQ,6CAA6C,CAAC,CAAC;QAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,IAAA,6CAAwB,EAAC,OAAO,CAAC,CAAC;IAErD,MAAM,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC7C,CAAC,CAAA,CAAC;AAbW,QAAA,qBAAqB,yBAahC","sourcesContent":["// `qpq clear-resources` — interactively EMPTY selected data resources (storage\n// drive buckets, key value store tables) without touching the stacks: the\n// \"reset my data\" counterpart to `qpq teardown`. Resolves the app +\n// environment the same way as go/teardown, enumerates the app's owned\n// resources from its live qpq configs, multi-selects what to empty (with a\n// typed confirmation — this deletes stored data), then hands off to the\n// platform driver.\nimport { promptClearResourcesPlan } from '../lib/clearResourcesPlan';\nimport { resolveDeployEnvironment } from '../lib/deployEnv';\nimport { resolveAppSelection } from '../lib/resolveAppSelection';\nimport { getPlatformDriver } from '../platforms';\n\nexport const clearResourcesCommand = async (argv: string[]): Promise<void> => {\n const appName = await resolveAppSelection({ argv, envVar: 'DEPLOY_APP_NAME' });\n const { platform } = await resolveDeployEnvironment(argv, appName);\n const driver = getPlatformDriver(platform);\n\n if (!driver.clearResources) {\n console.error(`The '${platform}' platform has no clear-resources strategy.`);\n process.exit(1);\n }\n\n const plan = await promptClearResourcesPlan(appName);\n\n await driver.clearResources(appName, plan);\n};\n"]}
|
|
@@ -18,10 +18,12 @@ const deployPrompts_1 = require("../lib/deployPrompts");
|
|
|
18
18
|
const resolveAppSelection_1 = require("../lib/resolveAppSelection");
|
|
19
19
|
const platforms_1 = require("../platforms");
|
|
20
20
|
const goCommand = (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
var _a;
|
|
21
22
|
const appName = yield (0, resolveAppSelection_1.resolveAppSelection)({ argv, envVar: 'DEPLOY_APP_NAME' });
|
|
22
23
|
const { platform } = yield (0, deployEnv_1.resolveDeployEnvironment)(argv, appName);
|
|
23
24
|
const driver = (0, platforms_1.getPlatformDriver)(platform);
|
|
24
|
-
|
|
25
|
+
// Positional args (`qpq go all all`) run prompt-free; otherwise ask.
|
|
26
|
+
const plan = (_a = (0, deployPrompts_1.buildDeployPlanFromArgs)(appName, argv)) !== null && _a !== void 0 ? _a : (yield (0, deployPrompts_1.promptDeployPlan)(appName));
|
|
25
27
|
yield driver.go(appName, plan);
|
|
26
28
|
});
|
|
27
29
|
exports.goCommand = goCommand;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"go.js","sourceRoot":"","sources":["../../../src/commands/go.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAA6E;AAC7E,+EAA+E;AAC/E,sDAAsD;AACtD,gDAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"go.js","sourceRoot":"","sources":["../../../src/commands/go.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAA6E;AAC7E,+EAA+E;AAC/E,sDAAsD;AACtD,gDAA4D;AAC5D,wDAAiF;AACjF,oEAAiE;AACjE,4CAAiD;AAE1C,MAAM,SAAS,GAAG,CAAO,IAAc,EAAiB,EAAE;;IAC/D,MAAM,OAAO,GAAG,MAAM,IAAA,yCAAmB,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAC/E,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAA,oCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,IAAA,6BAAiB,EAAC,QAAQ,CAAC,CAAC;IAE3C,qEAAqE;IACrE,MAAM,IAAI,GAAG,MAAA,IAAA,uCAAuB,EAAC,OAAO,EAAE,IAAI,CAAC,mCAAI,CAAC,MAAM,IAAA,gCAAgB,EAAC,OAAO,CAAC,CAAC,CAAC;IAEzF,MAAM,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC,CAAA,CAAC;AATW,QAAA,SAAS,aASpB","sourcesContent":["// `qpq go` — interactive deploy. Resolves the app + environment (which names\n// the deploy platform in apps/<app>/deploy.config.json, default aws), asks the\n// deploy plan, then hands off to the platform driver.\nimport { resolveDeployEnvironment } from '../lib/deployEnv';\nimport { buildDeployPlanFromArgs, promptDeployPlan } from '../lib/deployPrompts';\nimport { resolveAppSelection } from '../lib/resolveAppSelection';\nimport { getPlatformDriver } from '../platforms';\n\nexport const goCommand = async (argv: string[]): Promise<void> => {\n const appName = await resolveAppSelection({ argv, envVar: 'DEPLOY_APP_NAME' });\n const { platform } = await resolveDeployEnvironment(argv, appName);\n const driver = getPlatformDriver(platform);\n\n // Positional args (`qpq go all all`) run prompt-free; otherwise ask.\n const plan = buildDeployPlanFromArgs(appName, argv) ?? (await promptDeployPlan(appName));\n\n await driver.go(appName, plan);\n};\n"]}
|