@easy-web/core 1.8.0 → 1.9.1

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 CHANGED
@@ -99,7 +99,9 @@ are allowed. A registry pin identifies package name, exact version, SHA-512 SRI
99
99
  and package-relative export path. The future loader must verify artifact bytes
100
100
  before importing executable code; admission checks its receipt against the
101
101
  CLI-owned registry, not a registry supplied by the target. A receipt schema alone
102
- is not cryptographic verification. No loader or recipe implementation ships here.
102
+ is not cryptographic verification. The verified-artifact loader is not implemented;
103
+ the CLI currently imports its first-party workspace/package dependencies directly.
104
+ Core ships the shell recipe and content-site recipe factory.
103
105
 
104
106
  ## Generic content composition
105
107
 
@@ -115,4 +117,29 @@ Only a money-enabled selection accepts `currency`, validated by the shared ISO
115
117
  4217 input schema. `homepage` requires `featured`, so a type cannot occupy that
116
118
  featured presentation slot merely by defining an image.
117
119
 
120
+ `createContentSiteRecipes(composition)` from `@easy-web/core/recipes` connects a
121
+ validated composition to shell navigation and a `content.pages` recipe. Its
122
+ `generatedContentCompositionSchema` deliberately accepts a smaller implemented
123
+ subset than the generic contract: one locale, `title`/`slug`/`body`, optional
124
+ `summary`/`image`, list/detail bindings and optional navigation or `cms-admin`. Other valid
125
+ contract selections fail with an explicit not-yet-supported diagnostic.
126
+
127
+ The recipe generates Astro collections from shared trait schemas, deterministic
128
+ example content, contract-checked entry adapters and list/detail pages using Card,
129
+ Media and Prose. A body becomes `HasBody` only after Astro renders it. Content
130
+ roles and bindings are logical graph contributions, not output filenames.
131
+ `primary` is a graph role; it does not select a homepage automatically.
132
+ `@easy-web/cms-adapters` supplies `createCmsContentSiteRecipes` for the CMS-enabled
133
+ path, consuming the same composition without replacing core's schemas or routes.
134
+ Core's optional `ContentSiteOptions` lets first-party recipes choose an asset
135
+ folder and contribute imports/integrations/markdown processing to the shell's
136
+ single configuration renderer. These are package-owned source expressions, not
137
+ user-configurable JavaScript or a post-generation config merge.
138
+ Application-auth composition remains unsupported.
139
+
140
+ Generated content sites require core `^1.6.0`, the first release with the trait
141
+ schemas used in their collections and adapters, even without images. This does
142
+ not raise the shell-only floor of `^1.5.0`. CMS composition adds its own higher
143
+ runtime requirement.
144
+
118
145
  This package is published as part of the fixed `@easy-web/*` family through the Changesets and npm Trusted Publishing workflow.
@@ -0,0 +1,75 @@
1
+ import { z } from 'astro/zod';
2
+ import type { ShellConfiguration, ShellRecipeOptions } from './shell-recipe.js';
3
+ import type { RecipeMetadata } from './types.js';
4
+ export interface ContentSiteOptions {
5
+ readonly mediaFolder?: string;
6
+ readonly shellConfiguration?: ShellConfiguration;
7
+ }
8
+ export declare const generatedContentCompositionSchema: z.ZodReadonly<z.ZodObject<{
9
+ contentLocales: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ContentLocale", "out">>>;
10
+ contentTypes: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
11
+ traits: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
12
+ title: "title";
13
+ slug: "slug";
14
+ summary: "summary";
15
+ body: "body";
16
+ image: "image";
17
+ photos: "photos";
18
+ order: "order";
19
+ taxonomy: "taxonomy";
20
+ publication: "publication";
21
+ schedule: "schedule";
22
+ location: "location";
23
+ cta: "cta";
24
+ money: "money";
25
+ featured: "featured";
26
+ }>>>;
27
+ currency: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "CurrencyCode", "out">>;
28
+ id: z.core.$ZodBranded<z.ZodString, "ContentTypeId", "out">;
29
+ primary: z.ZodDefault<z.ZodBoolean>;
30
+ labels: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>;
31
+ routes: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>;
32
+ bindings: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
33
+ homepage: "homepage";
34
+ list: "list";
35
+ detail: "detail";
36
+ navigation: "navigation";
37
+ "cms-admin": "cms-admin";
38
+ }>>>;
39
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
40
+ traits: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
41
+ title: "title";
42
+ slug: "slug";
43
+ summary: "summary";
44
+ body: "body";
45
+ image: "image";
46
+ photos: "photos";
47
+ order: "order";
48
+ taxonomy: "taxonomy";
49
+ publication: "publication";
50
+ schedule: "schedule";
51
+ location: "location";
52
+ cta: "cta";
53
+ money: "money";
54
+ featured: "featured";
55
+ }>>>;
56
+ id: z.core.$ZodBranded<z.ZodString, "ContentTypeId", "out">;
57
+ primary: z.ZodDefault<z.ZodBoolean>;
58
+ labels: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>;
59
+ routes: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>;
60
+ bindings: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
61
+ homepage: "homepage";
62
+ list: "list";
63
+ detail: "detail";
64
+ navigation: "navigation";
65
+ "cms-admin": "cms-admin";
66
+ }>>>;
67
+ }, z.core.$strict>>]>>>;
68
+ reservedRoutes: z.ZodReadonly<z.ZodDefault<z.ZodArray<z.ZodString>>>;
69
+ }, z.core.$strict>>;
70
+ /** Bind package-owned content generation to a validated composition, independently of a CMS. */
71
+ export declare function createContentSiteRecipes(rawComposition: unknown, options?: ContentSiteOptions): {
72
+ readonly shell: RecipeMetadata<ShellRecipeOptions>;
73
+ readonly content: RecipeMetadata;
74
+ };
75
+ //# sourceMappingURL=content-site.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-site.d.ts","sourceRoot":"","sources":["../../src/recipes/content-site.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAK9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,KAAK,EAAuB,cAAc,EAAE,MAAM,YAAY,CAAC;AAOtE,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACpD;AAED,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA+B5C,CAAC;AA4IH,gGAAgG;AAChG,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,OAAO,EAAE,OAAO,GAAE,kBAAuB,GAAG;IACjG,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,kBAAkB,CAAC,CAAC;IACnD,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CACpC,CAmCA"}
@@ -0,0 +1,202 @@
1
+ import { z } from 'astro/zod';
2
+ import { posix } from 'node:path';
3
+ import { contentCompositionSchema, defaultReservedContentRoutes } from '../contracts/content-composition.js';
4
+ import { buildShellFiles, shellRecipe } from './shell-recipe.js';
5
+ const supportedTraits = new Set(['title', 'slug', 'summary', 'image', 'body']);
6
+ const supportedBindings = new Set(['list', 'detail', 'navigation', 'cms-admin']);
7
+ const contentRuntimeRange = '^1.6.0';
8
+ export const generatedContentCompositionSchema = contentCompositionSchema.superRefine((composition, context) => {
9
+ if (composition.contentLocales.length !== 1) {
10
+ context.addIssue({ code: 'custom', path: ['contentLocales'], message: 'Content generation currently requires exactly one locale' });
11
+ }
12
+ if (!composition.contentTypes.length) {
13
+ context.addIssue({ code: 'custom', path: ['contentTypes'], message: 'Content generation requires at least one content type' });
14
+ }
15
+ const routes = [];
16
+ composition.contentTypes.forEach((type, index) => {
17
+ const path = ['contentTypes', index];
18
+ for (const trait of type.traits) {
19
+ if (!supportedTraits.has(trait))
20
+ context.addIssue({ code: 'custom', path: [...path, 'traits'], message: `Content generation does not yet support trait "${trait}"` });
21
+ }
22
+ for (const binding of type.bindings) {
23
+ if (!supportedBindings.has(binding))
24
+ context.addIssue({ code: 'custom', path: [...path, 'bindings'], message: `Content generation does not yet support binding "${binding}"` });
25
+ }
26
+ if (!type.bindings.includes('list') || !type.bindings.includes('detail')) {
27
+ context.addIssue({ code: 'custom', path: [...path, 'bindings'], message: 'Content generation requires both list and detail bindings' });
28
+ }
29
+ for (const route of Object.values(type.routes)) {
30
+ const base = route.replace(/\/$/, '');
31
+ if (!/^\/[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/.test(base)
32
+ || defaultReservedContentRoutes.some((reserved) => reserved !== '/' && `${base}/`.startsWith(reserved))) {
33
+ context.addIssue({ code: 'custom', path: [...path, 'routes'], message: `Unsupported generated content route "${route}"; use non-reserved lowercase path segments` });
34
+ }
35
+ if (routes.some((other) => base.startsWith(`${other}/`) || other.startsWith(`${base}/`))) {
36
+ context.addIssue({ code: 'custom', path: [...path, 'routes'], message: `Generated list/detail routes overlap at "${route}"` });
37
+ }
38
+ routes.push(base);
39
+ }
40
+ });
41
+ });
42
+ function routeBase(type, locale) {
43
+ return type.routes[locale].replace(/\/$/, '');
44
+ }
45
+ function collectionSchema(type) {
46
+ const shapes = ['...titleTraitSchema.unwrap().shape', '...slugTraitSchema.unwrap().shape'];
47
+ if (type.traits.includes('summary'))
48
+ shapes.push('...summaryTraitSchema.unwrap().shape');
49
+ if (type.traits.includes('image')) {
50
+ shapes.push('image: imageTraitSchema.unwrap().shape.image.unwrap().extend({ src: image() })');
51
+ }
52
+ // File-based IDs keep duplicate public slugs visible to route validation.
53
+ return `${JSON.stringify(type.id)}: defineCollection({
54
+ loader: glob({ pattern: '**/*.md', base: ${JSON.stringify(`./src/content/${type.id}`)}, generateId: ({ entry }) => entry.replace(/\\.md$/, '') }),
55
+ schema: ${type.traits.includes('image') ? '({ image }) => ' : ''}z.object({ ${shapes.join(', ')} }).strict(),
56
+ })`;
57
+ }
58
+ function adapterSource(type, locale, index) {
59
+ const contracts = ['HasTitle', 'HasSlug', ...(type.traits.includes('summary') ? ['HasSummary'] : []), ...(type.traits.includes('image') ? ['HasImage'] : [])];
60
+ return `import type { CollectionEntry } from 'astro:content';
61
+ import { assertImplements, type Item, type Linkable, ${contracts.map((name) => `type ${name}`).join(', ')} } from '@easy-web/core/contracts';
62
+ import { composition } from '../../content/definitions';
63
+
64
+ type Entry = CollectionEntry<${JSON.stringify(type.id)}>;
65
+ assertImplements<Entry['data'], ${contracts.join(' & ')}>();
66
+
67
+ export function toItem(entry: Entry): Item & Linkable {
68
+ const data = entry.data;
69
+ return {
70
+ title: data.title,
71
+ ${type.traits.includes('summary') ? 'description: data.summary,' : ''}
72
+ ${type.traits.includes('image') ? 'image: data.image,' : ''}
73
+ href: composition.contentTypes[${index}].routes[${JSON.stringify(locale)}].replace(/\\/$/, '') + '/' + data.slug + '/',
74
+ };
75
+ }
76
+ `;
77
+ }
78
+ function listSource(type, locale) {
79
+ const prefix = '../'.repeat(routeBase(type, locale).split('/').length);
80
+ return `---
81
+ import { getCollection } from 'astro:content';
82
+ import Base from '${prefix}layouts/Base.astro';
83
+ import { toItem } from '${prefix}lib/content/${type.id}';
84
+ import Card from '@easy-web/core/components/Card.astro';
85
+ import CardGrid from '@easy-web/core/components/CardGrid.astro';
86
+
87
+ const items = (await getCollection(${JSON.stringify(type.id)}))
88
+ .map(toItem).sort((left, right) => left.href < right.href ? -1 : left.href > right.href ? 1 : 0);
89
+ ---
90
+ <Base title={${JSON.stringify(type.labels[locale])}}>
91
+ <h1>{${JSON.stringify(type.labels[locale])}}</h1>
92
+ <CardGrid>
93
+ {items.map((item) => <Card item={item} />)}
94
+ </CardGrid>
95
+ </Base>
96
+ `;
97
+ }
98
+ function detailSource(type, locale) {
99
+ const prefix = '../'.repeat(routeBase(type, locale).split('/').length);
100
+ return `---
101
+ import { getCollection, render, type CollectionEntry } from 'astro:content';
102
+ import type { Rendered, Item, Linkable } from '@easy-web/core/contracts';
103
+ import Base from '${prefix}layouts/Base.astro';
104
+ import { toItem } from '${prefix}lib/content/${type.id}';
105
+ import Prose from '@easy-web/core/components/Prose.astro';
106
+ ${type.traits.includes('image') ? "import Media from '@easy-web/core/components/Media.astro';" : ''}
107
+
108
+ export async function getStaticPaths() {
109
+ const entries = await getCollection(${JSON.stringify(type.id)});
110
+ const seen = new Set<string>();
111
+ return entries.map((entry) => {
112
+ if (seen.has(entry.data.slug)) throw new Error('Duplicate content slug: ' + entry.data.slug);
113
+ seen.add(entry.data.slug);
114
+ return { params: { slug: entry.data.slug }, props: { entry } };
115
+ });
116
+ }
117
+
118
+ interface Props { entry: CollectionEntry<${JSON.stringify(type.id)}> }
119
+ const { entry } = Astro.props;
120
+ const rendered: Rendered<Item & Linkable> = { ...toItem(entry), ...(await render(entry)) };
121
+ const { Content } = rendered;
122
+ ---
123
+ <Base title={rendered.title} description={rendered.description}${type.traits.includes('image') ? ' image={rendered.image?.src && (typeof rendered.image.src === \'string\' ? rendered.image.src : rendered.image.src.src)}' : ''}>
124
+ <Prose>
125
+ <h1>{rendered.title}</h1>
126
+ {rendered.description && <p>{rendered.description}</p>}
127
+ ${type.traits.includes('image') ? '{rendered.image && <Media image={rendered.image} />}' : ''}
128
+ <Content />
129
+ </Prose>
130
+ </Base>
131
+ `;
132
+ }
133
+ function contentFiles(composition, options) {
134
+ const locale = composition.contentLocales[0];
135
+ const mediaFolder = z.string().regex(/^src\/assets(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/)
136
+ .parse(options.mediaFolder ?? 'src/assets');
137
+ const exampleImage = `${mediaFolder}/content-example.svg`;
138
+ const files = [
139
+ { path: 'src/content/definitions.ts', content: `import { defineCollection, z } from 'astro:content';
140
+ import { glob } from 'astro/loaders';
141
+ import { titleTraitSchema, slugTraitSchema${composition.contentTypes.some((type) => type.traits.includes('summary')) ? ', summaryTraitSchema' : ''}${composition.contentTypes.some((type) => type.traits.includes('image')) ? ', imageTraitSchema' : ''} } from '@easy-web/core/contracts';
142
+
143
+ export const composition = ${JSON.stringify(composition, null, 2)} as const;
144
+
145
+ export const collections = {
146
+ ${composition.contentTypes.map(collectionSchema).join(',\n ')},
147
+ };
148
+ ` },
149
+ { path: 'src/content.config.ts', content: "export { collections } from './content/definitions';\n" },
150
+ { path: 'package.json', content: `${JSON.stringify({ dependencies: {
151
+ '@easy-web/core': contentRuntimeRange,
152
+ ...(composition.contentTypes.some((type) => type.traits.includes('image')) ? { sharp: '^0.35.0' } : {}),
153
+ } }, null, 2)}\n` },
154
+ ];
155
+ if (composition.contentTypes.some((type) => type.traits.includes('image'))) {
156
+ files.push({ path: exampleImage, content: '<svg xmlns="http://www.w3.org/2000/svg" width="640" height="360" viewBox="0 0 640 360"><rect width="640" height="360" fill="#334155"/><circle cx="320" cy="180" r="90" fill="#94a3b8"/></svg>\n' });
157
+ }
158
+ for (const [index, type] of composition.contentTypes.entries()) {
159
+ const data = {
160
+ title: `${type.labels[locale]} - ${locale === 'de' ? 'Beispiel' : 'Example'}`,
161
+ slug: 'example',
162
+ ...(type.traits.includes('summary') ? { summary: locale === 'de' ? 'Generierter Beispielinhalt.' : 'Generated example content.' } : {}),
163
+ ...(type.traits.includes('image') ? { image: { src: posix.relative(`src/content/${type.id}`, exampleImage), alt: locale === 'de' ? 'Kreis auf dunklem Hintergrund' : 'Circle on a dark background' } } : {}),
164
+ };
165
+ const base = routeBase(type, locale).slice(1);
166
+ files.push({ path: `src/content/${type.id}/example.md`, content: `---\n${JSON.stringify(data, null, 2)}\n---\n\n${locale === 'de' ? 'Ersetze diesen Beispielinhalt vor der Veroeffentlichung.' : 'Replace this example content before production.'}\n` }, { path: `src/lib/content/${type.id}.ts`, content: adapterSource(type, locale, index) }, { path: `src/pages/${base}/index.astro`, content: listSource(type, locale) }, { path: `src/pages/${base}/[slug].astro`, content: detailSource(type, locale) });
167
+ }
168
+ return files;
169
+ }
170
+ /** Bind package-owned content generation to a validated composition, independently of a CMS. */
171
+ export function createContentSiteRecipes(rawComposition, options = {}) {
172
+ const composition = generatedContentCompositionSchema.parse(rawComposition);
173
+ const locale = composition.contentLocales[0];
174
+ const files = contentFiles(composition, options);
175
+ const contributions = files
176
+ .filter(({ path }) => !path.startsWith('src/pages/'))
177
+ .map(({ path }, index) => ({ kind: path === 'package.json' ? 'dependency' : 'file', id: `content.file.${index}`, target: path }));
178
+ for (const type of composition.contentTypes) {
179
+ contributions.push({ kind: 'content', id: `content.type.${type.id}`, target: type.primary ? 'primary' : 'additional' }, { kind: 'route', id: `content.list.${type.id}`, target: `${routeBase(type, locale)}/` }, { kind: 'route', id: `content.detail.${type.id}`, target: `${routeBase(type, locale)}/[slug]` }, ...type.bindings.map((binding) => ({ kind: 'binding', id: `content.binding.${type.id}.${binding}`, target: `content.type.${type.id}` })));
180
+ }
181
+ const navigation = composition.contentTypes.filter((type) => type.bindings.includes('navigation'))
182
+ .map((type) => ({ label: type.labels[locale], href: `${routeBase(type, locale)}/` }));
183
+ return {
184
+ shell: {
185
+ ...shellRecipe,
186
+ validators: [{
187
+ id: 'shell.content-locale', phase: 'options',
188
+ validate: ({ options }) => options.defaultLocale === locale ? [] : [{ code: 'CONTENT_LOCALE_MISMATCH', message: 'shell.defaultLocale must match the content composition locale' }],
189
+ }],
190
+ generate: ({ options: shellOptions }) => ({ files: buildShellFiles(shellOptions, navigation, options.shellConfiguration) }),
191
+ },
192
+ content: {
193
+ id: 'content.pages', version: '1.7.1', protocolVersion: 1,
194
+ compatibleCliRange: '^0.1.0 || ^0.2.0', compatibleRuntimeRange: contentRuntimeRange,
195
+ provides: ['content.pages', 'content.typed-definitions'], requires: ['site.shell'], conflicts: [],
196
+ order: { priority: 10, key: 'content' }, optionsSchema: z.strictObject({}),
197
+ outputContributions: contributions, validators: [],
198
+ generate: () => ({ files }),
199
+ },
200
+ };
201
+ }
202
+ //# sourceMappingURL=content-site.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-site.js","sourceRoot":"","sources":["../../src/recipes/content-site.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OA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AAE;YACH,GAAG,WAAW;YACd,UAAU,EAAE,CAAC;oBACT,EAAE,EAAE,sBAAsB,EAAE,KAAK,EAAE,SAAS;oBAC5C,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,aAAa,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,+DAA+D,EAAE,CAAC;iBACrL,CAAC;YACF,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC;SAC9H;QACD,OAAO,EAAE;YACL,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;YACzD,kBAAkB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,mBAAmB;YACnF,QAAQ,EAAE,CAAC,eAAe,EAAE,2BAA2B,CAAC,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,EAAE;YACjG,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC;YAC1E,mBAAmB,EAAE,aAAa,EAAE,UAAU,EAAE,EAAE;YAClD,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;SAC9B;KACJ,CAAC;AACN,CAAC"}
@@ -6,4 +6,5 @@ export * from './graph.js';
6
6
  export * from './serialize.js';
7
7
  export * from './mermaid.js';
8
8
  export * from './shell-recipe.js';
9
+ export * from './content-site.js';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recipes/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recipes/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
@@ -6,4 +6,5 @@ export * from './graph.js';
6
6
  export * from './serialize.js';
7
7
  export * from './mermaid.js';
8
8
  export * from './shell-recipe.js';
9
+ export * from './content-site.js';
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recipes/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recipes/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { z } from 'astro/zod';
2
+ import type { NavItem } from '../contracts/types.js';
2
3
  export declare const SHELL_RECIPE_ID = "site.shell";
3
4
  declare const shellOptionsSchema: z.ZodObject<{
4
5
  siteName: z.ZodDefault<z.ZodString>;
@@ -6,7 +7,13 @@ declare const shellOptionsSchema: z.ZodObject<{
6
7
  noIndex: z.ZodDefault<z.ZodBoolean>;
7
8
  }, z.core.$strict>;
8
9
  export type ShellRecipeOptions = z.infer<typeof shellOptionsSchema>;
9
- export declare function buildShellFiles(rawOptions: unknown): readonly {
10
+ /** Source expressions supplied by first-party recipes, never by CLI configuration. */
11
+ export interface ShellConfiguration {
12
+ readonly imports?: readonly string[];
13
+ readonly integrations?: readonly string[];
14
+ readonly markdownProcessor?: string;
15
+ }
16
+ export declare function buildShellFiles(rawOptions: unknown, navigation?: readonly NavItem[], configuration?: ShellConfiguration): readonly {
10
17
  path: string;
11
18
  content: string;
12
19
  }[];
@@ -1 +1 @@
1
- {"version":3,"file":"shell-recipe.d.ts","sourceRoot":"","sources":["../../src/recipes/shell-recipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAG9B,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C,QAAA,MAAM,kBAAkB;;;;kBAItB,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AA6GpE,wBAAgB,eAAe,CAAC,UAAU,EAAE,OAAO,GAAG,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAajG;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAuBA;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE;;kBAtC0B,MAAM;qBAAW,MAAM;;;CAuChD,CAAC;AAE/C,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"shell-recipe.d.ts","sourceRoot":"","sources":["../../src/recipes/shell-recipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAE9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C,QAAA,MAAM,kBAAkB;;;;kBAItB,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAIpE,sFAAsF;AACtF,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACvC;AA+GD,wBAAgB,eAAe,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,GAAE,SAAS,OAAO,EAAO,EAAE,aAAa,GAAE,kBAAuB,GAAG,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAa9K;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAuBA;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE;;kBAtCuG,MAAM;qBAAW,MAAM;;;CAuC7H,CAAC;AAE/C,eAAe,WAAW,CAAC"}
@@ -6,48 +6,56 @@ const shellOptionsSchema = z.strictObject({
6
6
  noIndex: z.boolean().default(false),
7
7
  });
8
8
  const PLACEHOLDER_SITE_URL = 'https://replace-with-your-domain.example';
9
- function astroConfig(options) {
9
+ function astroConfig(options, configuration) {
10
10
  return `import { defineConfig } from 'astro/config';
11
11
  import easyWebSeo from '@easy-web/core/seo';
12
+ ${(configuration.imports ?? []).join('\n')}
12
13
 
13
14
  export default defineConfig({
14
15
  site: ${JSON.stringify(PLACEHOLDER_SITE_URL)},
16
+ ${configuration.markdownProcessor ? `markdown: { processor: ${configuration.markdownProcessor} },` : ''}
15
17
  integrations: [
16
18
  easyWebSeo({ noIndex: ${options.noIndex ? 'true' : 'false'} }),
19
+ ${(configuration.integrations ?? []).map((integration) => `${integration},`).join('\n ')}
17
20
  ],
18
21
  });
19
22
  `;
20
23
  }
21
24
  const packageJsonFragment = `${JSON.stringify({
22
25
  type: 'module',
23
- scripts: { dev: 'astro dev', build: 'astro build', preview: 'astro preview' },
26
+ scripts: { dev: 'astro dev', typecheck: 'astro check', build: 'astro build', preview: 'astro preview' },
24
27
  dependencies: { '@easy-web/core': '^1.5.0', astro: '^7.3.5' },
25
- devDependencies: { typescript: '^5.5.0' },
28
+ devDependencies: { '@astrojs/check': '^0.9.4', typescript: '^5.5.0' },
26
29
  }, null, 2)}\n`;
27
30
  const pnpmWorkspace = `allowBuilds:
28
31
  esbuild: true
29
32
  sharp: true
30
33
  `;
31
- function baseLayout(options) {
34
+ function baseLayout(options, navigation) {
32
35
  return `---
33
36
  import PageShell from '@easy-web/core/components/PageShell.astro';
34
37
  import Header from '@easy-web/core/components/Header.astro';
35
38
  import Footer from '@easy-web/core/components/Footer.astro';
39
+ import SeoHead from '@easy-web/core/components/SeoHead.astro';
40
+ import '@easy-web/core/styles/tokens.css';
36
41
 
37
42
  interface Props {
38
43
  title: string;
44
+ description?: string;
45
+ image?: string;
39
46
  }
40
- const { title } = Astro.props;
47
+ const { title, description, image } = Astro.props;
41
48
  const siteName = ${JSON.stringify(options.siteName)};
42
49
  const currentLang = ${JSON.stringify(options.defaultLocale)};
43
- const navItems = [{ label: 'Home', href: '/' }];
50
+ const navItems = ${JSON.stringify([{ label: options.defaultLocale === 'de' ? 'Startseite' : 'Home', href: '/' }, ...navigation])};
44
51
  ---
45
52
  <!doctype html>
46
53
  <html lang=${JSON.stringify(options.defaultLocale)}>
47
54
  <head>
48
55
  <meta charset="utf-8" />
49
56
  <meta name="viewport" content="width=device-width, initial-scale=1" />
50
- <title>{title}</title>
57
+ <SeoHead title={title} description={description} ogImage={image}
58
+ pathname={Astro.url.pathname} locale={currentLang} siteName={siteName} />
51
59
  </head>
52
60
  <body>
53
61
  <PageShell lang={currentLang}>
@@ -95,24 +103,21 @@ const localizedPaths = `import type { LocalizedPathGroup } from '@easy-web/core/
95
103
 
96
104
  export const localizedPaths: readonly LocalizedPathGroup[] = [];
97
105
  `;
98
- const robotsTxt = `Disallow: /admin/
99
- Sitemap: ${PLACEHOLDER_SITE_URL}/sitemap-index.xml
100
- `;
101
106
  const gitignore = `node_modules
102
107
  dist
103
108
  .astro
104
109
  `;
105
- export function buildShellFiles(rawOptions) {
110
+ export function buildShellFiles(rawOptions, navigation = [], configuration = {}) {
106
111
  const options = shellOptionsSchema.parse(rawOptions ?? {});
107
112
  return [
108
- { path: 'astro.config.mjs', content: astroConfig(options) },
113
+ { path: 'astro.config.mjs', content: astroConfig(options, configuration) },
109
114
  { path: 'package.json', content: packageJsonFragment },
110
115
  { path: 'pnpm-workspace.yaml', content: pnpmWorkspace },
111
- { path: 'src/layouts/Base.astro', content: baseLayout(options) },
116
+ { path: 'src/layouts/Base.astro', content: baseLayout(options, navigation) },
112
117
  { path: 'src/pages/index.astro', content: homePage(options) },
113
118
  { path: 'src/pages/404.astro', content: notFoundPage(options) },
114
119
  { path: 'src/lib/localized-paths.ts', content: localizedPaths },
115
- { path: 'public/robots.txt', content: robotsTxt },
120
+ { path: 'tsconfig.json', content: `${JSON.stringify({ extends: 'astro/tsconfigs/strict', include: ['.astro/types.d.ts', '**/*'], exclude: ['dist'] }, null, 2)}\n` },
116
121
  { path: '.gitignore', content: gitignore },
117
122
  ];
118
123
  }
@@ -120,7 +125,7 @@ export const shellRecipe = {
120
125
  id: SHELL_RECIPE_ID,
121
126
  version: '1.5.0',
122
127
  protocolVersion: 1,
123
- compatibleCliRange: '^0.1.0',
128
+ compatibleCliRange: '^0.1.0 || ^0.2.0',
124
129
  compatibleRuntimeRange: '^1.5.0',
125
130
  provides: [SHELL_RECIPE_ID],
126
131
  requires: [],
@@ -135,7 +140,7 @@ export const shellRecipe = {
135
140
  { kind: 'route', id: 'shell.home', target: '/' },
136
141
  { kind: 'route', id: 'shell.404', target: '/404' },
137
142
  { kind: 'file', id: 'shell.localized-paths', target: 'src/lib/localized-paths.ts' },
138
- { kind: 'file', id: 'shell.robots', target: 'public/robots.txt' },
143
+ { kind: 'configuration', id: 'shell.tsconfig', target: 'tsconfig.json' },
139
144
  { kind: 'file', id: 'shell.gitignore', target: '.gitignore' },
140
145
  ],
141
146
  validators: [],
@@ -1 +1 @@
1
- {"version":3,"file":"shell-recipe.js","sourceRoot":"","sources":["../../src/recipes/shell-recipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAG9B,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC;AAE5C,MAAM,kBAAkB,GAAG,CAAC,CAAC,YAAY,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;IACnD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACvC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACtC,CAAC,CAAC;AAIH,MAAM,oBAAoB,GAAG,0CAA0C,CAAC;AAExE,SAAS,WAAW,CAAC,OAA2B;IAC5C,OAAO;;;;UAID,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC;;4BAElB,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;;;CAG7D,CAAC;AACF,CAAC;AAED,MAAM,mBAAmB,GAAG,GAAG,IAAI,CA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AC3E,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE;QAChD,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE;QAClD,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,uBAAuB,EAAE,MAAM,EAAE,4BAA4B,EAAE;QACnF,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,eAAe,EAAE;QACxE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAE,YAAY,EAAE;KAChE;IACD,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE,CAAC,OAA8B,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;CACjD,CAAC;AAE/C,eAAe,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-web/core",
3
- "version": "1.8.0",
3
+ "version": "1.9.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -0,0 +1,78 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { createContentSiteRecipes, generatedContentCompositionSchema } from '../content-site.js';
3
+ import { resolveCapabilityGraph } from '../graph.js';
4
+ import { shellRecipe } from '../shell-recipe.js';
5
+
6
+ const type = {
7
+ id: 'entries', primary: true, labels: { en: 'Entries' }, routes: { en: '/entries/' },
8
+ traits: ['title', 'slug', 'summary', 'image', 'body'],
9
+ bindings: ['list', 'detail', 'navigation'],
10
+ };
11
+ const composition = { contentLocales: ['en'], contentTypes: [type] };
12
+
13
+ describe('content site recipes', () => {
14
+ it.each([{ traits: ['title', 'slug', 'body'] }, { traits: type.traits }])('declares the first trait-schema runtime with traits $traits', async ({ traits }) => {
15
+ const { content } = createContentSiteRecipes({ ...composition, contentTypes: [{ ...type, traits }] });
16
+ const output = await content.generate({ options: {}, capabilities: [], contributions: [] });
17
+ const manifest = JSON.parse(String(output.files.find(({ path }) => path === 'package.json')?.content));
18
+ expect(manifest.dependencies).toEqual({
19
+ '@easy-web/core': '^1.6.0',
20
+ ...(traits.includes('image') ? { sharp: '^0.35.0' } : {}),
21
+ });
22
+ expect(content.compatibleRuntimeRange).toBe(manifest.dependencies['@easy-web/core']);
23
+ expect(content.outputContributions).toContainEqual(expect.objectContaining({ kind: 'dependency', target: 'package.json' }));
24
+ });
25
+
26
+ it('resolves content roles, rendering bindings and routes with shell navigation', async () => {
27
+ const recipes = createContentSiteRecipes(composition);
28
+ const graph = resolveCapabilityGraph([recipes.content, recipes.shell]);
29
+ expect(graph.ok).toBe(true);
30
+ if (!graph.ok) throw new Error(JSON.stringify(graph.error));
31
+ expect(graph.value.contentTypes.primary?.id).toBe('content.type.entries');
32
+ expect(graph.value.contributions.filter(({ kind }) => kind === 'binding')).toHaveLength(3);
33
+ expect(graph.value.fixedPages.map(({ target }) => target)).toEqual(expect.arrayContaining(['/entries/', '/entries/[slug]']));
34
+ const shell = await recipes.shell.generate({ options: shellRecipe.optionsSchema.parse({}), capabilities: [], contributions: [] });
35
+ expect(shell.files.find(({ path }) => path === 'src/layouts/Base.astro')?.content).toContain('"href":"/entries/"');
36
+ const content = await recipes.content.generate({ options: {}, capabilities: [], contributions: [] });
37
+ expect(content.files.find(({ path }) => path === 'src/content/definitions.ts')?.content).toContain('image()');
38
+ expect(content.files.find(({ path }) => path === 'src/lib/content/entries.ts')?.content).toContain("assertImplements<Entry['data'], HasTitle & HasSlug & HasSummary & HasImage>()");
39
+ });
40
+
41
+ it('omits optional image/summary fields and navigation rather than inventing capabilities', async () => {
42
+ const recipes = createContentSiteRecipes({ ...composition, contentTypes: [{ ...type, traits: ['title', 'slug', 'body'], bindings: ['list', 'detail'] }] });
43
+ const content = await recipes.content.generate({ options: {}, capabilities: [], contributions: [] });
44
+ expect(content.files.some(({ path }) => path.endsWith('.svg'))).toBe(false);
45
+ expect(content.files.find(({ path }) => path === 'src/lib/content/entries.ts')?.content).not.toContain('data.summary');
46
+ expect(recipes.content.outputContributions.some(({ id }) => id.endsWith('.navigation'))).toBe(false);
47
+ });
48
+
49
+ it('uses bracket access for kebab-case collection IDs and nested route imports', async () => {
50
+ const recipes = createContentSiteRecipes({ ...composition, contentTypes: [{ ...type, id: 'example-entry', routes: { en: '/library/entries' } }] });
51
+ const content = await recipes.content.generate({ options: {}, capabilities: [], contributions: [] });
52
+ expect(content.files.find(({ path }) => path === 'src/pages/library/entries/index.astro')?.content).toContain("../../../lib/content/example-entry");
53
+ expect(content.files.find(({ path }) => path === 'src/content/definitions.ts')?.content).toContain('"example-entry": defineCollection');
54
+ });
55
+
56
+ it.each([
57
+ { traits: ['title', 'slug', 'body', 'photos'] },
58
+ { traits: ['title', 'slug', 'body', 'money'], currency: 'EUR' },
59
+ { bindings: ['homepage', 'list', 'detail'], traits: ['title', 'slug', 'image', 'featured', 'body'] },
60
+ { bindings: ['list'] },
61
+ { traits: ['title', 'slug'] },
62
+ { routes: { en: '/admin/imports/' } },
63
+ { routes: { en: '/404/examples/' } },
64
+ { routes: { en: '/x/[slug]/' } },
65
+ { routes: { en: '/x/../y/' } },
66
+ ])('rejects unsupported composition changes %j', (change) => {
67
+ expect(generatedContentCompositionSchema.safeParse({ ...composition, reservedRoutes: [], contentTypes: [{ ...type, ...change }] }).success).toBe(false);
68
+ });
69
+
70
+ it('rejects overlapping routes before producing recipes', () => {
71
+ expect(() => createContentSiteRecipes({ ...composition, contentTypes: [type, { ...type, id: 'other', primary: false, routes: { en: '/entries/example/' } }] })).toThrow('overlap');
72
+ });
73
+
74
+ it('rejects multiple locales and empty content selections', () => {
75
+ expect(generatedContentCompositionSchema.safeParse({ contentLocales: ['en'], contentTypes: [] }).success).toBe(false);
76
+ expect(generatedContentCompositionSchema.safeParse({ contentLocales: ['en', 'de'], contentTypes: [] }).success).toBe(false);
77
+ });
78
+ });
@@ -10,7 +10,7 @@ const CONTRIBUTION_FILE_PATH: Record<string, string> = {
10
10
  'shell.home': 'src/pages/index.astro',
11
11
  'shell.404': 'src/pages/404.astro',
12
12
  'shell.localized-paths': 'src/lib/localized-paths.ts',
13
- 'shell.robots': 'public/robots.txt',
13
+ 'shell.tsconfig': 'tsconfig.json',
14
14
  'shell.gitignore': '.gitignore',
15
15
  };
16
16
 
@@ -38,6 +38,8 @@ describe('shell recipe', () => {
38
38
  const files = buildShellFiles({ noIndex: true });
39
39
  const config = files.find((file) => file.path === 'astro.config.mjs')!;
40
40
  expect(config.content).toContain('noIndex: true');
41
+ expect(files.find((file) => file.path === 'src/layouts/Base.astro')!.content).toContain('<SeoHead');
42
+ expect(files.some((file) => file.path === 'public/robots.txt')).toBe(false);
41
43
  });
42
44
 
43
45
  it('never emits a real domain', () => {
@@ -72,4 +74,12 @@ describe('shell recipe', () => {
72
74
 
73
75
  expect(workspace.content).toBe('allowBuilds:\n esbuild: true\n sharp: true\n');
74
76
  });
77
+
78
+ it('keeps the shell-only runtime floor independent of content generation', () => {
79
+ const manifest = JSON.parse(buildShellFiles({}).find(({ path }) => path === 'package.json')!.content);
80
+ expect(manifest.dependencies['@easy-web/core']).toBe('^1.5.0');
81
+ expect(manifest.dependencies['@easy-web/cms-adapters']).toBeUndefined();
82
+ expect(manifest.dependencies.sharp).toBeUndefined();
83
+ expect(shellRecipe.compatibleRuntimeRange).toBe('^1.5.0');
84
+ });
75
85
  });
@@ -0,0 +1,229 @@
1
+ import { z } from 'astro/zod';
2
+ import { posix } from 'node:path';
3
+ import { contentCompositionSchema, defaultReservedContentRoutes } from '../contracts/content-composition.js';
4
+ import type { ContentComposition, ContentTypeDefinition } from '../contracts/content-composition.js';
5
+ import { buildShellFiles, shellRecipe } from './shell-recipe.js';
6
+ import type { ShellConfiguration, ShellRecipeOptions } from './shell-recipe.js';
7
+ import type { RecipeGeneratedFile, RecipeMetadata } from './types.js';
8
+ import type { RecipeOutputContribution } from './schema.js';
9
+
10
+ const supportedTraits = new Set(['title', 'slug', 'summary', 'image', 'body']);
11
+ const supportedBindings = new Set(['list', 'detail', 'navigation', 'cms-admin']);
12
+ const contentRuntimeRange = '^1.6.0';
13
+
14
+ export interface ContentSiteOptions {
15
+ readonly mediaFolder?: string;
16
+ readonly shellConfiguration?: ShellConfiguration;
17
+ }
18
+
19
+ export const generatedContentCompositionSchema = contentCompositionSchema.superRefine((composition, context) => {
20
+ if (composition.contentLocales.length !== 1) {
21
+ context.addIssue({ code: 'custom', path: ['contentLocales'], message: 'Content generation currently requires exactly one locale' });
22
+ }
23
+ if (!composition.contentTypes.length) {
24
+ context.addIssue({ code: 'custom', path: ['contentTypes'], message: 'Content generation requires at least one content type' });
25
+ }
26
+ const routes: string[] = [];
27
+ composition.contentTypes.forEach((type, index) => {
28
+ const path = ['contentTypes', index];
29
+ for (const trait of type.traits) {
30
+ if (!supportedTraits.has(trait)) context.addIssue({ code: 'custom', path: [...path, 'traits'], message: `Content generation does not yet support trait "${trait}"` });
31
+ }
32
+ for (const binding of type.bindings) {
33
+ if (!supportedBindings.has(binding)) context.addIssue({ code: 'custom', path: [...path, 'bindings'], message: `Content generation does not yet support binding "${binding}"` });
34
+ }
35
+ if (!type.bindings.includes('list') || !type.bindings.includes('detail')) {
36
+ context.addIssue({ code: 'custom', path: [...path, 'bindings'], message: 'Content generation requires both list and detail bindings' });
37
+ }
38
+ for (const route of Object.values(type.routes)) {
39
+ const base = route.replace(/\/$/, '');
40
+ if (!/^\/[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/.test(base)
41
+ || defaultReservedContentRoutes.some((reserved) => reserved !== '/' && `${base}/`.startsWith(reserved))) {
42
+ context.addIssue({ code: 'custom', path: [...path, 'routes'], message: `Unsupported generated content route "${route}"; use non-reserved lowercase path segments` });
43
+ }
44
+ if (routes.some((other) => base.startsWith(`${other}/`) || other.startsWith(`${base}/`))) {
45
+ context.addIssue({ code: 'custom', path: [...path, 'routes'], message: `Generated list/detail routes overlap at "${route}"` });
46
+ }
47
+ routes.push(base);
48
+ }
49
+ });
50
+ });
51
+
52
+ function routeBase(type: ContentTypeDefinition, locale: string): string {
53
+ return type.routes[locale]!.replace(/\/$/, '');
54
+ }
55
+
56
+ function collectionSchema(type: ContentTypeDefinition): string {
57
+ const shapes = ['...titleTraitSchema.unwrap().shape', '...slugTraitSchema.unwrap().shape'];
58
+ if (type.traits.includes('summary')) shapes.push('...summaryTraitSchema.unwrap().shape');
59
+ if (type.traits.includes('image')) {
60
+ shapes.push('image: imageTraitSchema.unwrap().shape.image.unwrap().extend({ src: image() })');
61
+ }
62
+ // File-based IDs keep duplicate public slugs visible to route validation.
63
+ return `${JSON.stringify(type.id)}: defineCollection({
64
+ loader: glob({ pattern: '**/*.md', base: ${JSON.stringify(`./src/content/${type.id}`)}, generateId: ({ entry }) => entry.replace(/\\.md$/, '') }),
65
+ schema: ${type.traits.includes('image') ? '({ image }) => ' : ''}z.object({ ${shapes.join(', ')} }).strict(),
66
+ })`;
67
+ }
68
+
69
+ function adapterSource(type: ContentTypeDefinition, locale: string, index: number): string {
70
+ const contracts = ['HasTitle', 'HasSlug', ...(type.traits.includes('summary') ? ['HasSummary'] : []), ...(type.traits.includes('image') ? ['HasImage'] : [])];
71
+ return `import type { CollectionEntry } from 'astro:content';
72
+ import { assertImplements, type Item, type Linkable, ${contracts.map((name) => `type ${name}`).join(', ')} } from '@easy-web/core/contracts';
73
+ import { composition } from '../../content/definitions';
74
+
75
+ type Entry = CollectionEntry<${JSON.stringify(type.id)}>;
76
+ assertImplements<Entry['data'], ${contracts.join(' & ')}>();
77
+
78
+ export function toItem(entry: Entry): Item & Linkable {
79
+ const data = entry.data;
80
+ return {
81
+ title: data.title,
82
+ ${type.traits.includes('summary') ? 'description: data.summary,' : ''}
83
+ ${type.traits.includes('image') ? 'image: data.image,' : ''}
84
+ href: composition.contentTypes[${index}].routes[${JSON.stringify(locale)}].replace(/\\/$/, '') + '/' + data.slug + '/',
85
+ };
86
+ }
87
+ `;
88
+ }
89
+
90
+ function listSource(type: ContentTypeDefinition, locale: string): string {
91
+ const prefix = '../'.repeat(routeBase(type, locale).split('/').length);
92
+ return `---
93
+ import { getCollection } from 'astro:content';
94
+ import Base from '${prefix}layouts/Base.astro';
95
+ import { toItem } from '${prefix}lib/content/${type.id}';
96
+ import Card from '@easy-web/core/components/Card.astro';
97
+ import CardGrid from '@easy-web/core/components/CardGrid.astro';
98
+
99
+ const items = (await getCollection(${JSON.stringify(type.id)}))
100
+ .map(toItem).sort((left, right) => left.href < right.href ? -1 : left.href > right.href ? 1 : 0);
101
+ ---
102
+ <Base title={${JSON.stringify(type.labels[locale])}}>
103
+ <h1>{${JSON.stringify(type.labels[locale])}}</h1>
104
+ <CardGrid>
105
+ {items.map((item) => <Card item={item} />)}
106
+ </CardGrid>
107
+ </Base>
108
+ `;
109
+ }
110
+
111
+ function detailSource(type: ContentTypeDefinition, locale: string): string {
112
+ const prefix = '../'.repeat(routeBase(type, locale).split('/').length);
113
+ return `---
114
+ import { getCollection, render, type CollectionEntry } from 'astro:content';
115
+ import type { Rendered, Item, Linkable } from '@easy-web/core/contracts';
116
+ import Base from '${prefix}layouts/Base.astro';
117
+ import { toItem } from '${prefix}lib/content/${type.id}';
118
+ import Prose from '@easy-web/core/components/Prose.astro';
119
+ ${type.traits.includes('image') ? "import Media from '@easy-web/core/components/Media.astro';" : ''}
120
+
121
+ export async function getStaticPaths() {
122
+ const entries = await getCollection(${JSON.stringify(type.id)});
123
+ const seen = new Set<string>();
124
+ return entries.map((entry) => {
125
+ if (seen.has(entry.data.slug)) throw new Error('Duplicate content slug: ' + entry.data.slug);
126
+ seen.add(entry.data.slug);
127
+ return { params: { slug: entry.data.slug }, props: { entry } };
128
+ });
129
+ }
130
+
131
+ interface Props { entry: CollectionEntry<${JSON.stringify(type.id)}> }
132
+ const { entry } = Astro.props;
133
+ const rendered: Rendered<Item & Linkable> = { ...toItem(entry), ...(await render(entry)) };
134
+ const { Content } = rendered;
135
+ ---
136
+ <Base title={rendered.title} description={rendered.description}${type.traits.includes('image') ? ' image={rendered.image?.src && (typeof rendered.image.src === \'string\' ? rendered.image.src : rendered.image.src.src)}' : ''}>
137
+ <Prose>
138
+ <h1>{rendered.title}</h1>
139
+ {rendered.description && <p>{rendered.description}</p>}
140
+ ${type.traits.includes('image') ? '{rendered.image && <Media image={rendered.image} />}' : ''}
141
+ <Content />
142
+ </Prose>
143
+ </Base>
144
+ `;
145
+ }
146
+
147
+ function contentFiles(composition: ContentComposition, options: ContentSiteOptions): readonly RecipeGeneratedFile[] {
148
+ const locale = composition.contentLocales[0]!;
149
+ const mediaFolder = z.string().regex(/^src\/assets(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/)
150
+ .parse(options.mediaFolder ?? 'src/assets');
151
+ const exampleImage = `${mediaFolder}/content-example.svg`;
152
+ const files: RecipeGeneratedFile[] = [
153
+ { path: 'src/content/definitions.ts', content: `import { defineCollection, z } from 'astro:content';
154
+ import { glob } from 'astro/loaders';
155
+ import { titleTraitSchema, slugTraitSchema${composition.contentTypes.some((type) => type.traits.includes('summary')) ? ', summaryTraitSchema' : ''}${composition.contentTypes.some((type) => type.traits.includes('image')) ? ', imageTraitSchema' : ''} } from '@easy-web/core/contracts';
156
+
157
+ export const composition = ${JSON.stringify(composition, null, 2)} as const;
158
+
159
+ export const collections = {
160
+ ${composition.contentTypes.map(collectionSchema).join(',\n ')},
161
+ };
162
+ ` },
163
+ { path: 'src/content.config.ts', content: "export { collections } from './content/definitions';\n" },
164
+ { path: 'package.json', content: `${JSON.stringify({ dependencies: {
165
+ '@easy-web/core': contentRuntimeRange,
166
+ ...(composition.contentTypes.some((type) => type.traits.includes('image')) ? { sharp: '^0.35.0' } : {}),
167
+ } }, null, 2)}\n` },
168
+ ];
169
+ if (composition.contentTypes.some((type) => type.traits.includes('image'))) {
170
+ files.push({ path: exampleImage, content: '<svg xmlns="http://www.w3.org/2000/svg" width="640" height="360" viewBox="0 0 640 360"><rect width="640" height="360" fill="#334155"/><circle cx="320" cy="180" r="90" fill="#94a3b8"/></svg>\n' });
171
+ }
172
+ for (const [index, type] of composition.contentTypes.entries()) {
173
+ const data = {
174
+ title: `${type.labels[locale]} - ${locale === 'de' ? 'Beispiel' : 'Example'}`,
175
+ slug: 'example',
176
+ ...(type.traits.includes('summary') ? { summary: locale === 'de' ? 'Generierter Beispielinhalt.' : 'Generated example content.' } : {}),
177
+ ...(type.traits.includes('image') ? { image: { src: posix.relative(`src/content/${type.id}`, exampleImage), alt: locale === 'de' ? 'Kreis auf dunklem Hintergrund' : 'Circle on a dark background' } } : {}),
178
+ };
179
+ const base = routeBase(type, locale).slice(1);
180
+ files.push(
181
+ { path: `src/content/${type.id}/example.md`, content: `---\n${JSON.stringify(data, null, 2)}\n---\n\n${locale === 'de' ? 'Ersetze diesen Beispielinhalt vor der Veroeffentlichung.' : 'Replace this example content before production.'}\n` },
182
+ { path: `src/lib/content/${type.id}.ts`, content: adapterSource(type, locale, index) },
183
+ { path: `src/pages/${base}/index.astro`, content: listSource(type, locale) },
184
+ { path: `src/pages/${base}/[slug].astro`, content: detailSource(type, locale) },
185
+ );
186
+ }
187
+ return files;
188
+ }
189
+
190
+ /** Bind package-owned content generation to a validated composition, independently of a CMS. */
191
+ export function createContentSiteRecipes(rawComposition: unknown, options: ContentSiteOptions = {}): {
192
+ readonly shell: RecipeMetadata<ShellRecipeOptions>;
193
+ readonly content: RecipeMetadata;
194
+ } {
195
+ const composition = generatedContentCompositionSchema.parse(rawComposition);
196
+ const locale = composition.contentLocales[0]!;
197
+ const files = contentFiles(composition, options);
198
+ const contributions: RecipeOutputContribution[] = files
199
+ .filter(({ path }) => !path.startsWith('src/pages/'))
200
+ .map(({ path }, index) => ({ kind: path === 'package.json' ? 'dependency' : 'file', id: `content.file.${index}`, target: path }));
201
+ for (const type of composition.contentTypes) {
202
+ contributions.push(
203
+ { kind: 'content', id: `content.type.${type.id}`, target: type.primary ? 'primary' : 'additional' },
204
+ { kind: 'route', id: `content.list.${type.id}`, target: `${routeBase(type, locale)}/` },
205
+ { kind: 'route', id: `content.detail.${type.id}`, target: `${routeBase(type, locale)}/[slug]` },
206
+ ...type.bindings.map((binding) => ({ kind: 'binding' as const, id: `content.binding.${type.id}.${binding}`, target: `content.type.${type.id}` })),
207
+ );
208
+ }
209
+ const navigation = composition.contentTypes.filter((type) => type.bindings.includes('navigation'))
210
+ .map((type) => ({ label: type.labels[locale]!, href: `${routeBase(type, locale)}/` }));
211
+ return {
212
+ shell: {
213
+ ...shellRecipe,
214
+ validators: [{
215
+ id: 'shell.content-locale', phase: 'options',
216
+ validate: ({ options }) => options.defaultLocale === locale ? [] : [{ code: 'CONTENT_LOCALE_MISMATCH', message: 'shell.defaultLocale must match the content composition locale' }],
217
+ }],
218
+ generate: ({ options: shellOptions }) => ({ files: buildShellFiles(shellOptions, navigation, options.shellConfiguration) }),
219
+ },
220
+ content: {
221
+ id: 'content.pages', version: '1.7.1', protocolVersion: 1,
222
+ compatibleCliRange: '^0.1.0 || ^0.2.0', compatibleRuntimeRange: contentRuntimeRange,
223
+ provides: ['content.pages', 'content.typed-definitions'], requires: ['site.shell'], conflicts: [],
224
+ order: { priority: 10, key: 'content' }, optionsSchema: z.strictObject({}),
225
+ outputContributions: contributions, validators: [],
226
+ generate: () => ({ files }),
227
+ },
228
+ };
229
+ }
@@ -6,3 +6,4 @@ export * from './graph.js';
6
6
  export * from './serialize.js';
7
7
  export * from './mermaid.js';
8
8
  export * from './shell-recipe.js';
9
+ export * from './content-site.js';
@@ -1,5 +1,6 @@
1
1
  import { z } from 'astro/zod';
2
2
  import type { RecipeMetadata } from './types.js';
3
+ import type { NavItem } from '../contracts/types.js';
3
4
 
4
5
  export const SHELL_RECIPE_ID = 'site.shell';
5
6
 
@@ -13,14 +14,24 @@ export type ShellRecipeOptions = z.infer<typeof shellOptionsSchema>;
13
14
 
14
15
  const PLACEHOLDER_SITE_URL = 'https://replace-with-your-domain.example';
15
16
 
16
- function astroConfig(options: ShellRecipeOptions): string {
17
+ /** Source expressions supplied by first-party recipes, never by CLI configuration. */
18
+ export interface ShellConfiguration {
19
+ readonly imports?: readonly string[];
20
+ readonly integrations?: readonly string[];
21
+ readonly markdownProcessor?: string;
22
+ }
23
+
24
+ function astroConfig(options: ShellRecipeOptions, configuration: ShellConfiguration): string {
17
25
  return `import { defineConfig } from 'astro/config';
18
26
  import easyWebSeo from '@easy-web/core/seo';
27
+ ${(configuration.imports ?? []).join('\n')}
19
28
 
20
29
  export default defineConfig({
21
30
  site: ${JSON.stringify(PLACEHOLDER_SITE_URL)},
31
+ ${configuration.markdownProcessor ? `markdown: { processor: ${configuration.markdownProcessor} },` : ''}
22
32
  integrations: [
23
33
  easyWebSeo({ noIndex: ${options.noIndex ? 'true' : 'false'} }),
34
+ ${(configuration.integrations ?? []).map((integration) => `${integration},`).join('\n ')}
24
35
  ],
25
36
  });
26
37
  `;
@@ -28,9 +39,9 @@ export default defineConfig({
28
39
 
29
40
  const packageJsonFragment = `${JSON.stringify({
30
41
  type: 'module',
31
- scripts: { dev: 'astro dev', build: 'astro build', preview: 'astro preview' },
42
+ scripts: { dev: 'astro dev', typecheck: 'astro check', build: 'astro build', preview: 'astro preview' },
32
43
  dependencies: { '@easy-web/core': '^1.5.0', astro: '^7.3.5' },
33
- devDependencies: { typescript: '^5.5.0' },
44
+ devDependencies: { '@astrojs/check': '^0.9.4', typescript: '^5.5.0' },
34
45
  }, null, 2)}\n`;
35
46
 
36
47
  const pnpmWorkspace = `allowBuilds:
@@ -38,26 +49,31 @@ const pnpmWorkspace = `allowBuilds:
38
49
  sharp: true
39
50
  `;
40
51
 
41
- function baseLayout(options: ShellRecipeOptions): string {
52
+ function baseLayout(options: ShellRecipeOptions, navigation: readonly NavItem[]): string {
42
53
  return `---
43
54
  import PageShell from '@easy-web/core/components/PageShell.astro';
44
55
  import Header from '@easy-web/core/components/Header.astro';
45
56
  import Footer from '@easy-web/core/components/Footer.astro';
57
+ import SeoHead from '@easy-web/core/components/SeoHead.astro';
58
+ import '@easy-web/core/styles/tokens.css';
46
59
 
47
60
  interface Props {
48
61
  title: string;
62
+ description?: string;
63
+ image?: string;
49
64
  }
50
- const { title } = Astro.props;
65
+ const { title, description, image } = Astro.props;
51
66
  const siteName = ${JSON.stringify(options.siteName)};
52
67
  const currentLang = ${JSON.stringify(options.defaultLocale)};
53
- const navItems = [{ label: 'Home', href: '/' }];
68
+ const navItems = ${JSON.stringify([{ label: options.defaultLocale === 'de' ? 'Startseite' : 'Home', href: '/' }, ...navigation])};
54
69
  ---
55
70
  <!doctype html>
56
71
  <html lang=${JSON.stringify(options.defaultLocale)}>
57
72
  <head>
58
73
  <meta charset="utf-8" />
59
74
  <meta name="viewport" content="width=device-width, initial-scale=1" />
60
- <title>{title}</title>
75
+ <SeoHead title={title} description={description} ogImage={image}
76
+ pathname={Astro.url.pathname} locale={currentLang} siteName={siteName} />
61
77
  </head>
62
78
  <body>
63
79
  <PageShell lang={currentLang}>
@@ -109,26 +125,22 @@ const localizedPaths = `import type { LocalizedPathGroup } from '@easy-web/core/
109
125
  export const localizedPaths: readonly LocalizedPathGroup[] = [];
110
126
  `;
111
127
 
112
- const robotsTxt = `Disallow: /admin/
113
- Sitemap: ${PLACEHOLDER_SITE_URL}/sitemap-index.xml
114
- `;
115
-
116
128
  const gitignore = `node_modules
117
129
  dist
118
130
  .astro
119
131
  `;
120
132
 
121
- export function buildShellFiles(rawOptions: unknown): readonly { path: string; content: string }[] {
133
+ export function buildShellFiles(rawOptions: unknown, navigation: readonly NavItem[] = [], configuration: ShellConfiguration = {}): readonly { path: string; content: string }[] {
122
134
  const options = shellOptionsSchema.parse(rawOptions ?? {});
123
135
  return [
124
- { path: 'astro.config.mjs', content: astroConfig(options) },
136
+ { path: 'astro.config.mjs', content: astroConfig(options, configuration) },
125
137
  { path: 'package.json', content: packageJsonFragment },
126
138
  { path: 'pnpm-workspace.yaml', content: pnpmWorkspace },
127
- { path: 'src/layouts/Base.astro', content: baseLayout(options) },
139
+ { path: 'src/layouts/Base.astro', content: baseLayout(options, navigation) },
128
140
  { path: 'src/pages/index.astro', content: homePage(options) },
129
141
  { path: 'src/pages/404.astro', content: notFoundPage(options) },
130
142
  { path: 'src/lib/localized-paths.ts', content: localizedPaths },
131
- { path: 'public/robots.txt', content: robotsTxt },
143
+ { path: 'tsconfig.json', content: `${JSON.stringify({ extends: 'astro/tsconfigs/strict', include: ['.astro/types.d.ts', '**/*'], exclude: ['dist'] }, null, 2)}\n` },
132
144
  { path: '.gitignore', content: gitignore },
133
145
  ];
134
146
  }
@@ -137,7 +149,7 @@ export const shellRecipe = {
137
149
  id: SHELL_RECIPE_ID,
138
150
  version: '1.5.0',
139
151
  protocolVersion: 1,
140
- compatibleCliRange: '^0.1.0',
152
+ compatibleCliRange: '^0.1.0 || ^0.2.0',
141
153
  compatibleRuntimeRange: '^1.5.0',
142
154
  provides: [SHELL_RECIPE_ID],
143
155
  requires: [],
@@ -152,7 +164,7 @@ export const shellRecipe = {
152
164
  { kind: 'route', id: 'shell.home', target: '/' },
153
165
  { kind: 'route', id: 'shell.404', target: '/404' },
154
166
  { kind: 'file', id: 'shell.localized-paths', target: 'src/lib/localized-paths.ts' },
155
- { kind: 'file', id: 'shell.robots', target: 'public/robots.txt' },
167
+ { kind: 'configuration', id: 'shell.tsconfig', target: 'tsconfig.json' },
156
168
  { kind: 'file', id: 'shell.gitignore', target: '.gitignore' },
157
169
  ],
158
170
  validators: [],