infernoflow 0.33.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +208 -120
- package/dist/bin/infernoflow.mjs +271 -85
- package/dist/lib/adopters/angular.mjs +128 -1
- package/dist/lib/adopters/css.mjs +111 -1
- package/dist/lib/adopters/react.mjs +104 -1
- package/dist/lib/ai/ideDetection.mjs +31 -1
- package/dist/lib/ai/localProvider.mjs +88 -1
- package/dist/lib/ai/providerRouter.mjs +295 -2
- package/dist/lib/commands/adopt.mjs +869 -20
- package/dist/lib/commands/adoptWizard.mjs +320 -9
- package/dist/lib/commands/agent.mjs +191 -5
- package/dist/lib/commands/ai.mjs +407 -2
- package/dist/lib/commands/ask.mjs +299 -0
- package/dist/lib/commands/audit.mjs +300 -13
- package/dist/lib/commands/changelog.mjs +594 -26
- package/dist/lib/commands/check.mjs +184 -3
- package/dist/lib/commands/ci.mjs +208 -3
- package/dist/lib/commands/claudeMd.mjs +139 -28
- package/dist/lib/commands/cloud.mjs +521 -5
- package/dist/lib/commands/context.mjs +346 -34
- package/dist/lib/commands/coverage.mjs +282 -2
- package/dist/lib/commands/dashboard.mjs +635 -123
- package/dist/lib/commands/demo.mjs +465 -8
- package/dist/lib/commands/diff.mjs +274 -5
- package/dist/lib/commands/docGate.mjs +81 -2
- package/dist/lib/commands/doctor.mjs +321 -3
- package/dist/lib/commands/explain.mjs +438 -8
- package/dist/lib/commands/export.mjs +239 -10
- package/dist/lib/commands/generateSkills.mjs +163 -38
- package/dist/lib/commands/graph.mjs +378 -11
- package/dist/lib/commands/health.mjs +309 -2
- package/dist/lib/commands/impact.mjs +325 -2
- package/dist/lib/commands/implement.mjs +103 -7
- package/dist/lib/commands/init.mjs +545 -23
- package/dist/lib/commands/installCursorHooks.mjs +36 -1
- package/dist/lib/commands/installVsCodeCopilotHooks.mjs +37 -1
- package/dist/lib/commands/link.mjs +342 -2
- package/dist/lib/commands/log.mjs +164 -16
- package/dist/lib/commands/monorepo.mjs +428 -4
- package/dist/lib/commands/notify.mjs +258 -4
- package/dist/lib/commands/onboard.mjs +296 -4
- package/dist/lib/commands/prComment.mjs +361 -2
- package/dist/lib/commands/prImpact.mjs +157 -2
- package/dist/lib/commands/publish.mjs +316 -15
- package/dist/lib/commands/recap.mjs +359 -0
- package/dist/lib/commands/report.mjs +272 -28
- package/dist/lib/commands/review.mjs +223 -9
- package/dist/lib/commands/run.mjs +336 -8
- package/dist/lib/commands/scaffold.mjs +419 -54
- package/dist/lib/commands/scan.mjs +1118 -5
- package/dist/lib/commands/scout.mjs +291 -2
- package/dist/lib/commands/setup.mjs +310 -5
- package/dist/lib/commands/share.mjs +196 -13
- package/dist/lib/commands/snapshot.mjs +383 -3
- package/dist/lib/commands/stability.mjs +293 -2
- package/dist/lib/commands/stats.mjs +402 -0
- package/dist/lib/commands/status.mjs +172 -4
- package/dist/lib/commands/suggest.mjs +563 -21
- package/dist/lib/commands/switch.mjs +310 -0
- package/dist/lib/commands/syncAuto.mjs +96 -1
- package/dist/lib/commands/synthesize.mjs +228 -10
- package/dist/lib/commands/teamSync.mjs +388 -2
- package/dist/lib/commands/test.mjs +363 -6
- package/dist/lib/commands/theme.mjs +195 -18
- package/dist/lib/commands/upgrade.mjs +153 -0
- package/dist/lib/commands/version.mjs +282 -2
- package/dist/lib/commands/vibe.mjs +357 -7
- package/dist/lib/commands/watch.mjs +203 -4
- package/dist/lib/commands/why.mjs +358 -4
- package/dist/lib/cursorHooksInstall.mjs +60 -1
- package/dist/lib/draftToolingInstall.mjs +68 -7
- package/dist/lib/git/detect-drift.mjs +208 -4
- package/dist/lib/learning/adapt.mjs +101 -6
- package/dist/lib/learning/observe.mjs +119 -1
- package/dist/lib/learning/patternDetector.mjs +298 -1
- package/dist/lib/learning/profile.mjs +279 -2
- package/dist/lib/learning/skillSynthesizer.mjs +145 -24
- package/dist/lib/templates/index.mjs +131 -1
- package/dist/lib/theme/scanner.mjs +343 -4
- package/dist/lib/ui/errors.mjs +142 -1
- package/dist/lib/ui/output.mjs +72 -6
- package/dist/lib/ui/prompts.mjs +147 -6
- package/dist/lib/vsCodeCopilotHooksInstall.mjs +42 -1
- package/package.json +1 -1
|
@@ -1,21 +1,322 @@
|
|
|
1
|
-
|
|
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
|
+
*/
|
|
2
21
|
|
|
3
|
-
|
|
22
|
+
import * as fs from "node:fs";
|
|
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";
|
|
4
27
|
|
|
5
|
-
|
|
6
|
-
|
|
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}
|
|
28
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
29
|
+
const PKG_ROOT = path.resolve(__dirname, "../..");
|
|
8
30
|
|
|
9
|
-
|
|
31
|
+
// ── helpers ──────────────────────────────────────────────────────────────────
|
|
10
32
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
33
|
+
function run(cmd, opts = {}) {
|
|
34
|
+
return execSync(cmd, {
|
|
35
|
+
cwd: PKG_ROOT,
|
|
36
|
+
encoding: "utf8",
|
|
37
|
+
stdio: opts.silent ? ["ignore", "pipe", "pipe"] : ["inherit", "inherit", "inherit"],
|
|
38
|
+
...opts,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
14
41
|
|
|
15
|
-
|
|
16
|
-
|
|
42
|
+
function runCapture(cmd) {
|
|
43
|
+
return execSync(cmd, { cwd: PKG_ROOT, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
|
|
44
|
+
}
|
|
17
45
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
46
|
+
function bumpVersion(current, type) {
|
|
47
|
+
const parts = current.split(".").map(Number);
|
|
48
|
+
if (type === "major") { parts[0]++; parts[1] = 0; parts[2] = 0; }
|
|
49
|
+
else if (type === "minor") { parts[1]++; parts[2] = 0; }
|
|
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
|
+
}
|