super-backlog 0.8.1 → 0.9.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 CHANGED
@@ -24,13 +24,13 @@ Install super-backlog into the current project with the official installer for y
24
24
  **Windows (PowerShell)** — bypasses Execution Policy automatically:
25
25
 
26
26
  ```powershell
27
- irm https://raw.githubusercontent.com/adam-s-k-i/super-backlog/main/scripts/install.ps1 | iex
27
+ irm https://raw.githubusercontent.com/adam-s-k-i/super-backlog/master/scripts/install.ps1 | iex
28
28
  ```
29
29
 
30
30
  **macOS / Linux**:
31
31
 
32
32
  ```bash
33
- curl -fsSL https://raw.githubusercontent.com/adam-s-k-i/super-backlog/main/scripts/install.sh | bash
33
+ curl -fsSL https://raw.githubusercontent.com/adam-s-k-i/super-backlog/master/scripts/install.sh | bash
34
34
  ```
35
35
 
36
36
  Both installers check Node.js and npm, install `super-backlog`, and run `sbl init` without using `npx`, so they work even when `npx` is blocked by PowerShell's Execution Policy.
@@ -20,6 +20,8 @@ function describeAction(action) {
20
20
  switch (action.kind) {
21
21
  case 'upstream-install':
22
22
  return `upstream-install via ${action.pm}`;
23
+ case 'scaffold-package-json':
24
+ return 'scaffold-package-json package.json';
23
25
  case 'merge-json':
24
26
  return `merge-json ${action.path} (${action.transform})`;
25
27
  case 'inject-agents-block':
@@ -1,6 +1,6 @@
1
1
  // src/dashboard/data.ts
2
2
  import { existsSync, readFileSync } from 'node:fs';
3
- import { join } from 'node:path';
3
+ import { basename, join } from 'node:path';
4
4
  import { resolveBacklogBin, runCapture } from '../lib/run.js';
5
5
  import { readSimpleKeys } from '../lib/yamlmini.js';
6
6
  function isRecord(v) {
@@ -235,6 +235,7 @@ function readProjectIdentity(cwd) {
235
235
  const name = asString(cfg['project_name']) ??
236
236
  asString(cfg['name']) ??
237
237
  asString(pkg?.['name']) ??
238
+ asString(basename(cwd)) ??
238
239
  'Untitled project';
239
240
  const description = asString(cfg['description']) ?? asString(pkg?.['description']) ?? '';
240
241
  return { name, description };
@@ -1,6 +1,6 @@
1
1
  // src/init/execute.ts
2
2
  import { existsSync, readFileSync } from 'node:fs';
3
- import { dirname, join, resolve } from 'node:path';
3
+ import { dirname, basename, join, resolve } from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
5
5
  import process from 'node:process';
6
6
  import { atomicWrite } from '../lib/atomic.js';
@@ -177,6 +177,18 @@ export async function executeActions(cwd, actions, ctx) {
177
177
  runUpstreamInstall(cwd, action, ctx);
178
178
  applied++;
179
179
  break;
180
+ case 'scaffold-package-json': {
181
+ const pkgPath = join(cwd, 'package.json');
182
+ if (existsSync(pkgPath)) {
183
+ skipped++;
184
+ }
185
+ else {
186
+ const minimal = { name: basename(cwd), private: true };
187
+ atomicWrite(pkgPath, `${JSON.stringify(minimal, null, 2)}\n`);
188
+ applied++;
189
+ }
190
+ break;
191
+ }
180
192
  case 'merge-json':
181
193
  applyMergeJson(cwd, action) ? applied++ : skipped++;
182
194
  break;
@@ -18,18 +18,24 @@ export function planInit(state, opts, _version) {
18
18
  const actions = [];
19
19
  const warnings = [];
20
20
  const degradedAuto = opts.pm === 'auto' && state.detectedPm === null;
21
- if (!opts.skipInstall && !degradedAuto && opts.pm !== 'skip') {
22
- if (opts.pm === 'auto' && state.detectedPm !== null) {
21
+ // degraded auto means: no package.json (detectPackageManager only returns
22
+ // null then). One-command promise: scaffold a minimal package.json and
23
+ // proceed with npm instead of degrading to a manual-install warning.
24
+ const scaffold = degradedAuto && !opts.skipInstall;
25
+ if (scaffold) {
26
+ actions.push({ kind: 'scaffold-package-json' });
27
+ }
28
+ if (!opts.skipInstall && opts.pm !== 'skip') {
29
+ if (scaffold) {
30
+ actions.push({ kind: 'upstream-install', pm: 'npm' });
31
+ }
32
+ else if (opts.pm === 'auto' && state.detectedPm !== null) {
23
33
  actions.push({ kind: 'upstream-install', pm: state.detectedPm });
24
34
  }
25
35
  else if (opts.pm !== 'auto') {
26
36
  actions.push({ kind: 'upstream-install', pm: opts.pm });
27
37
  }
28
38
  }
29
- if (degradedAuto && !opts.skipInstall) {
30
- warnings.push('no package manager detected - dependency installation and package.json merge were skipped; ' +
31
- 'install backlog.md and super-backlog manually, or re-run with --pm <npm|pnpm|bun>');
32
- }
33
39
  // opencode.json merge depends only on harness selection and applyPluginEntry
34
40
  // not throwing a near-miss - never on package.json presence or PM detection
35
41
  if (opts.harnesses.includes('opencode')) {
@@ -41,7 +47,7 @@ export function planInit(state, opts, _version) {
41
47
  warnings.push(err instanceof Error ? err.message : String(err));
42
48
  }
43
49
  }
44
- if (!degradedAuto && state.pkgExists) {
50
+ if ((!degradedAuto && state.pkgExists) || scaffold) {
45
51
  actions.push({ kind: 'merge-json', path: 'package.json', transform: 'scripts-and-devdeps' });
46
52
  }
47
53
  if (opts.harnesses.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-backlog",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "One command to equip any project with Backlog.md + Superpowers, plus a Project Dashboard.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,7 +28,8 @@
28
28
  "tasks": "backlog task list",
29
29
  "board": "backlog board",
30
30
  "browser": "backlog browser",
31
- "dashboard": "super-backlog dashboard"
31
+ "dashboard": "super-backlog dashboard",
32
+ "screenshot": "npm run build && node scripts/capture-dashboard.mjs"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@types/node": "^26.2.0",