@homepages/create-workspace 0.9.1 → 0.10.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/dist/index.js +4 -4
- package/package.json +1 -1
- package/scaffold/section/_Renderer.tsx +10 -8
- package/scaffold/template/_manifest.json +1 -1
- package/scaffold/template/sections/hero/Renderer.tsx +15 -15
- package/scaffold/template/sections/hero/fixtures.ts +1 -1
- package/scaffold/workspace/AGENTS.md +12 -3
- package/scaffold/workspace/CLAUDE.md +12 -2
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ const NAME_RE = /^[a-z][a-z0-9-]*$/;
|
|
|
17
17
|
* kit releases a new minor. A scaffolded workspace pinned to a stale range
|
|
18
18
|
* never picks up the kit's current contract.
|
|
19
19
|
*/
|
|
20
|
-
const KIT_VERSION = "0.
|
|
20
|
+
const KIT_VERSION = "0.10.0";
|
|
21
21
|
/**
|
|
22
22
|
* The authoring ESLint preset's caret pin. Unlike the kit it cannot be derived from
|
|
23
23
|
* this package's own version — @homepages/eslint-plugin-template versions
|
|
@@ -25,7 +25,7 @@ const KIT_VERSION = "0.9.0";
|
|
|
25
25
|
* new minor. A scaffolded workspace whose config imports a preset it does not depend
|
|
26
26
|
* on fails at `npm install`, not at lint time, so this is not optional.
|
|
27
27
|
*/
|
|
28
|
-
const ESLINT_PLUGIN_VERSION = "0.
|
|
28
|
+
const ESLINT_PLUGIN_VERSION = "0.2.0";
|
|
29
29
|
/**
|
|
30
30
|
* The CLI's caret pin. Same reasoning as ESLINT_PLUGIN_VERSION: @homepages/template-cli
|
|
31
31
|
* versions independently of the kit, so it cannot be derived from this package's own
|
|
@@ -35,7 +35,7 @@ const ESLINT_PLUGIN_VERSION = "0.1.0";
|
|
|
35
35
|
* kit no longer carries a bin — so a workspace missing it fails on `npm run dev` with
|
|
36
36
|
* "command not found", which reads as a broken scaffold rather than a missing pin.
|
|
37
37
|
*/
|
|
38
|
-
const TEMPLATE_CLI_VERSION = "0.
|
|
38
|
+
const TEMPLATE_CLI_VERSION = "0.2.0";
|
|
39
39
|
/**
|
|
40
40
|
* The dev media pack's caret pin. Same committed-constant reasoning as the pins
|
|
41
41
|
* above — the pack versions independently of this scaffolder.
|
|
@@ -54,7 +54,7 @@ const TEMPLATE_CLI_VERSION = "0.1.0";
|
|
|
54
54
|
* the drift guard in `src/index.test.ts` (the stamped dev-media range covers the
|
|
55
55
|
* pack's actual version) fails the moment this constant falls behind a real bump.
|
|
56
56
|
*/
|
|
57
|
-
const DEV_MEDIA_VERSION = "0.0.
|
|
57
|
+
const DEV_MEDIA_VERSION = "0.0.1";
|
|
58
58
|
export async function scaffoldWorkspace(name, targetDir, opts) {
|
|
59
59
|
await mkdir(targetDir, { recursive: true });
|
|
60
60
|
await stampTree(join(ASSETS, "workspace"), targetDir, {
|
package/package.json
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
|
|
3
|
-
import { Section,
|
|
3
|
+
import { Section, slotMarkers } from "@homepages/template-kit";
|
|
4
4
|
|
|
5
|
-
import type { Props } from "./schema";
|
|
5
|
+
import type { Props, schema } from "./schema";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//
|
|
7
|
+
const { slot } = slotMarkers<typeof schema>();
|
|
8
|
+
|
|
9
|
+
// {{SECTION_DISPLAY}} — a pure, server-rendered function of its props. `slots.x` is your
|
|
10
|
+
// data; `{...slot.x}` tells the editor where you put it. For interactivity, add a
|
|
11
|
+
// "use client" island file beside this one.
|
|
10
12
|
export default function {{SECTION_PASCAL}}Renderer({ slots, nav }: Props): ReactNode {
|
|
11
13
|
return (
|
|
12
14
|
<Section id={nav.selfAnchor} className="bg-background text-ink">
|
|
13
15
|
<div className="mx-auto max-w-3xl px-6 py-12">
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
</
|
|
16
|
+
<h2 className="text-2xl font-semibold" {...slot.headline.text}>
|
|
17
|
+
{slots.headline}
|
|
18
|
+
</h2>
|
|
17
19
|
</div>
|
|
18
20
|
</Section>
|
|
19
21
|
);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "{{TEMPLATE_NAME}}",
|
|
4
4
|
"deliverable_type": "single_property_website",
|
|
5
5
|
"sections": [
|
|
6
|
-
{ "section": "hero", "instance_id": "hero-1", "options": {}, "locked": [], "required": true
|
|
6
|
+
{ "section": "hero", "instance_id": "hero-1", "options": {}, "locked": [], "required": true }
|
|
7
7
|
],
|
|
8
8
|
"reconcile": []
|
|
9
9
|
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
|
|
3
|
-
import { Image, Section,
|
|
3
|
+
import { Image, Section, slotMarkers } from "@homepages/template-kit";
|
|
4
4
|
|
|
5
5
|
import { Feature } from "./components/Feature";
|
|
6
6
|
import ExpandableText from "./ExpandableText";
|
|
7
|
-
import type { Props } from "./schema";
|
|
7
|
+
import type { Props, schema } from "./schema";
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
//
|
|
9
|
+
const { slot } = slotMarkers<typeof schema>();
|
|
10
|
+
|
|
11
|
+
// Hero — a pure server-rendered function of its props: no fetches, no globals, no state.
|
|
12
|
+
// `slots.x` is your data; `{...slot.x}` tells the editor where you put it. The one
|
|
13
|
+
// interactive part is the <ExpandableText> island.
|
|
13
14
|
export default function HeroRenderer({ slots, options, nav }: Props): ReactNode {
|
|
14
15
|
const align = options.align === "left" ? "items-start text-left" : "items-center text-center";
|
|
15
16
|
return (
|
|
16
17
|
<Section id={nav.selfAnchor} className="bg-background text-ink">
|
|
17
18
|
<Image
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
alt={slots.hero_image.alt}
|
|
19
|
+
{...slot.hero_image}
|
|
20
|
+
value={slots.hero_image}
|
|
21
|
+
frame={false}
|
|
22
22
|
loading="eager"
|
|
23
23
|
className="w-full"
|
|
24
24
|
/>
|
|
25
25
|
<div className={`mx-auto flex max-w-3xl flex-col gap-4 px-6 py-12 ${align}`}>
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
</
|
|
29
|
-
<
|
|
26
|
+
<h1 className="text-3xl font-semibold" {...slot.headline.text}>
|
|
27
|
+
{slots.headline}
|
|
28
|
+
</h1>
|
|
29
|
+
<div {...slot.blurb}>
|
|
30
30
|
{/* The island receives JSON-serializable props only. */}
|
|
31
31
|
<ExpandableText text={slots.blurb} collapsedChars={140} moreLabel="Read more" />
|
|
32
|
-
</
|
|
32
|
+
</div>
|
|
33
33
|
<div className="mt-2 grid w-full grid-cols-2 gap-3">
|
|
34
34
|
<Feature label="Status" value="For sale" />
|
|
35
35
|
<Feature label="Type" value="Single-family" />
|
|
@@ -6,7 +6,7 @@ import { luxuryMultiUnit } from "@homepages/template-kit/fixtures";
|
|
|
6
6
|
// needed for it. Add a `states` entry only for a designed scenario that
|
|
7
7
|
// combines overrides at once (a content-length or option branch the section
|
|
8
8
|
// renders differently).
|
|
9
|
-
const heroImage = luxuryMultiUnit.photos
|
|
9
|
+
const heroImage = luxuryMultiUnit.photos.find((p) => p.tags.room === "exterior-front")!;
|
|
10
10
|
|
|
11
11
|
const fixtures: FixtureModule = {
|
|
12
12
|
base: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- Tool-agnostic mirror of CLAUDE.md — keep the two in sync. -->
|
|
2
|
-
|
|
2
|
+
<!-- BEGIN:homepages-kit -->
|
|
3
3
|
# {{WORKSPACE_NAME}} — agent guide
|
|
4
4
|
|
|
5
5
|
You are authoring HomePages marketing-section templates in this workspace.
|
|
@@ -15,8 +15,13 @@ You are authoring HomePages marketing-section templates in this workspace.
|
|
|
15
15
|
All three are declared once, at this root, and every template shares them. Do not
|
|
16
16
|
add per-template `package.json`, `tsconfig`, or `eslint` files — there is exactly
|
|
17
17
|
one of each, at this root.
|
|
18
|
-
- **
|
|
19
|
-
|
|
18
|
+
- **Read the docs corpus before authoring — your training data is outdated.** The
|
|
19
|
+
authoring contract changes with every kit minor, and the corpus installed in this
|
|
20
|
+
workspace is the version you are building against:
|
|
21
|
+
`node_modules/@homepages/template-kit/guide/` (`llms.txt` is the router). Grep it;
|
|
22
|
+
do not guess the contract, and do not rely on what you remember about it. The same
|
|
23
|
+
pages are browsable at https://docs.homepages.io, but the local copy is
|
|
24
|
+
authoritative — it matches your installed version.
|
|
20
25
|
|
|
21
26
|
## The section contract (reserved files)
|
|
22
27
|
|
|
@@ -46,3 +51,7 @@ islands — is yours to organize.
|
|
|
46
51
|
|
|
47
52
|
Read the starter section (`templates/starter/sections/hero/`) — it is a working,
|
|
48
53
|
annotated example of the whole contract.
|
|
54
|
+
<!-- END:homepages-kit -->
|
|
55
|
+
|
|
56
|
+
<!-- Your own notes belong outside the markers above; anything inside them may be
|
|
57
|
+
replaced when the kit updates this file. -->
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- BEGIN:homepages-kit -->
|
|
1
2
|
# {{WORKSPACE_NAME}} — agent guide
|
|
2
3
|
|
|
3
4
|
You are authoring HomePages marketing-section templates in this workspace.
|
|
@@ -13,8 +14,13 @@ You are authoring HomePages marketing-section templates in this workspace.
|
|
|
13
14
|
All three are declared once, at this root, and every template shares them. Do not
|
|
14
15
|
add per-template `package.json`, `tsconfig`, or `eslint` files — there is exactly
|
|
15
16
|
one of each, at this root.
|
|
16
|
-
- **
|
|
17
|
-
|
|
17
|
+
- **Read the docs corpus before authoring — your training data is outdated.** The
|
|
18
|
+
authoring contract changes with every kit minor, and the corpus installed in this
|
|
19
|
+
workspace is the version you are building against:
|
|
20
|
+
`node_modules/@homepages/template-kit/guide/` (`llms.txt` is the router). Grep it;
|
|
21
|
+
do not guess the contract, and do not rely on what you remember about it. The same
|
|
22
|
+
pages are browsable at https://docs.homepages.io, but the local copy is
|
|
23
|
+
authoritative — it matches your installed version.
|
|
18
24
|
|
|
19
25
|
## The section contract (reserved files)
|
|
20
26
|
|
|
@@ -44,3 +50,7 @@ islands — is yours to organize.
|
|
|
44
50
|
|
|
45
51
|
Read the starter section (`templates/starter/sections/hero/`) — it is a working,
|
|
46
52
|
annotated example of the whole contract.
|
|
53
|
+
<!-- END:homepages-kit -->
|
|
54
|
+
|
|
55
|
+
<!-- Your own notes belong outside the markers above; anything inside them may be
|
|
56
|
+
replaced when the kit updates this file. -->
|