scribe-cms 0.0.12 → 0.0.14
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 +21 -6
- package/dist/cli/index.cjs +1207 -204
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +1208 -205
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/prompt-translate.d.ts +3 -0
- package/dist/cli/prompt-translate.d.ts.map +1 -1
- package/dist/cli/translate-progress.d.ts.map +1 -1
- package/dist/index.cjs +969 -166
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +970 -168
- package/dist/index.js.map +1 -1
- package/dist/runtime.cjs +136 -62
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +136 -62
- package/dist/runtime.js.map +1 -1
- package/dist/src/config/resolve-config.d.ts.map +1 -1
- package/dist/src/core/introspect-schema.d.ts +7 -1
- package/dist/src/core/introspect-schema.d.ts.map +1 -1
- package/dist/src/core/types.d.ts +6 -0
- package/dist/src/core/types.d.ts.map +1 -1
- package/dist/src/create-project.d.ts.map +1 -1
- package/dist/src/i18n/resolve-document.d.ts +1 -1
- package/dist/src/i18n/resolve-document.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/storage/batch-jobs.d.ts +53 -0
- package/dist/src/storage/batch-jobs.d.ts.map +1 -0
- package/dist/src/storage/sqlite.d.ts.map +1 -1
- package/dist/src/translate/batch-worklist.d.ts +87 -0
- package/dist/src/translate/batch-worklist.d.ts.map +1 -0
- package/dist/src/translate/gemini-batch.d.ts +26 -0
- package/dist/src/translate/gemini-batch.d.ts.map +1 -0
- package/dist/src/translate/gemini-client.d.ts +18 -0
- package/dist/src/translate/gemini-client.d.ts.map +1 -1
- package/dist/src/translate/gemini-models.d.ts +9 -0
- package/dist/src/translate/gemini-models.d.ts.map +1 -1
- package/dist/src/translate/gemini-pricing.d.ts +2 -1
- package/dist/src/translate/gemini-pricing.d.ts.map +1 -1
- package/dist/src/translate/page-translator.d.ts +25 -52
- package/dist/src/translate/page-translator.d.ts.map +1 -1
- package/dist/src/translate/prompts/translation-prompt.d.ts +6 -0
- package/dist/src/translate/prompts/translation-prompt.d.ts.map +1 -1
- package/dist/src/translate/response-schema.d.ts +8 -1
- package/dist/src/translate/response-schema.d.ts.map +1 -1
- package/dist/src/translate/retry.d.ts +16 -0
- package/dist/src/translate/retry.d.ts.map +1 -0
- package/dist/src/translate/sanitize-mdx-jsx.d.ts.map +1 -1
- package/dist/src/translate/translate-core.d.ts +155 -0
- package/dist/src/translate/translate-core.d.ts.map +1 -0
- package/dist/studio/server.cjs +84 -47
- package/dist/studio/server.cjs.map +1 -1
- package/dist/studio/server.js +84 -47
- package/dist/studio/server.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Typed, file-based CMS for multilingual MDX. English source files on disk, locale
|
|
|
4
4
|
|
|
5
5
|
Scribe has no framework dependency — it reads files and SQLite in-process and works with any Node-based stack (Next.js, Astro, Remix, SvelteKit, a static-site script, …). Examples in these docs use Next.js, but nothing about Scribe is Next-specific.
|
|
6
6
|
|
|
7
|
-
**Docs:** [Getting started](./docs/getting-started.md) · [Configuration](./docs/configuration.md) · [Writing content](./docs/content.md) · [Runtime API](./docs/runtime-api.md) · [Translation](./docs/translation.md)
|
|
7
|
+
**Docs:** [scribe.genlook.app/docs](https://scribe.genlook.app/docs) · [Getting started](./docs/getting-started.md) · [Configuration](./docs/configuration.md) · [Writing content](./docs/content.md) · [Runtime API](./docs/runtime-api.md) · [Translation](./docs/translation.md)
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -40,6 +40,7 @@ export default defineConfig({
|
|
|
40
40
|
// store: ".scribe/store.sqlite" (default)
|
|
41
41
|
locales: ["en", "fr"],
|
|
42
42
|
// defaultLocale: "en" (default)
|
|
43
|
+
// localeFallbacks: true (default: regional variants fall back to their base language, e.g. pt-BR to pt; set false to disable)
|
|
43
44
|
types: [
|
|
44
45
|
defineContentType({
|
|
45
46
|
id: "blog",
|
|
@@ -82,7 +83,7 @@ const scribe = createScribe(config);
|
|
|
82
83
|
// Lists & lookups
|
|
83
84
|
scribe.blog.list("fr"); // sorted docs for a locale
|
|
84
85
|
scribe.blog.get("my-post"); // exact slug lookup, no fallback
|
|
85
|
-
const r = scribe.blog.resolve("my-post", "fr"); // cross-locale slug fix + EN fallback
|
|
86
|
+
const r = scribe.blog.resolve("my-post", "fr"); // cross-locale slug fix + fallback chain + EN fallback
|
|
86
87
|
// r = { document, actualLocale, shouldRedirectTo?, canonicalPath? }
|
|
87
88
|
|
|
88
89
|
// Routing helpers
|
|
@@ -105,13 +106,27 @@ are inferred from the config — no codegen.
|
|
|
105
106
|
|
|
106
107
|
```bash
|
|
107
108
|
scribe status # EN docs + translation coverage
|
|
108
|
-
scribe validate # schemas, relations, redirects, sqlite consistency
|
|
109
|
-
scribe translate --locale fr # translate stale/missing pages (Gemini)
|
|
110
|
-
scribe translate --preset active
|
|
111
|
-
scribe
|
|
109
|
+
scribe validate # schemas, MDX bodies, relations, redirects, sqlite consistency
|
|
110
|
+
scribe translate --locale fr # translate stale/missing pages (Gemini Batch API, 50% token cost)
|
|
111
|
+
scribe translate --preset active --strategy missing-only
|
|
112
|
+
scribe translate --direct # per-page API calls at full price, immediate results
|
|
113
|
+
scribe translate --resume # pick up pending batch jobs from an interrupted run
|
|
114
|
+
scribe translate --dry-run # show the worklist without calling the API
|
|
115
|
+
scribe history blog my-post fr # EN snapshot timeline for one document
|
|
112
116
|
scribe studio # read-only local admin UI
|
|
117
|
+
scribe export-static # raw MDX files for static hosting / crawlers
|
|
113
118
|
```
|
|
114
119
|
|
|
120
|
+
Translated output is checked before it is stored: the returned MDX body must
|
|
121
|
+
parse and the frontmatter must re-validate against your Zod schema, so a bad
|
|
122
|
+
model response fails the command instead of reaching production. Interactive
|
|
123
|
+
runs show live progress with token counts and an estimated cost in USD.
|
|
124
|
+
|
|
125
|
+
Translation runs through the Gemini Batch API by default (half the token
|
|
126
|
+
cost). Jobs are persisted in the store as soon as they are submitted, so
|
|
127
|
+
interrupting a run is safe: the next `scribe translate` (or `--resume`) picks
|
|
128
|
+
pending jobs back up without submitting anything twice.
|
|
129
|
+
|
|
115
130
|
Translations are stored in `.scribe/store.sqlite` keyed by a hash of the EN
|
|
116
131
|
translatable content, so `scribe translate` only re-translates what changed.
|
|
117
132
|
**Commit `.scribe/`** — do not add it to `.gitignore`.
|