@koehler8/cms 1.0.0-beta.14 → 1.0.0-beta.16
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/bin/cms-create-site.js +7 -0
- package/package.json +3 -2
- package/scripts/create-site.mjs +11 -0
- package/scripts/scaffold.mjs +55 -19
- package/src/components/Home.vue +8 -52
- package/templates/scaffolds/site/.nvmrc +1 -0
- package/templates/scaffolds/site/CLAUDE.md +121 -0
- package/templates/scaffolds/site/README.md +25 -0
- package/templates/scaffolds/site/amplify.yml +22 -0
- package/templates/scaffolds/site/package.json +26 -0
- package/templates/scaffolds/site/site/assets/img/.gitkeep +0 -0
- package/templates/scaffolds/site/site/components/.gitkeep +0 -0
- package/templates/scaffolds/site/site/content/content.config.json +3 -0
- package/templates/scaffolds/site/site/content/en/pages/home.json +8 -0
- package/templates/scaffolds/site/site/content/en/shared.json +5 -0
- package/templates/scaffolds/site/site/content/en/site.json +7 -0
- package/templates/scaffolds/site/site/style.css +4 -0
- package/templates/scaffolds/site/vite.config.js +15 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
4
|
+
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const scriptPath = path.resolve(__dirname, '..', 'scripts', 'create-site.mjs');
|
|
7
|
+
await import(pathToFileURL(scriptPath).href);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koehler8/cms",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.16",
|
|
4
4
|
"description": "Vertex CMS — lightweight, config-driven Vue 3 framework with theming, extensions, and SSG support",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"cms-validate-themes": "./bin/cms-validate-themes.js",
|
|
50
50
|
"cms-validate-extensions": "./bin/cms-validate-extensions.js",
|
|
51
51
|
"cms-create-theme": "./bin/cms-create-theme.js",
|
|
52
|
-
"cms-create-extension": "./bin/cms-create-extension.js"
|
|
52
|
+
"cms-create-extension": "./bin/cms-create-extension.js",
|
|
53
|
+
"cms-create-site": "./bin/cms-create-site.js"
|
|
53
54
|
},
|
|
54
55
|
"files": [
|
|
55
56
|
"src",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { runScaffold } from './scaffold.mjs';
|
|
2
|
+
|
|
3
|
+
const result = await runScaffold({
|
|
4
|
+
kind: 'site',
|
|
5
|
+
argv: process.argv.slice(2),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
if (result.message) {
|
|
9
|
+
process[result.ok ? 'stdout' : 'stderr'].write(result.message + '\n');
|
|
10
|
+
}
|
|
11
|
+
process.exit(result.ok ? 0 : 1);
|
package/scripts/scaffold.mjs
CHANGED
|
@@ -53,11 +53,16 @@ async function pathExists(p) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
// Files in the template tree that should never be copied into the
|
|
57
|
+
// scaffolded output (OS junk, editor artifacts). Dotfiles in general
|
|
58
|
+
// ARE copied — site templates need .nvmrc, .gitignore, .env.example.
|
|
59
|
+
const TEMPLATE_SKIP = new Set(['.DS_Store', 'Thumbs.db', '.git']);
|
|
60
|
+
|
|
56
61
|
async function collectTemplateFiles(dir) {
|
|
57
62
|
const out = [];
|
|
58
63
|
const entries = await readdir(dir, { withFileTypes: true });
|
|
59
64
|
for (const entry of entries) {
|
|
60
|
-
if (entry.name
|
|
65
|
+
if (TEMPLATE_SKIP.has(entry.name)) continue;
|
|
61
66
|
const full = path.join(dir, entry.name);
|
|
62
67
|
if (entry.isDirectory()) {
|
|
63
68
|
out.push(...(await collectTemplateFiles(full)));
|
|
@@ -86,7 +91,7 @@ function applySubstitutions(content, subs) {
|
|
|
86
91
|
* @returns {Promise<{ok: boolean, slug?: string, targetDir?: string, message?: string}>}
|
|
87
92
|
*/
|
|
88
93
|
export async function runScaffold({ kind, argv, cwd = process.cwd(), frameworkRoot } = {}) {
|
|
89
|
-
if (kind !== 'theme' && kind !== 'extension') {
|
|
94
|
+
if (kind !== 'theme' && kind !== 'extension' && kind !== 'site') {
|
|
90
95
|
return { ok: false, message: `unknown kind: ${kind}` };
|
|
91
96
|
}
|
|
92
97
|
const root = frameworkRoot || defaultFrameworkRoot();
|
|
@@ -115,10 +120,18 @@ export async function runScaffold({ kind, argv, cwd = process.cwd(), frameworkRo
|
|
|
115
120
|
const displayName = toDisplayName(slug);
|
|
116
121
|
const subs = { __SLUG__: slug, __DISPLAY_NAME__: displayName };
|
|
117
122
|
const templateDir = path.join(root, 'templates', 'scaffolds', kind);
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
123
|
+
// Default target dir: themes/<slug>/ for themes, extensions/<slug>/ for
|
|
124
|
+
// extensions, site-<slug>/ (sibling of cwd) for sites — matches the
|
|
125
|
+
// conventional koehler8/site-<slug> repo naming.
|
|
126
|
+
let defaultTarget;
|
|
127
|
+
if (kind === 'site') {
|
|
128
|
+
defaultTarget = path.join(cwd, `site-${slug}`);
|
|
129
|
+
} else if (kind === 'theme') {
|
|
130
|
+
defaultTarget = path.join(cwd, 'themes', slug);
|
|
131
|
+
} else {
|
|
132
|
+
defaultTarget = path.join(cwd, 'extensions', slug);
|
|
133
|
+
}
|
|
134
|
+
const targetDir = args.out ? path.resolve(cwd, args.out) : defaultTarget;
|
|
122
135
|
|
|
123
136
|
if (!(await pathExists(templateDir))) {
|
|
124
137
|
return {
|
|
@@ -153,8 +166,7 @@ export async function runScaffold({ kind, argv, cwd = process.cwd(), frameworkRo
|
|
|
153
166
|
}
|
|
154
167
|
|
|
155
168
|
function successHeader(kind, slug, targetRel) {
|
|
156
|
-
|
|
157
|
-
return `✓ Scaffolded ${kind} "${slug}" → ${targetRel}/ (${fileCount} files)`;
|
|
169
|
+
return `✓ Scaffolded ${kind} "${slug}" → ${targetRel}/`;
|
|
158
170
|
}
|
|
159
171
|
|
|
160
172
|
function nextSteps(kind, slug, targetRel) {
|
|
@@ -173,33 +185,57 @@ function nextSteps(kind, slug, targetRel) {
|
|
|
173
185
|
'',
|
|
174
186
|
].join('\n');
|
|
175
187
|
}
|
|
188
|
+
if (kind === 'extension') {
|
|
189
|
+
return [
|
|
190
|
+
'',
|
|
191
|
+
'Next steps:',
|
|
192
|
+
' 1. Add to your site\'s package.json dependencies:',
|
|
193
|
+
` "cms-ext-${slug}": "file:./${targetRel}"`,
|
|
194
|
+
' 2. Run `npm install` to symlink it into node_modules.',
|
|
195
|
+
' 3. Add to vite.config.js\'s extensions array:',
|
|
196
|
+
` extensions: ['cms-ext-${slug}'],`,
|
|
197
|
+
` 4. Add components to ${targetRel}/components/ as needed (see ${targetRel}/README.md).`,
|
|
198
|
+
` Or, for one-off site-only components, prefer site/components/ instead.`,
|
|
199
|
+
'',
|
|
200
|
+
].join('\n');
|
|
201
|
+
}
|
|
202
|
+
// site
|
|
176
203
|
return [
|
|
177
204
|
'',
|
|
178
205
|
'Next steps:',
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
'
|
|
182
|
-
'
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
`
|
|
206
|
+
` 1. cd ${targetRel}`,
|
|
207
|
+
' 2. nvm use && npm install',
|
|
208
|
+
' 3. npm run dev # Vite dev server on http://localhost:5173',
|
|
209
|
+
' 4. Read CLAUDE.md # navigation guide for "where things go"',
|
|
210
|
+
'',
|
|
211
|
+
'Then start customizing:',
|
|
212
|
+
` - Edit site/content/en/site.json (title, description, theme key)`,
|
|
213
|
+
` - Edit site/content/en/pages/home.json (hero copy, components)`,
|
|
214
|
+
` - Add a theme: npx cms-create-theme <slug>`,
|
|
215
|
+
` - Add a local extension: npx cms-create-extension <slug>`,
|
|
216
|
+
` - Add a one-off Vue component: drop a file in site/components/`,
|
|
186
217
|
'',
|
|
187
218
|
].join('\n');
|
|
188
219
|
}
|
|
189
220
|
|
|
190
221
|
function usage(kind) {
|
|
191
|
-
const
|
|
192
|
-
const
|
|
222
|
+
const cmds = { theme: 'cms-create-theme', extension: 'cms-create-extension', site: 'cms-create-site' };
|
|
223
|
+
const cmd = cmds[kind];
|
|
224
|
+
const defaultDir = {
|
|
225
|
+
theme: './themes/<slug>/',
|
|
226
|
+
extension: './extensions/<slug>/',
|
|
227
|
+
site: './site-<slug>/',
|
|
228
|
+
}[kind];
|
|
193
229
|
return `
|
|
194
230
|
Usage: npx ${cmd} <slug> [--out <directory>] [--force]
|
|
195
231
|
|
|
196
|
-
Scaffolds a new @koehler8/cms ${kind} into the current
|
|
232
|
+
Scaffolds a new @koehler8/cms ${kind} into the current directory.
|
|
197
233
|
|
|
198
234
|
Arguments:
|
|
199
235
|
<slug> Lowercase kebab-case slug (e.g. "coastal", "lush-canopy").
|
|
200
236
|
|
|
201
237
|
Options:
|
|
202
|
-
--out <dir> Where to create the ${kind}. Defaults to
|
|
238
|
+
--out <dir> Where to create the ${kind}. Defaults to ${defaultDir}.
|
|
203
239
|
--force Overwrite an existing target directory.
|
|
204
240
|
-h, --help Show this message.
|
|
205
241
|
`;
|
package/src/components/Home.vue
CHANGED
|
@@ -10,21 +10,6 @@
|
|
|
10
10
|
:key="entry.key"
|
|
11
11
|
v-bind="entry.props"
|
|
12
12
|
/>
|
|
13
|
-
<div
|
|
14
|
-
v-if="showLoadingIndicator"
|
|
15
|
-
class="page-loading-placeholder"
|
|
16
|
-
role="status"
|
|
17
|
-
aria-live="polite"
|
|
18
|
-
>
|
|
19
|
-
Loading…
|
|
20
|
-
</div>
|
|
21
|
-
<div
|
|
22
|
-
v-else-if="loadErrorMessage"
|
|
23
|
-
class="page-error-message"
|
|
24
|
-
role="alert"
|
|
25
|
-
>
|
|
26
|
-
{{ loadErrorMessage }}
|
|
27
|
-
</div>
|
|
28
13
|
</main>
|
|
29
14
|
<ComingSoonModal
|
|
30
15
|
:open="isComingSoonVisible"
|
|
@@ -35,7 +20,7 @@
|
|
|
35
20
|
</template>
|
|
36
21
|
|
|
37
22
|
<script setup>
|
|
38
|
-
import { computed, nextTick,
|
|
23
|
+
import { computed, nextTick, provide, watch } from 'vue';
|
|
39
24
|
|
|
40
25
|
import ComingSoonModal from '../components/ComingSoonModal.vue';
|
|
41
26
|
import IntroGate from '../components/IntroGate.vue';
|
|
@@ -106,25 +91,13 @@ provide('pageContent', pageContent);
|
|
|
106
91
|
provide('pageConfig', currentPage);
|
|
107
92
|
provide('currentPageId', computed(() => currentPage.value.id));
|
|
108
93
|
|
|
109
|
-
//
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
nextTick().then(() => {
|
|
117
|
-
isHydrating.value = false;
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
const showLoadingIndicator = computed(() =>
|
|
122
|
-
!isHydrating.value &&
|
|
123
|
-
isLoading.value &&
|
|
124
|
-
componentKeys.value.length === 0 &&
|
|
125
|
-
!loadError.value
|
|
126
|
-
);
|
|
127
|
-
const loadErrorMessage = computed(() => loadError.value ? (loadError.value.message || 'Unable to load page content.') : '');
|
|
94
|
+
// Loading + error state are exposed via inject so sites can build their
|
|
95
|
+
// own preloader / error surface as a component (e.g. site/components/
|
|
96
|
+
// Preloader.vue or the bundled Preloader). Home itself no longer renders
|
|
97
|
+
// any built-in placeholder UI — sites that want one opt in by listing a
|
|
98
|
+
// preloader component in their pages/{pageId}.json `components[]`.
|
|
99
|
+
provide('pageIsLoading', isLoading);
|
|
100
|
+
provide('pageLoadError', loadError);
|
|
128
101
|
|
|
129
102
|
watch(componentKeys, async () => {
|
|
130
103
|
await nextTick();
|
|
@@ -142,20 +115,3 @@ watch(
|
|
|
142
115
|
);
|
|
143
116
|
</script>
|
|
144
117
|
|
|
145
|
-
<style scoped>
|
|
146
|
-
.page-loading-placeholder,
|
|
147
|
-
.page-error-message {
|
|
148
|
-
display: flex;
|
|
149
|
-
align-items: center;
|
|
150
|
-
justify-content: center;
|
|
151
|
-
min-height: 40vh;
|
|
152
|
-
font-size: 1.125rem;
|
|
153
|
-
font-weight: 600;
|
|
154
|
-
color: #111;
|
|
155
|
-
text-align: center;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.page-error-message {
|
|
159
|
-
color: #b00020;
|
|
160
|
-
}
|
|
161
|
-
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
20.19.0
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# site-__SLUG__
|
|
2
|
+
|
|
3
|
+
(staging URL TBD)
|
|
4
|
+
|
|
5
|
+
A site built on the [`@koehler8/cms`](https://github.com/koehler8/cms) framework. **Owner: TBD.** This file is auto-loaded by Claude Code in this directory — read it before making changes.
|
|
6
|
+
|
|
7
|
+
## Project status
|
|
8
|
+
|
|
9
|
+
Freshly scaffolded via `npx cms-create-site`. Home page renders the bundled `Header` + `Hero` + `Footer` components with placeholder copy. No theme, extension, or custom components yet — see "Where things go" below for the path each new addition should take.
|
|
10
|
+
|
|
11
|
+
## Working with the site owner
|
|
12
|
+
|
|
13
|
+
Assume the owner is not a developer unless you know otherwise. Default behaviors:
|
|
14
|
+
|
|
15
|
+
- Explain trade-offs in plain language; propose options, don't present decisions.
|
|
16
|
+
- Confirm before structural or visual changes that will be hard to reverse.
|
|
17
|
+
- Push small, reviewable changes frequently and verify on the live URL.
|
|
18
|
+
- Don't over-engineer — most requests can be satisfied by editing `pages/*.json` + bundled CMS components. Reach for a custom Vue component only when the bundled set clearly can't do the job.
|
|
19
|
+
|
|
20
|
+
## Where things go (the navigation guide)
|
|
21
|
+
|
|
22
|
+
| Goal | Where |
|
|
23
|
+
|---|---|
|
|
24
|
+
| Edit page copy / hero text / section content | `site/content/{locale}/pages/{pageId}.json` under `content.{configKey}.*` keys |
|
|
25
|
+
| Edit site title, theme key, support email | `site/content/{locale}/site.json` |
|
|
26
|
+
| Edit header logo text, nav items, footer flags | `site/content/{locale}/shared.json` |
|
|
27
|
+
| Add a translation | Mirror the keys you want to override into `site/content/{otherLocale}/...` (only set the keys that differ — the rest inherit from the base locale) |
|
|
28
|
+
| Add an asset (image, icon) | `site/assets/img/...`. Reference it from a component via `resolveAsset('img/foo.png')` or a URL string in content (`"img/foo.png"`) |
|
|
29
|
+
| Override the favicon | Drop a real `.ico` at `site/favicon.ico`; the `cms-generate-public-assets` script picks it up |
|
|
30
|
+
| Add a one-off Vue component (this site only) | `site/components/Foo.vue`. Auto-globbed by the CMS — reference it as `"Foo"` in any page's `components[]`. Read content via `inject('pageContent')`, use `<style scoped>` with `var(--brand-*)` tokens. |
|
|
31
|
+
| Add a component intended to be reused on other sites | The local extension at `extensions/<slug>/`. Add `components/Foo.vue`, register it in `extension.config.json`, and add a dynamic import to `index.js`. Eventually publishable as `@koehler8/cms-ext-<slug>`. |
|
|
32
|
+
| Customize colors, typography, surfaces | `themes/<slug>/theme.config.js`. The CMS regenerates `virtual:cms-theme-vars.css` from the manifest on next build; CMS components consume the vars via `var(--brand-*)`. |
|
|
33
|
+
| Activate a theme | Set `"theme": "<slug>"` in `site/content/{baseLocale}/site.json`. |
|
|
34
|
+
| Add a new page | Create `site/content/{locale}/pages/{pageId}.json` with a `path` and `components[]` array. vite-ssg pre-renders one HTML file per page automatically. |
|
|
35
|
+
| Add a new locale | Create `site/content/{locale}/...` mirroring the base locale's structure. Auto-discovered. |
|
|
36
|
+
| Add a new theme to the project | `npx cms-create-theme <slug>` (scaffolds `themes/<slug>/`, then follow the printed next-steps). |
|
|
37
|
+
| Add a new local extension | `npx cms-create-extension <slug>`. |
|
|
38
|
+
|
|
39
|
+
If you find yourself writing a component that conceptually belongs in a "regions" or "agents" or "podcasts" sister site, **promote it from `site/components/` into `extensions/<slug>/`** so it can eventually become a published shared package.
|
|
40
|
+
|
|
41
|
+
## Stack at a glance
|
|
42
|
+
|
|
43
|
+
- `@koehler8/cms` ^1.0.0-beta.15+ — Vue 3 + vite-ssg framework
|
|
44
|
+
- `@koehler8/cms-ext-compliance` — cookie banner / legal pages (registered by default)
|
|
45
|
+
- `[site/components/](site/components/)` — auto-globbed Vue files for one-off custom UI specific to this site. **The default home for new components.**
|
|
46
|
+
- `[themes/](themes/)`, `[extensions/](extensions/)` — currently empty. Add via the `cms-create-{theme,extension}` CLIs above.
|
|
47
|
+
|
|
48
|
+
## File layout
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
site/content/{locale}/ per-locale content (auto-discovered)
|
|
52
|
+
site.json site title, description, theme key, support email
|
|
53
|
+
shared.json cross-page settings — header logo / nav, footer flags
|
|
54
|
+
pages/{pageId}.json per-page components[] + content.{configKey}.* keys
|
|
55
|
+
pages/home.json home page (the only page in a freshly scaffolded site)
|
|
56
|
+
site/components/ auto-globbed Vue files (the default home for one-off
|
|
57
|
+
custom UI). Reference by basename in components[].
|
|
58
|
+
site/assets/img/ site-specific images / icons
|
|
59
|
+
site/style.css non-critical site overrides (loaded async by the CMS;
|
|
60
|
+
fine for things that wouldn't cause a visible flash)
|
|
61
|
+
site/favicon.ico optional override; `cms-generate-public-assets`
|
|
62
|
+
picks it up over the auto-generated letter-favicon
|
|
63
|
+
themes/<slug>/ site-local CMS theme — destined to lift into a
|
|
64
|
+
standalone @koehler8/cms-theme-<slug> repo
|
|
65
|
+
extensions/<slug>/ site-local CMS extension — destined to lift into a
|
|
66
|
+
standalone @koehler8/cms-ext-<slug> repo
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Common tasks (quick recipes)
|
|
70
|
+
|
|
71
|
+
### Edit hero / footer copy
|
|
72
|
+
Open `site/content/{baseLocale}/pages/home.json`. Hero text lives under `content.promo.*`; footer text under `content.footer.*` (or whatever configKey the components use). Push and the deploy pipeline picks it up.
|
|
73
|
+
|
|
74
|
+
### Edit nav links
|
|
75
|
+
`site/content/{baseLocale}/shared.json` → `content.header.navItems[N]`. Each entry is `{ text, href, target? }`. Add `"target": "_blank"` for off-site links.
|
|
76
|
+
|
|
77
|
+
### Add a custom component
|
|
78
|
+
1. Create `site/components/Foo.vue`.
|
|
79
|
+
2. `inject('pageContent')` for content; `<style scoped>` with `var(--brand-*)` tokens.
|
|
80
|
+
3. Reference as `"Foo"` in any page's `components[]`.
|
|
81
|
+
|
|
82
|
+
### Add a new page
|
|
83
|
+
1. Create `site/content/{baseLocale}/pages/{pageId}.json` with a `path` (e.g. `/about`) and `components[]`.
|
|
84
|
+
2. Add a `navItems` entry pointing at the new path in `shared.json` if it should be in the nav.
|
|
85
|
+
3. Push — vite-ssg generates `dist/{path}/index.html` automatically.
|
|
86
|
+
|
|
87
|
+
### Change colors / typography
|
|
88
|
+
Edit `themes/<slug>/theme.config.js`. The CMS regenerates `virtual:cms-theme-vars.css` from the manifest on next build; CMS components and your custom components consume the vars via `var(--brand-*)`, so the change cascades.
|
|
89
|
+
|
|
90
|
+
## Lockfile and npm version — read before bumping any dep
|
|
91
|
+
|
|
92
|
+
This project pins **Node 20.19 / npm 10.8** to match AWS Amplify exactly. Local installs with a different npm version produce subtly different lockfiles that look fine locally but break CI.
|
|
93
|
+
|
|
94
|
+
Two failure modes seen on sister sites:
|
|
95
|
+
1. `Cannot find module '@rolldown/binding-linux-x64-gnu'` — npm 11 regen stripped optional-dep entries Amplify needs.
|
|
96
|
+
2. `npm ci ... Missing: @types/react@..., @noble/hashes@... from lock file` — npm 11 omitted entries npm 10 expects.
|
|
97
|
+
|
|
98
|
+
Rules:
|
|
99
|
+
- **Always run `nvm use` before `npm install`**. `.nvmrc` pins 20.19.0 (which ships npm 10.8.x).
|
|
100
|
+
- **Prefer targeted bumps**: `npm install <pkg>@<ver> --no-audit --no-fund`. **Never** `rm package-lock.json && npm install` unless you're on the pinned npm version.
|
|
101
|
+
- **The build uses `npm install`**, not `npm ci` (see `amplify.yml`) for drift tolerance.
|
|
102
|
+
|
|
103
|
+
## Local dev
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
nvm use
|
|
107
|
+
cp .env.example .env # placeholder values; not used by default
|
|
108
|
+
npm install
|
|
109
|
+
npm run dev # Vite dev server on http://localhost:5173
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Build:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npm run generate:public-assets # generates favicon/og-image from site.json
|
|
116
|
+
npm run build:ssg # pre-renders dist/{locale}/{page}/index.html
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Deploy
|
|
120
|
+
|
|
121
|
+
Pushes to `main` trigger an automatic AWS Amplify build per `amplify.yml`. Set up the Amplify app + custom domain via the AWS console (or `aws amplify create-app` + `create-domain-association`) — see the existing sister sites' setup notes if available, or the koehler8 site repos as reference.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# site-__SLUG__
|
|
2
|
+
|
|
3
|
+
A site built on [`@koehler8/cms`](https://github.com/koehler8/cms).
|
|
4
|
+
|
|
5
|
+
For architecture, conventions, and a navigation guide for "where things go" (content, components, themes, extensions), read **[CLAUDE.md](CLAUDE.md)**.
|
|
6
|
+
|
|
7
|
+
## Local development
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
nvm use # Node 20.19.0 per .nvmrc
|
|
11
|
+
cp .env.example .env
|
|
12
|
+
npm install
|
|
13
|
+
npm run dev
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Build
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm run generate:public-assets
|
|
20
|
+
npm run build:ssg
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Deployment
|
|
24
|
+
|
|
25
|
+
Pushes to `main` trigger an automatic AWS Amplify build (see [amplify.yml](amplify.yml)).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
version: 1
|
|
2
|
+
frontend:
|
|
3
|
+
phases:
|
|
4
|
+
preBuild:
|
|
5
|
+
commands:
|
|
6
|
+
- nvm install 20.19.0 && nvm use 20.19.0
|
|
7
|
+
# Use `npm install` (not `npm ci`) so the build tolerates
|
|
8
|
+
# lockfile/npm-version drift. See CLAUDE.md → "Lockfile and
|
|
9
|
+
# npm version" for the rationale.
|
|
10
|
+
- npm install --prefer-offline --no-audit --no-fund
|
|
11
|
+
- npm run generate:public-assets
|
|
12
|
+
build:
|
|
13
|
+
commands:
|
|
14
|
+
- npm run build:ssg
|
|
15
|
+
artifacts:
|
|
16
|
+
baseDirectory: dist
|
|
17
|
+
files:
|
|
18
|
+
- '**/*'
|
|
19
|
+
cache:
|
|
20
|
+
paths:
|
|
21
|
+
- node_modules/**/*
|
|
22
|
+
- .npm/**/*
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@koehler8/site-__SLUG__",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"build:ssg": "vite-ssg build",
|
|
10
|
+
"preview": "vite preview",
|
|
11
|
+
"generate:public-assets": "cms-generate-public-assets --site-dir ./site"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@koehler8/cms": "^1.0.0-beta.15",
|
|
15
|
+
"@koehler8/cms-ext-compliance": "^1.0.0-beta.4",
|
|
16
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
17
|
+
"vite": "^8.0.3",
|
|
18
|
+
"vite-ssg": "^28.2.2",
|
|
19
|
+
"vue": "^3.5.22",
|
|
20
|
+
"vue-router": "^5.0.4"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20.19.0",
|
|
24
|
+
"npm": "^10.8.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import cms from '@koehler8/cms/vite';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
plugins: cms({
|
|
5
|
+
siteDir: './site',
|
|
6
|
+
// Add local themes (created via `npx cms-create-theme <slug>`) here:
|
|
7
|
+
// themes: ['cms-theme-<slug>'],
|
|
8
|
+
// Then activate by setting `"theme": "<slug>"` in site.json.
|
|
9
|
+
extensions: [
|
|
10
|
+
'@koehler8/cms-ext-compliance',
|
|
11
|
+
// Add local extensions (created via `npx cms-create-extension <slug>`) here:
|
|
12
|
+
// 'cms-ext-<slug>',
|
|
13
|
+
],
|
|
14
|
+
}),
|
|
15
|
+
};
|