@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.
- package/README.md +1 -1
- package/lib/init.js +19 -7
- package/package.json +1 -1
package/README.md
CHANGED
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
|
-
|
|
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
|
|
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
|
|
144
|
-
//
|
|
145
|
-
|
|
146
|
-
|
|
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,
|
|
201
|
+
module.exports = { main, buildConfig, HELP, SHIM_TARGET, LEGACY_SHIM_TARGETS, cairnDir };
|
package/package.json
CHANGED