create-hlou-site 0.1.0 → 0.1.2
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 +7 -5
- package/index.mjs +5 -3
- package/lib/spec.mjs +43 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,11 +17,13 @@ It asks for the site's name, its source locale and its other locales, then:
|
|
|
17
17
|
Next.js static-export template every Hlou site is built from;
|
|
18
18
|
- writes an empty **site spec** in `hlou/site/`: `site.json` (locales, theme,
|
|
19
19
|
the site's name), `pages/home.json`, `content/<locale>.json`;
|
|
20
|
-
- names Hlou's Claude Code plugin marketplace in `.claude/settings.json`
|
|
21
|
-
|
|
20
|
+
- names Hlou's Claude Code plugin marketplace in `.claude/settings.json` and
|
|
21
|
+
enables its Figma plugin, so Claude Code offers to install it when you trust
|
|
22
|
+
the folder (otherwise: `/plugin marketplace add hloudev/hlou-claude-plugins`,
|
|
23
|
+
then `/plugin install hlou-figma-handoff@hlou-claude-plugins`).
|
|
22
24
|
|
|
23
|
-
Then ask your agent for pages — the starter's `AGENTS.md` and
|
|
24
|
-
|
|
25
|
+
Then ask your agent for pages — it reads the starter's `AGENTS.md` and
|
|
26
|
+
`.claude/skills/` on its own — and bring the site to Hlou with `pnpm hlou:pack` and
|
|
25
27
|
**New project › Import**. The starter's README says more.
|
|
26
28
|
|
|
27
29
|
## Options
|
|
@@ -33,7 +35,7 @@ create-hlou-site [folder] [options]
|
|
|
33
35
|
--locale <tag> the source locale, e.g. fr (default fr)
|
|
34
36
|
--locales <tags> the other locales, comma-separated, e.g. en,ar
|
|
35
37
|
--yes, -y ask nothing: the defaults for whatever is missing
|
|
36
|
-
--no-plugin-hint leave .claude/settings.json as the starter has it
|
|
38
|
+
--no-plugin-hint leave .claude/settings.json as the starter has it (no plugin)
|
|
37
39
|
--from <path|url> a local starter folder or .tar.gz instead of the pinned release
|
|
38
40
|
--ref <commit> another commit of hloudev/hlou-starter-next
|
|
39
41
|
```
|
package/index.mjs
CHANGED
|
@@ -25,6 +25,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
25
25
|
|
|
26
26
|
import {
|
|
27
27
|
emptySpec,
|
|
28
|
+
FIGMA_PLUGIN,
|
|
28
29
|
parseLocales,
|
|
29
30
|
PLUGIN_MARKETPLACE,
|
|
30
31
|
sitePackageJson,
|
|
@@ -209,11 +210,12 @@ export async function createSite(args, log = (line) => stdout.write(`${line}\n`)
|
|
|
209
210
|
log(' pnpm install # pnpm 10 (corepack enable), Node 24');
|
|
210
211
|
log(' pnpm dev # compiles hlou/site/ and serves http://localhost:3000');
|
|
211
212
|
log('');
|
|
212
|
-
log('Then ask your agent for pages: AGENTS.md and .claude/skills/
|
|
213
|
+
log('Then ask your agent for pages: it reads AGENTS.md and .claude/skills/ on its own.');
|
|
213
214
|
if (args.pluginHint) {
|
|
214
|
-
log('
|
|
215
|
+
log('Claude Code offers Hlou’s Figma plugin (Figma → spec) when you trust the folder;');
|
|
216
|
+
log('if it does not:');
|
|
215
217
|
log(` /plugin marketplace add ${PLUGIN_MARKETPLACE.repo}`);
|
|
216
|
-
log(` /plugin install
|
|
218
|
+
log(` /plugin install ${FIGMA_PLUGIN}`);
|
|
217
219
|
}
|
|
218
220
|
log('When it is ready: pnpm hlou:pack, then Hlou › New project › Import.');
|
|
219
221
|
return target;
|
package/lib/spec.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* The empty site spec a new Hlou site starts from (format 1, decision 219):
|
|
3
3
|
* the locales, a neutral theme, the site's name in the `site.name` slot and
|
|
4
|
-
* one home page
|
|
4
|
+
* one home page whose hero shows that name, so the first `pnpm dev` draws
|
|
5
|
+
* something. Pure: options in, files out.
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
8
|
/** A language tag as the spec reads it (`fr`, `en-GB`, `ar-TN`). */
|
|
@@ -116,11 +117,43 @@ export function emptySpec({ name, locales }) {
|
|
|
116
117
|
title: homeTitle(source),
|
|
117
118
|
position: 0,
|
|
118
119
|
status: 'ready',
|
|
119
|
-
sections: [
|
|
120
|
+
sections: [
|
|
121
|
+
{
|
|
122
|
+
key: 'hero',
|
|
123
|
+
label: 'Hero',
|
|
124
|
+
slots: [{ key: 'hero.title', kind: 'heading' }],
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
document: {
|
|
128
|
+
root: 'root',
|
|
129
|
+
rootProps: {},
|
|
130
|
+
nodes: {
|
|
131
|
+
root: { id: 'root', type: 'root', parent: null, slot: '', order: 'a0', props: {} },
|
|
132
|
+
'hero-home': {
|
|
133
|
+
id: 'hero-home',
|
|
134
|
+
type: 'hero',
|
|
135
|
+
parent: 'root',
|
|
136
|
+
slot: 'content',
|
|
137
|
+
order: 'a0',
|
|
138
|
+
role: 'hero',
|
|
139
|
+
section: 'hero',
|
|
140
|
+
props: {
|
|
141
|
+
eyebrow: '',
|
|
142
|
+
title: { $slot: 'hero.title' },
|
|
143
|
+
description: { type: 'doc', content: [] },
|
|
144
|
+
buttons: [],
|
|
145
|
+
align: 'start',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
120
150
|
}),
|
|
121
151
|
[`hlou/site/content/${source}.json`]: json({
|
|
122
152
|
$schema: '../../../renderer/spec/json-schema/content.schema.json',
|
|
123
|
-
values: {
|
|
153
|
+
values: {
|
|
154
|
+
'site/site.name': { kind: 'text', text: name },
|
|
155
|
+
'home/hero.title': { kind: 'heading', text: name },
|
|
156
|
+
},
|
|
124
157
|
}),
|
|
125
158
|
};
|
|
126
159
|
}
|
|
@@ -131,10 +164,13 @@ export const PLUGIN_MARKETPLACE = {
|
|
|
131
164
|
repo: 'hloudev/hlou-claude-plugins',
|
|
132
165
|
};
|
|
133
166
|
|
|
167
|
+
/** The plugin the scaffold enables: Figma → the site spec. */
|
|
168
|
+
export const FIGMA_PLUGIN = `hlou-figma-handoff@${PLUGIN_MARKETPLACE.name}`;
|
|
169
|
+
|
|
134
170
|
/**
|
|
135
|
-
* `.claude/settings.json` with Hlou's plugin marketplace known
|
|
136
|
-
*
|
|
137
|
-
* any; nothing in it is dropped.
|
|
171
|
+
* `.claude/settings.json` with Hlou's plugin marketplace known and its Figma
|
|
172
|
+
* plugin enabled: Claude Code offers to install both when the folder is
|
|
173
|
+
* trusted. `existing` is the starter's file, if any; nothing in it is dropped.
|
|
138
174
|
*/
|
|
139
175
|
export function withPluginMarketplace(existing) {
|
|
140
176
|
const settings = existing && typeof existing === 'object' ? { ...existing } : {};
|
|
@@ -144,6 +180,7 @@ export function withPluginMarketplace(existing) {
|
|
|
144
180
|
source: { source: 'github', repo: PLUGIN_MARKETPLACE.repo },
|
|
145
181
|
},
|
|
146
182
|
};
|
|
183
|
+
settings.enabledPlugins = { ...(settings.enabledPlugins ?? {}), [FIGMA_PLUGIN]: true };
|
|
147
184
|
return settings;
|
|
148
185
|
}
|
|
149
186
|
|