scribe-cms 0.0.1 → 0.0.4

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 (57) hide show
  1. package/README.md +3 -20
  2. package/bin/scribe.js +20 -0
  3. package/dist/cli/index.cjs +1284 -171
  4. package/dist/cli/index.cjs.map +1 -1
  5. package/dist/cli/index.js +1284 -171
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/cli/prompt-translate.d.ts +16 -0
  8. package/dist/cli/prompt-translate.d.ts.map +1 -0
  9. package/dist/cli/translate-progress.d.ts +11 -0
  10. package/dist/cli/translate-progress.d.ts.map +1 -0
  11. package/dist/index.cjs +479 -101
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.js +475 -102
  14. package/dist/index.js.map +1 -1
  15. package/dist/runtime.cjs +12 -2
  16. package/dist/runtime.cjs.map +1 -1
  17. package/dist/runtime.js +12 -2
  18. package/dist/runtime.js.map +1 -1
  19. package/dist/src/core/field.d.ts +2 -0
  20. package/dist/src/core/field.d.ts.map +1 -1
  21. package/dist/src/core/types.d.ts +1 -1
  22. package/dist/src/core/types.d.ts.map +1 -1
  23. package/dist/src/export/build-static-raw-exports.d.ts +37 -0
  24. package/dist/src/export/build-static-raw-exports.d.ts.map +1 -0
  25. package/dist/src/export/write-static-raw-exports.d.ts +12 -0
  26. package/dist/src/export/write-static-raw-exports.d.ts.map +1 -0
  27. package/dist/src/history/record-revision.d.ts +2 -0
  28. package/dist/src/history/record-revision.d.ts.map +1 -1
  29. package/dist/src/index.d.ts +7 -0
  30. package/dist/src/index.d.ts.map +1 -1
  31. package/dist/src/storage/sqlite.d.ts.map +1 -1
  32. package/dist/src/storage/translations.d.ts +6 -0
  33. package/dist/src/storage/translations.d.ts.map +1 -1
  34. package/dist/src/translate/gemini-client.d.ts +7 -0
  35. package/dist/src/translate/gemini-client.d.ts.map +1 -1
  36. package/dist/src/translate/gemini-models.d.ts +8 -0
  37. package/dist/src/translate/gemini-models.d.ts.map +1 -0
  38. package/dist/src/translate/gemini-pricing.d.ts +11 -0
  39. package/dist/src/translate/gemini-pricing.d.ts.map +1 -0
  40. package/dist/src/translate/page-translator.d.ts +38 -1
  41. package/dist/src/translate/page-translator.d.ts.map +1 -1
  42. package/dist/src/translate/prompts/translation-prompt.d.ts +1 -2
  43. package/dist/src/translate/prompts/translation-prompt.d.ts.map +1 -1
  44. package/dist/src/translate/response-schema.d.ts +7 -0
  45. package/dist/src/translate/response-schema.d.ts.map +1 -0
  46. package/dist/src/translate/validate-translation.d.ts +14 -0
  47. package/dist/src/translate/validate-translation.d.ts.map +1 -0
  48. package/dist/src/translate/worklist.d.ts +3 -0
  49. package/dist/src/translate/worklist.d.ts.map +1 -1
  50. package/dist/src/validate/validate-project.d.ts.map +1 -1
  51. package/dist/studio/server.cjs +611 -194
  52. package/dist/studio/server.cjs.map +1 -1
  53. package/dist/studio/server.d.ts +1 -1
  54. package/dist/studio/server.d.ts.map +1 -1
  55. package/dist/studio/server.js +611 -194
  56. package/dist/studio/server.js.map +1 -1
  57. package/package.json +17 -5
package/README.md CHANGED
@@ -20,8 +20,6 @@ Set `GEMINI_API_KEY` when using `scribe translate`.
20
20
 
21
21
  ```ts
22
22
  // scribe.config.ts (at your project root)
23
- import path from "node:path";
24
- import { fileURLToPath } from "node:url";
25
23
  import { z } from "zod";
26
24
  import { defineConfig, defineContentType, field } from "scribe-cms";
27
25
 
@@ -37,7 +35,7 @@ const authorSchema = z.object({
37
35
  });
38
36
 
39
37
  export default defineConfig({
40
- rootDir: path.dirname(fileURLToPath(import.meta.url)),
38
+ rootDir: ".", // relative to this file (CLI) / process.cwd() (runtime)
41
39
  // contentDir: "content" (default)
42
40
  // store: ".scribe/store.sqlite" (default)
43
41
  locales: ["en", "fr"],
@@ -116,6 +114,7 @@ scribe studio # read-only local admin UI
116
114
 
117
115
  Translations are stored in `.scribe/store.sqlite` keyed by a hash of the EN
118
116
  translatable content, so `scribe translate` only re-translates what changed.
117
+ **Commit `.scribe/`** — do not add it to `.gitignore`.
119
118
 
120
119
  ## Framework integration
121
120
 
@@ -131,20 +130,4 @@ The short version:
131
130
  `{ source, destination, permanent }` rules from aliases, `redirect_to`, and
132
131
  cross-locale slugs — map them to your framework's redirect config.
133
132
 
134
- ## Publish to npm
135
-
136
- From the monorepo root (builds, tests, then publishes):
137
-
138
- ```bash
139
- npm login # once, if needed
140
- pnpm publish:npm
141
- ```
142
-
143
- From this package directory:
144
-
145
- ```bash
146
- pnpm build
147
- pnpm publish:npm # runs npm publish --access public
148
- ```
149
-
150
- Site: [scribe.genlook.app](https://scribe.genlook.app)
133
+ **Site & examples:** [scribe.genlook.app](https://scribe.genlook.app) · [Example Next.js app](https://github.com/GenlookLabs/scribe-cms/tree/main/apps/web)
package/bin/scribe.js ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import { spawnSync } from "node:child_process";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ const pkgRoot = path.dirname(fileURLToPath(new URL("../package.json", import.meta.url)));
8
+ const builtCli = path.join(pkgRoot, "dist/cli/index.js");
9
+
10
+ if (!fs.existsSync(builtCli)) {
11
+ console.error("scribe-cms is not built.");
12
+ process.exit(1);
13
+ }
14
+
15
+ const result = spawnSync(process.execPath, [builtCli, ...process.argv.slice(2)], {
16
+ stdio: "inherit",
17
+ cwd: process.cwd(),
18
+ });
19
+
20
+ process.exit(result.status ?? 1);