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
|
@@ -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
|
|
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
|
@@ -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
|
-
|
|
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 {
|