@omniharmonic/openspace-cli 0.1.6 → 0.1.7

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.
@@ -1,9 +1,9 @@
1
1
  import { createRequire as __osCreateRequire } from "node:module"; const require = __osCreateRequire(import.meta.url);
2
2
  import {
3
3
  generateAgentsMd
4
- } from "./chunk-BW42R6WD.js";
4
+ } from "./chunk-KAJOS2YV.js";
5
5
  import "./chunk-26AZCID5.js";
6
6
  export {
7
7
  generateAgentsMd
8
8
  };
9
- //# sourceMappingURL=agents-md-Q2TI3NHB.js.map
9
+ //# sourceMappingURL=agents-md-A4JWPOMG.js.map
package/dist/bin.js CHANGED
@@ -3,9 +3,9 @@ import { createRequire as __osCreateRequire } from "node:module"; const require
3
3
  import {
4
4
  processIo,
5
5
  run
6
- } from "./chunk-7SWL46LQ.js";
6
+ } from "./chunk-ANGZMFLZ.js";
7
7
  import "./chunk-WE4QCL3R.js";
8
- import "./chunk-BW42R6WD.js";
8
+ import "./chunk-KAJOS2YV.js";
9
9
  import "./chunk-26AZCID5.js";
10
10
 
11
11
  // src/bin.ts
@@ -105,7 +105,7 @@ import {
105
105
  toHex,
106
106
  toJsonSchema,
107
107
  toMarkdown
108
- } from "./chunk-BW42R6WD.js";
108
+ } from "./chunk-KAJOS2YV.js";
109
109
  import {
110
110
  __commonJS,
111
111
  __require,
@@ -8549,7 +8549,7 @@ async function runCheck(root, options = {}) {
8549
8549
  rule: "gating",
8550
8550
  file,
8551
8551
  path: "access",
8552
- message: `Page "${page.title}" is ${kinds}: it is only published with Cloudflare hosting.`
8552
+ message: `Page "${page.title}" is ${kinds}: until you switch on members and password pages (Studio \u2192 Finish setting up), visitors don't see it and the rest of the site publishes as usual.`
8553
8553
  });
8554
8554
  }
8555
8555
  const errors2 = findings.filter((f) => f.severity === "error").length;
@@ -25703,7 +25703,7 @@ var DEVICE_WIDTH = {
25703
25703
  var screenshot = defineTool({
25704
25704
  name: "screenshot",
25705
25705
  title: "Screenshot",
25706
- description: 'PNG screenshot of a draft page or one section at desktop (1440), tablet (834) or mobile (390) width \u2014 or "all" three \u2014 so you can see the design and iterate. Returns the preview URL as well. Needs a screenshot provider (Playwright locally).',
25706
+ description: 'Screenshot of a draft page or one section at desktop (1440), tablet (834) or mobile (390) width \u2014 or "all" three \u2014 so you can see the design and iterate. Tall pages may come back as several images, top to bottom. Returns the preview URL as well. Needs a screenshot provider (Playwright locally, Cloudflare Browser Rendering on the Hub).',
25707
25707
  input: external_exports.object({
25708
25708
  site: siteArg,
25709
25709
  page: external_exports.string(),
@@ -25728,6 +25728,7 @@ var screenshot = defineTool({
25728
25728
  const devices = input.device === "all" ? ["desktop", "tablet", "mobile"] : [input.device ?? "desktop"];
25729
25729
  const images = [];
25730
25730
  const shots = [];
25731
+ const notes = [];
25731
25732
  for (const device of devices) {
25732
25733
  const shot = await ctx.store.screenshot(siteId, {
25733
25734
  pageId: id,
@@ -25742,10 +25743,14 @@ var screenshot = defineTool({
25742
25743
  mimeType: shot.mimeType,
25743
25744
  caption: `${device} ${shot.width}px`
25744
25745
  });
25746
+ for (const [i, part] of (shot.more ?? []).entries())
25747
+ images.push({ ...part, caption: `${device} ${shot.width}px (part ${i + 2})` });
25745
25748
  shots.push({ device, width: shot.width, height: shot.height });
25749
+ if (shot.note) notes.push(`${device}: ${shot.note}`);
25746
25750
  }
25747
25751
  return {
25748
- text: `Screenshot${shots.length > 1 ? "s" : ""} of ${page?.title ?? id}${input.section ? ` (section ${input.section})` : ""}: ${shots.map((s2) => `${s2.device} ${s2.width}\xD7${s2.height ?? "?"}`).join(", ")}.${url ? ` Preview: ${url}` : ""}`,
25752
+ text: `Screenshot${shots.length > 1 ? "s" : ""} of ${page?.title ?? id}${input.section ? ` (section ${input.section})` : ""}: ${shots.map((s2) => `${s2.device} ${s2.width}\xD7${s2.height ?? "?"}`).join(", ")}.${url ? ` Preview: ${url}` : ""}${notes.length ? `
25753
+ ${notes.join("\n")}` : ""}`,
25749
25754
  data: { url, shots },
25750
25755
  images
25751
25756
  };
@@ -28268,7 +28273,7 @@ async function renderAgentsMd(root, siteTitle) {
28268
28273
  } catch {
28269
28274
  }
28270
28275
  }
28271
- const { generateAgentsMd: generateAgentsMd2 } = await import("./agents-md-Q2TI3NHB.js");
28276
+ const { generateAgentsMd: generateAgentsMd2 } = await import("./agents-md-A4JWPOMG.js");
28272
28277
  return generateAgentsMd2(title ? { siteTitle: title } : {});
28273
28278
  }
28274
28279
  async function writeAgentsMd(root, siteTitle) {
@@ -28598,7 +28603,7 @@ async function runGatedSync(io, opts = {}, deps = {}) {
28598
28603
  }
28599
28604
  if (config.deploy?.target !== "cloudflare")
28600
28605
  throw new CliError(
28601
- "Members-only and password pages need Cloudflare hosting (Studio \u2192 Settings \u2192 Hosting)."
28606
+ "Members-only and password pages are switched on in Studio \u2192 Finish setting up (it moves the site to Cloudflare for you)."
28602
28607
  );
28603
28608
  const bucket = opts.bucket ?? gatedBucketName(root);
28604
28609
  if (!bucket)
@@ -29311,7 +29316,9 @@ function importSiteTool(opts) {
29311
29316
  exportFile: external_exports.string().optional().describe(
29312
29317
  "Path to a WordPress export (WXR XML): a WordPress site's full export, or Squarespace's blog export."
29313
29318
  ),
29314
- target: external_exports.enum(["github-pages", "cloudflare"]).optional().describe("cloudflare to sell products or gate pages"),
29319
+ target: external_exports.enum(["github-pages"]).optional().describe(
29320
+ "Always github-pages (the default): every import goes live on free GitHub Pages first. Shops, donations, member areas and password pages are switched on afterwards in Studio \u2192 Finish setting up."
29321
+ ),
29315
29322
  confirm: external_exports.boolean().optional().describe("Must be true: the owner agreed to fetch the site and create the folder.")
29316
29323
  }),
29317
29324
  annotations: { openWorldHint: true, destructiveHint: false, idempotentHint: false },
@@ -29845,6 +29852,15 @@ function rebrand(value, from, to) {
29845
29852
  return changed ? out : null;
29846
29853
  }
29847
29854
 
29855
+ // src/wow-first.ts
29856
+ var WOW_FIRST_MESSAGE = "New and imported sites always start on free GitHub Pages, so the first version goes live without any extra accounts. Shops, donations, member areas and password pages show a friendly \u201Copening soon\u201D note until you switch them on in Studio \u2192 Finish setting up (it moves the site to Cloudflare for you, with no downtime).";
29857
+ function assertGitHubPagesStart(target) {
29858
+ if (target && target !== "github-pages")
29859
+ throw new CliError(
29860
+ `--target ${target} isn't available when creating a site. ${WOW_FIRST_MESSAGE}`
29861
+ );
29862
+ }
29863
+
29848
29864
  // src/import.ts
29849
29865
  function defaultFolder(url) {
29850
29866
  try {
@@ -29912,7 +29928,8 @@ async function loadRenderer() {
29912
29928
  };
29913
29929
  }
29914
29930
  async function runImportSite(io, url, dirArg, opts = {}) {
29915
- const target = opts.target ?? "github-pages";
29931
+ assertGitHubPagesStart(opts.target);
29932
+ const target = "github-pages";
29916
29933
  const dir = resolve5(io.cwd, dirArg ?? defaultFolder(url));
29917
29934
  if (!await isEmptyDir(dir))
29918
29935
  throw new CliError(`${dir} already exists and is not empty. Choose a new folder.`);
@@ -30090,11 +30107,14 @@ The site won't build until you do.`);
30090
30107
  for (const f of r.written) io.out(` ${f}`);
30091
30108
  for (const f of r.removed) io.out(` ${opts.dryRun ? "would remove" : "removed"} ${f}`);
30092
30109
  });
30093
- program.command("new").description("Create a new site from a template.").argument("<template>", "template id (for example: meadow)").argument("<dir>", "folder to create").option("--target <target>", "github-pages or cloudflare", "github-pages").option("--repo <owner/name>", "GitHub repository, used for the Pages address").option("--url <url>", "address the site is served from before a custom domain").option("--domain <hostname>", "custom domain").option("--title <title>", "site title").option("--hub <url>", "Hub address").option("--templates-dir <dir>", "folder holding template directories").action(
30110
+ program.command("new").description("Create a new site from a template.").argument("<template>", "template id (for example: meadow)").argument("<dir>", "folder to create").option(
30111
+ "--target <target>",
30112
+ "always github-pages (Cloudflare is switched on later in Studio)",
30113
+ "github-pages"
30114
+ ).option("--repo <owner/name>", "GitHub repository, used for the Pages address").option("--url <url>", "address the site is served from before a custom domain").option("--domain <hostname>", "custom domain").option("--title <title>", "site title").option("--hub <url>", "Hub address").option("--templates-dir <dir>", "folder holding template directories").action(
30094
30115
  async (template, dir, opts) => {
30095
- if (opts.target !== "github-pages" && opts.target !== "cloudflare")
30096
- throw new CliError(`--target must be github-pages or cloudflare, not "${opts.target}".`);
30097
- const r = await runNew(io, template, dir, { ...opts, target: opts.target });
30116
+ assertGitHubPagesStart(opts.target);
30117
+ const r = await runNew(io, template, dir, { ...opts, target: "github-pages" });
30098
30118
  if (r.usedFallback)
30099
30119
  io.out(
30100
30120
  `Note: template "${template}" has no content of its own yet, so the Meadow sample site (${r.contentFrom}) was used instead.`
@@ -30140,13 +30160,12 @@ The site won't preview or build until you do.`);
30140
30160
  );
30141
30161
  return c.option(
30142
30162
  "--target <target>",
30143
- "github-pages or cloudflare (use cloudflare to sell products)",
30163
+ "always github-pages: shops and member areas are switched on later in Studio",
30144
30164
  "github-pages"
30145
30165
  ).option("--repo <owner/name>", "GitHub repository, used for the Pages address").option("--url <url>", "address the new site is served from before a custom domain").option("--domain <hostname>", "custom domain (set it when you move the domain)").option("--title <title>", "site title (default: the original site's title)").option("--hub <url>", "Hub address").option("--max-pages <n>", "most pages and items to read (default 400)", Number).option("--delay <ms>", "pause between requests to the site (default 300)", Number).option("--no-media", "don't download images and files (a quick structural preview)");
30146
30166
  };
30147
30167
  const runImportCommand = async (url, dir, opts, platform) => {
30148
- if (opts.target !== "github-pages" && opts.target !== "cloudflare")
30149
- throw new CliError(`--target must be github-pages or cloudflare, not "${opts.target}".`);
30168
+ assertGitHubPagesStart(opts.target);
30150
30169
  let chosen = platform;
30151
30170
  if (opts.platform) {
30152
30171
  const p = parsePlatform(opts.platform);
@@ -30162,7 +30181,7 @@ The site won't preview or build until you do.`);
30162
30181
  const { platform: _p, ...rest } = opts;
30163
30182
  const r = await runImportSite(io, url, dir, {
30164
30183
  ...rest,
30165
- target: opts.target,
30184
+ target: "github-pages",
30166
30185
  platform: chosen,
30167
30186
  ...deps.fetch ? { fetch: deps.fetch } : {}
30168
30187
  });
@@ -30272,4 +30291,4 @@ export {
30272
30291
  createProgram,
30273
30292
  run
30274
30293
  };
30275
- //# sourceMappingURL=chunk-7SWL46LQ.js.map
30294
+ //# sourceMappingURL=chunk-ANGZMFLZ.js.map