@homepages/template-kit 0.2.0 → 0.4.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/CHANGELOG.md +222 -0
- package/README.md +96 -17
- package/dist/asset-modules.d.ts +81 -0
- package/dist/base.css +9 -0
- package/dist/cli/check/config.js +41 -0
- package/dist/cli/check/css.js +131 -0
- package/dist/cli/check/diagnostics.js +32 -0
- package/dist/cli/check/index.js +87 -0
- package/dist/cli/check/loader.js +146 -0
- package/dist/cli/check/paths.js +15 -0
- package/dist/cli/check/relativize.js +18 -0
- package/dist/cli/check/render-invariants.js +24 -0
- package/dist/cli/check/resolve-tool.js +38 -0
- package/dist/cli/check/section-assets.js +58 -0
- package/dist/cli/check/stages/deps.js +337 -0
- package/dist/cli/check/stages/lint.js +46 -0
- package/dist/cli/check/stages/render.js +101 -0
- package/dist/cli/check/stages/size.js +274 -0
- package/dist/cli/check/stages/tree.js +206 -0
- package/dist/cli/check/stages/typecheck.js +46 -0
- package/dist/cli/check/stages/validate/catalog-exhaustiveness.js +18 -0
- package/dist/cli/check/stages/validate/facts.js +18 -0
- package/dist/cli/check/stages/validate/formatter-contract.js +14 -0
- package/dist/cli/check/stages/validate/group-contract.js +21 -0
- package/dist/cli/check/stages/validate/index.js +66 -0
- package/dist/cli/check/stages/validate/list-scalar-contract.js +22 -0
- package/dist/cli/check/stages/validate/nav-contract.js +93 -0
- package/dist/cli/check/stages/validate/nested-slot-contract.js +12 -0
- package/dist/cli/check/stages/validate/object-list-contract.js +31 -0
- package/dist/cli/check/stages/validate/orchestrator.js +241 -0
- package/dist/cli/check/stages/validate/produced-by-contract.js +18 -0
- package/dist/cli/check/stages/validate/row-contract.js +31 -0
- package/dist/cli/check/stages/validate/select-contract.js +13 -0
- package/dist/cli/check/stages/validate/source-contract.js +21 -0
- package/dist/cli/check/stages/validate/variant-contract.js +15 -0
- package/dist/cli/check/workspace.js +86 -0
- package/dist/cli/dev/build-css.js +91 -0
- package/dist/cli/dev/catalog.js +35 -0
- package/dist/cli/dev/compose-template.js +38 -0
- package/dist/cli/dev/content-override.js +58 -0
- package/dist/cli/dev/discover.js +35 -0
- package/dist/cli/dev/fill-state.js +75 -0
- package/dist/cli/dev/index.js +32 -0
- package/dist/cli/dev/inspect.js +38 -0
- package/dist/cli/dev/island-bootstrap.js +38 -0
- package/dist/cli/dev/island-map.js +35 -0
- package/dist/cli/dev/island-transform.js +31 -0
- package/dist/cli/dev/manifest-instances.js +31 -0
- package/dist/cli/dev/render-section.js +24 -0
- package/dist/cli/dev/screenshot-target.js +24 -0
- package/dist/cli/dev/section-page.js +54 -0
- package/dist/cli/dev/server.js +480 -0
- package/dist/cli/dev/slot-schema.js +12 -0
- package/dist/cli/dev/structure-summary.js +118 -0
- package/dist/cli/dev/tailwind.js +32 -0
- package/dist/cli/dev/vite-server.js +33 -0
- package/dist/cli/dev/workspace.js +63 -0
- package/dist/cli/link/index.js +74 -0
- package/dist/cli/link/overlay.js +59 -0
- package/dist/cli/link/watch.js +25 -0
- package/dist/cli/new/emit.js +48 -0
- package/dist/cli/new/index.js +69 -0
- package/dist/cli/new/scaffold/section/_Renderer.tsx +20 -0
- package/dist/cli/new/scaffold/section/_fill-spec.ts +18 -0
- package/dist/cli/new/scaffold/section/_fixtures.ts +13 -0
- package/dist/cli/new/scaffold/section/_schema.ts +24 -0
- package/dist/cli/new/scaffold/template/_manifest.json +9 -0
- package/dist/cli/new/scaffold/template/sections/hero/ExpandableText.tsx +45 -0
- package/dist/cli/new/scaffold/template/sections/hero/Renderer.tsx +40 -0
- package/dist/cli/new/scaffold/template/sections/hero/components/Feature.tsx +14 -0
- package/dist/cli/new/scaffold/template/sections/hero/fill-spec.ts +29 -0
- package/dist/cli/new/scaffold/template/sections/hero/fixtures.ts +41 -0
- package/dist/cli/new/scaffold/template/sections/hero/schema.ts +60 -0
- package/dist/cli/new/scaffold/template/theme.css +24 -0
- package/dist/cli/new/scaffold/template/theme.ts +27 -0
- package/dist/cli/new/scaffold-assets.js +20 -0
- package/dist/cli/pack/collect.js +44 -0
- package/dist/cli/pack/guards.js +57 -0
- package/dist/cli/pack/index.js +66 -0
- package/dist/cli/pack/manifest.js +15 -0
- package/dist/cli/pack/zip.js +86 -0
- package/dist/cli/theme/generate.js +43 -0
- package/dist/cli/theme/index.js +33 -0
- package/dist/cli/theme/load-theme.js +69 -0
- package/dist/cli.js +100 -16
- package/dist/contracts/fill-treatments.js +47 -0
- package/dist/design-system/theme.d.ts +30 -300
- package/dist/design-system/theme.js +112 -90
- package/dist/dev-client/assets/index-DfEfrp6P.css +1 -0
- package/dist/dev-client/assets/index-bpMP0b0W.js +50 -0
- package/dist/dev-client/index.html +13 -0
- package/dist/eslint/is-client-file.d.ts +4 -0
- package/dist/eslint/rules/no-hex.js +78 -6
- package/dist/eslint.js +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -2
- package/dist/islands/detect.d.ts +16 -0
- package/dist/islands/detect.js +22 -0
- package/dist/islands/discover.d.ts +5 -0
- package/dist/islands/discover.js +19 -0
- package/dist/islands/esbuild-plugin.d.ts +13 -0
- package/dist/islands/esbuild-plugin.js +39 -0
- package/dist/islands/wrap.d.ts +11 -0
- package/dist/islands/wrap.js +48 -0
- package/dist/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +77 -0
- package/dist/node_modules/magic-string/dist/magic-string.es.js +939 -0
- package/dist/package.js +1 -1
- package/dist/primitives/Image.js +1 -1
- package/dist/schema/fill-spec.d.ts +80 -590
- package/dist/schema/fixture-schema.d.ts +5 -81
- package/dist/schema/manifest.d.ts +39 -475
- package/dist/schema/resolve-section-ref.js +10 -0
- package/dist/schema/rows.js +10 -0
- package/dist/schema/section-nav.js +9 -0
- package/dist/schema/section-schema.d.ts +51 -437
- package/dist/schema/slot-types.d.ts +12 -16
- package/dist/ssr.d.ts +31 -0
- package/dist/ssr.js +46 -0
- package/dist/styles.css +31 -88
- package/docs/INDEX.md +12 -3
- package/docs/assets.md +128 -0
- package/docs/check.md +124 -0
- package/docs/dev.md +187 -0
- package/docs/eslint.md +18 -8
- package/docs/islands.md +5 -2
- package/docs/llms.txt +59 -9
- package/docs/new.md +27 -0
- package/docs/overview.md +57 -0
- package/docs/pack.md +46 -0
- package/docs/primitives.md +10 -6
- package/docs/quickstart.md +102 -0
- package/docs/recipes/INDEX.md +27 -0
- package/docs/recipes/bind-property-fact.md +58 -0
- package/docs/recipes/collection-slot.md +100 -0
- package/docs/recipes/fill-spec-decision.md +66 -0
- package/docs/recipes/fixture-states.md +68 -0
- package/docs/recipes/image-slot-crop.md +98 -0
- package/docs/recipes/interactive-island.md +100 -0
- package/docs/recipes/organize-section-folder.md +72 -0
- package/docs/recipes/prepare-submission.md +55 -0
- package/docs/recipes/second-template.md +49 -0
- package/docs/recipes/select-slot.md +59 -0
- package/docs/recipes/static-asset.md +103 -0
- package/docs/recipes/third-party-package.md +90 -0
- package/docs/rules/INDEX.md +14 -5
- package/docs/rules/bundle-binary-asset.md +83 -0
- package/docs/rules/bundle-incomplete.md +2 -2
- package/docs/rules/css-reason.md +3 -3
- package/docs/rules/fixtures-invalid.md +96 -0
- package/docs/rules/license-denied.md +11 -3
- package/docs/rules/manifest-invalid.md +99 -0
- package/docs/rules/no-bare-css-import.md +8 -8
- package/docs/rules/no-css-import-from-render-path.md +7 -8
- package/docs/rules/no-hex.md +76 -10
- package/docs/rules/no-templates.md +87 -0
- package/docs/rules/parse-error.md +76 -0
- package/docs/rules/schema-invalid.md +96 -0
- package/docs/rules/size-assets.md +88 -0
- package/docs/rules/size-island-bundle.md +123 -0
- package/docs/rules/size-section-css.md +19 -14
- package/docs/schema-system.md +28 -28
- package/docs/theme-and-css.md +157 -92
- package/docs/vocabulary.md +98 -0
- package/package.json +14 -11
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: The closed authoring vocabulary — slot types, direct() sources, derived() transforms, with selection semantics.
|
|
3
|
+
status: living
|
|
4
|
+
related: [schema-system.md]
|
|
5
|
+
updated: 2026-07-15
|
|
6
|
+
---
|
|
7
|
+
# The closed authoring vocabulary
|
|
8
|
+
|
|
9
|
+
Three closed sets. A slot's `type` picks its runtime value shape; a slot's
|
|
10
|
+
`source` (`direct()` or `derived()`) picks which fact or computation fills it.
|
|
11
|
+
This page is a selection reference — *which one to pick* — not a restatement
|
|
12
|
+
of their field shapes.
|
|
13
|
+
|
|
14
|
+
## Slot types
|
|
15
|
+
|
|
16
|
+
| type | runtime value shape | pick it when |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `text` | `string` (`string \| null` if optional) | one editable line/paragraph (`size` short\|medium\|long) |
|
|
19
|
+
| `number` | `number` (`number \| null` if optional) | a numeric fact with formatting |
|
|
20
|
+
| `select` | `string` (`string \| null` if optional) | a closed set of choices the user picks from |
|
|
21
|
+
| `image` | `ImageValue` (`ImageValue \| null` if optional) | one framed photo (add `crop`/`frame`) |
|
|
22
|
+
| `image_collection` | `ImageCollectionValue` | a gallery of framed photos |
|
|
23
|
+
| `list` | `string[]` for a `text` element, `unknown[]` otherwise | a flat list of scalar items |
|
|
24
|
+
| `poi_list` | `PoiRow[]` | neighborhood points of interest |
|
|
25
|
+
| `url` | `string` (`string \| null` if optional) | a link the user edits in a URL field |
|
|
26
|
+
| `object_list` | `Record<string, unknown>[]` | repeating, independently-editable multi-field items |
|
|
27
|
+
|
|
28
|
+
The full per-type field shapes live in your editor's autocomplete and
|
|
29
|
+
[schema-system.md](schema-system.md) — this page is only *which to pick*.
|
|
30
|
+
|
|
31
|
+
## `direct()` sources
|
|
32
|
+
|
|
33
|
+
The property facts a slot binds verbatim. A bad name is a compile error at
|
|
34
|
+
the `direct(...)` call site.
|
|
35
|
+
|
|
36
|
+
**Property facts** (resolve once per property):
|
|
37
|
+
- `address` — the full formatted address
|
|
38
|
+
- `listing_intent` — for-sale vs. for-rent state
|
|
39
|
+
- `status` — the listing status, free text as shown on the listing (e.g. "For Sale")
|
|
40
|
+
- `property_type` — the property type (`single_family` \| `condo_townhome` \| `multi_family` \| `investment`)
|
|
41
|
+
- `year_built` — the year the property was built
|
|
42
|
+
- `lot_size` — the lot size, pre-formatted text
|
|
43
|
+
|
|
44
|
+
**Per-unit facts** (resolve against the current/single unit row):
|
|
45
|
+
- `unit_label` — the unit's display label (e.g. "Unit 3B")
|
|
46
|
+
- `beds` — bedroom count for this unit
|
|
47
|
+
- `baths` — bathroom count for this unit
|
|
48
|
+
- `sqft` — square footage for this unit
|
|
49
|
+
- `price` — this unit's price, pre-formatted text
|
|
50
|
+
- `notes` — free-text notes on this unit
|
|
51
|
+
|
|
52
|
+
**List sources** (bind the whole array verbatim — pick these for `object_list`
|
|
53
|
+
slots that repeat over every row):
|
|
54
|
+
- `units` — every unit row on the property
|
|
55
|
+
- `contacts` — every contact attached to the section
|
|
56
|
+
|
|
57
|
+
**Per-contact fields** (resolve against the attached contact):
|
|
58
|
+
- `name` — the contact's display name
|
|
59
|
+
- `title` — the contact's job title/role
|
|
60
|
+
- `bio` — the contact's bio copy
|
|
61
|
+
- `email` — the contact's email address
|
|
62
|
+
- `phone` — the contact's phone number
|
|
63
|
+
- `website` — the contact's website URL
|
|
64
|
+
- `instagram` — the contact's Instagram handle/URL
|
|
65
|
+
- `linkedin` — the contact's LinkedIn handle/URL
|
|
66
|
+
- `x` — the contact's X (Twitter) handle/URL
|
|
67
|
+
- `facebook` — the contact's Facebook handle/URL
|
|
68
|
+
|
|
69
|
+
**Contact images** (bind only to `image` slots):
|
|
70
|
+
- `headshot` — the contact's headshot photo
|
|
71
|
+
- `logo_dark` — the contact's logo, dark-background variant
|
|
72
|
+
- `logo_light` — the contact's logo, light-background variant
|
|
73
|
+
|
|
74
|
+
## `derived()` transforms
|
|
75
|
+
|
|
76
|
+
Computed values, grouped by family. A bad name is a compile error at the
|
|
77
|
+
`derived(...)` call site.
|
|
78
|
+
|
|
79
|
+
| transform | what it computes |
|
|
80
|
+
|---|---|
|
|
81
|
+
| `units.bedsPrimary` | beds of the primary (lowest-position) unit |
|
|
82
|
+
| `units.bathsPrimary` | baths of the primary unit |
|
|
83
|
+
| `units.sqftPrimary` | sqft of the primary unit |
|
|
84
|
+
| `units.pricePrimary` | price of the primary unit, pre-formatted text |
|
|
85
|
+
| `units.bedsRange` | formatted beds range across all units (e.g. "2–4"), collapsing to one value when uniform |
|
|
86
|
+
| `units.priceStart` | the lowest numeric unit price; falls back to the first non-numeric price (e.g. "Sold") when none is numeric |
|
|
87
|
+
| `units.bedsMin` | the minimum beds across all units, formatted |
|
|
88
|
+
| `units.bedsMax` | the maximum beds across all units, formatted |
|
|
89
|
+
| `units.bathsMin` | the minimum baths across all units, formatted |
|
|
90
|
+
| `units.bathsMax` | the maximum baths across all units, formatted |
|
|
91
|
+
| `units.sqftMax` | the maximum sqft across all units, formatted |
|
|
92
|
+
| `address.line1` | the property address's street line |
|
|
93
|
+
| `address.line2` | the property address's city/state/zip line |
|
|
94
|
+
| `contact_address.line1` | a contact's address street line |
|
|
95
|
+
| `contact_address.line2` | a contact's address city/state/zip line |
|
|
96
|
+
| `clock.currentYear` | the current year (e.g. for a copyright line) |
|
|
97
|
+
| `coordinate.lat` | latitude, split from the property's geocode |
|
|
98
|
+
| `coordinate.lng` | longitude, split from the property's geocode |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homepages/template-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Authoring kit for HomePages marketing-section templates: schema system, contract primitives, theme tokens, and the template-kit CLI.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
"types": "./dist/browser.d.ts",
|
|
42
42
|
"default": "./dist/browser.js"
|
|
43
43
|
},
|
|
44
|
+
"./ssr": {
|
|
45
|
+
"types": "./dist/ssr.d.ts",
|
|
46
|
+
"default": "./dist/ssr.js"
|
|
47
|
+
},
|
|
44
48
|
"./eslint": {
|
|
45
49
|
"types": "./dist/eslint.d.ts",
|
|
46
50
|
"default": "./dist/eslint.js"
|
|
@@ -55,9 +59,10 @@
|
|
|
55
59
|
],
|
|
56
60
|
"scripts": {
|
|
57
61
|
"prepack": "npm run build",
|
|
58
|
-
"build": "tsdown",
|
|
62
|
+
"build": "tsdown && node scripts/build-dev-client.mjs && node scripts/build-cli-assets.mjs",
|
|
59
63
|
"typecheck": "tsc --noEmit",
|
|
60
64
|
"lint": "eslint .",
|
|
65
|
+
"pretest": "node test/link-fixture-workspace.mjs",
|
|
61
66
|
"test": "node --import tsx --test 'src/**/*.test.ts' 'src/**/*.test.tsx'",
|
|
62
67
|
"lint:pkg": "publint --strict && attw --pack . --profile esm-only --exclude-entrypoints styles.css base.css",
|
|
63
68
|
"verify:consumer": "node scripts/verify-consumer.mjs",
|
|
@@ -67,24 +72,22 @@
|
|
|
67
72
|
"release": "changeset publish"
|
|
68
73
|
},
|
|
69
74
|
"peerDependencies": {
|
|
70
|
-
"eslint": "^9.0.0",
|
|
71
75
|
"react": "^19.0.0",
|
|
72
76
|
"react-dom": "^19.0.0"
|
|
73
77
|
},
|
|
74
|
-
"peerDependenciesMeta": {
|
|
75
|
-
"eslint": {
|
|
76
|
-
"optional": true
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
78
|
"devDependencies": {
|
|
80
79
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
81
80
|
"@changesets/cli": "^2.29.8",
|
|
82
81
|
"@eslint/js": "^9.39.4",
|
|
82
|
+
"@playwright/test": "^1.60.0",
|
|
83
83
|
"@tailwindcss/cli": "^4.3.0",
|
|
84
84
|
"@types/jsdom": "^21.1.7",
|
|
85
85
|
"@types/node": "^20.17.10",
|
|
86
86
|
"@types/react": "^19.0.0",
|
|
87
87
|
"@types/react-dom": "^19.0.0",
|
|
88
|
+
"@typescript-eslint/parser": "^8.60.1",
|
|
89
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
90
|
+
"chokidar": "^4.0.1",
|
|
88
91
|
"esbuild": "^0.28.1",
|
|
89
92
|
"eslint": "^9.39.4",
|
|
90
93
|
"jsdom": "^26.1.0",
|
|
@@ -95,10 +98,10 @@
|
|
|
95
98
|
"tsdown": "0.22.7",
|
|
96
99
|
"tsx": "^4.19.2",
|
|
97
100
|
"typescript": "^5.7.2",
|
|
98
|
-
"typescript-eslint": "^8.60.1"
|
|
101
|
+
"typescript-eslint": "^8.60.1",
|
|
102
|
+
"vite": "^6.0.5"
|
|
99
103
|
},
|
|
100
104
|
"dependencies": {
|
|
101
|
-
"
|
|
102
|
-
"zod": "^3.23.8"
|
|
105
|
+
"zod": "^4.4.3"
|
|
103
106
|
}
|
|
104
107
|
}
|
package/tsconfig.json
CHANGED