infernoflow 0.32.7 → 0.32.9
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/infernoflow.mjs +84 -255
- package/dist/lib/adopters/angular.mjs +1 -128
- package/dist/lib/adopters/css.mjs +1 -111
- package/dist/lib/adopters/react.mjs +1 -104
- package/dist/lib/ai/ideDetection.mjs +1 -31
- package/dist/lib/ai/localProvider.mjs +1 -88
- package/dist/lib/ai/providerRouter.mjs +2 -295
- package/dist/lib/commands/adopt.mjs +20 -869
- package/dist/lib/commands/adoptWizard.mjs +9 -320
- package/dist/lib/commands/agent.mjs +5 -191
- package/dist/lib/commands/ai.mjs +2 -407
- package/dist/lib/commands/audit.mjs +13 -300
- package/dist/lib/commands/changelog.mjs +26 -594
- package/dist/lib/commands/check.mjs +3 -184
- package/dist/lib/commands/ci.mjs +3 -208
- package/dist/lib/commands/claudeMd.mjs +25 -130
- package/dist/lib/commands/cloud.mjs +5 -521
- package/dist/lib/commands/context.mjs +31 -287
- package/dist/lib/commands/coverage.mjs +2 -282
- package/dist/lib/commands/dashboard.mjs +123 -635
- package/dist/lib/commands/demo.mjs +8 -465
- package/dist/lib/commands/diff.mjs +5 -274
- package/dist/lib/commands/docGate.mjs +2 -81
- package/dist/lib/commands/doctor.mjs +3 -321
- package/dist/lib/commands/explain.mjs +8 -438
- package/dist/lib/commands/export.mjs +10 -239
- package/dist/lib/commands/generateSkills.mjs +38 -163
- package/dist/lib/commands/graph.mjs +203 -320
- package/dist/lib/commands/health.mjs +2 -309
- package/dist/lib/commands/impact.mjs +2 -325
- package/dist/lib/commands/implement.mjs +7 -103
- package/dist/lib/commands/init.mjs +23 -475
- package/dist/lib/commands/installCursorHooks.mjs +1 -36
- package/dist/lib/commands/installVsCodeCopilotHooks.mjs +1 -37
- package/dist/lib/commands/link.mjs +2 -342
- package/dist/lib/commands/monorepo.mjs +4 -428
- package/dist/lib/commands/notify.mjs +4 -258
- package/dist/lib/commands/onboard.mjs +4 -296
- package/dist/lib/commands/prComment.mjs +2 -361
- package/dist/lib/commands/prImpact.mjs +2 -157
- package/dist/lib/commands/publish.mjs +15 -316
- package/dist/lib/commands/report.mjs +28 -272
- package/dist/lib/commands/review.mjs +9 -223
- package/dist/lib/commands/run.mjs +8 -336
- package/dist/lib/commands/scaffold.mjs +54 -419
- package/dist/lib/commands/scan.mjs +5 -558
- package/dist/lib/commands/scout.mjs +2 -291
- package/dist/lib/commands/setup.mjs +5 -310
- package/dist/lib/commands/share.mjs +13 -196
- package/dist/lib/commands/snapshot.mjs +3 -383
- package/dist/lib/commands/stability.mjs +2 -293
- package/dist/lib/commands/status.mjs +4 -172
- package/dist/lib/commands/suggest.mjs +21 -563
- package/dist/lib/commands/syncAuto.mjs +1 -96
- package/dist/lib/commands/synthesize.mjs +10 -228
- package/dist/lib/commands/teamSync.mjs +2 -388
- package/dist/lib/commands/test.mjs +6 -363
- package/dist/lib/commands/version.mjs +2 -282
- package/dist/lib/commands/vibe.mjs +7 -357
- package/dist/lib/commands/watch.mjs +4 -203
- package/dist/lib/commands/why.mjs +4 -358
- package/dist/lib/cursorHooksInstall.mjs +1 -60
- package/dist/lib/draftToolingInstall.mjs +7 -68
- package/dist/lib/git/detect-drift.mjs +4 -208
- package/dist/lib/learning/adapt.mjs +6 -101
- package/dist/lib/learning/observe.mjs +1 -119
- package/dist/lib/learning/patternDetector.mjs +1 -298
- package/dist/lib/learning/profile.mjs +2 -279
- package/dist/lib/learning/skillSynthesizer.mjs +24 -145
- package/dist/lib/templates/index.mjs +1 -131
- package/dist/lib/ui/errors.mjs +1 -142
- package/dist/lib/ui/output.mjs +6 -72
- package/dist/lib/ui/prompts.mjs +6 -147
- package/dist/lib/vsCodeCopilotHooksInstall.mjs +1 -42
- package/dist/templates/cursor/inferno-mcp-server.mjs +29 -0
- package/dist/templates/github-app/GITHUB_APP.md +67 -0
- package/dist/templates/github-app/app-manifest.json +20 -0
- package/package.json +1 -1
|
@@ -1,322 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
* infernoflow publish
|
|
3
|
-
*
|
|
4
|
-
* One command to release:
|
|
5
|
-
* 1. Bump version in package.json (--bump patch|minor|major, default: patch)
|
|
6
|
-
* 2. Move CHANGELOG ## Unreleased → ## <new-version> — <date>
|
|
7
|
-
* 3. Run build (node build.mjs)
|
|
8
|
-
* 4. Run smoke tests (skippable with --skip-tests)
|
|
9
|
-
* 5. npm publish
|
|
10
|
-
* 6. git add + commit + push
|
|
11
|
-
*
|
|
12
|
-
* Flags:
|
|
13
|
-
* --bump patch|minor|major Version bump type (default: patch)
|
|
14
|
-
* --skip-build Skip build step
|
|
15
|
-
* --skip-tests Skip smoke-test step
|
|
16
|
-
* --skip-push Publish + commit but don't git push
|
|
17
|
-
* --dry-run Print every step without executing
|
|
18
|
-
* --yes, -y Non-interactive (skip confirmation prompt)
|
|
19
|
-
* --tag Also create a git tag vX.Y.Z
|
|
20
|
-
*/
|
|
1
|
+
import*as u from"node:fs";import*as f from"node:path";import{execSync as j}from"node:child_process";import{fileURLToPath as U}from"node:url";import{header as E,ok as o,fail as C,warn as c,info as a,done as x,bold as g,cyan as y,gray as s,green as H}from"../ui/output.mjs";const P=f.dirname(U(import.meta.url)),m=f.resolve(P,"../..");function d(r,i={}){return j(r,{cwd:m,encoding:"utf8",stdio:i.silent?["ignore","pipe","pipe"]:["inherit","inherit","inherit"],...i})}function N(r){return j(r,{cwd:m,encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim()}function _(r,i){const e=r.split(".").map(Number);return i==="major"?(e[0]++,e[1]=0,e[2]=0):i==="minor"?(e[1]++,e[2]=0):e[2]++,e.join(".")}function $(){return new Date().toISOString().slice(0,10)}function B(r,i){if(!u.existsSync(r))return u.writeFileSync(r,`# Changelog \u2014 infernoflow
|
|
21
2
|
|
|
22
|
-
|
|
23
|
-
import * as path from "node:path";
|
|
24
|
-
import { execSync } from "node:child_process";
|
|
25
|
-
import { fileURLToPath } from "node:url";
|
|
26
|
-
import { header, ok, fail, warn, info, done, bold, cyan, gray, yellow, green } from "../ui/output.mjs";
|
|
3
|
+
## ${i} \u2014 ${$()}
|
|
27
4
|
|
|
28
|
-
|
|
29
|
-
|
|
5
|
+
### Added
|
|
6
|
+
- Release ${i}
|
|
7
|
+
`),!0;let e=u.readFileSync(r,"utf8");if(/^## Unreleased/im.test(e))return e=e.replace(/^## Unreleased.*$/im,`## ${i} \u2014 ${$()}`),u.writeFileSync(r,e),!0;const h=/^# .+$/im;return h.test(e)?(e=e.replace(h,b=>`${b}
|
|
30
8
|
|
|
31
|
-
|
|
9
|
+
## ${i} \u2014 ${$()}
|
|
32
10
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
encoding: "utf8",
|
|
37
|
-
stdio: opts.silent ? ["ignore", "pipe", "pipe"] : ["inherit", "inherit", "inherit"],
|
|
38
|
-
...opts,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
11
|
+
### Added
|
|
12
|
+
- Release ${i}
|
|
13
|
+
`),u.writeFileSync(r,e),!0):(u.writeFileSync(r,`## ${i} \u2014 ${$()}
|
|
41
14
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
15
|
+
### Added
|
|
16
|
+
- Release ${i}
|
|
45
17
|
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
else { parts[2]++; }
|
|
51
|
-
return parts.join(".");
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function todayISO() {
|
|
55
|
-
return new Date().toISOString().slice(0, 10);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function updateChangelog(changelogPath, newVersion) {
|
|
59
|
-
if (!fs.existsSync(changelogPath)) {
|
|
60
|
-
// create a minimal changelog if none exists
|
|
61
|
-
fs.writeFileSync(changelogPath,
|
|
62
|
-
`# Changelog — infernoflow\n\n## ${newVersion} — ${todayISO()}\n\n### Added\n- Release ${newVersion}\n`);
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
let text = fs.readFileSync(changelogPath, "utf8");
|
|
67
|
-
|
|
68
|
-
// If there's an ## Unreleased section, rename it
|
|
69
|
-
if (/^## Unreleased/im.test(text)) {
|
|
70
|
-
text = text.replace(
|
|
71
|
-
/^## Unreleased.*$/im,
|
|
72
|
-
`## ${newVersion} — ${todayISO()}`
|
|
73
|
-
);
|
|
74
|
-
fs.writeFileSync(changelogPath, text);
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// No Unreleased section — insert a new version heading after the first heading
|
|
79
|
-
const insertAfter = /^# .+$/im;
|
|
80
|
-
if (insertAfter.test(text)) {
|
|
81
|
-
text = text.replace(
|
|
82
|
-
insertAfter,
|
|
83
|
-
(m) => `${m}\n\n## ${newVersion} — ${todayISO()}\n\n### Added\n- Release ${newVersion}\n`
|
|
84
|
-
);
|
|
85
|
-
fs.writeFileSync(changelogPath, text);
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Fallback: prepend
|
|
90
|
-
fs.writeFileSync(changelogPath, `## ${newVersion} — ${todayISO()}\n\n### Added\n- Release ${newVersion}\n\n${text}`);
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function hasUncommittedChanges() {
|
|
95
|
-
try {
|
|
96
|
-
const out = runCapture("git status --porcelain");
|
|
97
|
-
return out.length > 0;
|
|
98
|
-
} catch { return false; }
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function gitUserConfigured() {
|
|
102
|
-
try {
|
|
103
|
-
runCapture("git config user.email");
|
|
104
|
-
return true;
|
|
105
|
-
} catch { return false; }
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// ── main ─────────────────────────────────────────────────────────────────────
|
|
110
|
-
|
|
111
|
-
export async function publishCommand(rawArgs) {
|
|
112
|
-
const args = rawArgs.slice(1); // drop command name
|
|
113
|
-
|
|
114
|
-
const dryRun = args.includes("--dry-run");
|
|
115
|
-
const skipBuild = args.includes("--skip-build");
|
|
116
|
-
const skipTests = args.includes("--skip-tests");
|
|
117
|
-
const skipPush = args.includes("--skip-push");
|
|
118
|
-
const createTag = args.includes("--tag");
|
|
119
|
-
const yes = args.includes("--yes") || args.includes("-y");
|
|
120
|
-
|
|
121
|
-
const bumpIdx = args.indexOf("--bump");
|
|
122
|
-
let bumpType = bumpIdx !== -1 ? (args[bumpIdx + 1] || "patch") : null;
|
|
123
|
-
|
|
124
|
-
if (bumpType && !["patch", "minor", "major"].includes(bumpType)) {
|
|
125
|
-
console.error(` Invalid --bump value: ${bumpType}. Must be patch, minor, or major.`);
|
|
126
|
-
process.exit(1);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
header("infernoflow publish");
|
|
130
|
-
|
|
131
|
-
if (dryRun) {
|
|
132
|
-
warn("DRY RUN — no files will be written, no commands executed");
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// ── 1. Read current version ───────────────────────────────────────────────
|
|
136
|
-
const pkgPath = path.join(PKG_ROOT, "package.json");
|
|
137
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
138
|
-
const oldVersion = pkg.version;
|
|
139
|
-
|
|
140
|
-
// ── Auto-detect bump type from capability diff if not specified ───────────
|
|
141
|
-
if (!bumpType) {
|
|
142
|
-
try {
|
|
143
|
-
const { versionCommand: _vc, ...versionModule } = await import("./version.mjs");
|
|
144
|
-
// Use the JSON output to get the recommendation
|
|
145
|
-
const { execSync: _exec } = await import("node:child_process");
|
|
146
|
-
const result = _exec("node " + JSON.stringify(path.join(PKG_ROOT, "bin", "infernoflow.mjs")) + " version --json", {
|
|
147
|
-
cwd: PKG_ROOT, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"],
|
|
148
|
-
});
|
|
149
|
-
const parsed = JSON.parse(result);
|
|
150
|
-
if (parsed.bump && parsed.bump !== "none") {
|
|
151
|
-
bumpType = parsed.bump;
|
|
152
|
-
info(`Auto-detected bump type: ${bold(cyan(bumpType))} (from capability diff)`);
|
|
153
|
-
} else {
|
|
154
|
-
bumpType = "patch";
|
|
155
|
-
info(`No capability changes detected — defaulting to ${bold("patch")}`);
|
|
156
|
-
}
|
|
157
|
-
} catch {
|
|
158
|
-
bumpType = "patch";
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const newVersion = bumpVersion(oldVersion, bumpType);
|
|
163
|
-
|
|
164
|
-
console.log();
|
|
165
|
-
console.log(` ${gray("current")} ${bold(oldVersion)}`);
|
|
166
|
-
console.log(` ${gray("new ")} ${bold(green(newVersion))} ${gray("(" + bumpType + " bump)")}`);
|
|
167
|
-
console.log();
|
|
168
|
-
|
|
169
|
-
// ── 2. Confirm ────────────────────────────────────────────────────────────
|
|
170
|
-
if (!yes && !dryRun) {
|
|
171
|
-
process.stdout.write(` Publish ${bold(cyan("infernoflow@" + newVersion))} to npm? [y/N] `);
|
|
172
|
-
let confirmed = false;
|
|
173
|
-
try {
|
|
174
|
-
const answer = execSync("bash -c 'read -r ans </dev/tty; echo $ans'", {
|
|
175
|
-
encoding: "utf8",
|
|
176
|
-
stdio: ["inherit", "pipe", "inherit"],
|
|
177
|
-
}).trim().toLowerCase();
|
|
178
|
-
confirmed = answer === "y" || answer === "yes";
|
|
179
|
-
} catch {
|
|
180
|
-
confirmed = false;
|
|
181
|
-
}
|
|
182
|
-
console.log();
|
|
183
|
-
if (!confirmed) {
|
|
184
|
-
console.log(gray(" Aborted.\n"));
|
|
185
|
-
process.exit(0);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// ── 3. Bump package.json ──────────────────────────────────────────────────
|
|
190
|
-
info(`Bumping package.json ${gray(oldVersion + " → " + newVersion)}`);
|
|
191
|
-
if (!dryRun) {
|
|
192
|
-
pkg.version = newVersion;
|
|
193
|
-
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 4) + "\n");
|
|
194
|
-
ok("package.json updated");
|
|
195
|
-
} else {
|
|
196
|
-
ok(gray("[dry] would write package.json"));
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// ── 4. Update CHANGELOG ───────────────────────────────────────────────────
|
|
200
|
-
const changelogPath = path.join(PKG_ROOT, "CHANGELOG.md");
|
|
201
|
-
info("Updating CHANGELOG.md");
|
|
202
|
-
if (!dryRun) {
|
|
203
|
-
updateChangelog(changelogPath, newVersion);
|
|
204
|
-
ok("CHANGELOG.md updated");
|
|
205
|
-
} else {
|
|
206
|
-
ok(gray("[dry] would update CHANGELOG.md"));
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// ── 5. Build ──────────────────────────────────────────────────────────────
|
|
210
|
-
if (!skipBuild) {
|
|
211
|
-
info("Running build " + gray("node build.mjs"));
|
|
212
|
-
if (!dryRun) {
|
|
213
|
-
try {
|
|
214
|
-
run("node build.mjs", { silent: false });
|
|
215
|
-
ok("Build succeeded");
|
|
216
|
-
} catch (err) {
|
|
217
|
-
fail("Build failed", err.message);
|
|
218
|
-
process.exit(1);
|
|
219
|
-
}
|
|
220
|
-
} else {
|
|
221
|
-
ok(gray("[dry] would run: node build.mjs"));
|
|
222
|
-
}
|
|
223
|
-
} else {
|
|
224
|
-
warn("Skipping build (--skip-build)");
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// ── 6. Smoke tests ────────────────────────────────────────────────────────
|
|
228
|
-
if (!skipTests) {
|
|
229
|
-
info("Running smoke tests");
|
|
230
|
-
if (!dryRun) {
|
|
231
|
-
try {
|
|
232
|
-
run("npm test", { silent: false });
|
|
233
|
-
ok("All smoke tests passed");
|
|
234
|
-
} catch (err) {
|
|
235
|
-
fail("Smoke tests failed", "Fix tests or re-run with --skip-tests");
|
|
236
|
-
process.exit(1);
|
|
237
|
-
}
|
|
238
|
-
} else {
|
|
239
|
-
ok(gray("[dry] would run: npm test"));
|
|
240
|
-
}
|
|
241
|
-
} else {
|
|
242
|
-
warn("Skipping tests (--skip-tests)");
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// ── 7. npm publish ────────────────────────────────────────────────────────
|
|
246
|
-
info(`Publishing to npm ${gray("infernoflow@" + newVersion)}`);
|
|
247
|
-
if (!dryRun) {
|
|
248
|
-
try {
|
|
249
|
-
run("npm publish", { silent: false });
|
|
250
|
-
ok(`Published infernoflow@${newVersion}`);
|
|
251
|
-
} catch (err) {
|
|
252
|
-
fail("npm publish failed", err.message || "Check npm credentials");
|
|
253
|
-
// Don't exit — still commit the version bump even if publish fails
|
|
254
|
-
warn("Continuing to git commit despite publish failure");
|
|
255
|
-
}
|
|
256
|
-
} else {
|
|
257
|
-
ok(gray("[dry] would run: npm publish"));
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
// ── 8. Git commit ─────────────────────────────────────────────────────────
|
|
261
|
-
info("Committing version bump");
|
|
262
|
-
if (!dryRun) {
|
|
263
|
-
try {
|
|
264
|
-
// Stage changed files
|
|
265
|
-
const filesToStage = ["package.json", "CHANGELOG.md"];
|
|
266
|
-
run(`git add ${filesToStage.join(" ")}`, { silent: false });
|
|
267
|
-
|
|
268
|
-
const commitMsg = `chore: release ${newVersion}`;
|
|
269
|
-
run(`git commit -m "${commitMsg}"`, { silent: false });
|
|
270
|
-
ok(`Committed: ${gray(commitMsg)}`);
|
|
271
|
-
} catch (err) {
|
|
272
|
-
warn(`Git commit failed: ${err.message}`);
|
|
273
|
-
warn("You can commit manually: git add package.json CHANGELOG.md && git commit -m \"chore: release " + newVersion + "\"");
|
|
274
|
-
}
|
|
275
|
-
} else {
|
|
276
|
-
ok(gray(`[dry] would commit: chore: release ${newVersion}`));
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// ── 9. Git tag ────────────────────────────────────────────────────────────
|
|
280
|
-
if (createTag) {
|
|
281
|
-
info(`Creating git tag ${gray("v" + newVersion)}`);
|
|
282
|
-
if (!dryRun) {
|
|
283
|
-
try {
|
|
284
|
-
run(`git tag v${newVersion}`, { silent: false });
|
|
285
|
-
ok(`Tagged v${newVersion}`);
|
|
286
|
-
} catch (err) {
|
|
287
|
-
warn(`Git tag failed: ${err.message}`);
|
|
288
|
-
}
|
|
289
|
-
} else {
|
|
290
|
-
ok(gray(`[dry] would tag: v${newVersion}`));
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
// ── 10. Git push ──────────────────────────────────────────────────────────
|
|
295
|
-
if (!skipPush) {
|
|
296
|
-
info("Pushing to origin");
|
|
297
|
-
if (!dryRun) {
|
|
298
|
-
try {
|
|
299
|
-
const pushCmd = createTag ? `git push && git push origin v${newVersion}` : "git push";
|
|
300
|
-
run(pushCmd, { silent: false });
|
|
301
|
-
ok("Pushed to origin");
|
|
302
|
-
} catch (err) {
|
|
303
|
-
warn(`Git push failed: ${err.message}`);
|
|
304
|
-
warn("Push manually: git push");
|
|
305
|
-
}
|
|
306
|
-
} else {
|
|
307
|
-
ok(gray("[dry] would run: git push"));
|
|
308
|
-
}
|
|
309
|
-
} else {
|
|
310
|
-
warn("Skipping push (--skip-push)");
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// ── Done ──────────────────────────────────────────────────────────────────
|
|
314
|
-
console.log();
|
|
315
|
-
if (dryRun) {
|
|
316
|
-
done(`Dry run complete — would have published infernoflow@${newVersion}`);
|
|
317
|
-
} else {
|
|
318
|
-
done(`infernoflow@${newVersion} published, committed, and pushed`);
|
|
319
|
-
console.log(` ${cyan("npm:")} https://www.npmjs.com/package/infernoflow`);
|
|
320
|
-
console.log(` ${cyan("git:")} ${gray("chore: release " + newVersion)}\n`);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
18
|
+
${e}`),!0)}function Y(){try{return N("git status --porcelain").length>0}catch{return!1}}function K(){try{return N("git config user.email"),!0}catch{return!1}}async function q(r){const i=r.slice(1),e=i.includes("--dry-run"),h=i.includes("--skip-build"),b=i.includes("--skip-tests"),A=i.includes("--skip-push"),v=i.includes("--tag"),R=i.includes("--yes")||i.includes("-y"),G=i.indexOf("--bump");let l=G!==-1?i[G+1]||"patch":null;l&&!["patch","minor","major"].includes(l)&&(console.error(` Invalid --bump value: ${l}. Must be patch, minor, or major.`),process.exit(1)),E("infernoflow publish"),e&&c("DRY RUN \u2014 no files will be written, no commands executed");const O=f.join(m,"package.json"),w=JSON.parse(u.readFileSync(O,"utf8")),k=w.version;if(!l)try{const{versionCommand:n,...p}=await import("./version.mjs"),{execSync:L}=await import("node:child_process"),T=L("node "+JSON.stringify(f.join(m,"bin","infernoflow.mjs"))+" version --json",{cwd:m,encoding:"utf8",stdio:["ignore","pipe","pipe"]}),S=JSON.parse(T);S.bump&&S.bump!=="none"?(l=S.bump,a(`Auto-detected bump type: ${g(y(l))} (from capability diff)`)):(l="patch",a(`No capability changes detected \u2014 defaulting to ${g("patch")}`))}catch{l="patch"}const t=_(k,l);if(console.log(),console.log(` ${s("current")} ${g(k)}`),console.log(` ${s("new ")} ${g(H(t))} ${s("("+l+" bump)")}`),console.log(),!R&&!e){process.stdout.write(` Publish ${g(y("infernoflow@"+t))} to npm? [y/N] `);let n=!1;try{const p=j("bash -c 'read -r ans </dev/tty; echo $ans'",{encoding:"utf8",stdio:["inherit","pipe","inherit"]}).trim().toLowerCase();n=p==="y"||p==="yes"}catch{n=!1}console.log(),n||(console.log(s(` Aborted.
|
|
19
|
+
`)),process.exit(0))}a(`Bumping package.json ${s(k+" \u2192 "+t)}`),e?o(s("[dry] would write package.json")):(w.version=t,u.writeFileSync(O,JSON.stringify(w,null,4)+`
|
|
20
|
+
`),o("package.json updated"));const F=f.join(m,"CHANGELOG.md");if(a("Updating CHANGELOG.md"),e?o(s("[dry] would update CHANGELOG.md")):(B(F,t),o("CHANGELOG.md updated")),h)c("Skipping build (--skip-build)");else if(a("Running build "+s("node build.mjs")),e)o(s("[dry] would run: node build.mjs"));else try{d("node build.mjs",{silent:!1}),o("Build succeeded")}catch(n){C("Build failed",n.message),process.exit(1)}if(b)c("Skipping tests (--skip-tests)");else if(a("Running smoke tests"),e)o(s("[dry] would run: npm test"));else try{d("npm test",{silent:!1}),o("All smoke tests passed")}catch{C("Smoke tests failed","Fix tests or re-run with --skip-tests"),process.exit(1)}if(a(`Publishing to npm ${s("infernoflow@"+t)}`),e)o(s("[dry] would run: npm publish"));else try{d("npm publish",{silent:!1}),o(`Published infernoflow@${t}`)}catch(n){C("npm publish failed",n.message||"Check npm credentials"),c("Continuing to git commit despite publish failure")}if(a("Committing version bump"),e)o(s(`[dry] would commit: chore: release ${t}`));else try{d(`git add ${["package.json","CHANGELOG.md"].join(" ")}`,{silent:!1});const p=`chore: release ${t}`;d(`git commit -m "${p}"`,{silent:!1}),o(`Committed: ${s(p)}`)}catch(n){c(`Git commit failed: ${n.message}`),c('You can commit manually: git add package.json CHANGELOG.md && git commit -m "chore: release '+t+'"')}if(v)if(a(`Creating git tag ${s("v"+t)}`),e)o(s(`[dry] would tag: v${t}`));else try{d(`git tag v${t}`,{silent:!1}),o(`Tagged v${t}`)}catch(n){c(`Git tag failed: ${n.message}`)}if(A)c("Skipping push (--skip-push)");else if(a("Pushing to origin"),e)o(s("[dry] would run: git push"));else try{const n=v?`git push && git push origin v${t}`:"git push";d(n,{silent:!1}),o("Pushed to origin")}catch(n){c(`Git push failed: ${n.message}`),c("Push manually: git push")}console.log(),e?x(`Dry run complete \u2014 would have published infernoflow@${t}`):(x(`infernoflow@${t} published, committed, and pushed`),console.log(` ${y("npm:")} https://www.npmjs.com/package/infernoflow`),console.log(` ${y("git:")} ${s("chore: release "+t)}
|
|
21
|
+
`))}export{q as publishCommand};
|