@domandigital/create-site 0.8.0 → 0.9.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @domandigital/create-site
2
2
 
3
+ ## 0.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - bcbdbb8: New sites install `@domandigital/craft` ^0.21.0 (DOM-1053), so `measure.mjs` holds a text field, select or textarea to 48px tall (portal standard rule 5; the measure failed fields under 44px as targets before).
8
+
9
+ ## 0.9.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 0dba997: Sites made with create-site deploy their preview to Cloudflare only. `scripts/gates/deploy-preview.mjs` no longer has a Vercel branch or looks for `.vercel/project.json`, `preview.host` in `site.programme.json` is `cloudflare` or null, the `host` answer prompt suggests `cloudflare`, and `docs/site-programme.md` and the README say so. A site that still sets `preview.host` to `vercel` now stops at Stage 06 with a message naming the host; remove the key or set it to `cloudflare`. The synthetic README and a craft comment no longer name Vercel; no behaviour changes in those two.
14
+
3
15
  ## 0.8.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -84,8 +84,8 @@ autocomplete, and a phone number that is not a `tel:` link; in landscape, on
84
84
  fixed layers over half the height; at 1440 and 1920, on body lines over 80
85
85
  characters. `measure.baseline` lists known failures so they stay visible.
86
86
  `pnpm deploy:preview` is the only deploy: it sets `PUBLIC_PREVIEW` itself,
87
- builds, measures with noindex required, and deploys a preview to Cloudflare
88
- or Vercel; it refuses a route, a custom domain or `--prod`. So a site made
87
+ builds, measures with noindex required, and deploys a preview to Cloudflare;
88
+ it refuses a route, a custom domain or `--prod`. So a site made
89
89
  with create-site cannot build until its programme exists and Stages 05 and 06
90
90
  are done, and cannot reach a URL unmeasured.
91
91
 
@@ -131,7 +131,7 @@ same answers the site was made with (`--answers`).
131
131
  `siteUrl`, `sector`, `description`, `phone`, `email`, `locality`,
132
132
  `postalCode`, `serviceAreas`, `registers` (ids from `src/sectors.ts`) and
133
133
  `previousHosts`, `programme` (the Linear issue, like `--programme`), and the
134
- declared technology: `host` (`cloudflare` or `vercel` also becomes the preview
134
+ declared technology: `host` (`cloudflare` also becomes the preview
135
135
  host in `site.programme.json`), `dns`, `cms`,
136
136
  `analytics` (a list, e.g. `["ga4", "gtm", "posthog"]`), `errorMonitoring` and
137
137
  `emailSending` (a list). Each can be skipped, and a skipped one is left out of
package/dist/cli.js CHANGED
@@ -162,7 +162,7 @@ async function collectStack(optional) {
162
162
  ...new Set(list(await optional(key, question)).map((v) => name(key, v)))
163
163
  ];
164
164
  const stack = {
165
- host: await single("host", "Hosting, e.g. vercel"),
165
+ host: await single("host", "Hosting, e.g. cloudflare"),
166
166
  dns: await single("dns", "DNS host, e.g. cloudflare"),
167
167
  cms: await single("cms", "CMS, e.g. sanity"),
168
168
  analytics: await many("analytics", "Analytics and tags, comma separated, e.g. ga4, gtm, posthog"),
@@ -749,7 +749,7 @@ function renderRedirects() {
749
749
  function renderProgramme(a, project) {
750
750
  const base = project.srcBase;
751
751
  const source = base ? [base.replace(/\/$/, "")] : ["app", "components", "lib", "content"];
752
- const host = a.stack.host === "cloudflare" || a.stack.host === "vercel" ? a.stack.host : null;
752
+ const host = a.stack.host === "cloudflare" ? a.stack.host : null;
753
753
  const programme = {
754
754
  $comment: "Read by scripts/gates/ before every build and preview deploy. docs/site-programme.md says what each key is for. Written by @domandigital/create-site; yours to edit, never overwritten.",
755
755
  issue: a.programme,
@@ -788,7 +788,7 @@ var HOUSE_DEPENDENCIES = {
788
788
  "@domandigital/seo": "^0.3.0"
789
789
  };
790
790
  var HOUSE_DEV_DEPENDENCIES = {
791
- "@domandigital/craft": "^0.20.0",
791
+ "@domandigital/craft": "^0.21.0",
792
792
  "@types/node": "^22.0.0",
793
793
  vitest: "^4.1.11",
794
794
  // scripts/gates/measure.mjs renders the pages at every viewport, phone first,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domandigital/create-site",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
4
4
  "private": false,
5
5
  "description": "The first thing that runs on a new Doman Digital client site: installs the house packages and writes the per-site files they read (the facts file, route policy, backlink register, redirects, JSON-LD, the designer credit, house docs and the SEO checks), so every build starts on the same foundation and stays upgradeable by bumping packages.",
6
6
  "license": "Apache-2.0",
@@ -41,7 +41,7 @@
41
41
  "tsup": "^8.3.5",
42
42
  "typescript": "^5.6.3",
43
43
  "vitest": "^4.0.0",
44
- "@domandigital/craft": "^0.20.0",
44
+ "@domandigital/craft": "^0.21.0",
45
45
  "@domandigital/graph": "^0.7.0",
46
46
  "@domandigital/seo": "^0.3.1"
47
47
  },
@@ -104,4 +104,4 @@ pricing modules and writes the facts the redesign renders.
104
104
  | `nullCheck` | `harvest` (a path, `~/` allowed) and `justified` (phrase to reason) |
105
105
  | `facts` | `importer`: the site's importer script, or null |
106
106
  | `mobileFirst` | `exceptions`: the files allowed a `max-width` query or `max-*:` variant, each `{ "file": "src/styles/print.css", "reason": "..." }` |
107
- | `preview` | `host`: `cloudflare` or `vercel`, or null to find it from the config |
107
+ | `preview` | `host`: `cloudflare`, or null to find it from the config |
@@ -4,12 +4,11 @@
4
4
  // runs every build gate; serves the build locally and measures it at 1440 and
5
5
  // 390 with --preview (noindex required); and only then deploys, preview only:
6
6
  //
7
- // cloudflare wrangler deploy, refused while the wrangler config carries a
8
- // route, a custom domain or workers_dev: false
9
- // vercel vercel deploy, never --prod
7
+ // Cloudflare: wrangler deploy, refused while the wrangler config carries a
8
+ // route, a custom domain or workers_dev: false.
10
9
  //
11
10
  // The host is preview.host in site.programme.json, or found from the
12
- // wrangler config or .vercel/project.json. Going live is a separate,
11
+ // wrangler config. Going live is a separate,
13
12
  // recorded decision in Stage 09; nothing here can do it. --dry-run does
14
13
  // everything but the deploy.
15
14
  //
@@ -29,8 +28,8 @@ const env = { ...process.env, PUBLIC_PREVIEW: "1", NEXT_PUBLIC_PREVIEW: "1" };
29
28
  const bin = (name) => join(root, "node_modules", ".bin", name);
30
29
 
31
30
  const wranglerFile = ["wrangler.jsonc", "wrangler.json", "wrangler.toml"].find((f) => existsSync(join(root, f)));
32
- const host = preview.host ?? (wranglerFile ? "cloudflare" : existsSync(join(root, ".vercel", "project.json")) ? "vercel" : null);
33
- if (!host) stop(GATE, "06", "no preview host. Set preview.host in site.programme.json to cloudflare or vercel.");
31
+ const host = preview.host ?? (wranglerFile ? "cloudflare" : null);
32
+ if (!host) stop(GATE, "06", "no preview host. Set preview.host in site.programme.json to cloudflare.");
34
33
 
35
34
  if (host === "cloudflare") {
36
35
  if (!wranglerFile) stop(GATE, "06", "preview.host is cloudflare but there is no wrangler config.");
@@ -39,8 +38,8 @@ if (host === "cloudflare") {
39
38
  if (/["']?\broutes?\b["']?\s*[:=]/.test(text)) stop(GATE, "06", `${wranglerFile} carries a route. A preview has none: the live domain is attached only by the Stage 09 release.`);
40
39
  if (/custom_domain/.test(text)) stop(GATE, "06", `${wranglerFile} carries a custom domain. A preview has none.`);
41
40
  if (/workers_dev["']?\s*[:=]\s*false/.test(text)) stop(GATE, "06", `${wranglerFile} sets workers_dev to false, so a preview would have no address.`);
42
- } else if (host !== "vercel") {
43
- stop(GATE, "06", `preview.host is ${host}; this script knows cloudflare and vercel.`);
41
+ } else {
42
+ stop(GATE, "06", `preview.host is ${host}; this script knows cloudflare.`);
44
43
  }
45
44
 
46
45
  // The package manager that ran this script, so the build is the one `build` names.
@@ -55,9 +54,6 @@ if (dryRun) {
55
54
  console.log(`${GATE}: built and measured; --dry-run, so nothing was deployed.`);
56
55
  process.exit(0);
57
56
  }
58
- const deploy =
59
- host === "cloudflare"
60
- ? spawnSync(existsSync(bin("wrangler")) ? bin("wrangler") : "npx", existsSync(bin("wrangler")) ? ["deploy"] : ["wrangler", "deploy"], { cwd: root, env, stdio: "inherit" })
61
- : spawnSync("npx", ["vercel", "deploy", "--build-env", "PUBLIC_PREVIEW=1", "--build-env", "NEXT_PUBLIC_PREVIEW=1", "--env", "PUBLIC_PREVIEW=1", "--env", "NEXT_PUBLIC_PREVIEW=1"], { cwd: root, env, stdio: "inherit" });
57
+ const deploy = spawnSync(existsSync(bin("wrangler")) ? bin("wrangler") : "npx", existsSync(bin("wrangler")) ? ["deploy"] : ["wrangler", "deploy"], { cwd: root, env, stdio: "inherit" });
62
58
  if (deploy.status !== 0) stop(GATE, "06", `the ${host} deploy failed.`);
63
59
  console.log(`${GATE}: measured and deployed to a ${host} preview. The live site is untouched.`);