dsh-artcraft-plugin-soundcraft 0.1.0 → 0.1.2
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/kit/discover.js +6 -3
- package/src/kit/profiles.mjs +3 -0
- package/src/kit/tools.js +6 -1
package/package.json
CHANGED
package/src/kit/discover.js
CHANGED
|
@@ -140,8 +140,8 @@ export function discoverCraft(profile , configured , packag
|
|
|
140
140
|
return undefined
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
/** Cached `--version` output per resolved path. */
|
|
144
|
-
const versionCache = new Map
|
|
143
|
+
/** Cached `--version` output per resolved path; only successes are stored. */
|
|
144
|
+
const versionCache = new Map ()
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
147
|
* Read a craft binary's version, tolerating CLIs that spell the flag
|
|
@@ -162,7 +162,10 @@ export function craftVersion(path , timeoutMs = 5000)
|
|
|
162
162
|
// Try the next spelling; a missing flag is expected on some crafts.
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
|
|
165
|
+
// Only a successful probe is cached. A binary that is mid-install, or that
|
|
166
|
+
// had not been written when the previous call ran, must be retried rather
|
|
167
|
+
// than remembered as version-less for the rest of the session.
|
|
168
|
+
if (version !== undefined) versionCache.set(path, version)
|
|
166
169
|
return version
|
|
167
170
|
}
|
|
168
171
|
|
package/src/kit/profiles.mjs
CHANGED
|
@@ -261,7 +261,10 @@ export const CRAFT_PROFILES = [
|
|
|
261
261
|
cmdSeparator: '',
|
|
262
262
|
cmdStyle: 'flag-params',
|
|
263
263
|
cmdParamsFlag: '--params',
|
|
264
|
+
// VectorCraft renders documents and artifacts through one flag, so both
|
|
265
|
+
// names map to it: the kernel folds `export` into `save` when they match.
|
|
264
266
|
saveFlag: '--export',
|
|
267
|
+
exportFlag: '--export',
|
|
265
268
|
},
|
|
266
269
|
reads: [
|
|
267
270
|
{ name: 'convert', verb: 'convert', summary: 'Open any readable format and export it to another.' },
|
package/src/kit/tools.js
CHANGED
|
@@ -364,7 +364,12 @@ export function createToolSet(runtime ) {
|
|
|
364
364
|
...(profile.run.saveMode ?? 'flag') === 'flag'
|
|
365
365
|
? { save: { type: 'string', description: `Path to write the edited document to (${profile.extensions.join('/')}).` } }
|
|
366
366
|
: {},
|
|
367
|
-
|
|
367
|
+
// `export` is always advertised when the craft can render one. Where the
|
|
368
|
+
// craft writes documents and artifacts through the same flag (VectorCraft
|
|
369
|
+
// `--export`), the executor folds `export` into `save`; the parameter is
|
|
370
|
+
// still offered because naming the artifact is what a caller means, and
|
|
371
|
+
// withholding it only pushes them to `extraArgs`.
|
|
372
|
+
...profile.run.exportFlag !== undefined
|
|
368
373
|
? { export: { type: 'string', description: 'Path to export a rendered artifact to (png/svg/pdf, or the app\'s native media type).' } }
|
|
369
374
|
: {},
|
|
370
375
|
...profile.run.sampleFlag.length > 0
|