@bbsnly/sdlc 0.3.0 → 0.5.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 +2 -2
- package/bin/sdlc-install.js +11 -4
- package/checksums.txt +11 -13
- package/lib/install.js +13 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ something else — and `--ignore-scripts` changes nothing here.
|
|
|
32
32
|
## Options
|
|
33
33
|
|
|
34
34
|
```sh
|
|
35
|
-
npx @bbsnly/sdlc install --version 0.
|
|
35
|
+
npx @bbsnly/sdlc install --version 0.4.0 # an earlier release than this package's
|
|
36
36
|
npx @bbsnly/sdlc install --dir /usr/local/bin
|
|
37
37
|
```
|
|
38
38
|
|
|
@@ -41,7 +41,7 @@ npx @bbsnly/sdlc install --dir /usr/local/bin
|
|
|
41
41
|
## Other ways to install
|
|
42
42
|
|
|
43
43
|
```sh
|
|
44
|
-
curl -fsSL https://raw.githubusercontent.com/bbsnly/sdlc/main/install.sh | sh
|
|
44
|
+
curl --proto '=https' --tlsv1.2 -fsSL https://raw.githubusercontent.com/bbsnly/sdlc/main/install.sh | sh
|
|
45
45
|
go install github.com/bbsnly/sdlc/cmd/sdlc@latest
|
|
46
46
|
```
|
|
47
47
|
|
package/bin/sdlc-install.js
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
const { install, Failure } = require('../lib/install.js')
|
|
5
5
|
const pkg = require('../package.json')
|
|
6
6
|
|
|
7
|
-
const USAGE = `Install sdlc, the story-driven delivery loop for Claude Code.
|
|
7
|
+
const USAGE = String.raw`Install sdlc, the story-driven delivery loop for Claude Code.
|
|
8
8
|
|
|
9
9
|
npx @bbsnly/sdlc install [--version X.Y.Z] [--dir PATH]
|
|
10
10
|
|
|
11
11
|
--version X.Y.Z install that version instead of this package's own
|
|
12
12
|
--dir PATH install somewhere other than the default
|
|
13
|
-
(~/.local/bin, or %LOCALAPPDATA
|
|
13
|
+
(~/.local/bin, or %LOCALAPPDATA%\Programs\sdlc\bin)
|
|
14
14
|
-h, --help this
|
|
15
15
|
|
|
16
16
|
The same settings can come from the environment: SDLC_VERSION and
|
|
@@ -19,6 +19,13 @@ SDLC_INSTALL_DIR.
|
|
|
19
19
|
This package installs a native binary and then gets out of the way: what ends
|
|
20
20
|
up on your PATH is sdlc itself, not a Node wrapper around it.`
|
|
21
21
|
|
|
22
|
+
// splitFlag reads `--flag=value` as well as `--flag`; inline is null when there
|
|
23
|
+
// is no `=`, so that an empty `--flag=` is still a value.
|
|
24
|
+
function splitFlag(arg) {
|
|
25
|
+
const eq = arg.indexOf('=')
|
|
26
|
+
return eq === -1 ? [arg, null] : [arg.slice(0, eq), arg.slice(eq + 1)]
|
|
27
|
+
}
|
|
28
|
+
|
|
22
29
|
function parse(argv) {
|
|
23
30
|
const options = {}
|
|
24
31
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -26,7 +33,7 @@ function parse(argv) {
|
|
|
26
33
|
if (arg === 'install') continue // `npx @bbsnly/sdlc install` reads better than the bare form
|
|
27
34
|
if (arg === '-h' || arg === '--help') return { help: true }
|
|
28
35
|
if (arg === '-v' || arg === '--print-version') return { printVersion: true }
|
|
29
|
-
const [flag, inline] =
|
|
36
|
+
const [flag, inline] = splitFlag(arg)
|
|
30
37
|
const value = inline !== null ? inline : argv[++i]
|
|
31
38
|
if (flag === '--version') options.version = value
|
|
32
39
|
else if (flag === '--dir') options.dir = value
|
|
@@ -66,7 +73,7 @@ main().catch((err) => {
|
|
|
66
73
|
console.error(`sdlc: ${err.message}`)
|
|
67
74
|
for (const line of err.advice) console.error(` ${line}`)
|
|
68
75
|
} else {
|
|
69
|
-
console.error(`sdlc: ${err
|
|
76
|
+
console.error(`sdlc: ${err?.message ? err.message : err}`)
|
|
70
77
|
}
|
|
71
78
|
process.exitCode = 1
|
|
72
79
|
})
|
package/checksums.txt
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
6a99b4dfdd71f28d00652a02c9d1b9d4fed62b2abbdc9a2fe92ce1a78f07b23f install.ps1
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
470591a728562530eaa210bc6c4daadd80ced671e0d7dfe08b1b2194c682f7f5 sdlc_0.3.0_windows_arm64.zip
|
|
14
|
-
1f0b22fe5f17da4ca13516a923090ee998ac0c7cb97a57976b85ddce603fb3f8 sdlc_0.3.0_windows_arm64.zip.sbom.json
|
|
2
|
+
99a1f36960b6c98d34a6089ff01ffeb1dcf0f564b758e720234cea7b78214c63 install.sh
|
|
3
|
+
6f62d560df3a0c186571d47125404c322c47dc60cf4e3c1f370f31dc74bb92bf sdlc_0.5.0_darwin_arm64.tar.gz
|
|
4
|
+
bc4ab48216149e70599f51fecf125cb7c9d54df9bc3a7975c8f11f7b35997b62 sdlc_0.5.0_darwin_arm64.tar.gz.sbom.json
|
|
5
|
+
dc5dfb993aaca54d6539b885a22f784c689aa53dc42a4a3ac1f54705871dff5b sdlc_0.5.0_linux_amd64.tar.gz
|
|
6
|
+
b412ba6a4c668c055f7638213aa866152738f843545d21b10375a4550b4f0a18 sdlc_0.5.0_linux_amd64.tar.gz.sbom.json
|
|
7
|
+
c0f3bbda7b775ac876ecc7d429b09f1389999d101d7c6a6f666bbf81acad0b2a sdlc_0.5.0_linux_arm64.tar.gz
|
|
8
|
+
912729448e095e8e74a7a532f298664d30f601da4f5e6adb1ab44e2026786f65 sdlc_0.5.0_linux_arm64.tar.gz.sbom.json
|
|
9
|
+
51712df676693fab87bdd8bd30e5a8fd4c6222cd09170a0e881df884f85a9fde sdlc_0.5.0_windows_amd64.zip
|
|
10
|
+
eaf738f7bb49f5676136e70cbc8b373b70ed273110d4ce177ada621b45548910 sdlc_0.5.0_windows_amd64.zip.sbom.json
|
|
11
|
+
62e36ba54bed6ac3d2aa4ba8c01c6cbf16e6f0b50bae9a5e72b8e989a4bd49d2 sdlc_0.5.0_windows_arm64.zip
|
|
12
|
+
c30c2ab12a396e3d1ccb5887bb00e046477e8395cb35437d7f9cd0e1054e4104 sdlc_0.5.0_windows_arm64.zip.sbom.json
|
package/lib/install.js
CHANGED
|
@@ -42,7 +42,7 @@ class Failure extends Error {
|
|
|
42
42
|
function assetFor(platform, arch, version) {
|
|
43
43
|
const goos = { darwin: 'darwin', linux: 'linux', win32: 'windows' }[platform]
|
|
44
44
|
const goarch = { x64: 'amd64', arm64: 'arm64' }[arch]
|
|
45
|
-
if (!goos || !goarch) {
|
|
45
|
+
if (!goos || !goarch || (goos === 'darwin' && goarch === 'amd64')) {
|
|
46
46
|
throw new Failure(`there is no prebuilt sdlc for ${platform}/${arch}.`, [
|
|
47
47
|
'Build from source instead:',
|
|
48
48
|
` go install github.com/${REPO}/cmd/sdlc@latest`,
|
|
@@ -71,8 +71,11 @@ function defaultDir(platform = process.platform, env = process.env) {
|
|
|
71
71
|
function parseChecksums(text) {
|
|
72
72
|
const out = new Map()
|
|
73
73
|
for (const line of text.split('\n')) {
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
// The name starts at a non-space so that the space before it has one way
|
|
75
|
+
// to match; with `\*?(.+)` there, a long run of spaces backtracked
|
|
76
|
+
// quadratically. The marker comes off afterwards for the same reason.
|
|
77
|
+
const match = /^([0-9a-f]{64})\s+(\S.*)$/i.exec(line.trim())
|
|
78
|
+
if (match) out.set(match[2].replace(/^\*(?=.)/, '').trim(), match[1].toLowerCase())
|
|
76
79
|
}
|
|
77
80
|
return out
|
|
78
81
|
}
|
|
@@ -89,8 +92,8 @@ function onPath(dir, env = process.env) {
|
|
|
89
92
|
// not read HTTPS_PROXY by default: behind a proxy npm itself goes through, the
|
|
90
93
|
// download went direct and failed with nothing more to say than that.
|
|
91
94
|
function unreachable(url, what, err) {
|
|
92
|
-
const cause = err
|
|
93
|
-
const reason =
|
|
95
|
+
const cause = err?.cause
|
|
96
|
+
const reason = cause?.code || cause?.message || err?.message || String(err)
|
|
94
97
|
return new Failure(what, [
|
|
95
98
|
`why ${url} could not be reached (${reason})`,
|
|
96
99
|
'fix check that this machine can reach github.com. Behind a proxy, use install.sh',
|
|
@@ -176,7 +179,7 @@ async function latestVersion() {
|
|
|
176
179
|
throw unreachable(url, 'could not work out the latest version of sdlc.', err)
|
|
177
180
|
}
|
|
178
181
|
const location = response.headers.get('location') || ''
|
|
179
|
-
const match =
|
|
182
|
+
const match = /\/tag\/v(\d[^/]*)$/.exec(location)
|
|
180
183
|
if (!match) {
|
|
181
184
|
throw new Failure('could not work out the latest version of sdlc.', [
|
|
182
185
|
`why ${url} did not redirect to a tag;`,
|
|
@@ -215,7 +218,7 @@ async function checksumsFor(version, archive, tmp, log) {
|
|
|
215
218
|
// apostrophe in it -- O'Brien -- would otherwise end the string early and turn
|
|
216
219
|
// a verified download into a parse error.
|
|
217
220
|
function psQuote(value) {
|
|
218
|
-
return value.
|
|
221
|
+
return value.replaceAll("'", "''")
|
|
219
222
|
}
|
|
220
223
|
|
|
221
224
|
function unpack(archive, into, binary) {
|
|
@@ -265,7 +268,9 @@ async function install(options = {}) {
|
|
|
265
268
|
|
|
266
269
|
const unpacked = unpack(downloaded, tmp, binary)
|
|
267
270
|
fs.mkdirSync(dir, { recursive: true })
|
|
268
|
-
|
|
271
|
+
// The unpacked copy lives in a private temporary directory; only the
|
|
272
|
+
// installed file needs to be executable by others.
|
|
273
|
+
fs.chmodSync(unpacked, 0o700)
|
|
269
274
|
// Through a temporary name in the target's own directory and then rename:
|
|
270
275
|
// a half written binary on PATH is worse than no binary on PATH, and
|
|
271
276
|
// rename is the only step that is atomic.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bbsnly/sdlc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Install sdlc: a story-driven delivery loop for Claude Code, with gates a model cannot talk its way past.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Anatoliy Babushka <anatoliybabushka@gmail.com>",
|