@theholocron/cli 3.32.0 → 3.33.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 CHANGED
@@ -2844,7 +2844,7 @@ function extractPreviewConfig(raw, ctx = {}) {
2844
2844
  if (!preview) return null;
2845
2845
  if (preview === true) {
2846
2846
  const project = ctx.org ? `${ctx.org}-preview` : null;
2847
- const domain = ctx.docsDomain ? `preview.${ctx.docsDomain}` : void 0;
2847
+ const domain = ctx.domain ? `preview.${ctx.domain}` : void 0;
2848
2848
  if (!project) return null;
2849
2849
  return {
2850
2850
  project,
@@ -2855,7 +2855,7 @@ function extractPreviewConfig(raw, ctx = {}) {
2855
2855
  const p = preview;
2856
2856
  const project = typeof p["project"] === "string" && p["project"] ? p["project"] : ctx.org ? `${ctx.org}-preview` : null;
2857
2857
  if (!project) return null;
2858
- const domain = typeof p["domain"] === "string" && p["domain"] ? p["domain"] : ctx.docsDomain ? `preview.${ctx.docsDomain}` : void 0;
2858
+ const domain = typeof p["domain"] === "string" && p["domain"] ? p["domain"] : ctx.domain ? `preview.${ctx.domain}` : void 0;
2859
2859
  return {
2860
2860
  project,
2861
2861
  ...domain ? { domain } : {}
@@ -2935,7 +2935,7 @@ function generateCombinedDeployContent(deployWith, paths, preview) {
2935
2935
  *
2936
2936
  * Used by both `holocron setup` and `sync-workflow-templates`.
2937
2937
  */
2938
- function normalizeWorkflowWith(raw) {
2938
+ function normalizeWorkflowWith(raw, repoName) {
2939
2939
  const result = { ...raw };
2940
2940
  delete result["preview"];
2941
2941
  const hasDocs = raw["docs"] === true || raw["docs"] !== null && typeof raw["docs"] === "object";
@@ -2943,6 +2943,7 @@ function normalizeWorkflowWith(raw) {
2943
2943
  if (hasDocs) {
2944
2944
  result["type"] = "docs";
2945
2945
  delete result["docs"];
2946
+ if (!result["name"] && repoName) result["name"] = repoName;
2946
2947
  }
2947
2948
  if (Array.isArray(storybookProjects)) {
2948
2949
  if (!hasDocs) result["type"] = "storybook";
@@ -3488,7 +3489,7 @@ async function runSetup(input) {
3488
3489
  for (const entry of workflows) {
3489
3490
  const name = typeof entry === "string" ? entry : entry.name;
3490
3491
  const rawWith = typeof entry === "object" ? entry.with : void 0;
3491
- const withOverrides = rawWith ? normalizeWorkflowWith(rawWith) : void 0;
3492
+ const withOverrides = rawWith ? normalizeWorkflowWith(rawWith, config.name) : void 0;
3492
3493
  const additionalPaths = (typeof entry === "object" ? entry.paths : void 0) ?? (name === "deploy" && rawWith ? deriveDeployPaths(rawWith) : void 0);
3493
3494
  if (name === "test" && withOverrides) {
3494
3495
  const runUnit = withOverrides["run-unit"];
@@ -3508,7 +3509,7 @@ async function runSetup(input) {
3508
3509
  if (name === "deploy" && rawWith) {
3509
3510
  const previewCfg = extractPreviewConfig(rawWith, {
3510
3511
  org: config.org,
3511
- docsDomain: config.docs?.domain
3512
+ domain: config.domain
3512
3513
  });
3513
3514
  if (previewCfg) {
3514
3515
  const paths = additionalPaths;
@@ -4779,10 +4780,12 @@ function parseWorkflowsFromTs(source) {
4779
4780
  */
4780
4781
  function parseOrgContextFromTs(source) {
4781
4782
  const orgMatch = source.match(/\borg\s*:\s*["']([^"']+)["']/);
4782
- const domainMatch = source.match(/\bdocs\s*:[^}]*?domain\s*:\s*["']([^"']+)["']/s);
4783
+ const domainMatch = source.match(/\bdomain\s*:\s*["']([^"']+)["']/);
4784
+ const nameMatch = source.split(/\bworkflows\s*:/)[0].match(/\bname\s*:\s*["']([^"']+)["']/);
4783
4785
  return {
4784
4786
  org: orgMatch?.[1],
4785
- docsDomain: domainMatch?.[1]
4787
+ domain: domainMatch?.[1],
4788
+ repoName: nameMatch?.[1]
4786
4789
  };
4787
4790
  }
4788
4791
  function reusableHeader(source) {
@@ -4822,7 +4825,7 @@ function buildBatch(repo, allowedWorkflows, withOverrides, orgContext) {
4822
4825
  if (name === "deploy-preview") continue;
4823
4826
  if (allowedWorkflows && !allowedWorkflows.has(name)) continue;
4824
4827
  const rawWith = withOverrides?.get(name);
4825
- const normalizedWith = rawWith ? normalizeWorkflowWith(rawWith) : void 0;
4828
+ const normalizedWith = rawWith ? normalizeWorkflowWith(rawWith, orgContext?.repoName) : void 0;
4826
4829
  const additionalPaths = name === "deploy" && rawWith ? deriveDeployPaths(rawWith) : void 0;
4827
4830
  if (name === "deploy" && rawWith) {
4828
4831
  const previewCfg = extractPreviewConfig(rawWith, orgContext);