@theholocron/cli 3.33.0 → 3.33.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/dist/cli.mjs CHANGED
@@ -260,6 +260,7 @@ function resolveConfig(raw) {
260
260
  description: raw.description,
261
261
  homepage,
262
262
  org: raw.org,
263
+ domain: raw.domain,
263
264
  repo: raw.repo,
264
265
  workflows: raw.workflows,
265
266
  providers,
@@ -3687,22 +3688,41 @@ async function runSetup(input) {
3687
3688
  if (loader.has("deployment")) {
3688
3689
  const deploy = loader.get("deployment");
3689
3690
  print(style.step("deployment"));
3690
- steps.push(await runStep("deployment", `ensureProject ${config.name}`, dryRun, async () => {
3691
- await deploy.ensureProject({ name: config.name });
3692
- }));
3693
- print(formatStep(steps[steps.length - 1]));
3694
3691
  const deployEntry = (config.workflows ?? []).map((e) => typeof e === "string" ? { name: e } : e).find((e) => e.name === "deploy");
3695
- const previewCfg = deployEntry?.with ? extractPreviewConfig(deployEntry.with) : null;
3692
+ const previewCfg = deployEntry?.with ? extractPreviewConfig(deployEntry.with, {
3693
+ org: config.org,
3694
+ domain: config.domain
3695
+ }) : null;
3696
+ if (!previewCfg) {
3697
+ steps.push(await runStep("deployment", `ensureProject ${config.name}`, dryRun, async () => {
3698
+ await deploy.ensureProject({ name: config.name });
3699
+ }));
3700
+ print(formatStep(steps[steps.length - 1]));
3701
+ }
3702
+ if (previewCfg) {
3703
+ steps.push(await runStep("deployment", `ensureProject ${previewCfg.project}`, dryRun, async () => {
3704
+ await deploy.ensureProject({ name: previewCfg.project });
3705
+ }));
3706
+ print(formatStep(steps[steps.length - 1]));
3707
+ }
3696
3708
  if (previewCfg?.domain && deploy.ensureCustomDomain) {
3697
- const wildcardDomain = `*.${previewCfg.domain}`;
3698
- steps.push(await runStep("deployment", `ensureCustomDomain ${wildcardDomain}`, dryRun, async () => {
3699
- await deploy.ensureCustomDomain(previewCfg.project, wildcardDomain);
3709
+ steps.push(await runStep("deployment", `ensureCustomDomain ${previewCfg.domain}`, dryRun, async () => {
3710
+ await deploy.ensureCustomDomain(previewCfg.project, previewCfg.domain);
3700
3711
  }));
3701
3712
  print(formatStep(steps[steps.length - 1]));
3702
3713
  }
3703
3714
  if (previewCfg?.domain && loader.has("dns")) {
3704
3715
  const dns = loader.get("dns");
3705
3716
  const wildcardDomain = `*.${previewCfg.domain}`;
3717
+ steps.push(await runStep("dns", `upsertRecord ${previewCfg.domain}`, dryRun, async () => {
3718
+ await dns.upsertRecord(previewCfg.domain, {
3719
+ type: "CNAME",
3720
+ name: previewCfg.domain,
3721
+ content: `${previewCfg.project}.pages.dev`,
3722
+ ttl: 1
3723
+ });
3724
+ }));
3725
+ print(formatStep(steps[steps.length - 1]));
3706
3726
  steps.push(await runStep("dns", `upsertRecord ${wildcardDomain}`, dryRun, async () => {
3707
3727
  await dns.upsertRecord(previewCfg.domain, {
3708
3728
  type: "CNAME",