@theholocron/cli 3.29.5 → 3.29.6
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/dist/cli.mjs +10 -5
- package/dist/cli.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -4387,7 +4387,8 @@ function parseWorkflowsFromTs(source) {
|
|
|
4387
4387
|
i++;
|
|
4388
4388
|
}
|
|
4389
4389
|
const body = source.slice(start, i - 1);
|
|
4390
|
-
const
|
|
4390
|
+
const hasPresetSpread = /\.\.\.[a-zA-Z_$][a-zA-Z0-9_$]*/.test(body);
|
|
4391
|
+
const explicit = [];
|
|
4391
4392
|
const objSpans = [];
|
|
4392
4393
|
const objRe = /\{\s*name\s*:\s*"([^"]+)"(?:\s*,\s*with\s*:\s*(\{[^}]*\}))?(?:\s*,[^}]*)?\s*,?\s*\}/g;
|
|
4393
4394
|
let m;
|
|
@@ -4398,7 +4399,7 @@ function parseWorkflowsFromTs(source) {
|
|
|
4398
4399
|
const jsonSafe = m[2].replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)\s*:/g, "$1\"$2\":");
|
|
4399
4400
|
withObj = JSON.parse(jsonSafe);
|
|
4400
4401
|
} catch {}
|
|
4401
|
-
|
|
4402
|
+
explicit.push({
|
|
4402
4403
|
pos: m.index,
|
|
4403
4404
|
entry: {
|
|
4404
4405
|
name: m[1],
|
|
@@ -4407,12 +4408,16 @@ function parseWorkflowsFromTs(source) {
|
|
|
4407
4408
|
});
|
|
4408
4409
|
}
|
|
4409
4410
|
const strRe = /"([^"]+)"/g;
|
|
4410
|
-
while ((m = strRe.exec(body)) !== null) if (!objSpans.some(([s, e]) => m.index >= s && m.index < e))
|
|
4411
|
+
while ((m = strRe.exec(body)) !== null) if (!objSpans.some(([s, e]) => m.index >= s && m.index < e)) explicit.push({
|
|
4411
4412
|
pos: m.index,
|
|
4412
4413
|
entry: { name: m[1] }
|
|
4413
4414
|
});
|
|
4414
|
-
|
|
4415
|
-
|
|
4415
|
+
explicit.sort((a, b) => a.pos - b.pos);
|
|
4416
|
+
const explicitEntries = explicit.map(({ entry }) => entry);
|
|
4417
|
+
if (!hasPresetSpread) return explicitEntries;
|
|
4418
|
+
const merged = new Map([...KNOWN_WORKFLOWS].map((name) => [name, { name }]));
|
|
4419
|
+
for (const entry of explicitEntries) merged.set(entry.name, entry);
|
|
4420
|
+
return [...merged.values()];
|
|
4416
4421
|
}
|
|
4417
4422
|
function reusableHeader(source) {
|
|
4418
4423
|
return [
|