@skitterbyte/skitterspec-github 3.2.3 → 3.2.4
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/package.json +1 -1
- package/src/provider.js +66 -8
- package/src/updateall.js +8 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skitterbyte/skitterspec-github",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4",
|
|
4
4
|
"description": "Spec-driven development for Claude Code, with one-way GitHub sync — a superset of @skitterbyte/skitterspec: the base filesystem workflow plus /spec-status · /spec-push · /spec-claim and the spec-sync CLI, mirroring specs to GitHub Issues, sub-issues and a Projects v2 board, with GitHub Releases. The repo is canonical; GitHub is a generated mirror. Install this OR the base OR one other superset — exactly one.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
package/src/provider.js
CHANGED
|
@@ -90,6 +90,67 @@ function registerConfiguredProvider({ cwd, envConfig, idea, resolve = resolvePac
|
|
|
90
90
|
return { provider: p.name, registered: 'config' }
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
// The configured provider's own bin, installed beside the base or in the
|
|
94
|
+
// project, or null when it is not installed. `candidates` narrows where to
|
|
95
|
+
// look: an install takes only the published superset, since the workspace
|
|
96
|
+
// source package's assets are uncomposed and its bin refuses to install them.
|
|
97
|
+
function providerBin(p, dir, resolve, candidates = p.candidates) {
|
|
98
|
+
const bin = join('bin', `skitterspec-${p.name}.js`)
|
|
99
|
+
for (const [pkg] of candidates) {
|
|
100
|
+
const root = resolve(pkg, [__dirname, dir])
|
|
101
|
+
if (root && existsSync(join(root, bin))) return join(root, bin)
|
|
102
|
+
}
|
|
103
|
+
return null
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Run `init`, `update`, `enable` or `uninstall` for a project with a provider
|
|
108
|
+
* configured through that provider's own bin. The install set is a
|
|
109
|
+
* distribution's own `assets/`, and the base's lacks the provider's skills,
|
|
110
|
+
* seams and docs — so the base installing it would prune and rewrite them
|
|
111
|
+
* (bug-base-update-clobbers-provider). `update --all` is not forwarded: it
|
|
112
|
+
* runs each project's own distribution itself.
|
|
113
|
+
*
|
|
114
|
+
* `target` is the folder the verb acts on (`--dir`, else its positional,
|
|
115
|
+
* else cwd). Returns the exit status, or `null` when the base installs as it
|
|
116
|
+
* always has: another verb, or no provider configured.
|
|
117
|
+
*
|
|
118
|
+
* WHAT WOULD FOOL THIS: a provider installed where Node's resolution cannot
|
|
119
|
+
* see it from the base or the project reads as not installed — and the verb is
|
|
120
|
+
* refused, naming the package, rather than falling back to the base set. Two
|
|
121
|
+
* provider configs is a project this cannot read, refused the same way.
|
|
122
|
+
*/
|
|
123
|
+
const INSTALL_VERBS = ['init', 'update', 'enable', 'uninstall']
|
|
124
|
+
|
|
125
|
+
function forwardInstallCommand({ cwd, argv, target = cwd, resolve = resolvePackage, warn = () => {}, spawn = spawnSync }) {
|
|
126
|
+
const [cmd, ...rest] = argv
|
|
127
|
+
if (!INSTALL_VERBS.includes(cmd)) return null
|
|
128
|
+
if (cmd === 'update' && rest.includes('--all')) return null
|
|
129
|
+
if (rest.includes('--help') || rest.includes('-h')) return null
|
|
130
|
+
const dir = projectDir(target)
|
|
131
|
+
if (!dir) return null
|
|
132
|
+
const configured = PROVIDERS.filter((p) => existsSync(join(dir, p.configFile)))
|
|
133
|
+
if (configured.length === 0) return null
|
|
134
|
+
if (configured.length > 1) {
|
|
135
|
+
warn(
|
|
136
|
+
`skitterspec: more than one ticketing provider is configured here (${configured.map((p) => p.configFile).join(', ')}) — ` +
|
|
137
|
+
`${cmd} refused: keep one, then run it again`,
|
|
138
|
+
)
|
|
139
|
+
return 1
|
|
140
|
+
}
|
|
141
|
+
const p = configured[0]
|
|
142
|
+
const bin = providerBin(p, dir, resolve, p.candidates.slice(0, 1))
|
|
143
|
+
if (bin) {
|
|
144
|
+
const r = spawn(process.execPath, [bin, ...argv], { cwd, stdio: 'inherit' })
|
|
145
|
+
return r.status ?? 1
|
|
146
|
+
}
|
|
147
|
+
warn(
|
|
148
|
+
`skitterspec: ${cmd} refused — ${p.configFile} is here but @skitterbyte/skitterspec-${p.name} is not installed beside this one, ` +
|
|
149
|
+
`and the base set would overwrite its skills. Install it alongside @skitterbyte/skitterspec, at the latest of each.`,
|
|
150
|
+
)
|
|
151
|
+
return 1
|
|
152
|
+
}
|
|
153
|
+
|
|
93
154
|
/**
|
|
94
155
|
* Run a verb the base does not ship (`commands`, e.g. `spec-sync`) on the
|
|
95
156
|
* provider configured in the project at or above `cwd`, through that
|
|
@@ -119,13 +180,10 @@ function forwardProviderCommand({
|
|
|
119
180
|
const configured = PROVIDERS.filter((p) => existsSync(join(dir, p.configFile)))
|
|
120
181
|
if (configured.length !== 1) return null
|
|
121
182
|
const p = configured[0]
|
|
122
|
-
const bin =
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
const r = spawn(process.execPath, [join(root, bin), ...argv], { cwd, stdio: 'inherit' })
|
|
127
|
-
return r.status ?? 1
|
|
128
|
-
}
|
|
183
|
+
const bin = providerBin(p, dir, resolve)
|
|
184
|
+
if (bin) {
|
|
185
|
+
const r = spawn(process.execPath, [bin, ...argv], { cwd, stdio: 'inherit' })
|
|
186
|
+
return r.status ?? 1
|
|
129
187
|
}
|
|
130
188
|
warn(
|
|
131
189
|
`skitterspec: ${cmd} needs @skitterbyte/skitterspec-${p.name} installed beside this one — ` +
|
|
@@ -134,4 +192,4 @@ function forwardProviderCommand({
|
|
|
134
192
|
return 1
|
|
135
193
|
}
|
|
136
194
|
|
|
137
|
-
module.exports = { registerConfiguredProvider, forwardProviderCommand, PROVIDERS }
|
|
195
|
+
module.exports = { registerConfiguredProvider, forwardProviderCommand, forwardInstallCommand, INSTALL_VERBS, PROVIDERS }
|
package/src/updateall.js
CHANGED
|
@@ -62,16 +62,16 @@ function inPrimary(dir, git) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
* The distribution that owns a project:
|
|
66
|
-
*
|
|
67
|
-
*
|
|
65
|
+
* The distribution that owns a project: the one provider whose config is in
|
|
66
|
+
* `specs/.core/`, else what its manifest recorded, else the base. The config
|
|
67
|
+
* wins because a bare base `update` used to rewrite the manifest's field to
|
|
68
|
+
* the base (bug-base-update-clobbers-provider), so the field alone can name
|
|
69
|
+
* the wrong set; two configs is unreadable, and the manifest decides.
|
|
68
70
|
*/
|
|
69
71
|
function distributionOf(dir, manifest, exists) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
return BASE
|
|
72
|
+
const configured = PROVIDERS.filter((p) => exists(path.join(dir, 'specs', '.core', `${p}.config.json`)))
|
|
73
|
+
if (configured.length === 1) return `${BASE}-${configured[0]}`
|
|
74
|
+
return manifest.distribution || BASE
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
const binOf = (pkg) => pkg.replace(/^@skitterbyte\//, '')
|