@ox-content/vite-plugin 2.16.0 → 2.26.0

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.
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+ // Thin shim so pnpm can link the bin during `pnpm install` even before the
3
+ // package has been built. The real entry lives in `dist/vitepress-cli.mjs`
4
+ // and is produced by `pnpm run build`. The shim is checked in so the
5
+ // symlink target always exists.
6
+ //
7
+ // If `dist/vitepress-cli.mjs` is missing the user is running the source
8
+ // checkout without having built it yet — give a clearer error than the
9
+ // stack trace `import` would emit.
10
+
11
+ import { existsSync } from "node:fs";
12
+ import { dirname, resolve } from "node:path";
13
+ import { fileURLToPath, pathToFileURL } from "node:url";
14
+
15
+ const here = dirname(fileURLToPath(import.meta.url));
16
+ const entry = resolve(here, "..", "dist", "vitepress-cli.mjs");
17
+
18
+ if (!existsSync(entry)) {
19
+ process.stderr.write(
20
+ "ox-content-migrate-vitepress: dist/vitepress-cli.mjs is missing.\n" +
21
+ "Run `pnpm --filter @ox-content/vite-plugin build` (or your package's\n" +
22
+ "build script) first.\n",
23
+ );
24
+ process.exit(1);
25
+ }
26
+
27
+ await import(pathToFileURL(entry).href);