@easy-web/cli 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 +67 -8
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -26,6 +26,16 @@ content composition, as shown below. Arbitrary multi-recipe JS config merging is
|
|
|
26
26
|
not supported in Phase 1. Package dependencies, devDependencies and
|
|
27
27
|
scripts merge additively in resolver order; the later value wins a key collision.
|
|
28
28
|
|
|
29
|
+
Generated runtime minima follow the APIs emitted by the selected recipes:
|
|
30
|
+
shell-only uses core `^1.5.0`; single-locale unordered content collections require core
|
|
31
|
+
`^1.6.0` (trait schemas); single-locale unordered content plus CMS requires core and CMS
|
|
32
|
+
adapters `^1.9.0` (`buildContentCompositionDecapConfig` and its coupled core
|
|
33
|
+
APIs). Bilingual DE/EN or ordered content requires core and, when enabled, CMS adapters
|
|
34
|
+
`^1.10.0` for the newly emitted APIs. Ordinary
|
|
35
|
+
installation must satisfy these ranges without release-age exclusions or other
|
|
36
|
+
policy bypasses. The CLI's own dependencies are creation-time dependencies, not
|
|
37
|
+
proof that the generated site's runtime ranges are sufficient.
|
|
38
|
+
|
|
29
39
|
## Content-aware generation
|
|
30
40
|
|
|
31
41
|
An optional top-level `composition` selects content independently of CMS. The CLI
|
|
@@ -52,14 +62,57 @@ not clone a site, copy a pilot, or read a customer repository.
|
|
|
52
62
|
}
|
|
53
63
|
```
|
|
54
64
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
`
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
Content generation supports one locale matching `shell.defaultLocale`, or the
|
|
66
|
+
opt-in DE/EN pair with a distinct label and route for each locale. It supports
|
|
67
|
+
one or more content types, required `title`/`slug`/`body`, optional
|
|
68
|
+
`summary`/`image`/`order`, and `list`/`detail` plus optional `navigation` bindings. At
|
|
69
|
+
most one type can be `primary`; that marker describes its graph role, not a
|
|
70
|
+
homepage renderer. Routes use non-reserved lowercase path segments and must not
|
|
71
|
+
overlap. Unsupported locale combinations, traits, homepage bindings, and
|
|
72
|
+
combining this composition with application auth fail as invalid input, before
|
|
73
|
+
target files are created. Existing single-locale and shell-only/auth behavior
|
|
74
|
+
remains unchanged.
|
|
75
|
+
|
|
76
|
+
When selected, `order` is optional per entry and accepts finite integers,
|
|
77
|
+
including negative and zero values. Missing values sort last; ties sort by slug
|
|
78
|
+
in the content locale, then by the collection ID. CMS forms expose an optional,
|
|
79
|
+
unbounded integer field. Bilingual or ordered consumers require core `^1.10.0`
|
|
80
|
+
and, when selected, CMS adapters `^1.10.0`; those floors assume both features
|
|
81
|
+
first ship together in 1.10.0. Other content-only compositions retain `^1.6.0`,
|
|
82
|
+
and CMS compositions without either feature retain `^1.9.0`.
|
|
83
|
+
|
|
84
|
+
To opt in to bilingual content, declare both complete locale entries and make
|
|
85
|
+
the shell's default match the first locale:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"recipes": {
|
|
90
|
+
"shell": { "siteName": "Example Site", "defaultLocale": "de" }
|
|
91
|
+
},
|
|
92
|
+
"composition": {
|
|
93
|
+
"contentLocales": ["de", "en"],
|
|
94
|
+
"contentTypes": [{
|
|
95
|
+
"id": "entries",
|
|
96
|
+
"primary": true,
|
|
97
|
+
"labels": { "de": "Einträge", "en": "Entries" },
|
|
98
|
+
"routes": { "de": "/beitraege/", "en": "/entries/" },
|
|
99
|
+
"traits": ["title", "slug", "summary", "body"],
|
|
100
|
+
"bindings": ["list", "detail", "navigation", "cms-admin"]
|
|
101
|
+
}]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The generated collection stores localized entries under
|
|
107
|
+
`src/content/<type>/<locale>/`, including required `locale` and
|
|
108
|
+
`translationKey` fields. Slugs, title, summary and markdown body belong to each
|
|
109
|
+
locale's entry. Each locale gets the exact list/detail routes in the composition,
|
|
110
|
+
localized navigation and language switching. Detail hreflang links are emitted
|
|
111
|
+
only for matching translation keys; an untranslated entry switches to that
|
|
112
|
+
locale's list instead of inventing a detail URL. Canonicals use the actual
|
|
113
|
+
locale route, and the opt-in SEO reconciliation validates built canonicals and
|
|
114
|
+
reciprocal head links before adding the same alternates to the sitemap. Localized
|
|
115
|
+
links and SEO URLs honor Astro's configured `base` path and trailing-slash mode.
|
|
63
116
|
|
|
64
117
|
Core owns schema, sample-content and page generation. The generated definitions
|
|
65
118
|
record the composition and export Astro collections built from the shared trait
|
|
@@ -105,6 +158,12 @@ standalone `/admin/` page, using the existing `AdminPage` component. Only conten
|
|
|
105
158
|
types with `cms-admin` appear in the editor; no binding means no editor exposure.
|
|
106
159
|
CMS without a bound type, or a CMS binding without the add-on, is rejected.
|
|
107
160
|
|
|
161
|
+
For a bilingual composition, Decap creates separate DE and EN collections under
|
|
162
|
+
the matching locale folders. Both sets of entries use the same `translationKey`
|
|
163
|
+
field as the Astro collection, and collection labels use the locale-specific
|
|
164
|
+
composition labels. The CMS editor's `uiLocale` controls the editor's field
|
|
165
|
+
labels independently of content locales.
|
|
166
|
+
|
|
108
167
|
The first media root owns editor uploads and the generated example image; all
|
|
109
168
|
configured roots get explicit source-asset previews. Roots must be distinct and
|
|
110
169
|
non-overlapping. Astro's markdown processor handles Decap's `/src/assets/...`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easy-web/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Create-only command-line interface for generating easy-web sites.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -16,13 +16,15 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"mri": "^1.2.0",
|
|
18
18
|
"astro": "^7.3.5",
|
|
19
|
-
"@easy-web/core": "1.
|
|
20
|
-
"@easy-web/auth": "1.
|
|
21
|
-
"@easy-web/cms-adapters": "1.
|
|
19
|
+
"@easy-web/core": "1.10.0",
|
|
20
|
+
"@easy-web/auth": "1.10.0",
|
|
21
|
+
"@easy-web/cms-adapters": "1.10.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^24.0.0",
|
|
25
|
+
"@types/semver": "^7.8.0",
|
|
25
26
|
"execa": "^9.6.1",
|
|
27
|
+
"semver": "^7.8.5",
|
|
26
28
|
"tsup": "^8.0.0",
|
|
27
29
|
"typescript": "^5.5.0",
|
|
28
30
|
"vitest": "^3.2.4"
|