@homepages/create-workspace 0.9.0-dev-20260719205406 → 0.9.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/dist/index.js
CHANGED
|
@@ -18,12 +18,23 @@ const NAME_RE = /^[a-z][a-z0-9-]*$/;
|
|
|
18
18
|
* on fails at `npm install`, not at lint time, so this is not optional.
|
|
19
19
|
*/
|
|
20
20
|
const ESLINT_PLUGIN_VERSION = "0.1.0";
|
|
21
|
+
/**
|
|
22
|
+
* The CLI's caret pin. Same reasoning as ESLINT_PLUGIN_VERSION: @homepages/template-cli
|
|
23
|
+
* versions independently of the kit, so it cannot be derived from this package's own
|
|
24
|
+
* version and is a committed constant, bumped when that package releases a new minor.
|
|
25
|
+
*
|
|
26
|
+
* It is what supplies the `template-kit` command the scaffolded scripts invoke — the
|
|
27
|
+
* kit no longer carries a bin — so a workspace missing it fails on `npm run dev` with
|
|
28
|
+
* "command not found", which reads as a broken scaffold rather than a missing pin.
|
|
29
|
+
*/
|
|
30
|
+
const TEMPLATE_CLI_VERSION = "0.1.0";
|
|
21
31
|
export async function scaffoldWorkspace(name, targetDir, opts) {
|
|
22
32
|
await mkdir(targetDir, { recursive: true });
|
|
23
33
|
await stampTree(join(ASSETS, "workspace"), targetDir, {
|
|
24
34
|
WORKSPACE_NAME: name,
|
|
25
35
|
KIT_VERSION: opts.kitVersion,
|
|
26
36
|
ESLINT_PLUGIN_VERSION: opts.eslintPluginVersion ?? ESLINT_PLUGIN_VERSION,
|
|
37
|
+
TEMPLATE_CLI_VERSION: opts.templateCliVersion ?? TEMPLATE_CLI_VERSION,
|
|
27
38
|
});
|
|
28
39
|
await stampTree(join(ASSETS, "template"), join(targetDir, "templates", "starter"), {
|
|
29
40
|
TEMPLATE_KEY: "starter",
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FixtureModule } from "@homepages/template-kit";
|
|
2
|
-
import { luxuryMultiUnit
|
|
2
|
+
import { luxuryMultiUnit } from "@homepages/template-kit/fixtures";
|
|
3
3
|
|
|
4
4
|
// Base content the section is designed for. Nullability coverage (each optional
|
|
5
5
|
// slot rendered empty) is derived automatically from schema.ts — no fixture
|
|
@@ -12,12 +12,12 @@ const fixtures: FixtureModule = {
|
|
|
12
12
|
base: {
|
|
13
13
|
slots: {
|
|
14
14
|
headline: luxuryMultiUnit.facts.address.display,
|
|
15
|
+
// State the asset id, exactly as a saved page does — the preview server
|
|
16
|
+
// resolves it to a URL and a responsive ladder, the same way the API does
|
|
17
|
+
// when the page is published. A fixture never states a URL.
|
|
15
18
|
hero_image: {
|
|
16
19
|
photo_id: heroImage.id,
|
|
17
|
-
url: heroImage.url,
|
|
18
20
|
alt: heroImage.alt,
|
|
19
|
-
// Height set to a 16:9 ratio to match the slot's locked crop.
|
|
20
|
-
responsive: mkResponsive(heroImage.url, 2048, 1152),
|
|
21
21
|
},
|
|
22
22
|
blurb: "A 12-unit mansard Victorian in Jamaica Plain, moments from the Emerald Necklace.",
|
|
23
23
|
},
|
|
@@ -9,9 +9,12 @@ You are authoring HomePages marketing-section templates in this workspace.
|
|
|
9
9
|
- **Templates live in `templates/`.** Each is a plain folder — not an npm package.
|
|
10
10
|
Add one with `npx template-kit new <name>`; add a section with
|
|
11
11
|
`npx template-kit new-section <name>`.
|
|
12
|
-
- **One kit, one version.** `@homepages/template-kit`
|
|
13
|
-
|
|
14
|
-
`
|
|
12
|
+
- **One kit, one version.** `@homepages/template-kit` carries the authoring
|
|
13
|
+
contract every template imports; `@homepages/template-cli` provides the
|
|
14
|
+
`template-kit` command and `@homepages/eslint-plugin-template` the lint preset.
|
|
15
|
+
All three are declared once, at this root, and every template shares them. Do not
|
|
16
|
+
add per-template `package.json`, `tsconfig`, or `eslint` files — there is exactly
|
|
17
|
+
one of each, at this root.
|
|
15
18
|
- **The docs corpus is your whole universe:** `node_modules/@homepages/template-kit/guide/`
|
|
16
19
|
(`llms.txt` is the router). Read it before authoring; do not guess the contract.
|
|
17
20
|
|
|
@@ -7,9 +7,12 @@ You are authoring HomePages marketing-section templates in this workspace.
|
|
|
7
7
|
- **Templates live in `templates/`.** Each is a plain folder — not an npm package.
|
|
8
8
|
Add one with `npx template-kit new <name>`; add a section with
|
|
9
9
|
`npx template-kit new-section <name>`.
|
|
10
|
-
- **One kit, one version.** `@homepages/template-kit`
|
|
11
|
-
|
|
12
|
-
`
|
|
10
|
+
- **One kit, one version.** `@homepages/template-kit` carries the authoring
|
|
11
|
+
contract every template imports; `@homepages/template-cli` provides the
|
|
12
|
+
`template-kit` command and `@homepages/eslint-plugin-template` the lint preset.
|
|
13
|
+
All three are declared once, at this root, and every template shares them. Do not
|
|
14
|
+
add per-template `package.json`, `tsconfig`, or `eslint` files — there is exactly
|
|
15
|
+
one of each, at this root.
|
|
13
16
|
- **The docs corpus is your whole universe:** `node_modules/@homepages/template-kit/guide/`
|
|
14
17
|
(`llms.txt` is the router). Read it before authoring; do not guess the contract.
|
|
15
18
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
# {{WORKSPACE_NAME}}
|
|
2
2
|
|
|
3
|
-
A HomePages template workspace. Templates live in `templates/`. The
|
|
4
|
-
|
|
3
|
+
A HomePages template workspace. Templates live in `templates/`. The toolchain is
|
|
4
|
+
declared once at this root — `@homepages/template-kit` (the authoring contract),
|
|
5
|
+
`@homepages/template-cli` (the `template-kit` command) and
|
|
6
|
+
`@homepages/eslint-plugin-template` (the lint preset) — and shared by every
|
|
7
|
+
template here.
|
|
5
8
|
|
|
6
9
|
## Commands
|
|
7
10
|
|