@devbie/newbie-cli 1.9.1 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -103
- package/dist/assemble/modules-copy.js +1 -1
- package/dist/assemble/modules-copy.js.map +1 -1
- package/dist/assemble/modules.js +13 -4
- package/dist/assemble/modules.js.map +1 -1
- package/dist/assemble/schema.js +1 -1
- package/dist/commands/create.js +1 -1
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/doctor.d.ts +4 -1
- package/dist/commands/doctor.js +36 -16
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/modules/default.d.ts +5 -0
- package/dist/commands/{default.js → modules/default.js} +64 -13
- package/dist/commands/modules/default.js.map +1 -0
- package/dist/commands/modules/install.d.ts +7 -0
- package/dist/commands/modules/install.js +121 -0
- package/dist/commands/modules/install.js.map +1 -0
- package/dist/commands/modules/lint.d.ts +3 -0
- package/dist/commands/{dev → modules}/lint.js +12 -11
- package/dist/commands/modules/lint.js.map +1 -0
- package/dist/commands/modules/remove.d.ts +6 -0
- package/dist/commands/modules/remove.js +47 -0
- package/dist/commands/modules/remove.js.map +1 -0
- package/dist/commands/modules/update.d.ts +8 -0
- package/dist/commands/{update.js → modules/update.js} +68 -27
- package/dist/commands/modules/update.js.map +1 -0
- package/dist/commands/modules/watch.d.ts +6 -0
- package/dist/commands/{watch.js → modules/watch.js} +16 -8
- package/dist/commands/modules/watch.js.map +1 -0
- package/dist/commands/shared.d.ts +1 -0
- package/dist/commands/shared.js +1 -1
- package/dist/commands/shared.js.map +1 -1
- package/dist/commands/template/sync.d.ts +7 -0
- package/dist/commands/{sync-template.js → template/sync.js} +10 -19
- package/dist/commands/template/sync.js.map +1 -0
- package/dist/core/deploy-compose.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -179
- package/dist/index.js.map +1 -1
- package/dist/lib/module-selector.d.ts +1 -0
- package/dist/lib/module-selector.js +13 -0
- package/dist/lib/module-selector.js.map +1 -0
- package/dist/lib/sink.d.ts +10 -1
- package/dist/lib/sink.js +42 -3
- package/dist/lib/sink.js.map +1 -1
- package/dist/program.d.ts +3 -0
- package/dist/program.js +166 -0
- package/dist/program.js.map +1 -0
- package/package.json +2 -1
- package/dist/commands/agent.d.ts +0 -5
- package/dist/commands/agent.js +0 -223
- package/dist/commands/agent.js.map +0 -1
- package/dist/commands/apply.d.ts +0 -7
- package/dist/commands/apply.js +0 -61
- package/dist/commands/apply.js.map +0 -1
- package/dist/commands/assemble.d.ts +0 -5
- package/dist/commands/assemble.js +0 -66
- package/dist/commands/assemble.js.map +0 -1
- package/dist/commands/config.d.ts +0 -7
- package/dist/commands/config.js +0 -120
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/default.d.ts +0 -2
- package/dist/commands/default.js.map +0 -1
- package/dist/commands/dev/lint.d.ts +0 -3
- package/dist/commands/dev/lint.js.map +0 -1
- package/dist/commands/install.d.ts +0 -4
- package/dist/commands/install.js +0 -48
- package/dist/commands/install.js.map +0 -1
- package/dist/commands/sync-template.d.ts +0 -8
- package/dist/commands/sync-template.js.map +0 -1
- package/dist/commands/update.d.ts +0 -8
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/watch.d.ts +0 -5
- package/dist/commands/watch.js.map +0 -1
package/dist/program.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.VERSION = void 0;
|
|
7
|
+
exports.buildProgram = buildProgram;
|
|
8
|
+
const commander_1 = require("commander");
|
|
9
|
+
const package_json_1 = __importDefault(require("../package.json"));
|
|
10
|
+
const create_1 = require("./commands/create");
|
|
11
|
+
const doctor_1 = require("./commands/doctor");
|
|
12
|
+
const default_1 = require("./commands/modules/default");
|
|
13
|
+
const install_1 = require("./commands/modules/install");
|
|
14
|
+
const lint_1 = require("./commands/modules/lint");
|
|
15
|
+
const remove_1 = require("./commands/modules/remove");
|
|
16
|
+
const update_1 = require("./commands/modules/update");
|
|
17
|
+
const watch_1 = require("./commands/modules/watch");
|
|
18
|
+
const status_1 = require("./commands/status");
|
|
19
|
+
const sync_1 = require("./commands/template/sync");
|
|
20
|
+
const cli_runner_1 = require("./lib/cli-runner");
|
|
21
|
+
const module_selector_1 = require("./lib/module-selector");
|
|
22
|
+
exports.VERSION = package_json_1.default.version;
|
|
23
|
+
function buildProgram() {
|
|
24
|
+
const program = new commander_1.Command();
|
|
25
|
+
program
|
|
26
|
+
.name("newbie")
|
|
27
|
+
.description("Newbie framework CLI: manage modules from the newbie-modules registry and sync project files")
|
|
28
|
+
.version(exports.VERSION)
|
|
29
|
+
.option("-C, --cwd <dir>", "project root directory", process.cwd())
|
|
30
|
+
.option("--dry-run", "print planned changes without writing files or running mutating commands", false)
|
|
31
|
+
.option("--skip-prisma-generate", "skip `npx prisma generate` after schema changes", false);
|
|
32
|
+
function collectOptions(command) {
|
|
33
|
+
const globals = command.optsWithGlobals();
|
|
34
|
+
return {
|
|
35
|
+
cwd: globals.cwd ?? process.cwd(),
|
|
36
|
+
dryRun: Boolean(globals.dryRun),
|
|
37
|
+
skipPrismaGenerate: Boolean(globals.skipPrismaGenerate),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
program
|
|
41
|
+
.command("create <project-name>")
|
|
42
|
+
.description("Scaffold a new project from the basic template")
|
|
43
|
+
.option("--template-path <dir>", "use a local template directory instead of cloning newbie-starter")
|
|
44
|
+
.option("--template-ref <ref>", "git ref of newbie-starter to clone the template from")
|
|
45
|
+
.option("--no-git-init", "skip 'git init' in the new project", undefined)
|
|
46
|
+
.action(function (name) {
|
|
47
|
+
const flags = this.opts();
|
|
48
|
+
return (0, cli_runner_1.run)(() => (0, create_1.runCreate)({
|
|
49
|
+
...collectOptions(this),
|
|
50
|
+
name,
|
|
51
|
+
templatePath: flags.templatePath,
|
|
52
|
+
templateRef: flags.templateRef,
|
|
53
|
+
gitInit: flags.gitInit,
|
|
54
|
+
}));
|
|
55
|
+
});
|
|
56
|
+
program
|
|
57
|
+
.command("doctor")
|
|
58
|
+
.description("Audit the installation: registry pins, copied modules, drift, env and prisma wiring")
|
|
59
|
+
.option("--json", "print findings as JSON", false)
|
|
60
|
+
.action(function () {
|
|
61
|
+
const flags = this.opts();
|
|
62
|
+
return (0, cli_runner_1.run)(() => (0, doctor_1.runDoctor)({ ...collectOptions(this), json: Boolean(flags.json) }));
|
|
63
|
+
});
|
|
64
|
+
program
|
|
65
|
+
.command("status")
|
|
66
|
+
.description("Print machine-readable project state as JSON")
|
|
67
|
+
.option("--drift", "include content drift against pinned pristine copies", false)
|
|
68
|
+
.action(function () {
|
|
69
|
+
const flags = this.opts();
|
|
70
|
+
return (0, cli_runner_1.run)(() => (0, status_1.runStatus)({ ...collectOptions(this), drift: Boolean(flags.drift) }));
|
|
71
|
+
});
|
|
72
|
+
const modules = program
|
|
73
|
+
.command("modules")
|
|
74
|
+
.description("Inspect and manage the enabled module set (bare invocation opens the picker on a TTY)")
|
|
75
|
+
.option("--json", "print the module inventory as JSON", false);
|
|
76
|
+
modules.action(function () {
|
|
77
|
+
const flags = this.opts();
|
|
78
|
+
return (0, cli_runner_1.run)(() => (0, default_1.runModules)({ ...collectOptions(this), json: Boolean(flags.json) }));
|
|
79
|
+
});
|
|
80
|
+
modules
|
|
81
|
+
.command("install [keys...]")
|
|
82
|
+
.description("Reconcile the project with modules.json; with keys, declare them (npm-style add) and install. --check is the CI gate")
|
|
83
|
+
.option("--check", "CI gate: verify module copies and generated wiring without writing anything", false)
|
|
84
|
+
.option("-y, --yes", "skip confirmation prompts", false)
|
|
85
|
+
.action(function (keys) {
|
|
86
|
+
const flags = this.opts();
|
|
87
|
+
return (0, cli_runner_1.run)(() => (0, install_1.runInstall)({
|
|
88
|
+
...collectOptions(this),
|
|
89
|
+
check: Boolean(flags.check),
|
|
90
|
+
yes: Boolean(flags.yes),
|
|
91
|
+
keys: (0, module_selector_1.parseModuleSelector)(keys),
|
|
92
|
+
}));
|
|
93
|
+
});
|
|
94
|
+
modules
|
|
95
|
+
.command("remove <keys...>")
|
|
96
|
+
.description("Remove modules from the enabled set (blocked while another enabled module still requires them)")
|
|
97
|
+
.option("-y, --yes", "skip confirmation prompts", false)
|
|
98
|
+
.action(function (keys) {
|
|
99
|
+
const flags = this.opts();
|
|
100
|
+
return (0, cli_runner_1.run)(() => (0, remove_1.runRemove)({
|
|
101
|
+
...collectOptions(this),
|
|
102
|
+
yes: Boolean(flags.yes),
|
|
103
|
+
keys: (0, module_selector_1.parseModuleSelector)(keys) ?? [],
|
|
104
|
+
}));
|
|
105
|
+
});
|
|
106
|
+
modules
|
|
107
|
+
.command("update [keys...]")
|
|
108
|
+
.description("Update enabled module copies to the registry HEAD commit; --check is the offline drift gate against the registry checkout")
|
|
109
|
+
.option("--check", "CI gate: verify installed copies against the registry checkout without writing anything", false)
|
|
110
|
+
.option("-y, --yes", "skip confirmation prompts", false)
|
|
111
|
+
.option("--force", "overwrite locally drifted module copies", false)
|
|
112
|
+
.action(function (keys) {
|
|
113
|
+
const flags = this.opts();
|
|
114
|
+
return (0, cli_runner_1.run)(() => (0, update_1.runUpdate)({
|
|
115
|
+
...collectOptions(this),
|
|
116
|
+
check: Boolean(flags.check),
|
|
117
|
+
yes: Boolean(flags.yes),
|
|
118
|
+
force: Boolean(flags.force),
|
|
119
|
+
keys: (0, module_selector_1.parseModuleSelector)(keys),
|
|
120
|
+
}));
|
|
121
|
+
});
|
|
122
|
+
modules
|
|
123
|
+
.command("watch [keys...]")
|
|
124
|
+
.description("Watch the local newbie-modules registry and sync installed module sources into the project on change")
|
|
125
|
+
.option("--all", "watch every registry module instead of only installed ones", false)
|
|
126
|
+
.action(function (keys) {
|
|
127
|
+
const flags = this.opts();
|
|
128
|
+
return (0, cli_runner_1.run)(() => (0, watch_1.runWatch)({
|
|
129
|
+
...collectOptions(this),
|
|
130
|
+
all: Boolean(flags.all),
|
|
131
|
+
keys: (0, module_selector_1.parseModuleSelector)(keys),
|
|
132
|
+
}));
|
|
133
|
+
});
|
|
134
|
+
modules
|
|
135
|
+
.command("lint")
|
|
136
|
+
.description("Enforce the module layering rules (feature -> capability -> infrastructure -> datastore) across registry sources; registry checkouts only")
|
|
137
|
+
.action(function () {
|
|
138
|
+
return (0, cli_runner_1.run)(() => (0, lint_1.runLint)(collectOptions(this)));
|
|
139
|
+
});
|
|
140
|
+
const template = program.command("template").description("Manage the framework-owned part of the project template");
|
|
141
|
+
template.action(() => {
|
|
142
|
+
template.outputHelp();
|
|
143
|
+
});
|
|
144
|
+
template
|
|
145
|
+
.command("sync [paths...]")
|
|
146
|
+
.description("Sync framework-owned template files (ADR-009 ownership registry: main.ts, tsconfig*, nest-cli.json, prisma.config.ts, prisma framework block, .env.example/.gitignore framework blocks, deploy/*) from the template; pass path prefixes to restrict the scope")
|
|
147
|
+
.option("--template-path <dir>", "use a local template directory instead of cloning newbie-starter")
|
|
148
|
+
.option("--template-ref <ref>", "git ref (e.g. a template tag) of newbie-starter to sync from")
|
|
149
|
+
.option("--check", "CI gate: print the diff and exit non-zero when skeleton files drift", false)
|
|
150
|
+
.action(function (paths) {
|
|
151
|
+
const flags = this.opts();
|
|
152
|
+
return (0, cli_runner_1.run)(() => (0, sync_1.runTemplateSync)({
|
|
153
|
+
...collectOptions(this),
|
|
154
|
+
templatePath: flags.templatePath,
|
|
155
|
+
templateRef: flags.templateRef,
|
|
156
|
+
check: Boolean(flags.check),
|
|
157
|
+
paths,
|
|
158
|
+
}));
|
|
159
|
+
});
|
|
160
|
+
program.action(() => {
|
|
161
|
+
program.outputHelp();
|
|
162
|
+
console.info(`\nnewbie v${exports.VERSION}`);
|
|
163
|
+
});
|
|
164
|
+
return program;
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=program.js.map
|
|
@@ -0,0 +1 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C;IACJ,CAAC,CAAC,CAAC;IAGL,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE;QAClB,OAAO,CAAC,UAAU,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,aAAa,eAAO,EAAE,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devbie/newbie-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "newbie backend framework CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "worldzhy",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"colorette": "^2.0.20",
|
|
29
29
|
"commander": "^12.1.0",
|
|
30
30
|
"figlet": "^1.7.0",
|
|
31
|
+
"prettier": "^3.9.9",
|
|
31
32
|
"tsx": "^4.19.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
package/dist/commands/agent.d.ts
DELETED
package/dist/commands/agent.js
DELETED
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.runAgent = runAgent;
|
|
7
|
-
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
8
|
-
const node_os_1 = __importDefault(require("node:os"));
|
|
9
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
-
const colorette_1 = require("colorette");
|
|
11
|
-
const modules_state_1 = require("../core/modules-state");
|
|
12
|
-
const errors_1 = require("../lib/errors");
|
|
13
|
-
const exec_1 = require("../lib/exec");
|
|
14
|
-
const modules_state_2 = require("../lib/modules-state");
|
|
15
|
-
const registry_1 = require("../lib/registry");
|
|
16
|
-
const version_1 = require("../lib/version");
|
|
17
|
-
const apply_1 = require("./apply");
|
|
18
|
-
const status_1 = require("./status");
|
|
19
|
-
const update_1 = require("./update");
|
|
20
|
-
const ENDPOINT_ENV = "MODULE_HUB_ENDPOINT";
|
|
21
|
-
const TOKEN_ENV = "MODULE_HUB_TOKEN";
|
|
22
|
-
const DEFAULT_POLL_INTERVAL_SECONDS = 60;
|
|
23
|
-
class HubHttpError extends Error {
|
|
24
|
-
status;
|
|
25
|
-
constructor(status, message) {
|
|
26
|
-
super(message);
|
|
27
|
-
this.status = status;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function sleep(ms) {
|
|
31
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
32
|
-
}
|
|
33
|
-
async function postPoll(endpoint, token, body) {
|
|
34
|
-
const url = `${endpoint}/module-hub/agent/poll`;
|
|
35
|
-
let response;
|
|
36
|
-
try {
|
|
37
|
-
response = await fetch(url, {
|
|
38
|
-
method: "POST",
|
|
39
|
-
headers: {
|
|
40
|
-
"content-type": "application/json",
|
|
41
|
-
"x-module-hub-token": token,
|
|
42
|
-
},
|
|
43
|
-
body: JSON.stringify(body),
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
throw new errors_1.CliError(`Cannot reach module hub at ${url}: ${error.message}`);
|
|
48
|
-
}
|
|
49
|
-
const text = await response.text();
|
|
50
|
-
if (!response.ok) {
|
|
51
|
-
throw new HubHttpError(response.status, `Hub poll failed with HTTP ${response.status}: ${text.slice(0, 500)}`);
|
|
52
|
-
}
|
|
53
|
-
let parsed;
|
|
54
|
-
try {
|
|
55
|
-
parsed = JSON.parse(text);
|
|
56
|
-
}
|
|
57
|
-
catch {
|
|
58
|
-
throw new errors_1.CliError(`Hub poll returned invalid JSON: ${text.slice(0, 500)}`);
|
|
59
|
-
}
|
|
60
|
-
const payload = parsed && typeof parsed === "object" && "data" in parsed && "code" in parsed
|
|
61
|
-
? parsed.data
|
|
62
|
-
: parsed;
|
|
63
|
-
return payload;
|
|
64
|
-
}
|
|
65
|
-
async function workingTreeSummary(cwd) {
|
|
66
|
-
try {
|
|
67
|
-
const result = await (0, exec_1.execCapture)("git", ["status", "--porcelain"], { cwd });
|
|
68
|
-
return result.stdout.trim() || null;
|
|
69
|
-
}
|
|
70
|
-
catch {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
async function collectReceiptSummary(cwd) {
|
|
75
|
-
return {
|
|
76
|
-
changedFiles: await workingTreeSummary(cwd),
|
|
77
|
-
status: await (0, status_1.collectStatus)(cwd),
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
async function executeSetChange(change, options) {
|
|
81
|
-
const state = await (0, modules_state_2.readModulesState)(options.cwd);
|
|
82
|
-
const current = (0, modules_state_1.moduleKeys)(state);
|
|
83
|
-
const next = change.type === "ADD"
|
|
84
|
-
? [...new Set([...current, change.moduleKey])]
|
|
85
|
-
: current.filter((key) => key !== change.moduleKey);
|
|
86
|
-
const specPath = node_path_1.default.join(node_os_1.default.tmpdir(), `newbie-agent-apply-${change.id}.json`);
|
|
87
|
-
await promises_1.default.writeFile(specPath, JSON.stringify({ modules: next }, null, 2), "utf8");
|
|
88
|
-
try {
|
|
89
|
-
await (0, apply_1.runApply)({ ...options, config: specPath, ci: true });
|
|
90
|
-
}
|
|
91
|
-
finally {
|
|
92
|
-
await promises_1.default.rm(specPath, { force: true });
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
async function executeUpgrade(change, options) {
|
|
96
|
-
const previousRef = process.env[registry_1.REGISTRY_REF_ENV];
|
|
97
|
-
if (change.targetSourceCommit) {
|
|
98
|
-
process.env[registry_1.REGISTRY_REF_ENV] = change.targetSourceCommit;
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
delete process.env[registry_1.REGISTRY_REF_ENV];
|
|
102
|
-
}
|
|
103
|
-
try {
|
|
104
|
-
await (0, update_1.runUpdate)({
|
|
105
|
-
...options,
|
|
106
|
-
yes: true,
|
|
107
|
-
force: change.driftPolicy === "force",
|
|
108
|
-
keys: [change.moduleKey],
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
finally {
|
|
112
|
-
if (previousRef === undefined) {
|
|
113
|
-
delete process.env[registry_1.REGISTRY_REF_ENV];
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
process.env[registry_1.REGISTRY_REF_ENV] = previousRef;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
async function executeChange(change, status, options) {
|
|
121
|
-
console.info((0, colorette_1.cyan)(`\n[agent] Executing ${change.type} ${change.moduleKey} (${change.id})`));
|
|
122
|
-
if (change.driftPolicy !== "force") {
|
|
123
|
-
const entry = status.modules.find((module) => module.key === change.moduleKey);
|
|
124
|
-
if (entry?.drift && !entry.drift.clean) {
|
|
125
|
-
return {
|
|
126
|
-
changeRequestId: change.id,
|
|
127
|
-
outcome: "FAILED",
|
|
128
|
-
error: `local drift detected on '${change.moduleKey}' (driftPolicy=reject)`,
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
try {
|
|
133
|
-
if (change.type === "UPGRADE") {
|
|
134
|
-
await executeUpgrade(change, options);
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
await executeSetChange(change, options);
|
|
138
|
-
}
|
|
139
|
-
console.info((0, colorette_1.green)(`[agent] ${change.type} ${change.moduleKey} completed.`));
|
|
140
|
-
return {
|
|
141
|
-
changeRequestId: change.id,
|
|
142
|
-
outcome: "DONE",
|
|
143
|
-
summary: await collectReceiptSummary(options.cwd),
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
console.error((0, colorette_1.red)(`[agent] ${change.type} ${change.moduleKey} failed: ${error.message}`));
|
|
148
|
-
return {
|
|
149
|
-
changeRequestId: change.id,
|
|
150
|
-
outcome: "FAILED",
|
|
151
|
-
error: error.message,
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
async function runAgent(options) {
|
|
156
|
-
const endpoint = process.env[ENDPOINT_ENV]?.replace(/\/+$/, "");
|
|
157
|
-
const token = process.env[TOKEN_ENV];
|
|
158
|
-
if (!endpoint || !token) {
|
|
159
|
-
throw new errors_1.CliError(`Agent requires ${ENDPOINT_ENV} and ${TOKEN_ENV} to be set.`);
|
|
160
|
-
}
|
|
161
|
-
const cwd = node_path_1.default.resolve(options.cwd);
|
|
162
|
-
const agentOptions = { ...options, cwd };
|
|
163
|
-
let pollInterval = DEFAULT_POLL_INTERVAL_SECONDS;
|
|
164
|
-
let receipts = [];
|
|
165
|
-
let stopped = false;
|
|
166
|
-
const stop = () => {
|
|
167
|
-
stopped = true;
|
|
168
|
-
};
|
|
169
|
-
process.on("SIGINT", stop);
|
|
170
|
-
process.on("SIGTERM", stop);
|
|
171
|
-
console.info((0, colorette_1.cyan)(`[agent] Module hub: ${endpoint}`));
|
|
172
|
-
console.info((0, colorette_1.cyan)(`[agent] Mode: ${options.once ? "single pass (--once)" : `daemon (${pollInterval}s interval)`}`));
|
|
173
|
-
while (!stopped) {
|
|
174
|
-
const status = await (0, status_1.collectStatus)(cwd, { drift: true });
|
|
175
|
-
let response;
|
|
176
|
-
try {
|
|
177
|
-
response = await postPoll(endpoint, token, {
|
|
178
|
-
cliVersion: version_1.CLI_VERSION,
|
|
179
|
-
status,
|
|
180
|
-
results: receipts,
|
|
181
|
-
});
|
|
182
|
-
receipts = [];
|
|
183
|
-
}
|
|
184
|
-
catch (error) {
|
|
185
|
-
if (error instanceof HubHttpError && (error.status === 401 || error.status === 403)) {
|
|
186
|
-
throw new errors_1.CliError(`Hub rejected the installation token (HTTP ${error.status}). The token may be revoked.`);
|
|
187
|
-
}
|
|
188
|
-
if (options.once)
|
|
189
|
-
throw error;
|
|
190
|
-
console.error((0, colorette_1.red)(`[agent] Poll failed: ${error.message}; retrying in ${pollInterval}s.`));
|
|
191
|
-
await sleep(pollInterval * 1000);
|
|
192
|
-
continue;
|
|
193
|
-
}
|
|
194
|
-
pollInterval = response.pollIntervalSeconds ?? DEFAULT_POLL_INTERVAL_SECONDS;
|
|
195
|
-
const pending = response.pendingChanges ?? [];
|
|
196
|
-
if (pending.length === 0) {
|
|
197
|
-
if (options.once) {
|
|
198
|
-
console.info((0, colorette_1.green)("\n[agent] No pending changes; single pass complete.\n"));
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
console.info(`[agent] ${new Date().toISOString()} idle (registry HEAD: ${response.latestRegistrySourceCommit ?? "unknown"})`);
|
|
202
|
-
await sleep(pollInterval * 1000);
|
|
203
|
-
continue;
|
|
204
|
-
}
|
|
205
|
-
console.info((0, colorette_1.yellow)(`[agent] Received ${pending.length} change request(s).`));
|
|
206
|
-
for (const change of pending) {
|
|
207
|
-
if (change.delivery && change.delivery !== "worktree") {
|
|
208
|
-
receipts.push({
|
|
209
|
-
changeRequestId: change.id,
|
|
210
|
-
outcome: "FAILED",
|
|
211
|
-
error: `delivery '${change.delivery}' is not supported by this CLI version`,
|
|
212
|
-
});
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
receipts.push(await executeChange(change, status, agentOptions));
|
|
216
|
-
}
|
|
217
|
-
if (options.once && pending.length > 0) {
|
|
218
|
-
console.info((0, colorette_1.cyan)("[agent] Delivering receipts with a final poll..."));
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
console.info((0, colorette_1.yellow)("\n[agent] Stopped.\n"));
|
|
222
|
-
}
|
|
223
|
-
//# sourceMappingURL=agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":";;;;;AA2NA,4BAgFC;AA3SD,gEAAkC;AAClC,sDAAyB;AACzB,0DAA6B;AAC7B,yCAAqD;AAErD,yDAAmD;AACnD,0CAAyC;AACzC,sCAA0C;AAC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,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,IAAA,gBAAI,EAAC,kDAAkD,CAAC,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,IAAA,kBAAM,EAAC,sBAAsB,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
package/dist/commands/apply.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GlobalOptions } from "./shared";
|
|
2
|
-
export interface ApplyOptions extends GlobalOptions {
|
|
3
|
-
config: string;
|
|
4
|
-
ci?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare function readSpec(file: string): Promise<string[]>;
|
|
7
|
-
export declare function runApply(options: ApplyOptions): Promise<void>;
|
package/dist/commands/apply.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.readSpec = readSpec;
|
|
7
|
-
exports.runApply = runApply;
|
|
8
|
-
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
9
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
-
const colorette_1 = require("colorette");
|
|
11
|
-
const pipeline_1 = require("../assemble/pipeline");
|
|
12
|
-
const errors_1 = require("../lib/errors");
|
|
13
|
-
const registry_1 = require("../lib/registry");
|
|
14
|
-
const shared_1 = require("./shared");
|
|
15
|
-
async function readSpec(file) {
|
|
16
|
-
const absolute = node_path_1.default.resolve(file);
|
|
17
|
-
let raw;
|
|
18
|
-
try {
|
|
19
|
-
raw = await promises_1.default.readFile(absolute, "utf8");
|
|
20
|
-
}
|
|
21
|
-
catch (error) {
|
|
22
|
-
throw new errors_1.CliError(`Cannot read apply spec ${file}: ${error.message}`);
|
|
23
|
-
}
|
|
24
|
-
let spec;
|
|
25
|
-
try {
|
|
26
|
-
spec = JSON.parse(raw);
|
|
27
|
-
}
|
|
28
|
-
catch (error) {
|
|
29
|
-
throw new errors_1.CliError(`Invalid JSON in apply spec ${file}: ${error.message}`);
|
|
30
|
-
}
|
|
31
|
-
if (!Array.isArray(spec.modules) || !spec.modules.every((key) => typeof key === "string")) {
|
|
32
|
-
throw new errors_1.CliError(`Apply spec ${file} must contain a string array "modules".`);
|
|
33
|
-
}
|
|
34
|
-
return spec.modules;
|
|
35
|
-
}
|
|
36
|
-
async function runApply(options) {
|
|
37
|
-
const wanted = await readSpec(options.config);
|
|
38
|
-
const { ctx } = await (0, shared_1.createContext)(options, {
|
|
39
|
-
ensureConfig: true,
|
|
40
|
-
fetch: true,
|
|
41
|
-
});
|
|
42
|
-
const registryModules = await (0, registry_1.listRegistryModules)(ctx.registry.root);
|
|
43
|
-
const known = new Set(registryModules.map((entry) => entry.key));
|
|
44
|
-
const deduped = new Set(wanted);
|
|
45
|
-
const unknown = [...deduped].filter((key) => !known.has(key));
|
|
46
|
-
if (unknown.length > 0) {
|
|
47
|
-
throw new errors_1.CliError(`Unknown module(s) in ${options.config}: ${unknown.join(", ")}. Available modules: ${[...known].join(", ")}`);
|
|
48
|
-
}
|
|
49
|
-
const deprecated = (0, registry_1.deprecatedNoticesOf)(registryModules);
|
|
50
|
-
const deprecatedChosen = [...deduped].filter((key) => deprecated.has(key));
|
|
51
|
-
if (deprecatedChosen.length > 0) {
|
|
52
|
-
throw new errors_1.CliError(`Cannot apply deprecated module(s): ${deprecatedChosen
|
|
53
|
-
.map((key) => `'${key}' (${deprecated.get(key)})`)
|
|
54
|
-
.join(", ")}`);
|
|
55
|
-
}
|
|
56
|
-
const nextKeys = [...deduped];
|
|
57
|
-
await (0, pipeline_1.applyModuleKeys)(ctx, nextKeys);
|
|
58
|
-
ctx.issues.assertEmpty();
|
|
59
|
-
console.info((0, colorette_1.bold)((0, colorette_1.green)("\n🍺 A P P L I E D\n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gBAAgB;aACnD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;aACjD,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IAE9B,MAAM,IAAA,0BAAe,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACrC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;IACzB,OAAO,CAAC,IAAI,CAAC,IAAA,gBAAI,EAAC,IAAA,iBAAK,EAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runAssemble = runAssemble;
|
|
4
|
-
const colorette_1 = require("colorette");
|
|
5
|
-
const deploy_1 = require("../assemble/deploy");
|
|
6
|
-
const module_source_drift_1 = require("../assemble/module-source-drift");
|
|
7
|
-
const modules_state_1 = require("../core/modules-state");
|
|
8
|
-
const unified_diff_1 = require("../core/unified-diff");
|
|
9
|
-
const errors_1 = require("../lib/errors");
|
|
10
|
-
const shared_1 = require("./shared");
|
|
11
|
-
function printSourceDrift(drift) {
|
|
12
|
-
const verdict = drift.report === null ? "absent from" : "differs from";
|
|
13
|
-
console.info((0, colorette_1.bold)(`\n# ${drift.installedPath} (${verdict} ${drift.registryPath})`));
|
|
14
|
-
if (drift.report === null)
|
|
15
|
-
return;
|
|
16
|
-
for (const file of drift.report.added)
|
|
17
|
-
console.info(` added: ${file}`);
|
|
18
|
-
for (const file of drift.report.changed)
|
|
19
|
-
console.info(` changed: ${file}`);
|
|
20
|
-
for (const file of drift.report.removed)
|
|
21
|
-
console.info(` removed: ${file}`);
|
|
22
|
-
}
|
|
23
|
-
async function runAssemble(options) {
|
|
24
|
-
const { ctx, sink } = await (0, shared_1.createContext)(options, { fetch: false });
|
|
25
|
-
const enabledKeys = (0, modules_state_1.moduleKeys)(ctx.state);
|
|
26
|
-
const plans = await (0, deploy_1.planDeployRenders)({ cwd: ctx.cwd, sink, issues: ctx.issues, enabledKeys });
|
|
27
|
-
const sourceDrifts = options.check
|
|
28
|
-
? await (0, module_source_drift_1.diffModuleSources)({ cwd: ctx.cwd, registryRoot: ctx.registry.root, enabledKeys })
|
|
29
|
-
: [];
|
|
30
|
-
if (plans.length === 0 && sourceDrifts.length === 0) {
|
|
31
|
-
console.info((0, colorette_1.green)((0, colorette_1.bold)(options.check
|
|
32
|
-
? "✓ Deploy assets are up to date and module sources match the registry checkout."
|
|
33
|
-
: "✓ Deploy assets are up to date with the installed module set.")));
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
if (options.check) {
|
|
37
|
-
for (const plan of plans) {
|
|
38
|
-
console.info((0, colorette_1.bold)(`\n# ${plan.path} (${plan.current === null ? "missing in project" : "drifts from render"})`));
|
|
39
|
-
const aLabel = plan.current === null ? "/dev/null" : `a/${plan.path}`;
|
|
40
|
-
process.stdout.write((0, unified_diff_1.unifiedDiff)(plan.current ?? "", plan.next, aLabel, `b/${plan.path}`));
|
|
41
|
-
}
|
|
42
|
-
for (const drift of sourceDrifts)
|
|
43
|
-
printSourceDrift(drift);
|
|
44
|
-
const problems = [];
|
|
45
|
-
if (plans.length > 0) {
|
|
46
|
-
problems.push(`${plans.length} deploy asset(s) drift from the installed module set; run \`newbie assemble\` to regenerate.`);
|
|
47
|
-
}
|
|
48
|
-
if (sourceDrifts.length > 0) {
|
|
49
|
-
const keys = sourceDrifts.map((drift) => drift.key).join(", ");
|
|
50
|
-
problems.push(`${sourceDrifts.length} installed module(s) differ from the registry checkout (${keys}); ` +
|
|
51
|
-
"back-port the host changes to newbie-modules, or run `newbie update` to adopt the registry version.");
|
|
52
|
-
}
|
|
53
|
-
throw new errors_1.CliError(problems.join("\n"));
|
|
54
|
-
}
|
|
55
|
-
for (const plan of plans) {
|
|
56
|
-
console.info(` ${plan.path}`);
|
|
57
|
-
}
|
|
58
|
-
await (0, deploy_1.applyDeployRenders)(sink, plans);
|
|
59
|
-
if (options.dryRun) {
|
|
60
|
-
console.info("[dry-run] no files were modified");
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
console.info((0, colorette_1.green)((0, colorette_1.bold)("\n✓ Deploy assets updated.")));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=assemble.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assemble.js","sourceRoot":"","sources":["../../src/commands/assemble.ts"],"names":[],"mappings":";;AAkCA,kCAuDC;AAzFD,yCAAwC;AAExC,+CAA2E;AAC3E,yEAAuF;AACvF,yDAAmD;AACnD,uDAAmD;AACnD,0CAAyC;AACzC,qCAAwD;AAQxD,SAAS,gBAAgB,CAAC,KAAwB;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC;IACvE,OAAO,CAAC,IAAI,CAAC,IAAA,gBAAI,EAAC,OAAO,KAAK,CAAC,aAAa,KAAK,OAAO,IAAI,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;IACpF,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI;QAAE,OAAO;IAClC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK;QAAE,OAAO,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;IACxE,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO;QAAE,OAAO,CAAC,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC;IAC5E,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO;QAAE,OAAO,CAAC,IAAI,CAAC,cAAc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