sandcms 0.5.2 → 0.5.3
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 +2 -2
- package/dist/admin/Navigation.svelte +62 -0
- package/dist/admin/Navigation.svelte.d.ts +7 -0
- package/dist/admin/Shell.svelte +12 -22
- package/dist/admin/generated/admin.css +36 -0
- package/dist/admin/navigation.d.ts +7 -0
- package/dist/admin/navigation.js +25 -0
- package/dist/blueprints/load.js +4 -0
- package/dist/blueprints/types.d.ts +3 -0
- package/dist/cli/files.js +1 -1
- package/dist/server/admin-load.d.ts +18 -0
- package/docs/acceptance.md +1 -1
- package/docs/content.md +19 -1
- package/docs/email.md +3 -3
- package/docs/media.md +1 -1
- package/docs/package.md +5 -5
- package/docs/releases.md +10 -0
- package/docs/upgrades.md +4 -0
- package/package.json +1 -1
- package/templates/hooks.server.ts +1 -1
- package/templates/integration.ts +1 -1
- package/templates/routes/admin/+page.server.ts +1 -1
- package/templates/routes/admin/+page.svelte +1 -1
- package/templates/routes/api/+server.ts +1 -1
- package/templates/sandcms/blueprints/pages/home.yaml +2 -0
- package/templates/sandcms/worker/index.ts +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# SandCMS
|
|
2
2
|
|
|
3
|
-
**0.5.
|
|
3
|
+
**0.5.3** adds collapsible blueprint navigation groups. Pages are grouped by default; blueprints can choose a custom group or stay at the top level. Existing YAML and stored data are preserved, with no new database migration. See the [0.5.3 release notes](docs/releases.md#053), [upgrade workflow](docs/upgrades.md) and [agent instructions](AGENTS.md).
|
|
4
4
|
|
|
5
5
|
SandCMS embeds a content workspace into a SvelteKit website. Developers own YAML blueprints and public routes; editors manage drafts, publication, images, and form submissions at `/admin`.
|
|
6
6
|
|
|
7
|
-
This repository contains the
|
|
7
|
+
This repository contains the `sandcms` package and a working example website. The private npm package includes the CMS, the `sandcms` CLI, and a minimal SvelteKit starter. See [publishing from macOS](docs/package.md#publish-from-macos) for release commands.
|
|
8
8
|
|
|
9
9
|
## Run locally
|
|
10
10
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { afterNavigate } from '$app/navigation';
|
|
3
|
+
import { page } from '$app/state';
|
|
4
|
+
import { Icon } from '@lucide/svelte';
|
|
5
|
+
import Folder from '@lucide/svelte/icons/folder';
|
|
6
|
+
import ChevronRight from '@lucide/svelte/icons/chevron-right';
|
|
7
|
+
import type { AdminData } from './types.js';
|
|
8
|
+
import { blueprintHref, navigationGroups, navigationSelected } from './navigation.js';
|
|
9
|
+
|
|
10
|
+
let { blueprints }: { blueprints: NonNullable<AdminData['blueprints']> } = $props();
|
|
11
|
+
const id = $props.id();
|
|
12
|
+
const items = $derived(navigationGroups(blueprints));
|
|
13
|
+
let expanded = $state(new Map<string, boolean>());
|
|
14
|
+
const active = (b: (typeof blueprints)[number]) =>
|
|
15
|
+
navigationSelected(page.url.pathname, blueprintHref(b));
|
|
16
|
+
afterNavigate(() => {
|
|
17
|
+
for (const item of items) {
|
|
18
|
+
if (item.group !== false && item.blueprints.some(active)) {
|
|
19
|
+
expanded = new Map(expanded).set(item.group, true);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
{#snippet links(entries: typeof blueprints)}
|
|
26
|
+
{#each entries as b (b.id)}
|
|
27
|
+
<a
|
|
28
|
+
href={blueprintHref(b)}
|
|
29
|
+
class:active={active(b)}
|
|
30
|
+
aria-current={active(b) ? 'page' : undefined}
|
|
31
|
+
>
|
|
32
|
+
<Icon icon={b.navigationIcon} size={17} />{b.label}
|
|
33
|
+
</a>
|
|
34
|
+
{/each}
|
|
35
|
+
{/snippet}
|
|
36
|
+
|
|
37
|
+
{#each items as item, index}
|
|
38
|
+
{#if item.group === false}
|
|
39
|
+
{@render links(item.blueprints)}
|
|
40
|
+
{:else}
|
|
41
|
+
{@const group = item.group}
|
|
42
|
+
{@const isActive = item.blueprints.some(active)}
|
|
43
|
+
{@const isExpanded = expanded.get(group) ?? isActive}
|
|
44
|
+
<button
|
|
45
|
+
type="button"
|
|
46
|
+
class="cms-nav-group"
|
|
47
|
+
class:cms-nav-group-active={isActive}
|
|
48
|
+
aria-expanded={isExpanded}
|
|
49
|
+
aria-controls={`${id}-${index}`}
|
|
50
|
+
onclick={() => (expanded = new Map(expanded).set(group, !isExpanded))}
|
|
51
|
+
>
|
|
52
|
+
<Folder size={17} />{group}
|
|
53
|
+
<ChevronRight
|
|
54
|
+
size={14}
|
|
55
|
+
class={isExpanded ? 'cms-nav-chevron cms-nav-chevron-open' : 'cms-nav-chevron'}
|
|
56
|
+
/>
|
|
57
|
+
</button>
|
|
58
|
+
<div id={`${id}-${index}`} class="cms-nav-children" hidden={!isExpanded}>
|
|
59
|
+
{@render links(item.blueprints)}
|
|
60
|
+
</div>
|
|
61
|
+
{/if}
|
|
62
|
+
{/each}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AdminData } from './types.js';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
blueprints: NonNullable<AdminData['blueprints']>;
|
|
4
|
+
};
|
|
5
|
+
declare const Navigation: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type Navigation = ReturnType<typeof Navigation>;
|
|
7
|
+
export default Navigation;
|
package/dist/admin/Shell.svelte
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { authClient } from './client.js';
|
|
7
7
|
import { Button } from './components/ui/button/index.js';
|
|
8
8
|
import * as Avatar from './components/ui/avatar/index.js';
|
|
9
|
-
import
|
|
9
|
+
import Navigation from './Navigation.svelte';
|
|
10
10
|
import Layers from '@lucide/svelte/icons/layers';
|
|
11
11
|
import LayoutDashboard from '@lucide/svelte/icons/layout-dashboard';
|
|
12
12
|
import Image from '@lucide/svelte/icons/image';
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
let open = $state(false);
|
|
18
18
|
afterNavigate(() => (open = false));
|
|
19
19
|
const selected = (href: string) =>
|
|
20
|
-
href === '/admin'
|
|
20
|
+
href === '/admin'
|
|
21
|
+
? String(page.url.pathname) === '/admin'
|
|
22
|
+
: page.url.pathname === href || page.url.pathname.startsWith(href + '/');
|
|
21
23
|
async function logout() {
|
|
22
24
|
const result = await authClient.signOut();
|
|
23
25
|
if (!result.error) window.location.assign('/admin/login');
|
|
@@ -36,30 +38,18 @@
|
|
|
36
38
|
<nav aria-label="Admin navigation">
|
|
37
39
|
<a href="/admin" class:active={selected('/admin')}><LayoutDashboard size={17} /> Overview</a>
|
|
38
40
|
<p class="cms-nav-label">CONTENT</p>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
{#each data.blueprints?.filter((b) => b.kind === 'collection') ?? [] as b}<a
|
|
45
|
-
href={'/admin/content/' + b.id}
|
|
46
|
-
class:active={selected('/admin/content/' + b.id)}
|
|
47
|
-
><Icon icon={b.navigationIcon} size={17} />{b.label}</a
|
|
48
|
-
>{/each}
|
|
41
|
+
<Navigation
|
|
42
|
+
blueprints={(data.blueprints ?? []).filter(
|
|
43
|
+
(b) => b.kind === 'page' || b.kind === 'collection'
|
|
44
|
+
)}
|
|
45
|
+
/>
|
|
49
46
|
<a href="/admin/media" class:active={selected('/admin/media')}
|
|
50
47
|
><Image size={17} /> Media library</a
|
|
51
48
|
>
|
|
52
49
|
<p class="cms-nav-label">WORKSPACE</p>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
><Icon icon={b.navigationIcon} size={17} />{b.label}</a
|
|
57
|
-
>{/each}
|
|
58
|
-
{#each data.blueprints?.filter((b) => b.kind === 'site') ?? [] as b}<a
|
|
59
|
-
href={'/admin/content/' + b.id}
|
|
60
|
-
class:active={selected('/admin/content/' + b.id)}
|
|
61
|
-
><Icon icon={b.navigationIcon} size={17} />{b.label}</a
|
|
62
|
-
>{/each}
|
|
50
|
+
<Navigation
|
|
51
|
+
blueprints={(data.blueprints ?? []).filter((b) => b.kind === 'form' || b.kind === 'site')}
|
|
52
|
+
/>
|
|
63
53
|
{#if data.user?.role === 'admin'}<a
|
|
64
54
|
href="/admin/users"
|
|
65
55
|
class:active={selected('/admin/users')}><Users size={17} /> Users</a
|
|
@@ -2436,6 +2436,42 @@
|
|
|
2436
2436
|
gap: 10px;
|
|
2437
2437
|
padding: 16px 8px 6px;
|
|
2438
2438
|
}
|
|
2439
|
+
.cms-nav-group {
|
|
2440
|
+
display: flex;
|
|
2441
|
+
width: 100%;
|
|
2442
|
+
align-items: center;
|
|
2443
|
+
gap: 11px;
|
|
2444
|
+
padding: 9px 10px;
|
|
2445
|
+
margin: 3px 0;
|
|
2446
|
+
color: var(--sandcms-muted-foreground);
|
|
2447
|
+
font-size: 12px;
|
|
2448
|
+
text-align: left;
|
|
2449
|
+
cursor: pointer;
|
|
2450
|
+
}
|
|
2451
|
+
.cms-nav-group:hover {
|
|
2452
|
+
background: var(--sandcms-accent);
|
|
2453
|
+
color: var(--sandcms-foreground);
|
|
2454
|
+
}
|
|
2455
|
+
.cms-nav-group:focus-visible {
|
|
2456
|
+
outline: 2px solid var(--sandcms-ring);
|
|
2457
|
+
outline-offset: -2px;
|
|
2458
|
+
}
|
|
2459
|
+
.cms-nav-group-active {
|
|
2460
|
+
color: var(--sandcms-primary);
|
|
2461
|
+
font-weight: 550;
|
|
2462
|
+
}
|
|
2463
|
+
.cms-nav-chevron {
|
|
2464
|
+
margin-left: auto;
|
|
2465
|
+
flex-shrink: 0;
|
|
2466
|
+
}
|
|
2467
|
+
.cms-nav-chevron-open {
|
|
2468
|
+
transform: rotate(90deg);
|
|
2469
|
+
}
|
|
2470
|
+
.cms-nav-children {
|
|
2471
|
+
margin-left: 18px;
|
|
2472
|
+
border-left: 1px solid var(--sandcms-border);
|
|
2473
|
+
padding-left: 5px;
|
|
2474
|
+
}
|
|
2439
2475
|
.cms-main {
|
|
2440
2476
|
margin-left: 244px;
|
|
2441
2477
|
flex: 1;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Blueprint } from '../blueprints/types.js';
|
|
2
|
+
export declare function navigationGroups<T extends Blueprint>(blueprints: T[]): {
|
|
3
|
+
group: string | false;
|
|
4
|
+
blueprints: T[];
|
|
5
|
+
}[];
|
|
6
|
+
export declare const blueprintHref: (blueprint: Blueprint) => string;
|
|
7
|
+
export declare const navigationSelected: (pathname: string, href: string) => boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function navigationGroups(blueprints) {
|
|
2
|
+
const items = [];
|
|
3
|
+
const groups = new Map();
|
|
4
|
+
// Preserve the existing kind order, then blueprint order within each kind.
|
|
5
|
+
for (const kind of ['page', 'collection', 'form', 'site']) {
|
|
6
|
+
for (const blueprint of blueprints.filter((b) => b.kind === kind)) {
|
|
7
|
+
const group = blueprint.navigation?.group ?? (kind === 'page' ? 'Pages' : false);
|
|
8
|
+
if (group === false) {
|
|
9
|
+
items.push({ group, blueprints: [blueprint] });
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
let item = groups.get(group);
|
|
13
|
+
if (!item) {
|
|
14
|
+
item = { group, blueprints: [] };
|
|
15
|
+
groups.set(group, item);
|
|
16
|
+
items.push(item);
|
|
17
|
+
}
|
|
18
|
+
item.blueprints.push(blueprint);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return items;
|
|
23
|
+
}
|
|
24
|
+
export const blueprintHref = (blueprint) => `/admin/${blueprint.kind === 'form' ? 'forms' : 'content'}/${blueprint.id}`;
|
|
25
|
+
export const navigationSelected = (pathname, href) => pathname === href || pathname.startsWith(href + '/');
|
package/dist/blueprints/load.js
CHANGED
|
@@ -74,6 +74,10 @@ const blueprint = z
|
|
|
74
74
|
.string()
|
|
75
75
|
.refine(isBlueprintIcon, 'Unknown Lucide icon; use a lowercase kebab-case name from lucide.dev/icons')
|
|
76
76
|
.optional(),
|
|
77
|
+
navigation: z
|
|
78
|
+
.object({ group: z.union([z.string().trim().min(1), z.literal(false)]) })
|
|
79
|
+
.strict()
|
|
80
|
+
.optional(),
|
|
77
81
|
description: z.string().optional(),
|
|
78
82
|
preview: z
|
|
79
83
|
.string()
|
package/dist/cli/files.js
CHANGED
|
@@ -109,6 +109,6 @@ export function migrationReport(plan, notes = []) {
|
|
|
109
109
|
notes.map((n) => '- ' + n).join('\n') +
|
|
110
110
|
'\n\n' +
|
|
111
111
|
(plan.some((p) => /src\/hooks\.server\.[jt]s$/.test(p.path) && p.status === 'conflict')
|
|
112
|
-
? `## Compose the existing server hook\n\nPreserve the current handle, rename its export to siteHandle, then add:\n\n\`\`\`ts\nimport { sequence } from '@sveltejs/kit/hooks';\nimport { building } from '$app/environment';\nimport { cmsHandle } from '
|
|
112
|
+
? `## Compose the existing server hook\n\nPreserve the current handle, rename its export to siteHandle, then add:\n\n\`\`\`ts\nimport { sequence } from '@sveltejs/kit/hooks';\nimport { building } from '$app/environment';\nimport { cmsHandle } from '${PACKAGE_NAME}/server';\nimport { getCMS } from '$lib/server/sandcms';\nexport const handle = sequence(cmsHandle(getCMS, building), siteHandle);\n\`\`\`\n`
|
|
113
113
|
: ''));
|
|
114
114
|
}
|
|
@@ -21,6 +21,9 @@ export declare function adminLoad(cms: CMS, event: RequestEvent): Promise<{
|
|
|
21
21
|
label: string;
|
|
22
22
|
kind: "page" | "site" | "collection" | "form";
|
|
23
23
|
icon?: string;
|
|
24
|
+
navigation?: {
|
|
25
|
+
group: string | false;
|
|
26
|
+
};
|
|
24
27
|
description?: string;
|
|
25
28
|
preview?: string;
|
|
26
29
|
fields: Record<string, import("../index.ts").Field>;
|
|
@@ -111,6 +114,9 @@ export declare function adminLoad(cms: CMS, event: RequestEvent): Promise<{
|
|
|
111
114
|
label: string;
|
|
112
115
|
kind: "page" | "site" | "collection" | "form";
|
|
113
116
|
icon?: string;
|
|
117
|
+
navigation?: {
|
|
118
|
+
group: string | false;
|
|
119
|
+
};
|
|
114
120
|
description?: string;
|
|
115
121
|
preview?: string;
|
|
116
122
|
fields: Record<string, import("../index.ts").Field>;
|
|
@@ -173,6 +179,9 @@ export declare function adminLoad(cms: CMS, event: RequestEvent): Promise<{
|
|
|
173
179
|
label: string;
|
|
174
180
|
kind: "page" | "site" | "collection" | "form";
|
|
175
181
|
icon?: string;
|
|
182
|
+
navigation?: {
|
|
183
|
+
group: string | false;
|
|
184
|
+
};
|
|
176
185
|
description?: string;
|
|
177
186
|
preview?: string;
|
|
178
187
|
fields: Record<string, import("../index.ts").Field>;
|
|
@@ -227,6 +236,9 @@ export declare function adminLoad(cms: CMS, event: RequestEvent): Promise<{
|
|
|
227
236
|
label: string;
|
|
228
237
|
kind: "page" | "site" | "collection" | "form";
|
|
229
238
|
icon?: string;
|
|
239
|
+
navigation?: {
|
|
240
|
+
group: string | false;
|
|
241
|
+
};
|
|
230
242
|
description?: string;
|
|
231
243
|
preview?: string;
|
|
232
244
|
fields: Record<string, import("../index.ts").Field>;
|
|
@@ -274,6 +286,9 @@ export declare function adminLoad(cms: CMS, event: RequestEvent): Promise<{
|
|
|
274
286
|
label: string;
|
|
275
287
|
kind: "page" | "site" | "collection" | "form";
|
|
276
288
|
icon?: string;
|
|
289
|
+
navigation?: {
|
|
290
|
+
group: string | false;
|
|
291
|
+
};
|
|
277
292
|
description?: string;
|
|
278
293
|
preview?: string;
|
|
279
294
|
fields: Record<string, import("../index.ts").Field>;
|
|
@@ -327,6 +342,9 @@ export declare function adminLoad(cms: CMS, event: RequestEvent): Promise<{
|
|
|
327
342
|
label: string;
|
|
328
343
|
kind: "page" | "site" | "collection" | "form";
|
|
329
344
|
icon?: string;
|
|
345
|
+
navigation?: {
|
|
346
|
+
group: string | false;
|
|
347
|
+
};
|
|
330
348
|
description?: string;
|
|
331
349
|
preview?: string;
|
|
332
350
|
fields: Record<string, import("../index.ts").Field>;
|
package/docs/acceptance.md
CHANGED
|
@@ -53,6 +53,6 @@ The drill owns and removes its temporary containers and volume. It uses localhos
|
|
|
53
53
|
|
|
54
54
|
1. **Dokploy:** deploy the Railpack image with HTTPS, the production volume, runtime secrets, and the actual reverse proxy configuration. Bootstrap against that mounted database, publish content, replace the container, verify session/cookie and proxy behavior, and perform the documented backup/offline-restore drill. The local Docker proof covers the application mechanics; Dokploy's operator access, mounting, restart policy, and routing remain unverified.
|
|
55
55
|
2. **Cloudflare staging:** complete the [staging and CDN verification](cloudflare.md#staging-verification) with authorized staging resources. This remains an external release check; local tests do not prove deployed cache behavior or image quality.
|
|
56
|
-
3. **Private npm:** publish
|
|
56
|
+
3. **Private npm:** publish `sandcms` with restricted access from an authorized organization account, and prove an authenticated pinned install in a clean CI environment. Validate secret handling in the real build host. Local archive installation is complete; registry authentication and publication remain unverified.
|
|
57
57
|
|
|
58
58
|
The cloud provisioning implementation is present, but its live acceptance is pending. These checks are release gates, not prerequisites for continuing local development.
|
package/docs/content.md
CHANGED
|
@@ -26,6 +26,24 @@ When an editor has unsaved changes, SvelteKit's `beforeNavigate` check opens a s
|
|
|
26
26
|
|
|
27
27
|
When using the save API directly, supply complete repeatable rows, including hidden keys from the previous draft. The admin does this automatically when editing or reordering. Rows are replaced as ordered objects; merging by array index would attach retired data to the wrong row after a reorder.
|
|
28
28
|
|
|
29
|
+
## Sidebar groups
|
|
30
|
+
|
|
31
|
+
Pages appear under a collapsible **Pages** group by default. Other blueprint kinds stay at the top level. Set `navigation.group` on a content blueprint to choose a group:
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
id: about
|
|
35
|
+
label: About
|
|
36
|
+
kind: page
|
|
37
|
+
navigation:
|
|
38
|
+
group: Pages
|
|
39
|
+
fields:
|
|
40
|
+
title: { type: text }
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Use the same group label on several blueprints to group them together, or `navigation: { group: false }` to keep an item at the top level. Labels must be nonempty strings. Groups remain within the Content (pages/collections) or Workspace (forms/site settings) section. Groups follow the existing kind and blueprint order, appearing at their first member's position. File blueprints do not participate in navigation.
|
|
44
|
+
|
|
45
|
+
Groups start collapsed and automatically open when navigating to a member, including a direct link to an editor. You can toggle them with the mouse or keyboard; choices last while the admin shell remains mounted. This only changes the admin sidebar: public URLs, content relationships, blueprint IDs, and stored data stay the same. Restart the application after editing YAML.
|
|
46
|
+
|
|
29
47
|
## Sidebar icons
|
|
30
48
|
|
|
31
49
|
Every content blueprint kind accepts an optional `icon` using a lowercase, hyphenated name from the [Lucide catalogue](https://lucide.dev/icons/), such as `image`, `camera`, or `calendar-days`. Projects uses `icon: image` in the example above. The CMS validates names against its pinned Lucide version; unknown names report the YAML file and line when running `bun x sandcms validate` or starting the application.
|
|
@@ -73,7 +91,7 @@ SEO fields are ordinary blueprint fields; public routes must render them. The pa
|
|
|
73
91
|
|
|
74
92
|
```svelte
|
|
75
93
|
<script lang="ts">
|
|
76
|
-
import { Seo } from '
|
|
94
|
+
import { Seo } from 'sandcms';
|
|
77
95
|
let { data } = $props();
|
|
78
96
|
</script>
|
|
79
97
|
|
package/docs/email.md
CHANGED
|
@@ -26,7 +26,7 @@ The generated integration and repository demo read these variables. For an exist
|
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
28
|
import { env } from '$env/dynamic/private';
|
|
29
|
-
import { createCMS, emailOptionsFromEnv } from '
|
|
29
|
+
import { createCMS, emailOptionsFromEnv } from 'sandcms/server';
|
|
30
30
|
|
|
31
31
|
const cms = createCMS({
|
|
32
32
|
database: env.SANDCMS_DATABASE!,
|
|
@@ -41,7 +41,7 @@ const cms = createCMS({
|
|
|
41
41
|
Call from server code and await the result:
|
|
42
42
|
|
|
43
43
|
```ts
|
|
44
|
-
import { EmailError } from '
|
|
44
|
+
import { EmailError } from 'sandcms/server';
|
|
45
45
|
import { getCMS } from '$lib/server/sandcms';
|
|
46
46
|
|
|
47
47
|
try {
|
|
@@ -85,7 +85,7 @@ Omit credentials unless your local server requires them. The explicit insecure o
|
|
|
85
85
|
Supply an adapter instead of SMTP settings through `createCMS({ ..., email })`:
|
|
86
86
|
|
|
87
87
|
```ts
|
|
88
|
-
import type { EmailOptions } from '
|
|
88
|
+
import type { EmailOptions } from 'sandcms/server';
|
|
89
89
|
|
|
90
90
|
const email: EmailOptions = {
|
|
91
91
|
from: 'notifications@example.com',
|
package/docs/media.md
CHANGED
package/docs/package.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Installation and packaging
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`sandcms` is the npm package. It includes the CMS runtime, admin UI, `sandcms` terminal command, required route templates, and a minimal SvelteKit starter. There is no separate starter package.
|
|
4
4
|
|
|
5
5
|
## Publish from macOS
|
|
6
6
|
|
|
@@ -17,13 +17,13 @@ npm pack --dry-run
|
|
|
17
17
|
npm pack --pack-destination /tmp
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
This release produces `/tmp/
|
|
20
|
+
This release produces `/tmp/sandcms-0.5.3.tgz`. `npm pack` builds the package through `prepack`; it packages only the allowlisted distribution, templates, documentation, and package metadata. The repository's example website, tests, databases, and environment files are excluded. `release:check` checks types, runs unit tests, inspects an npm archive, and installs/builds that archive in both a fresh starter and an existing SvelteKit site.
|
|
21
21
|
|
|
22
22
|
Upload the archive you just built:
|
|
23
23
|
|
|
24
24
|
```sh
|
|
25
|
-
npm publish /tmp/
|
|
26
|
-
npm view
|
|
25
|
+
npm publish /tmp/sandcms-0.5.3.tgz --access restricted --registry=https://registry.npmjs.org/
|
|
26
|
+
npm view sandcms@0.5.3 version --registry=https://registry.npmjs.org/
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
Complete npm's authentication/2FA prompts. The logged-in account must have publishing permission in `sandquist-group`. The package also defaults to restricted access and the npmjs registry in `publishConfig`. Do not set `private: true` on this package: that prevents publication entirely. Generated websites do set it.
|
|
@@ -36,7 +36,7 @@ After publishing, authenticate as a user with read access to the package, then r
|
|
|
36
36
|
|
|
37
37
|
```sh
|
|
38
38
|
npm login --registry=https://registry.npmjs.org/
|
|
39
|
-
bunx --bun --package
|
|
39
|
+
bunx --bun --package sandcms@0.5.3 sandcms setup --cwd ./my-site
|
|
40
40
|
cd my-site
|
|
41
41
|
bun run dev
|
|
42
42
|
```
|
package/docs/releases.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Release notes
|
|
2
2
|
|
|
3
|
+
## 0.5.3
|
|
4
|
+
|
|
5
|
+
Adds collapsible blueprint navigation groups to the admin sidebar.
|
|
6
|
+
|
|
7
|
+
- Groups page blueprints under **Pages** by default. Other blueprint kinds remain at the top level.
|
|
8
|
+
- Supports custom groups through `navigation.group` and top-level links through `navigation: { group: false }`.
|
|
9
|
+
- Opens the active blueprint’s group automatically and supports mouse and keyboard toggling.
|
|
10
|
+
|
|
11
|
+
Existing project-owned YAML is preserved and needs no changes. Public URLs, blueprint IDs, and stored content are unchanged. There is no database schema change or new migration in 0.5.3. See [sidebar configuration](content.md#sidebar-groups) and the [upgrade workflow](upgrades.md).
|
|
12
|
+
|
|
3
13
|
## 0.5.1
|
|
4
14
|
|
|
5
15
|
Raises raster upload support to 100 MB and image dimensions to 100 MP, with variant encoding through remote Cloudflare image transformations.
|
package/docs/upgrades.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Updates and generated files
|
|
2
2
|
|
|
3
|
+
## 0.5.3: sidebar grouping
|
|
4
|
+
|
|
5
|
+
Page blueprints now default to a collapsible Pages sidebar group. Existing YAML needs no changes or database migration. Set `navigation: { group: false }` to retain a top-level link, or use a group label to organize content. Customized YAML remains developer-owned; see [sidebar groups](content.md#sidebar-groups).
|
|
6
|
+
|
|
3
7
|
## 0.5.1: 100 MB / 100 MP media processing
|
|
4
8
|
|
|
5
9
|
Deploy the protocol-3 media Worker and website together; older protocol combinations fail clearly. Raster encoding now uses remote transformations and private, five-minute signed source URLs. Keep the `MEDIA` and `IMAGES` bindings (Images is still used for dimension inspection) and the same CMS/Worker token. Enable Cloudflare image transformations for the Worker’s account and verify the deployed source and transformation flow in staging; local mocks do not prove production limits or caching behavior.
|
package/package.json
CHANGED
package/templates/integration.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { env } from '$env/dynamic/private';
|
|
2
|
-
import { createCMS, emailOptionsFromEnv, type CMS } from '
|
|
2
|
+
import { createCMS, emailOptionsFromEnv, type CMS } from 'sandcms/server';
|
|
3
3
|
let instance: CMS;
|
|
4
4
|
export function getCMS() {
|
|
5
5
|
if (!instance) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { apiHandler } from '
|
|
1
|
+
import { apiHandler } from 'sandcms/server';
|
|
2
2
|
import { getCMS } from '$lib/server/sandcms';
|
|
3
3
|
export const GET = (event: import('./$types').RequestEvent) => apiHandler(getCMS(), event);
|
|
4
4
|
export const POST = GET;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from '
|
|
1
|
+
export { default } from 'sandcms/worker';
|