docs-i18n 0.7.0 → 0.7.2
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/admin/package.json +0 -1
- package/dist/cli.js +12 -12
- package/package.json +2 -2
- package/template/package.json +0 -1
package/admin/package.json
CHANGED
package/dist/cli.js
CHANGED
|
@@ -52,20 +52,20 @@ async function handleSiteCommand() {
|
|
|
52
52
|
stdio: "inherit"
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
+
const viteBin = resolve(templateRoot, "node_modules", ".bin", "vite");
|
|
56
|
+
const siteEnv = { ...process.env, DOCS_I18N_PROJECT_ROOT: process.cwd() };
|
|
55
57
|
if (!subCommand || subCommand === "dev") {
|
|
56
|
-
const child = spawn(
|
|
58
|
+
const child = spawn(viteBin, ["--port", String(port)], {
|
|
57
59
|
cwd: templateRoot,
|
|
58
60
|
stdio: "inherit",
|
|
59
|
-
env:
|
|
60
|
-
shell: true
|
|
61
|
+
env: siteEnv
|
|
61
62
|
});
|
|
62
63
|
child.on("exit", (code) => process.exit(code ?? 0));
|
|
63
64
|
} else if (subCommand === "build") {
|
|
64
|
-
const child = spawn(
|
|
65
|
+
const child = spawn(viteBin, ["build"], {
|
|
65
66
|
cwd: templateRoot,
|
|
66
67
|
stdio: "inherit",
|
|
67
|
-
env:
|
|
68
|
-
shell: true
|
|
68
|
+
env: siteEnv
|
|
69
69
|
});
|
|
70
70
|
child.on("exit", (code) => process.exit(code ?? 0));
|
|
71
71
|
} else if (subCommand === "upload") {
|
|
@@ -82,10 +82,10 @@ async function handleSiteCommand() {
|
|
|
82
82
|
const sqlFile = resolve(os.tmpdir(), "docs-i18n-upload.sql");
|
|
83
83
|
writeFileSync(sqlFile, allSql.join("\n"));
|
|
84
84
|
const dbName = getOpt("db", "docs-i18n-db");
|
|
85
|
-
const
|
|
85
|
+
const wranglerBin = resolve(templateRoot, "node_modules", ".bin", "wrangler");
|
|
86
|
+
const child = spawn(wranglerBin, ["d1", "execute", dbName, "--file", sqlFile], {
|
|
86
87
|
cwd: templateRoot,
|
|
87
|
-
stdio: "inherit"
|
|
88
|
-
shell: true
|
|
88
|
+
stdio: "inherit"
|
|
89
89
|
});
|
|
90
90
|
child.on("exit", (code) => {
|
|
91
91
|
if (code === 0) {
|
|
@@ -94,11 +94,11 @@ async function handleSiteCommand() {
|
|
|
94
94
|
process.exit(code ?? 0);
|
|
95
95
|
});
|
|
96
96
|
} else if (subCommand === "deploy") {
|
|
97
|
-
const
|
|
97
|
+
const wranglerBin2 = resolve(templateRoot, "node_modules", ".bin", "wrangler");
|
|
98
|
+
const child = spawn(wranglerBin2, ["deploy"], {
|
|
98
99
|
cwd: templateRoot,
|
|
99
100
|
stdio: "inherit",
|
|
100
|
-
env:
|
|
101
|
-
shell: true
|
|
101
|
+
env: siteEnv
|
|
102
102
|
});
|
|
103
103
|
child.on("exit", (code) => process.exit(code ?? 0));
|
|
104
104
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docs-i18n",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Universal documentation translation engine — parse, translate, cache, assemble, manage.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dev": "tsup --watch",
|
|
24
24
|
"test": "vitest run",
|
|
25
25
|
"typecheck": "tsc --noEmit",
|
|
26
|
-
"prepack": "rm -rf admin template && cp -r ../admin admin && cp -r ../template template && rm -rf admin/node_modules template/node_modules",
|
|
26
|
+
"prepack": "rm -rf admin template && cp -r ../admin admin && cp -r ../template template && rm -rf admin/node_modules template/node_modules && node -e \"const fs=require('fs');const p=JSON.parse(fs.readFileSync('template/package.json','utf8'));delete p.dependencies['docs-i18n'];fs.writeFileSync('template/package.json',JSON.stringify(p,null,2)+'\\n');const a=JSON.parse(fs.readFileSync('admin/package.json','utf8'));delete a.dependencies['docs-i18n'];fs.writeFileSync('admin/package.json',JSON.stringify(a,null,2)+'\\n')\"",
|
|
27
27
|
"postpack": "rm -rf admin template",
|
|
28
28
|
"prepublishOnly": "rm -rf dist && tsup && chmod +x dist/cli.js"
|
|
29
29
|
},
|
package/template/package.json
CHANGED