scribe-cms 0.0.2 → 0.0.5
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 +2 -3
- package/bin/scribe.js +2 -11
- package/dist/cli/index.cjs +1437 -225
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +1437 -226
- 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 +591 -147
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +587 -148
- package/dist/index.js.map +1 -1
- package/dist/runtime.cjs +14 -2
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +14 -2
- package/dist/runtime.js.map +1 -1
- package/dist/src/config/resolve-config.d.ts.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 +5 -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-assets.d.ts +20 -0
- package/dist/src/validate/validate-assets.d.ts.map +1 -0
- package/dist/src/validate/validate-project.d.ts +1 -1
- package/dist/src/validate/validate-project.d.ts.map +1 -1
- package/dist/src/version.d.ts +4 -0
- package/dist/src/version.d.ts.map +1 -0
- 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 +16 -5
- package/bin/ensure-built.mjs +0 -31
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
|
|
package/bin/scribe.js
CHANGED
|
@@ -8,17 +8,8 @@ const pkgRoot = path.dirname(fileURLToPath(new URL("../package.json", import.met
|
|
|
8
8
|
const builtCli = path.join(pkgRoot, "dist/cli/index.js");
|
|
9
9
|
|
|
10
10
|
if (!fs.existsSync(builtCli)) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
stdio: "inherit",
|
|
14
|
-
cwd: pkgRoot,
|
|
15
|
-
});
|
|
16
|
-
if (build.status !== 0 || !fs.existsSync(builtCli)) {
|
|
17
|
-
console.error(
|
|
18
|
-
"scribe-cms could not run: dist/ is missing. Reinstall dependencies or run: pnpm --filter scribe-cms build",
|
|
19
|
-
);
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
11
|
+
console.error("scribe-cms is not built.");
|
|
12
|
+
process.exit(1);
|
|
22
13
|
}
|
|
23
14
|
|
|
24
15
|
const result = spawnSync(process.execPath, [builtCli, ...process.argv.slice(2)], {
|