docs-i18n 0.2.1 → 0.2.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/dist/cli.js CHANGED
@@ -88,7 +88,7 @@ Options:
88
88
  }
89
89
  case "admin": {
90
90
  const port = Number(getOpt("port", "3456"));
91
- const { startAdmin } = await import("./server-HNVJP43X.js");
91
+ const { startAdmin } = await import("./server-DPAACODY.js");
92
92
  await startAdmin(config, port);
93
93
  break;
94
94
  }
@@ -2694,7 +2694,9 @@ async function startAdmin(config, port = 3456) {
2694
2694
  Bun.spawn([fallback, fullPath], { stdio: ["ignore", "ignore", "ignore"] });
2695
2695
  return c.json({ opened: fullPath, editor: fallback });
2696
2696
  });
2697
- const adminRoot = resolve2(import.meta.dir, "..");
2697
+ const thisFile = new URL(import.meta.url).pathname;
2698
+ const pkgRoot = resolve2(thisFile, "..", "..");
2699
+ const adminRoot = resolve2(pkgRoot, "src", "admin");
2698
2700
  try {
2699
2701
  const { createServer: createViteServer } = await import("vite");
2700
2702
  const vite = await createViteServer({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docs-i18n",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Universal documentation translation engine — parse, translate, cache, assemble, manage.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -38,7 +38,12 @@ export async function startAdmin(config: DocsI18nConfig, port = 3456) {
38
38
  return c.json({ opened: fullPath, editor: fallback });
39
39
  });
40
40
 
41
- const adminRoot = resolve(import.meta.dir, '..');
41
+ // Resolve admin UI root — works both in dev (src/admin/) and installed (node_modules/docs-i18n/src/admin/)
42
+ const thisFile = new URL(import.meta.url).pathname;
43
+ // In bundled dist: thisFile is like .../dist/cli.js or .../dist/server-XXX.js
44
+ // Admin UI source is at .../src/admin/
45
+ const pkgRoot = resolve(thisFile, '..', '..');
46
+ const adminRoot = resolve(pkgRoot, 'src', 'admin');
42
47
 
43
48
  // Try to load Vite for dev mode (SPA)
44
49
  try {