@theholocron/cli 3.21.0 → 3.22.0
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 +29 -1
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +52 -7
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -3266,6 +3266,20 @@ async function runSetup(input) {
|
|
|
3266
3266
|
}
|
|
3267
3267
|
function normalizeWorkflowWith(raw) {
|
|
3268
3268
|
const result = { ...raw };
|
|
3269
|
+
const hasDocs = raw["docs"] === true || raw["docs"] !== null && typeof raw["docs"] === "object";
|
|
3270
|
+
const storybookProjects = raw["storybook"];
|
|
3271
|
+
if (hasDocs) {
|
|
3272
|
+
result["type"] = "docs";
|
|
3273
|
+
delete result["docs"];
|
|
3274
|
+
}
|
|
3275
|
+
if (Array.isArray(storybookProjects)) {
|
|
3276
|
+
if (!hasDocs) result["type"] = "storybook";
|
|
3277
|
+
result["storybook-projects"] = JSON.stringify(storybookProjects.map(({ name, path }) => ({
|
|
3278
|
+
name,
|
|
3279
|
+
workingDir: path
|
|
3280
|
+
})));
|
|
3281
|
+
delete result["storybook"];
|
|
3282
|
+
}
|
|
3269
3283
|
const runChromatic = raw["run-chromatic"];
|
|
3270
3284
|
if (runChromatic !== null && typeof runChromatic === "object" && "projects" in runChromatic) {
|
|
3271
3285
|
result["run-chromatic"] = true;
|
|
@@ -3278,6 +3292,20 @@ async function runSetup(input) {
|
|
|
3278
3292
|
for (const [k, v] of Object.entries(result)) if (Array.isArray(v)) result[k] = JSON.stringify(v);
|
|
3279
3293
|
return result;
|
|
3280
3294
|
}
|
|
3295
|
+
function deriveDeployPaths(raw) {
|
|
3296
|
+
const paths = [];
|
|
3297
|
+
const docs = raw["docs"];
|
|
3298
|
+
if (docs === true) paths.push("docs/**");
|
|
3299
|
+
else if (docs !== null && typeof docs === "object" && "path" in docs) {
|
|
3300
|
+
const p = docs.path;
|
|
3301
|
+
if (p && p !== ".") paths.push(`${p}/**`);
|
|
3302
|
+
}
|
|
3303
|
+
const storybookProjects = raw["storybook"];
|
|
3304
|
+
if (Array.isArray(storybookProjects)) {
|
|
3305
|
+
for (const s of storybookProjects) if (typeof s.path === "string" && s.path !== "." && s.path !== "") paths.push(`${s.path}/**`);
|
|
3306
|
+
}
|
|
3307
|
+
return paths;
|
|
3308
|
+
}
|
|
3281
3309
|
const workflows = config.workflows;
|
|
3282
3310
|
if (loader.has("source") && workflows && workflows.length > 0) {
|
|
3283
3311
|
const source = loader.get("source");
|
|
@@ -3286,7 +3314,7 @@ async function runSetup(input) {
|
|
|
3286
3314
|
const name = typeof entry === "string" ? entry : entry.name;
|
|
3287
3315
|
const rawWith = typeof entry === "object" ? entry.with : void 0;
|
|
3288
3316
|
const withOverrides = rawWith ? normalizeWorkflowWith(rawWith) : void 0;
|
|
3289
|
-
const additionalPaths = typeof entry === "object" ? entry.paths : void 0;
|
|
3317
|
+
const additionalPaths = (typeof entry === "object" ? entry.paths : void 0) ?? (name === "deploy" && rawWith ? deriveDeployPaths(rawWith) : void 0);
|
|
3290
3318
|
if (name === "test" && withOverrides) {
|
|
3291
3319
|
const runUnit = withOverrides["run-unit"];
|
|
3292
3320
|
const runStorybook = withOverrides["run-storybook"];
|