@stonepandastudio/cairn 0.3.0 → 0.3.1

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 (3) hide show
  1. package/README.md +1 -1
  2. package/lib/init.js +19 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -167,4 +167,4 @@ schema.json JSON Schema for cairn.config.json
167
167
  test/run.js dependency-free test runner
168
168
  ```
169
169
 
170
- No runtime dependencies. Node >= 18. `npm test` runs 46 tests.
170
+ No runtime dependencies. Node >= 18. `npm test` runs 47 tests.
package/lib/init.js CHANGED
@@ -29,7 +29,17 @@ const { makePaint } = require('./paint');
29
29
 
30
30
  const SHIM_SOURCE = 'shims/jira.js';
31
31
  const SHIM_TARGET = '_cairn/scripts/jira.js';
32
- const LEGACY_SHIM_TARGET = 'ai/scripts/jira.js';
32
+
33
+ // Copied tracker-client filenames seen across the repos. `cairn init` replaces
34
+ // every one that exists with the shim — the snap-proof repos carry all three
35
+ // (`task-tracker.js` dispatching to `jira.js` / `youtrack.js`), and the docs
36
+ // that reference them by path keep working because the shim reads the same
37
+ // argv. A repo that never had one is left alone; the shim is never invented.
38
+ const LEGACY_SHIM_TARGETS = [
39
+ 'ai/scripts/jira.js',
40
+ 'ai/scripts/youtrack.js',
41
+ 'ai/scripts/task-tracker.js',
42
+ ];
33
43
 
34
44
  const HELP = `cairn init — make a repo cairn-managed
35
45
 
@@ -41,7 +51,7 @@ Usage: cairn init [options]
41
51
  --project-key <KEY> tracker project key, e.g. PROOF
42
52
  --story-type <name> parent issue type (default: Story)
43
53
  --subtask-type <name> child issue type (default: Sub-task)
44
- --no-shim do not vendor the ai/scripts/jira.js compatibility shim
54
+ --no-shim do not vendor or replace the ai/scripts/*.js client shims
45
55
  --force overwrite an existing cairn.config.json
46
56
  --dry-run print what would be written, write nothing
47
57
  `;
@@ -140,10 +150,12 @@ function main(argv = process.argv.slice(2)) {
140
150
  const shim = readTemplate(SHIM_SOURCE);
141
151
  if (args.shim) {
142
152
  planned.push([SHIM_TARGET, shim, SHIM_SOURCE]);
143
- // Only replace the legacy path if a copied client is actually there. Creating
144
- // it in a repo that never had one would invent a path nothing references.
145
- if (fs.existsSync(path.join(repoPath, LEGACY_SHIM_TARGET))) {
146
- planned.push([LEGACY_SHIM_TARGET, shim, SHIM_SOURCE]);
153
+ // Only replace a legacy path if a copied client is actually there — creating
154
+ // one in a repo that never had it would invent a path nothing references.
155
+ for (const target of LEGACY_SHIM_TARGETS) {
156
+ if (fs.existsSync(path.join(repoPath, target))) {
157
+ planned.push([target, shim, SHIM_SOURCE]);
158
+ }
147
159
  }
148
160
  }
149
161
 
@@ -186,4 +198,4 @@ function main(argv = process.argv.slice(2)) {
186
198
  return 0;
187
199
  }
188
200
 
189
- module.exports = { main, buildConfig, HELP, SHIM_TARGET, LEGACY_SHIM_TARGET, cairnDir };
201
+ module.exports = { main, buildConfig, HELP, SHIM_TARGET, LEGACY_SHIM_TARGETS, cairnDir };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stonepandastudio/cairn",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Shared AI workflow scaffolding for Stone Panda repos — issue tracker client and drift doctor.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {