@able-autonomy/able 0.0.10 → 0.0.11

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.
Files changed (2) hide show
  1. package/able.ts +11 -1
  2. package/package.json +1 -1
package/able.ts CHANGED
@@ -101,6 +101,16 @@ if (command === 'config') {
101
101
  console.log(JSON.stringify(await loadConfig(hostRoot()), null, args.includes('--json') ? undefined : 2))
102
102
  process.exit(0)
103
103
  }
104
+ // `bunx` keeps the copy it fetched first; asking for @latest once refreshes it. A host that pins Able runs its pin instead.
105
+ if (command === 'upgrade') {
106
+ const r = Bun.spawnSync(['bunx', '@able-autonomy/able@latest'], { stdout: 'ignore', stderr: 'ignore' })
107
+ if (r.exitCode !== 0) fail('bunx @able-autonomy/able@latest failed')
108
+ const { version } = await (await fetch('https://registry.npmjs.org/@able-autonomy/able/latest')).json()
109
+ console.log(`able ${version} is the latest, and bunx now runs it`)
110
+ const pinned = Bun.file('node_modules/@able-autonomy/able/package.json')
111
+ if (await pinned.exists()) console.log(`this folder pins ${(await pinned.json()).version}: set @able-autonomy/able to ${version} in package.json, then bun install`)
112
+ process.exit(0)
113
+ }
104
114
  const modules: Record<string, string> = { commit: './src/commit.ts', push: './src/push.ts', ws: './src/workspaces/index.ts' }
105
115
  if (command && modules[command]) {
106
116
  await import(modules[command])
@@ -120,7 +130,7 @@ if (delegate) {
120
130
  }
121
131
  if (command !== 'gh') {
122
132
  console.error(
123
- "usage: able gh <gh arguments> run gh as Able's GitHub App\n able sync [--dry-run] file follow-ups and write ended weeks' records\n able config [--json] print the host's able.config.ts\n able commit \"<message>\" [<path>…] a pathspec commit after the touched folders' checks\n able push pushes this branch with its tags\n able ws <new|ls|current|refresh|merge|rm|start|stop|status|take> workspaces",
133
+ "usage: able gh <gh arguments> run gh as Able's GitHub App\n able sync [--dry-run] file follow-ups and write ended weeks' records\n able config [--json] print the host's able.config.ts\n able commit \"<message>\" [<path>…] a pathspec commit after the touched folders' checks\n able push pushes this branch with its tags\n able upgrade makes bunx run the latest published able\n able ws <new|ls|current|refresh|merge|rm|start|stop|status|take> workspaces",
124
134
  )
125
135
  process.exit(command ? 1 : 0)
126
136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@able-autonomy/able",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Able's command line and the config types a host's able.config.ts uses",
5
5
  "type": "module",
6
6
  "license": "MIT",