create-ailk 0.46.6 → 0.48.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/README.md +180 -43
- package/component-catalog.json +223 -285
- package/component-catalog.md +1 -1
- package/dist/apply-design.d.ts +26 -68
- package/dist/apply-design.js +150 -322
- package/dist/cli.js +152 -17
- package/dist/compare-chrome.d.ts +108 -0
- package/dist/compare-chrome.js +481 -0
- package/dist/compare-look.d.ts +94 -0
- package/dist/compare-look.js +378 -0
- package/dist/copy.js +1 -1
- package/dist/design-compile.d.ts +17 -21
- package/dist/design-compile.js +32 -56
- package/dist/design-files.d.ts +93 -0
- package/dist/design-files.js +312 -0
- package/dist/design-home.d.ts +4 -2
- package/dist/design-home.js +88 -6
- package/dist/design-names.d.ts +13 -0
- package/dist/design-names.js +76 -0
- package/dist/design-package.d.ts +46 -56
- package/dist/design-package.js +285 -288
- package/dist/design-presets.d.ts +41 -0
- package/dist/design-presets.js +83 -4
- package/dist/design-scaffold.d.ts +12 -2
- package/dist/design-scaffold.js +72 -34
- package/dist/generated/design-settings.d.ts +56 -0
- package/dist/generated/design-settings.js +237 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/inventory.d.ts +3 -2
- package/dist/inventory.js +10 -4
- package/dist/lib/design-checks.d.ts +46 -0
- package/dist/lib/design-checks.js +79 -1
- package/dist/lib/env-catalog.js +5 -1
- package/dist/lib/module-license-gate.d.ts +1 -1
- package/dist/lib/module-license-gate.js +1 -1
- package/dist/lib/render-verdict.d.ts +13 -1
- package/dist/lib/render-verdict.js +41 -1
- package/dist/look-hub.d.ts +44 -0
- package/dist/look-hub.js +130 -0
- package/dist/look-record.d.ts +35 -0
- package/dist/look-record.js +85 -0
- package/dist/look-samples.d.ts +66 -0
- package/dist/look-samples.js +456 -0
- package/dist/look-settings.d.ts +53 -0
- package/dist/look-settings.js +363 -0
- package/dist/module-architecture.js +12 -0
- package/dist/parse-args.d.ts +10 -6
- package/dist/parse-args.js +26 -13
- package/dist/programmatic.d.ts +1 -19
- package/dist/programmatic.js +65 -103
- package/dist/retired-design-bodies.d.ts +29 -0
- package/dist/retired-design-bodies.js +51 -0
- package/dist/seed-flows.d.ts +1 -1
- package/dist/seed-flows.js +12 -14
- package/dist/seed-workspace.d.ts +4 -1
- package/dist/seed-workspace.js +139 -17
- package/dist/site-chrome.d.ts +41 -41
- package/dist/site-chrome.js +50 -70
- package/dist/site-fonts.d.ts +10 -14
- package/dist/site-fonts.js +5 -1
- package/dist/starter-grid.d.ts +2 -2
- package/dist/strip-look-copies.d.ts +67 -0
- package/dist/strip-look-copies.js +591 -0
- package/dist/template-manifest.d.ts +6 -14
- package/dist/template-manifest.js +0 -9
- package/dist/template-record.d.ts +3 -1
- package/dist/template-record.js +3 -1
- package/dist/topology.d.ts +15 -0
- package/dist/topology.js +60 -0
- package/dist/update.d.ts +57 -1
- package/dist/update.js +742 -13
- package/package.json +3 -4
- package/site-templates/aliases/hub.TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/designs/minimalism/DESIGN.md +163 -297
- package/site-templates/designs/minimalism/LOOK.md +42 -0
- package/site-templates/designs/minimalism/design.yaml +167 -0
- package/site-templates/designs/standard/DESIGN.md +145 -149
- package/site-templates/designs/standard/LOOK.md +42 -0
- package/site-templates/designs/standard/design.yaml +72 -0
- package/site-templates/marketing-site/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/marketing-site/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/shapes/local-business-service/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/shapes/local-business-service/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/shapes/person-service/content/_site.mdx +0 -26
- package/templates/.claude/rules/extending.md +3 -2
- package/templates/.env.example +11 -4
- package/templates/CLAUDE.md +1 -1
- package/templates/DESIGN.md +145 -149
- package/templates/README.md +15 -16
- package/templates/apps/api/.env.example +29 -4
- package/templates/apps/api/CLAUDE.md +7 -4
- package/templates/apps/api/src/__tests__/vercel-handler.test.ts +176 -2
- package/templates/apps/api/src/lib/__mocks__/prisma.ts +30 -4
- package/templates/apps/api/src/vercel-handler.ts +32 -2
- package/templates/apps/mcp/.env.example +8 -0
- package/templates/apps/mcp/CLAUDE.md +5 -3
- package/templates/apps/web/.env.example +10 -3
- package/templates/apps/web/CLAUDE.md +31 -4
- package/templates/apps/web/app/[locale]/layout.tsx +141 -77
- package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +13 -3
- package/templates/apps/web/app/not-found.tsx +11 -11
- package/templates/apps/web/auth.ts +48 -35
- package/templates/apps/web/jest.config.cjs +5 -0
- package/templates/apps/web/lib/__tests__/hub-site-config.test.ts +542 -10
- package/templates/apps/web/lib/__tests__/library-fonts.test.ts +35 -0
- package/templates/apps/web/lib/__tests__/page-chrome-navigation.test.ts +233 -0
- package/templates/apps/web/lib/__tests__/page-chrome.test.ts +123 -26
- package/templates/apps/web/lib/__tests__/section-look.test.ts +150 -0
- package/templates/apps/web/lib/__tests__/site-identity-feature-list.test.ts +19 -1
- package/templates/apps/web/lib/__tests__/site-navigation.test.ts +288 -0
- package/templates/apps/web/lib/__tests__/site-theme.test.ts +81 -289
- package/templates/apps/web/lib/deck-page.ts +3 -10
- package/templates/apps/web/lib/deploy-fonts.ts +12 -0
- package/templates/apps/web/lib/hub-site-config.ts +237 -29
- package/templates/apps/web/lib/library-fonts.ts +41 -0
- package/templates/apps/web/lib/mcp-oauth.ts +11 -4
- package/templates/apps/web/lib/page-chrome.ts +105 -20
- package/templates/apps/web/lib/section-look.ts +28 -0
- package/templates/apps/web/lib/site-design.ts +205 -0
- package/templates/apps/web/lib/site-navigation.ts +208 -0
- package/templates/apps/web/lib/site-theme-head.ts +98 -13
- package/templates/apps/web/lib/site-theme.ts +40 -62
- package/templates/apps/web/messages/en.json +0 -6
- package/templates/apps/web/next.config.mjs +213 -11
- package/templates/apps/web/package.json +2 -0
- package/templates/apps/web/site-pages.config.tsx +4 -2
- package/templates/content/_site.mdx +0 -26
- package/templates/design.yaml +75 -0
- package/templates/project.yaml +14 -0
- package/versions.json +52 -51
- package/site-templates/marketing-site/DESIGN.md +0 -259
- package/site-templates/marketing-site-free/DESIGN.md +0 -259
- package/site-templates/saas-product/DESIGN.md +0 -259
- package/templates/apps/web/lib/__tests__/deck-page.test.ts +0 -288
- package/templates/apps/web/lib/__tests__/site-theme-head.test.ts +0 -70
- package/templates/apps/web/lib/site-chrome.ts +0 -46
- package/templates/apps/web/lib/site-fonts.ts +0 -15
package/README.md
CHANGED
|
@@ -175,7 +175,9 @@ comes back.
|
|
|
175
175
|
### Apply a design to an existing site
|
|
176
176
|
|
|
177
177
|
A site that already exists can wear a different design with one command. Name
|
|
178
|
-
a shipped design, or point at a directory holding a `
|
|
178
|
+
a shipped design, or point at a directory holding a `design.yaml` (the design's
|
|
179
|
+
settings; a `DESIGN.md` beside it is the design's guide, which a site reads and
|
|
180
|
+
does not edit):
|
|
179
181
|
|
|
180
182
|
```bash
|
|
181
183
|
# in an already-scaffolded repo (default target: cwd)
|
|
@@ -184,40 +186,32 @@ create-ailk apply-design minimalism
|
|
|
184
186
|
create-ailk apply-design ./designs/acme --target ./my-site
|
|
185
187
|
```
|
|
186
188
|
|
|
187
|
-
It changes how the site **looks**, never what it **is
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
home: the shape's own sections, or a design's arc of them. It never changes a
|
|
207
|
-
home whose sections were edited; it reports the home as kept and leaves it
|
|
208
|
-
byte-for-byte. A seeded home takes the design's looks; look values on the
|
|
209
|
-
sections it replaced are not kept. A design with no arc restores the shape's
|
|
210
|
-
own sections on a home that still wears another design's untouched arc.
|
|
189
|
+
It changes how the site **looks**, never what it **is**, and it changes no
|
|
190
|
+
file: a site's look is its hub design record, and `apply-design` writes that
|
|
191
|
+
record (#12477). A shipped look is recorded by name and version, keeping the
|
|
192
|
+
site's starter's own layout settings as its changes; a design given as a
|
|
193
|
+
directory is recorded as a look of the workspace's own. The record's header and
|
|
194
|
+
footer styles and its brand override are kept as they are. The site shows the
|
|
195
|
+
new look on its next request, with no deploy.
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
AILK_AGENT_KEY=<key> create-ailk apply-design minimalism --api-url https://api.example.com --workspace <wksp_id>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The hub's origin comes from `--api-url`, else `AILK_API_URL`; the workspace
|
|
202
|
+
from `--workspace`, else `AILK_WORKSPACE_ID`; the agent key from
|
|
203
|
+
`AILK_AGENT_KEY` only, and it needs the `site-design` grant. On a spoke, the
|
|
204
|
+
workspace and origin must be the ones its `apps/web` env files name. A site
|
|
205
|
+
that still carries its retired look files (`content/_site.mdx`'s `theme:`,
|
|
206
|
+
`apps/web/lib/site-chrome.ts`, `apps/web/lib/site-fonts.ts`) is refused until
|
|
207
|
+
its look has been imported into the hub.
|
|
211
208
|
|
|
212
209
|
A design other than `standard` needs a Pro or Pro Plus key. The key is read
|
|
213
210
|
from the site's own `ailk.key` (put one there with
|
|
214
211
|
`create-ailk license set <key>`), else from `AILK_LICENSE_KEY`. A malformed
|
|
215
|
-
package, a preset the validator refuses
|
|
216
|
-
anything is written, naming the field
|
|
217
|
-
|
|
218
|
-
A preset **sets** the look fields it names and never unsets one: a field it
|
|
219
|
-
does not name keeps whatever value the page has, including one a previous
|
|
220
|
-
design set.
|
|
212
|
+
package, a preset the validator refuses, a missing key or a missing credential
|
|
213
|
+
is refused before anything is written, naming the field, the licence level or
|
|
214
|
+
the variable.
|
|
221
215
|
|
|
222
216
|
### Sync `architecture.yaml` after adding a module
|
|
223
217
|
|
|
@@ -760,14 +754,17 @@ create-ailk seed-flows ./my-spoke --dry-run # check the files, send nothing
|
|
|
760
754
|
|
|
761
755
|
- The key is read from `AILK_SPOKE_KEY` only — never a flag or a file — and
|
|
762
756
|
never printed.
|
|
763
|
-
- The hub origin is `--hub-url`, else `AILK_API_URL`, else
|
|
764
|
-
line of `apps/web/.env.local`; it must be `https:`
|
|
765
|
-
|
|
757
|
+
- The hub origin is `--hub-url`, else `AILK_API_URL`, else (for `--dry-run`
|
|
758
|
+
only) the `AILK_API_URL=` line of `apps/web/.env.local`; it must be `https:`
|
|
759
|
+
(or `http:` on a loopback host), and a send goes only to the origin that
|
|
760
|
+
`.env.local` line names. The first line printed names it and its source,
|
|
761
|
+
before any request.
|
|
766
762
|
- Each flow is sent to `PUT <hub>/v1/flows/<slug>/definition` and prints
|
|
767
763
|
`created`, `updated` or `unchanged`, so a re-run is safe. A failure prints
|
|
768
764
|
only its status and code, and the rest still run.
|
|
769
765
|
- Exit 0 when every flow was accepted, 1 when any failed, 2 on a refusal (a hub
|
|
770
|
-
site, a bad file, no key, no valid hub origin
|
|
766
|
+
site, a bad file, no key, no valid hub origin, an origin other than the one
|
|
767
|
+
`apps/web/.env.local` names), which sends nothing.
|
|
771
768
|
|
|
772
769
|
The hub must have `AILK_SPOKE_FLOW_SEED=true`; until it does and this has run,
|
|
773
770
|
the spoke's `/flows/<slug>` links reach no flow. The repo owns each flow's
|
|
@@ -821,15 +818,28 @@ AILK_AGENT_KEY=<agent key> create-ailk seed-workspace ./my-site --api-url <api o
|
|
|
821
818
|
- The API then serves the pages only when it runs on the database it was
|
|
822
819
|
seeded through (its `DATABASE_URL`) and its site resolves to the seeded
|
|
823
820
|
workspace.
|
|
824
|
-
-
|
|
825
|
-
|
|
826
|
-
the
|
|
821
|
+
- Then the look (#12477): the site's first hub design record, from the design
|
|
822
|
+
and starter it was scaffolded with, is written to the workspace — only when
|
|
823
|
+
the workspace holds no record, never over one, never for a site that still
|
|
824
|
+
carries its look files and never into a workspace that already held pages.
|
|
825
|
+
This step alone needs the key's `site-design` grant; without it the step is
|
|
826
|
+
skipped and named (`Look: skipped …`), and until the look is written the site
|
|
827
|
+
renders the base look. It prints `Look: written`, `kept`, `skipped` or `not
|
|
828
|
+
written`, with why.
|
|
829
|
+
- On a spoke, whose pages are its own files, only the look is seeded, into the
|
|
830
|
+
workspace and at the hub the spoke's `apps/web` env files name (another id,
|
|
831
|
+
or an origin other than the `AILK_API_URL` of `apps/web/.env.local`, is
|
|
832
|
+
refused), and only when that workspace has no identity or navigation yet.
|
|
833
|
+
- Exit 0 when every page was seeded and the look written, kept or skipped, 1
|
|
834
|
+
when any failed, 2 on a refusal (no `.ailk-site-manifest.json`, a missing
|
|
835
|
+
key, workspace id or origin, a spoke naming another workspace or hub, the adapter
|
|
836
|
+
not installed), which sends nothing.
|
|
827
837
|
|
|
828
838
|
`pnpm create ailk` runs the same seed as its last step, after `--install`,
|
|
829
|
-
when the site has an Admin and `AILK_API_URL`,
|
|
830
|
-
`AILK_AGENT_KEY` are all set. When
|
|
831
|
-
|
|
832
|
-
|
|
839
|
+
when the site has an Admin or is a spoke and `AILK_API_URL`,
|
|
840
|
+
`AILK_WORKSPACE_ID` and `AILK_AGENT_KEY` are all set. When one is missing, or
|
|
841
|
+
`--install` was not passed, it prints that seeding was skipped and the command
|
|
842
|
+
above. A hub with no Admin prints nothing about it. A
|
|
833
843
|
seed that fails or is refused at scaffold time prints why and never fails the
|
|
834
844
|
scaffold; `seed-workspace` is where a seed's result is an exit code.
|
|
835
845
|
|
|
@@ -950,13 +960,64 @@ diff -r before after && echo "live site unchanged"
|
|
|
950
960
|
A non-empty diff is a finding: stop and report it before migrating another
|
|
951
961
|
site.
|
|
952
962
|
|
|
963
|
+
### Removing look copies from a site's page files
|
|
964
|
+
|
|
965
|
+
A design's section presets were copied onto every page file at scaffold.
|
|
966
|
+
Once a site renders its sections with its hub look merged in (#12474), those
|
|
967
|
+
copies only pin each page to the look it had then. `strip-look-copies`
|
|
968
|
+
removes them from the page files, after the site's look has been imported
|
|
969
|
+
into its workspace's design record:
|
|
970
|
+
|
|
971
|
+
```bash
|
|
972
|
+
# dry run: one line per removal, <path>: <sectionType>.<field>, and a total; writes nothing
|
|
973
|
+
AILK_AGENT_KEY=<agent key> create-ailk strip-look-copies ./my-site --api-url <api origin> --workspace <wksp_id>
|
|
974
|
+
# remove them, on a new branch when run on the default branch
|
|
975
|
+
AILK_AGENT_KEY=<agent key> create-ailk strip-look-copies ./my-site --apply --api-url <api origin> --workspace <wksp_id>
|
|
976
|
+
```
|
|
977
|
+
|
|
978
|
+
Credentials are read as `migrate-content` reads them: the origin from
|
|
979
|
+
`--api-url`, else `AILK_API_URL` (https:, or http: on a loopback host); the
|
|
980
|
+
workspace from `--workspace`, else `AILK_WORKSPACE_ID`; the agent key from
|
|
981
|
+
`AILK_AGENT_KEY` only. The look is the design read's worked-out section
|
|
982
|
+
settings (`GET /v1/workspaces/<id>/design`). The command also makes the
|
|
983
|
+
site's own read, `GET /v1/content/site-config` — on a spoke with
|
|
984
|
+
`AILK_SPOKE_KEY` when it is set, keyless otherwise — and refuses unless it
|
|
985
|
+
carries the same design version and the same section settings, so it strips
|
|
986
|
+
only against the look the site renders from. On a spoke, a workspace or
|
|
987
|
+
origin other than the one its `apps/web/.env` or `.env.local` names is
|
|
988
|
+
refused before any request. No key is printed.
|
|
989
|
+
|
|
990
|
+
An entry in a `content/` page (never `_site.mdx`) is removed only when:
|
|
991
|
+
|
|
992
|
+
- its field is a look field of its section type, the look sets it, and its
|
|
993
|
+
value equals the look's;
|
|
994
|
+
- the look sets no field that section lacks — else the section is left whole
|
|
995
|
+
and listed as kept, since the look would add to it;
|
|
996
|
+
- it is unchanged, in the same section with the same value, in every commit
|
|
997
|
+
of the file since the one that added it — else it was chosen, and is listed
|
|
998
|
+
as edited. A file no commit holds is kept whole.
|
|
999
|
+
|
|
1000
|
+
A value that differs from the look's always stays. Each removal takes the
|
|
1001
|
+
entry and one separator and leaves every other byte of the file as it was.
|
|
1002
|
+
|
|
1003
|
+
`--apply` refuses a dirty work tree and a directory outside a git work tree.
|
|
1004
|
+
On the default branch (`main`, `master`, or the one `origin/HEAD` names) it
|
|
1005
|
+
first creates and switches to `look-copy-import/<YYYYMMDD>`; then it writes
|
|
1006
|
+
the changed files and prints the next steps — review, commit, push, open a
|
|
1007
|
+
pull request — which it never takes itself. A second run reports nothing to
|
|
1008
|
+
remove. Applying a design to the site again copies its presets back, so run
|
|
1009
|
+
this again after one. Exit 0 on success, 2 on a refusal: a missing or
|
|
1010
|
+
malformed credential, a read that fails or carries no look, two reads that
|
|
1011
|
+
disagree, no git work tree, or a dirty one; nothing is written.
|
|
1012
|
+
|
|
953
1013
|
### Cutting a site over to the database
|
|
954
1014
|
|
|
955
1015
|
Once a site's pages are in its workspace, three commands move it from its
|
|
956
1016
|
page files to the database and back (#10648). Each reads the workspace with
|
|
957
1017
|
`AILK_AGENT_KEY` (the `content-edit` grant), `--api-url`/`AILK_API_URL` and
|
|
958
1018
|
`--workspace`/`AILK_WORKSPACE_ID`, as `migrate-content` does; a spoke also
|
|
959
|
-
needs `AILK_SPOKE_KEY
|
|
1019
|
+
needs `AILK_SPOKE_KEY`, and refuses a workspace or origin other than the one
|
|
1020
|
+
its `apps/web/.env` or `.env.local` names.
|
|
960
1021
|
|
|
961
1022
|
```bash
|
|
962
1023
|
# 1. Freeze what the site serves today, and audit it. Commit both files.
|
|
@@ -1016,6 +1077,82 @@ that have a path, and lists every other live row as not compared. It needs
|
|
|
1016
1077
|
Playwright's Chromium in the site, as `cutover` does. It exits 1 when a page
|
|
1017
1078
|
differs or a URL is not 200, and 2 on a refusal.
|
|
1018
1079
|
|
|
1080
|
+
### Comparing a site's header and footer before and after a chrome change
|
|
1081
|
+
|
|
1082
|
+
`compare-renders` reads `main` and takes its pictures with every menu closed,
|
|
1083
|
+
so a changed menu link passes it. `compare-chrome` (#12403) captures the
|
|
1084
|
+
chrome itself: for each `--path`, at 1440 and 390 wide, in a fresh signed-out
|
|
1085
|
+
context, the header, each desktop menu opened in turn, the phone's menu opened
|
|
1086
|
+
with every disclosure expanded, and the footer — each part's links (text,
|
|
1087
|
+
address and order) and a screenshot. It also records the page's render stamp (the `<meta name="ailk-nav-source">` in its `<head>`, else
|
|
1088
|
+
`data-nav-source` / `data-nav-version` on the header's wrapper). Capture before the change,
|
|
1089
|
+
then compare after:
|
|
1090
|
+
|
|
1091
|
+
```bash
|
|
1092
|
+
create-ailk compare-chrome . --origin https://example.com --path / --path /about --capture .chrome/example/before
|
|
1093
|
+
# … the change is made (for the navigation import: docs/internal/runbooks/site-navigation-import.md) …
|
|
1094
|
+
create-ailk compare-chrome . --origin https://example.com --path / --path /about --against .chrome/example/before --expect-source record --expect-version 1
|
|
1095
|
+
# → .chrome/example/before/comparison/{comparison.json,comparison.md,after/,shots/}
|
|
1096
|
+
```
|
|
1097
|
+
|
|
1098
|
+
Links must be equal entry by entry and screenshots pixel for pixel, unless
|
|
1099
|
+
`--tolerance <share>` allows a share of a screenshot's pixels to differ. A part
|
|
1100
|
+
found on one side only is a difference. `--expect-source` and
|
|
1101
|
+
`--expect-version` make an after-capture whose stamp differs on any path or
|
|
1102
|
+
viewport fail. It needs Playwright's Chromium in the site. It exits 1 when a
|
|
1103
|
+
part differs or a page does not load, and 2 on a refusal.
|
|
1104
|
+
|
|
1105
|
+
### Comparing whole pages before and after a look change
|
|
1106
|
+
|
|
1107
|
+
`compare-chrome` reads the header and footer only, so a changed colour, face or
|
|
1108
|
+
section layout in the page body passes it. `compare-look` (#12476) captures
|
|
1109
|
+
each `--path`'s whole page at 1440 and 390 wide, in the light and the dark
|
|
1110
|
+
colour scheme, each in a fresh signed-out context opened with that scheme: the
|
|
1111
|
+
response status, the page's design render stamp (the
|
|
1112
|
+
`<meta name="ailk-design-source">` in its `<head>`: `files`, or `record` with
|
|
1113
|
+
the record's version in `data-version`) and a full-page screenshot taken once
|
|
1114
|
+
the fonts are ready. Capture before the change, then compare after:
|
|
1115
|
+
|
|
1116
|
+
```bash
|
|
1117
|
+
create-ailk compare-look . --origin https://example.com --path / --path /about --capture .look/example/before
|
|
1118
|
+
# … the change is made (for the design import: docs/internal/runbooks/site-design-import.md) …
|
|
1119
|
+
create-ailk compare-look . --origin https://example.com --path / --path /about --against .look/example/before --expect-source record --expect-version 1
|
|
1120
|
+
# → .look/example/before/comparison/{comparison.json,comparison.md,after/,shots/}
|
|
1121
|
+
```
|
|
1122
|
+
|
|
1123
|
+
Only a page that answers 200 is captured; any other status, or a page whose
|
|
1124
|
+
shot fails, is recorded as not captured. Screenshots must be equal pixel for
|
|
1125
|
+
pixel, unless `--tolerance <share>` allows a share of a screenshot's pixels to
|
|
1126
|
+
differ; a size difference, a screenshot that cannot be read, a page that did
|
|
1127
|
+
not load and a shot on one side only are each a difference. A `--path` may be
|
|
1128
|
+
given once. `--expect-source record --expect-version <n>` makes an
|
|
1129
|
+
after-shot not stamped `record` at `<n>` fail, and `--expect-source files` one
|
|
1130
|
+
not stamped `files`. It needs Playwright's Chromium in `<dir>`. It exits 1 when
|
|
1131
|
+
a shot differs or a page does not load, and 2 on a refusal.
|
|
1132
|
+
|
|
1133
|
+
### Handing a site's look settings to its hub design record
|
|
1134
|
+
|
|
1135
|
+
`look-settings` (#12476) reads a site checkout's `design.yaml`, its roster
|
|
1136
|
+
(`.ailk-site-manifest.json`, else the legacy `TEMPLATE-MANIFEST.json`),
|
|
1137
|
+
`content/_site.mdx`, `apps/web/lib/site-chrome.ts` and
|
|
1138
|
+
`apps/web/lib/site-fonts.ts` — each once, as text; no site code runs and no
|
|
1139
|
+
credential is needed. The settings are `design.yaml` with its `layout` replaced
|
|
1140
|
+
by the layout `site-chrome.ts` holds, and they are handed over only when they
|
|
1141
|
+
compile, by create-ailk's own compile and renderers, to the `theme:` block,
|
|
1142
|
+
`site-chrome.ts` and `site-fonts.ts` byte for byte:
|
|
1143
|
+
|
|
1144
|
+
```bash
|
|
1145
|
+
create-ailk look-settings ~/sites/example --out ~/look-example.json
|
|
1146
|
+
# → the settings as JSON, then `settings sha256: <hex>`, `layout:`, `faces:`, `sections:` (and `brand:`) lines
|
|
1147
|
+
```
|
|
1148
|
+
|
|
1149
|
+
`--out` must be a new file outside the checkout; it is created mode 0600 and
|
|
1150
|
+
holds the settings, their digest (the SHA-256 of their canonical JSON) and the
|
|
1151
|
+
SHA-256 of every file read. The hub CLI `import-site-design` reads it and
|
|
1152
|
+
re-checks every digest. A generated file that differs is named with the first
|
|
1153
|
+
differing line and exits 3; a file missing, outside the checkout, over 1 MB or
|
|
1154
|
+
refused by the reader exits 1; a bad flag or `--out` exits 2.
|
|
1155
|
+
|
|
1019
1156
|
### A spoke's declared environment
|
|
1020
1157
|
|
|
1021
1158
|
A spoke scaffold's `pnpm preflight` and CI run `pnpm env:declared`: every
|