scribe-cms 0.0.12 → 0.0.13

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.
Files changed (55) hide show
  1. package/README.md +21 -6
  2. package/dist/cli/index.cjs +1220 -204
  3. package/dist/cli/index.cjs.map +1 -1
  4. package/dist/cli/index.js +1221 -205
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/cli/prompt-translate.d.ts +3 -0
  7. package/dist/cli/prompt-translate.d.ts.map +1 -1
  8. package/dist/cli/translate-progress.d.ts.map +1 -1
  9. package/dist/index.cjs +982 -166
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.js +983 -168
  12. package/dist/index.js.map +1 -1
  13. package/dist/runtime.cjs +149 -62
  14. package/dist/runtime.cjs.map +1 -1
  15. package/dist/runtime.js +149 -62
  16. package/dist/runtime.js.map +1 -1
  17. package/dist/src/config/resolve-config.d.ts.map +1 -1
  18. package/dist/src/core/introspect-schema.d.ts +7 -1
  19. package/dist/src/core/introspect-schema.d.ts.map +1 -1
  20. package/dist/src/core/types.d.ts +6 -0
  21. package/dist/src/core/types.d.ts.map +1 -1
  22. package/dist/src/create-project.d.ts.map +1 -1
  23. package/dist/src/i18n/resolve-document.d.ts +1 -1
  24. package/dist/src/i18n/resolve-document.d.ts.map +1 -1
  25. package/dist/src/index.d.ts +3 -3
  26. package/dist/src/index.d.ts.map +1 -1
  27. package/dist/src/storage/batch-jobs.d.ts +53 -0
  28. package/dist/src/storage/batch-jobs.d.ts.map +1 -0
  29. package/dist/src/storage/sqlite.d.ts.map +1 -1
  30. package/dist/src/translate/batch-worklist.d.ts +87 -0
  31. package/dist/src/translate/batch-worklist.d.ts.map +1 -0
  32. package/dist/src/translate/gemini-batch.d.ts +26 -0
  33. package/dist/src/translate/gemini-batch.d.ts.map +1 -0
  34. package/dist/src/translate/gemini-client.d.ts +18 -0
  35. package/dist/src/translate/gemini-client.d.ts.map +1 -1
  36. package/dist/src/translate/gemini-models.d.ts +9 -0
  37. package/dist/src/translate/gemini-models.d.ts.map +1 -1
  38. package/dist/src/translate/gemini-pricing.d.ts +2 -1
  39. package/dist/src/translate/gemini-pricing.d.ts.map +1 -1
  40. package/dist/src/translate/page-translator.d.ts +25 -52
  41. package/dist/src/translate/page-translator.d.ts.map +1 -1
  42. package/dist/src/translate/prompts/translation-prompt.d.ts +6 -0
  43. package/dist/src/translate/prompts/translation-prompt.d.ts.map +1 -1
  44. package/dist/src/translate/response-schema.d.ts +8 -1
  45. package/dist/src/translate/response-schema.d.ts.map +1 -1
  46. package/dist/src/translate/retry.d.ts +16 -0
  47. package/dist/src/translate/retry.d.ts.map +1 -0
  48. package/dist/src/translate/sanitize-mdx-jsx.d.ts.map +1 -1
  49. package/dist/src/translate/translate-core.d.ts +155 -0
  50. package/dist/src/translate/translate-core.d.ts.map +1 -0
  51. package/dist/studio/server.cjs +84 -47
  52. package/dist/studio/server.cjs.map +1 -1
  53. package/dist/studio/server.js +84 -47
  54. package/dist/studio/server.js.map +1 -1
  55. 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: { pt: ["pt-BR"] } (optional: try these locales before the default locale)
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 history blog my-post fr # revision timeline
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`.