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.
@@ -11,7 +11,6 @@
11
11
  "build": "vite build"
12
12
  },
13
13
  "dependencies": {
14
- "docs-i18n": "workspace:*",
15
14
  "hono": "^4.12.0",
16
15
  "react": "^19.1.0",
17
16
  "react-dom": "^19.1.0",
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("npx", ["vite", "--port", String(port)], {
58
+ const child = spawn(viteBin, ["--port", String(port)], {
57
59
  cwd: templateRoot,
58
60
  stdio: "inherit",
59
- env: { ...process.env, DOCS_I18N_PROJECT_ROOT: process.cwd() },
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("npx", ["vite", "build"], {
65
+ const child = spawn(viteBin, ["build"], {
65
66
  cwd: templateRoot,
66
67
  stdio: "inherit",
67
- env: { ...process.env, DOCS_I18N_PROJECT_ROOT: process.cwd() },
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 child = spawn("npx", ["wrangler", "d1", "execute", dbName, "--file", sqlFile], {
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 child = spawn("npx", ["wrangler", "deploy"], {
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: { ...process.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.0",
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
  },
@@ -15,7 +15,6 @@
15
15
  "@tanstack/react-router": "^1.120.3",
16
16
  "@tanstack/react-query": "^5.0.0",
17
17
  "@tanstack/react-start": "^1.120.3",
18
- "docs-i18n": "workspace:*",
19
18
  "drizzle-orm": "^0.38.0",
20
19
  "gray-matter": "^4.0.3",
21
20
  "hast-util-is-element": "^3.0.0",