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.
- package/README.md +3 -20
- package/bin/scribe.js +20 -0
- package/dist/cli/index.cjs +1284 -171
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +1284 -171
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/prompt-translate.d.ts +16 -0
- package/dist/cli/prompt-translate.d.ts.map +1 -0
- package/dist/cli/translate-progress.d.ts +11 -0
- package/dist/cli/translate-progress.d.ts.map +1 -0
- package/dist/index.cjs +479 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +475 -102
- package/dist/index.js.map +1 -1
- package/dist/runtime.cjs +12 -2
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +12 -2
- package/dist/runtime.js.map +1 -1
- package/dist/src/core/field.d.ts +2 -0
- package/dist/src/core/field.d.ts.map +1 -1
- package/dist/src/core/types.d.ts +1 -1
- package/dist/src/core/types.d.ts.map +1 -1
- package/dist/src/export/build-static-raw-exports.d.ts +37 -0
- package/dist/src/export/build-static-raw-exports.d.ts.map +1 -0
- package/dist/src/export/write-static-raw-exports.d.ts +12 -0
- package/dist/src/export/write-static-raw-exports.d.ts.map +1 -0
- package/dist/src/history/record-revision.d.ts +2 -0
- package/dist/src/history/record-revision.d.ts.map +1 -1
- package/dist/src/index.d.ts +7 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/storage/sqlite.d.ts.map +1 -1
- package/dist/src/storage/translations.d.ts +6 -0
- package/dist/src/storage/translations.d.ts.map +1 -1
- package/dist/src/translate/gemini-client.d.ts +7 -0
- package/dist/src/translate/gemini-client.d.ts.map +1 -1
- package/dist/src/translate/gemini-models.d.ts +8 -0
- package/dist/src/translate/gemini-models.d.ts.map +1 -0
- package/dist/src/translate/gemini-pricing.d.ts +11 -0
- package/dist/src/translate/gemini-pricing.d.ts.map +1 -0
- package/dist/src/translate/page-translator.d.ts +38 -1
- package/dist/src/translate/page-translator.d.ts.map +1 -1
- package/dist/src/translate/prompts/translation-prompt.d.ts +1 -2
- package/dist/src/translate/prompts/translation-prompt.d.ts.map +1 -1
- package/dist/src/translate/response-schema.d.ts +7 -0
- package/dist/src/translate/response-schema.d.ts.map +1 -0
- package/dist/src/translate/validate-translation.d.ts +14 -0
- package/dist/src/translate/validate-translation.d.ts.map +1 -0
- package/dist/src/translate/worklist.d.ts +3 -0
- package/dist/src/translate/worklist.d.ts.map +1 -1
- package/dist/src/validate/validate-project.d.ts.map +1 -1
- package/dist/studio/server.cjs +611 -194
- package/dist/studio/server.cjs.map +1 -1
- package/dist/studio/server.d.ts +1 -1
- package/dist/studio/server.d.ts.map +1 -1
- package/dist/studio/server.js +611 -194
- package/dist/studio/server.js.map +1 -1
- 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:
|
|
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
|
-
|
|
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);
|