@easy-web/cli 0.2.1 → 0.3.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 +82 -11
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -27,9 +27,11 @@ 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
29
|
Generated runtime minima follow the APIs emitted by the selected recipes:
|
|
30
|
-
shell-only uses core `^1.5.0`; content collections require core
|
|
31
|
-
schemas); content plus CMS requires core and CMS
|
|
32
|
-
(`buildContentCompositionDecapConfig` and its coupled core
|
|
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
|
|
33
35
|
installation must satisfy these ranges without release-age exclusions or other
|
|
34
36
|
policy bypasses. The CLI's own dependencies are creation-time dependencies, not
|
|
35
37
|
proof that the generated site's runtime ranges are sufficient.
|
|
@@ -60,14 +62,77 @@ not clone a site, copy a pilot, or read a customer repository.
|
|
|
60
62
|
}
|
|
61
63
|
```
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
`
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
+
### Opt in to publication gating
|
|
85
|
+
|
|
86
|
+
Set `"publish": "missing-date-means-draft"` on an individual content type in
|
|
87
|
+
`composition.contentTypes` to hide entries without a publication date. Alternatively,
|
|
88
|
+
`"missing-date-means-published"` shows undated entries. Both hide future dates and
|
|
89
|
+
show dates at or before evaluation time. Omit `publish` to keep the unfiltered
|
|
90
|
+
behavior. This option requires core `^1.11.0` and, with CMS, CMS adapters
|
|
91
|
+
`^1.11.0`.
|
|
92
|
+
|
|
93
|
+
The generated optional `publishDate` accepts dates, date strings, empty strings
|
|
94
|
+
and null; invalid dates and other types fail the build. CMS supplies a date-only UTC widget.
|
|
95
|
+
The draft policy also hides the undated generated example until a date is added.
|
|
96
|
+
Generated lists, detail routes and translation links filter independently for each
|
|
97
|
+
content type, using one instant captured when the static build is configured.
|
|
98
|
+
Development evaluates the current time on each read. On a static site, schedule a
|
|
99
|
+
rebuild after a date is reached; HTML does not update itself. Gating is not access
|
|
100
|
+
control. Any additional feeds, search indexes or custom routes must apply the same
|
|
101
|
+
rule and build instant themselves. Changing the generated build configuration or
|
|
102
|
+
switching to server rendering requires reviewing this behavior.
|
|
103
|
+
|
|
104
|
+
To opt in to bilingual content, declare both complete locale entries and make
|
|
105
|
+
the shell's default match the first locale:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"recipes": {
|
|
110
|
+
"shell": { "siteName": "Example Site", "defaultLocale": "de" }
|
|
111
|
+
},
|
|
112
|
+
"composition": {
|
|
113
|
+
"contentLocales": ["de", "en"],
|
|
114
|
+
"contentTypes": [{
|
|
115
|
+
"id": "entries",
|
|
116
|
+
"primary": true,
|
|
117
|
+
"labels": { "de": "Einträge", "en": "Entries" },
|
|
118
|
+
"routes": { "de": "/beitraege/", "en": "/entries/" },
|
|
119
|
+
"traits": ["title", "slug", "summary", "body"],
|
|
120
|
+
"bindings": ["list", "detail", "navigation", "cms-admin"]
|
|
121
|
+
}]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The generated collection stores localized entries under
|
|
127
|
+
`src/content/<type>/<locale>/`, including required `locale` and
|
|
128
|
+
`translationKey` fields. Slugs, title, summary and markdown body belong to each
|
|
129
|
+
locale's entry. Each locale gets the exact list/detail routes in the composition,
|
|
130
|
+
localized navigation and language switching. Detail hreflang links are emitted
|
|
131
|
+
only for matching translation keys; an untranslated entry switches to that
|
|
132
|
+
locale's list instead of inventing a detail URL. Canonicals use the actual
|
|
133
|
+
locale route, and the opt-in SEO reconciliation validates built canonicals and
|
|
134
|
+
reciprocal head links before adding the same alternates to the sitemap. Localized
|
|
135
|
+
links and SEO URLs honor Astro's configured `base` path and trailing-slash mode.
|
|
71
136
|
|
|
72
137
|
Core owns schema, sample-content and page generation. The generated definitions
|
|
73
138
|
record the composition and export Astro collections built from the shared trait
|
|
@@ -113,6 +178,12 @@ standalone `/admin/` page, using the existing `AdminPage` component. Only conten
|
|
|
113
178
|
types with `cms-admin` appear in the editor; no binding means no editor exposure.
|
|
114
179
|
CMS without a bound type, or a CMS binding without the add-on, is rejected.
|
|
115
180
|
|
|
181
|
+
For a bilingual composition, Decap creates separate DE and EN collections under
|
|
182
|
+
the matching locale folders. Both sets of entries use the same `translationKey`
|
|
183
|
+
field as the Astro collection, and collection labels use the locale-specific
|
|
184
|
+
composition labels. The CMS editor's `uiLocale` controls the editor's field
|
|
185
|
+
labels independently of content locales.
|
|
186
|
+
|
|
116
187
|
The first media root owns editor uploads and the generated example image; all
|
|
117
188
|
configured roots get explicit source-asset previews. Roots must be distinct and
|
|
118
189
|
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.1",
|
|
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.11.0",
|
|
20
|
+
"@easy-web/auth": "1.11.0",
|
|
21
|
+
"@easy-web/cms-adapters": "1.11.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"
|