@sumaq/site-kit 0.2.0 → 0.3.0
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
|
@@ -63,7 +63,7 @@ import Rooms from "../components/Rooms.astro"; // only this client
|
|
|
63
63
|
<BlockRenderer blocks={blocks} components={{ rooms: Rooms }} />
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
`components` merges into the catalogue **and wins over it**, so a site can add a block the kit does not have or replace one it does. An unmatched `type` still falls back to `Generic`, and warns in dev so a custom block never fails silently. Data-side there is nothing to register: `@sumaq/cms-schema` validates each block against the site's own `
|
|
66
|
+
`components` merges into the catalogue **and wins over it**, so a site can add a block the kit does not have or replace one it does. An unmatched `type` still falls back to `Generic`, and warns in dev so a custom block never fails silently. Data-side there is nothing to register: `@sumaq/cms-schema` validates each block against the site's own `schema/*.yaml`, never against a central list.
|
|
67
67
|
|
|
68
68
|
**The namespace rule:** `sq-*` belongs to the kit and is inventoried in `class-inventory.json`. Site-local components use their own prefix. That is what keeps the shared markup verifiable without taxing what makes a client's site theirs.
|
|
69
69
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sumaq/site-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Layouts, blocks, helpers and Astro config factory for Sumaq client sites.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "elingan",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@astrojs/sitemap": "3.7.3",
|
|
34
34
|
"marked": "15.0.7",
|
|
35
|
-
"@sumaq/cms-schema": "0.
|
|
35
|
+
"@sumaq/cms-schema": "0.2.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"astro": "7.1.4",
|
package/src/config.ts
CHANGED
|
@@ -21,13 +21,13 @@ export type SumaqSiteOptions = {
|
|
|
21
21
|
// i18n?: AstroUserConfig["i18n"];
|
|
22
22
|
// y se reenvía a `defineConfig` igual que `fonts` y `vite`. Hoy ningún sitio
|
|
23
23
|
// lo usa, así que no se añade en vacío: el día que haga falta, el cambio son
|
|
24
|
-
// dos líneas y hay que decidir a la vez cómo se traducen `
|
|
24
|
+
// dos líneas y hay que decidir a la vez cómo se traducen `schema/` y `content/`,
|
|
25
25
|
// que es la parte cara.
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Shared Astro config for Sumaq client sites.
|
|
30
|
-
* Validates content/*.json against
|
|
30
|
+
* Validates content/*.json against schema/*.yaml before the build emits pages.
|
|
31
31
|
*/
|
|
32
32
|
export function defineSumaqSite(opts: SumaqSiteOptions) {
|
|
33
33
|
return defineConfig({
|
|
@@ -41,10 +41,9 @@ export function defineSumaqSite(opts: SumaqSiteOptions) {
|
|
|
41
41
|
hooks: {
|
|
42
42
|
"astro:build:start": async () => {
|
|
43
43
|
if (opts.skipContentValidation) return;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
44
|
+
// No arguments: the directory names are the contract, and
|
|
45
|
+
// @sumaq/cms-schema is the only place that decides them.
|
|
46
|
+
await validateSiteContent();
|
|
48
47
|
},
|
|
49
48
|
},
|
|
50
49
|
},
|
package/src/profiles/clinic.yaml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Extraído de www-therapieraum-graz-at.
|
|
3
3
|
#
|
|
4
4
|
# `blocks` es el punto de partida, no el límite: un sitio puede declarar shapes
|
|
5
|
-
# propias en su `
|
|
5
|
+
# propias en su `schema/page.*.yaml` y pasar sus componentes a `<BlockRenderer
|
|
6
6
|
# components={{ … }} />`. Ver block-contract.md §7.
|
|
7
7
|
|
|
8
8
|
label: Práctica con sedes y equipo
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Extraído de www-elingan-dev.
|
|
3
3
|
#
|
|
4
4
|
# `blocks` es el punto de partida, no el límite: un sitio puede declarar shapes
|
|
5
|
-
# propias en su `
|
|
5
|
+
# propias en su `schema/page.*.yaml` y pasar sus componentes a `<BlockRenderer
|
|
6
6
|
# components={{ … }} />`. Ver block-contract.md §7.
|
|
7
7
|
|
|
8
8
|
label: Portfolio profesional
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Extraído de www-utehofer-at, www-bettinageidl-at y www-juliaschaffer-at.
|
|
3
3
|
#
|
|
4
4
|
# `blocks` es el punto de partida, no el límite: un sitio puede declarar shapes
|
|
5
|
-
# propias en su `
|
|
5
|
+
# propias en su `schema/page.*.yaml` y pasar sus componentes a `<BlockRenderer
|
|
6
6
|
# components={{ … }} />`. Ver block-contract.md §7.
|
|
7
7
|
|
|
8
8
|
label: Consulta de psicoterapia
|