create-smoodly-app 0.0.50 → 0.0.52
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 +22 -30
- package/dist/index.js +87 -329
- package/package.json +4 -5
- package/templates/astro-blank/AGENTS.md +2 -8
- package/templates/astro-blank/README.md +13 -23
- package/templates/astro-blank/package.json +2 -3
- package/templates/astro-blank/scripts/seed.ts +9 -3
- package/templates/astro-blank/src/smoodly/collections.ts +2 -2
- package/templates/astro-blank-intl/AGENTS.md +2 -8
- package/templates/astro-blank-intl/README.md +13 -23
- package/templates/astro-blank-intl/package.json +2 -3
- package/templates/astro-blank-intl/scripts/seed.ts +9 -3
- package/templates/astro-blank-intl/src/smoodly/collections.ts +2 -2
- package/templates/astro-lorem/AGENTS.md +2 -8
- package/templates/astro-lorem/README.md +12 -16
- package/templates/astro-lorem/package.json +2 -3
- package/templates/astro-lorem/scripts/seed.ts +9 -3
- package/templates/astro-lorem/src/components/sections/PageHero.schema.ts +3 -1
- package/templates/astro-lorem/src/sections/pageHero.astro +1 -1
- package/templates/astro-lorem-intl/AGENTS.md +2 -8
- package/templates/astro-lorem-intl/README.md +12 -16
- package/templates/astro-lorem-intl/package.json +2 -3
- package/templates/astro-lorem-intl/scripts/seed.ts +9 -3
- package/templates/astro-lorem-intl/src/components/sections/PageHero.schema.ts +3 -1
- package/templates/astro-lorem-intl/src/sections/pageHero.astro +1 -1
- package/templates/blank/AGENTS.md +7 -13
- package/templates/blank/README.md +12 -22
- package/templates/blank/app/(smoodly)/admin/[[...segments]]/route.ts +6 -5
- package/templates/blank/next.config.ts +1 -4
- package/templates/blank/package.json +4 -4
- package/templates/blank/scripts/seed.ts +9 -3
- package/templates/blank/smoodly/collections.ts +2 -2
- package/templates/blank/smoodly/server.ts +25 -47
- package/templates/blank-intl/AGENTS.md +7 -13
- package/templates/blank-intl/README.md +12 -22
- package/templates/blank-intl/app/(smoodly)/admin/[[...segments]]/route.ts +6 -5
- package/templates/blank-intl/next.config.ts +1 -4
- package/templates/blank-intl/package.json +4 -4
- package/templates/blank-intl/scripts/seed.ts +9 -3
- package/templates/blank-intl/smoodly/collections.ts +2 -2
- package/templates/blank-intl/smoodly/server.ts +25 -47
- package/templates/blank-intl.tsconfig.json +0 -3
- package/templates/blank.tsconfig.json +0 -3
- package/templates/lorem/AGENTS.md +7 -13
- package/templates/lorem/README.md +13 -17
- package/templates/lorem/app/(smoodly)/admin/[[...segments]]/route.ts +6 -5
- package/templates/lorem/components/sections/PageHero.schema.ts +3 -1
- package/templates/lorem/components/sections/PageHero.tsx +1 -1
- package/templates/lorem/next.config.ts +1 -4
- package/templates/lorem/package.json +4 -4
- package/templates/lorem/scripts/seed.ts +9 -3
- package/templates/lorem/smoodly/server.ts +25 -47
- package/templates/lorem-intl/AGENTS.md +7 -13
- package/templates/lorem-intl/README.md +13 -17
- package/templates/lorem-intl/app/(smoodly)/admin/[[...segments]]/route.ts +6 -5
- package/templates/lorem-intl/components/sections/PageHero.schema.ts +3 -1
- package/templates/lorem-intl/components/sections/PageHero.tsx +1 -1
- package/templates/lorem-intl/next.config.ts +1 -4
- package/templates/lorem-intl/package.json +4 -4
- package/templates/lorem-intl/scripts/seed.ts +9 -3
- package/templates/lorem-intl/smoodly/server.ts +25 -47
- package/templates/lorem-intl.tsconfig.json +0 -3
- package/templates/lorem.tsconfig.json +0 -3
- package/templates/astro-blank/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
- package/templates/astro-blank/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
- package/templates/astro-blank/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
- package/templates/astro-blank/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
- package/templates/astro-blank/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
- package/templates/astro-blank/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
- package/templates/astro-blank/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
- package/templates/astro-blank/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
- package/templates/astro-blank/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
- package/templates/astro-blank/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
- package/templates/astro-blank/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
- package/templates/astro-blank/supabase/migrations/20261009120100_smoodly_views.sql +0 -20
- package/templates/astro-blank-intl/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
- package/templates/astro-blank-intl/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
- package/templates/astro-blank-intl/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
- package/templates/astro-blank-intl/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
- package/templates/astro-blank-intl/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
- package/templates/astro-blank-intl/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
- package/templates/astro-blank-intl/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
- package/templates/astro-blank-intl/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
- package/templates/astro-blank-intl/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
- package/templates/astro-blank-intl/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
- package/templates/astro-blank-intl/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
- package/templates/astro-blank-intl/supabase/migrations/20261009120100_smoodly_views.sql +0 -20
- package/templates/astro-lorem/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
- package/templates/astro-lorem/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
- package/templates/astro-lorem/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
- package/templates/astro-lorem/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
- package/templates/astro-lorem/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
- package/templates/astro-lorem/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
- package/templates/astro-lorem/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
- package/templates/astro-lorem/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
- package/templates/astro-lorem/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
- package/templates/astro-lorem/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
- package/templates/astro-lorem/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
- package/templates/astro-lorem/supabase/migrations/20261009120100_smoodly_views.sql +0 -58
- package/templates/astro-lorem-intl/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
- package/templates/astro-lorem-intl/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
- package/templates/astro-lorem-intl/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
- package/templates/astro-lorem-intl/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
- package/templates/astro-lorem-intl/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
- package/templates/astro-lorem-intl/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
- package/templates/astro-lorem-intl/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
- package/templates/astro-lorem-intl/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
- package/templates/astro-lorem-intl/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
- package/templates/astro-lorem-intl/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
- package/templates/astro-lorem-intl/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
- package/templates/astro-lorem-intl/supabase/migrations/20261009120100_smoodly_views.sql +0 -58
- package/templates/blank/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
- package/templates/blank/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
- package/templates/blank/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
- package/templates/blank/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
- package/templates/blank/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
- package/templates/blank/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
- package/templates/blank/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
- package/templates/blank/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
- package/templates/blank/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
- package/templates/blank/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
- package/templates/blank/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
- package/templates/blank/supabase/migrations/20261009120100_smoodly_views.sql +0 -20
- package/templates/blank-intl/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
- package/templates/blank-intl/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
- package/templates/blank-intl/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
- package/templates/blank-intl/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
- package/templates/blank-intl/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
- package/templates/blank-intl/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
- package/templates/blank-intl/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
- package/templates/blank-intl/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
- package/templates/blank-intl/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
- package/templates/blank-intl/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
- package/templates/blank-intl/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
- package/templates/blank-intl/supabase/migrations/20261009120100_smoodly_views.sql +0 -20
- package/templates/lorem/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
- package/templates/lorem/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
- package/templates/lorem/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
- package/templates/lorem/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
- package/templates/lorem/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
- package/templates/lorem/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
- package/templates/lorem/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
- package/templates/lorem/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
- package/templates/lorem/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
- package/templates/lorem/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
- package/templates/lorem/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
- package/templates/lorem/supabase/migrations/20261009120100_smoodly_views.sql +0 -58
- package/templates/lorem-intl/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
- package/templates/lorem-intl/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
- package/templates/lorem-intl/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
- package/templates/lorem-intl/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
- package/templates/lorem-intl/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
- package/templates/lorem-intl/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
- package/templates/lorem-intl/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
- package/templates/lorem-intl/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
- package/templates/lorem-intl/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
- package/templates/lorem-intl/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
- package/templates/lorem-intl/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
- package/templates/lorem-intl/supabase/migrations/20261009120100_smoodly_views.sql +0 -58
|
@@ -13,7 +13,7 @@ function PageHeroView({ kicker, heading, text, image, styles }: Props<typeof pag
|
|
|
13
13
|
<h1 className="page-hero__heading" {...m.field("heading")}>{heading}</h1>
|
|
14
14
|
<p className="page-hero__text" {...m.field("text")}>{text}</p>
|
|
15
15
|
</div>
|
|
16
|
-
{image && <SmoodlyImage image={image} className="page-hero__image" sizes="100vw" priority {...m.field("image")} />}
|
|
16
|
+
{image && <SmoodlyImage image={image} media={{ tall: "(max-width: 767px)" }} className="page-hero__image" sizes="100vw" priority {...m.field("image")} />}
|
|
17
17
|
</div>
|
|
18
18
|
</smoodly.Section>
|
|
19
19
|
);
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
2
|
import createNextIntlPlugin from "next-intl/plugin";
|
|
3
|
-
import { smoodlyImages } from "smoodly/image/config";
|
|
4
3
|
|
|
5
4
|
const withNextIntl = createNextIntlPlugin();
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
// (a local stack also needs Next's local-IP allowance; the helper sets it).
|
|
9
|
-
const config: NextConfig = { images: smoodlyImages() };
|
|
6
|
+
const config: NextConfig = {};
|
|
10
7
|
|
|
11
8
|
export default withNextIntl(config);
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "next dev",
|
|
7
|
-
"build": "
|
|
7
|
+
"build": "next build",
|
|
8
8
|
"start": "next start",
|
|
9
9
|
"seed": "tsx scripts/seed.ts",
|
|
10
|
-
"typecheck": "tsc --noEmit"
|
|
10
|
+
"typecheck": "tsc --noEmit",
|
|
11
|
+
"prebuild": "smoodly push"
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
13
|
-
"@supabase/supabase-js": "^2.113.0",
|
|
14
14
|
"next": "^16.3.4",
|
|
15
15
|
"react": "^19",
|
|
16
16
|
"react-dom": "^19",
|
|
17
|
-
"smoodly": "0.0.
|
|
17
|
+
"smoodly": "0.0.52",
|
|
18
18
|
"next-intl": "^4.14.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// from smoodly/server.ts): the admin's own operations, so validation and
|
|
3
3
|
// the publish checks apply and a failure throws. This file is also the
|
|
4
4
|
// example of writing content from code. Content only; it ships in the template and create-smoodly-app runs
|
|
5
|
-
// `npm run seed` after the
|
|
5
|
+
// `npm run seed` after it pushes the schema. (The example repo's demo
|
|
6
6
|
// editor account is a separate, example-only script.)
|
|
7
|
-
// Run: npm run seed (needs .env.local
|
|
7
|
+
// Run: npm run seed (needs .env.local).
|
|
8
8
|
//
|
|
9
9
|
// Locales: the English content goes into the configured default locale,
|
|
10
10
|
// whatever its code, and the Finnish rows are written only when `fi` is
|
|
@@ -21,6 +21,12 @@ const { loadEnvConfig } = next;
|
|
|
21
21
|
|
|
22
22
|
loadEnvConfig(process.cwd());
|
|
23
23
|
|
|
24
|
+
// A refusal from Smoodly's API (a space with no schema yet, a wrong key) prints its message and code, not a stack trace.
|
|
25
|
+
process.on("uncaughtException", (e) => {
|
|
26
|
+
console.error(e.name === "SmoodlyContentError" ? `${e.message} (${(e as Error & { code?: string }).code})` : e);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
});
|
|
29
|
+
|
|
24
30
|
const { config } = await import("../smoodly/config");
|
|
25
31
|
const { articles, news } = await import("../smoodly/collections");
|
|
26
32
|
const { content, href, node } = await import("../smoodly/server");
|
|
@@ -36,7 +42,7 @@ const EN = config.locales.default;
|
|
|
36
42
|
const FI = config.locales.supported.includes("fi") && EN !== "fi" ? "fi" : null;
|
|
37
43
|
|
|
38
44
|
// The home page is code-owned: `find` returns its record, creating it when
|
|
39
|
-
// the
|
|
45
|
+
// the space is new. It is seeded once somebody has given it sections.
|
|
40
46
|
const home = (await c.pages.find(EN, "/"))!;
|
|
41
47
|
if (Object.values((await c.pages.getTree(home.id, EN))?.zones ?? {}).some((nodes) => nodes.length > 0)) {
|
|
42
48
|
console.log(`Already seeded — the home page has content in "${EN}".`);
|
|
@@ -1,60 +1,47 @@
|
|
|
1
|
-
// Server-only glue: the
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// secret is a service-role key or a cloud write key is invisible here.
|
|
1
|
+
// Server-only glue: the reads over Smoodly's API and the renderer,
|
|
2
|
+
// constructed lazily so `next build` doesn't need env vars at import time.
|
|
3
|
+
// The env shape is the package's (SMOODLY_*): the live site and the admin need
|
|
4
|
+
// SMOODLY_API_URL, SMOODLY_SPACE_ID and SMOODLY_SECRET_KEY; the admin learns
|
|
5
|
+
// where editors sign in from Smoodly's API. The site opens no database.
|
|
7
6
|
//
|
|
8
7
|
// Lazy on purpose: a page component imports this file to read through
|
|
9
8
|
// `q` (components/pages/Articles.tsx), and this file imports the
|
|
10
9
|
// components through ./views. That is a cycle, so nothing here reads
|
|
11
10
|
// views() or the env at module scope.
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from "smoodly";
|
|
16
|
-
// The admin's server pieces: the sign-in check and the content API. No browser code lives in the package's
|
|
17
|
-
// entries; the admin itself is prebuilt and served by app/(smoodly)/admin/[[...segments]]/route.ts.
|
|
18
|
-
import { createSmoodlyContent, supabaseAdminAuth, type AdminAuth, type AuthConfig, type SmoodlyContent } from "smoodly/admin";
|
|
11
|
+
import { apiEnv, createSmoodlyApi, presenceConfig, smoodlyEnv, type ContentReads, type PresenceConfig } from "smoodly";
|
|
12
|
+
// The admin's server pieces: the content API for scripts. No browser code lives in the package's entries;
|
|
13
|
+
// the admin itself is prebuilt and served by app/(smoodly)/admin/[[...segments]]/route.ts.
|
|
14
|
+
import { apiTransport, createSmoodlyContent, type SmoodlyContent } from "smoodly/admin";
|
|
19
15
|
import { buildGate, createPageRenderer, createSmoodlyQueries } from "smoodly/next";
|
|
20
|
-
import type { SupabaseClient } from "@supabase/supabase-js";
|
|
21
16
|
import { getPathname } from "@/i18n/navigation";
|
|
22
17
|
import { collections, config, globals } from "./config";
|
|
23
18
|
import { views } from "./views";
|
|
24
19
|
|
|
25
20
|
type Renderer = ReturnType<typeof createPageRenderer>;
|
|
26
21
|
type Queries = ReturnType<typeof createSmoodlyQueries<typeof collections, typeof globals>>;
|
|
27
|
-
type Bound = {
|
|
28
|
-
db: SupabaseClient; pages: SupabasePageStore; entries: SupabaseEntryStore; assets: SupabaseAssetStore; members: SupabaseMemberStore; auth: AdminAuth; site: SmoodlySite; renderer: Renderer; q: Queries;
|
|
29
|
-
};
|
|
22
|
+
type Bound = { site: ContentReads; renderer: Renderer; q: Queries };
|
|
30
23
|
|
|
31
24
|
let cached: Bound | null = null;
|
|
32
25
|
|
|
33
26
|
function bound(): Bound {
|
|
34
27
|
if (cached) return cached;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
//
|
|
38
|
-
const
|
|
39
|
-
const auth = supabaseAdminAuth({ authUrl: env.authUrl, authKey: env.authKey, db });
|
|
40
|
-
// The site layer: (locale, path) → page or entry, and the content API
|
|
41
|
-
// `q` wraps below. Not exported — the app reads through `q`, which adds
|
|
42
|
-
// draft awareness and the cache.
|
|
43
|
-
const site = createSmoodlySite(siteOptions(config, () => ({ pages, entries, assets, published })));
|
|
28
|
+
// The site's reads go over Smoodly's API (SMOODLY_API_URL, SMOODLY_SPACE_ID, SMOODLY_SECRET_KEY):
|
|
29
|
+
// (locale, path) → page or entry, and the reads `q` wraps below. Not exported — the app reads
|
|
30
|
+
// through `q`, which adds draft awareness and the cache.
|
|
31
|
+
const site = createSmoodlyApi({ ...apiEnv(), config });
|
|
44
32
|
// The components, checked against the config's schemas here, on first use.
|
|
45
33
|
const renderer = createPageRenderer({ site, ...views(), href });
|
|
46
34
|
// The read API (spec 2026-09-11): typed by the registry, draft-aware, cached under tags the admin expires.
|
|
47
35
|
const q = createSmoodlyQueries({ site, collections, globals });
|
|
48
|
-
cached = {
|
|
36
|
+
cached = { site, renderer, q };
|
|
49
37
|
return cached;
|
|
50
38
|
}
|
|
51
39
|
|
|
52
|
-
/** The admin's wiring, for the admin route only
|
|
40
|
+
/** The admin's wiring, for the admin route only: the page and its files, the revalidate route the
|
|
41
|
+
* service calls and the preview route the browser posts the grant to. Operations run in the service. */
|
|
53
42
|
export function adminDeps() {
|
|
54
|
-
smoodlyEnv("admin"); // the admin
|
|
55
|
-
|
|
56
|
-
// The projector: a publish writes the finished documents a live page reads.
|
|
57
|
-
return { pages, entries, assets, members, auth, href, projector: site.projector };
|
|
43
|
+
const env = smoodlyEnv("admin"); // the admin talks to SMOODLY_API_URL, which also tells it where editors sign in
|
|
44
|
+
return { apiUrl: env.apiUrl, spaceId: env.spaceId, delivery: "live" as const };
|
|
58
45
|
}
|
|
59
46
|
|
|
60
47
|
/** Write content from code — seeds, migrations, route handlers (spec 2026-09-30 tester findings §1).
|
|
@@ -62,24 +49,15 @@ export function adminDeps() {
|
|
|
62
49
|
* throws `SmoodlyContentError`. `content().pages.create(…)`, `.entries.create(…)`, `.globals.set(…)`,
|
|
63
50
|
* `.media.upload(…)`; build tree nodes with `node(Section, fields)`. */
|
|
64
51
|
export function content(): SmoodlyContent {
|
|
65
|
-
|
|
66
|
-
return createSmoodlyContent({ config,
|
|
52
|
+
// Over Smoodly's API with the secret key: the service runs the operations.
|
|
53
|
+
return createSmoodlyContent({ config, href, transport: apiTransport(apiEnv()) });
|
|
67
54
|
}
|
|
68
55
|
|
|
69
56
|
export { node } from "smoodly";
|
|
70
57
|
|
|
71
|
-
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
/** What the browser needs to sign in — public values only. */
|
|
75
|
-
export function publicAuth(): AuthConfig {
|
|
76
|
-
const env = smoodlyEnv("admin");
|
|
77
|
-
return { url: env.authUrl, key: env.authKey };
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/** What the browser needs to join the editing-presence channel — public values only (spec 2026-09-26 concurrency §5).
|
|
81
|
-
* The space is asked of the database once per process. */
|
|
82
|
-
export function presence(): Promise<PresenceConfig> {
|
|
58
|
+
/** What the browser needs to open the editing-presence socket — Smoodly's API and the space, public values only
|
|
59
|
+
* (spec 2026-10-15 the space object §6). */
|
|
60
|
+
export function presence(): PresenceConfig {
|
|
83
61
|
return presenceConfig(smoodlyEnv("admin"));
|
|
84
62
|
}
|
|
85
63
|
|
|
@@ -106,7 +84,7 @@ export const q = (): Queries =>
|
|
|
106
84
|
// route file without a dynamic segment reads nothing at build and the build needs no keys — a layout
|
|
107
85
|
// reading a global through q() included (2026-10-02, tester round 6). At run time it does nothing: a
|
|
108
86
|
// CMS route renders on its first visit and is cached until a publish expires it (plan 2026-10-09).
|
|
109
|
-
/** The
|
|
87
|
+
/** The route file calls these. */
|
|
110
88
|
export const renderSmoodlyPath: Renderer["renderSmoodlyPath"] = async (...args) => { await buildGate(); return bound().renderer.renderSmoodlyPath(...args); };
|
|
111
89
|
export const smoodlyMetadata: Renderer["smoodlyMetadata"] = async (...args) => { await buildGate(); return bound().renderer.smoodlyMetadata(...args); };
|
|
112
90
|
export const renderSmoodlyPage: Renderer["renderSmoodlyPage"] = async (...args) => { await buildGate(); return bound().renderer.renderSmoodlyPage(...args); };
|