@malloy-publisher/server 0.0.189-dev → 0.0.191

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/build.ts CHANGED
@@ -8,7 +8,7 @@ await build({
8
8
  entrypoints: ["./src/server.ts", "./src/instrumentation.ts"],
9
9
  outdir: "./dist",
10
10
  target: "node",
11
- format: "cjs",
11
+ format: "esm",
12
12
  external: [
13
13
  "@malloydata/db-duckdb",
14
14
  "duckdb",
@@ -28,8 +28,12 @@ await build({
28
28
 
29
29
  fs.cpSync("../app/dist", "./dist/app", { recursive: true });
30
30
 
31
- // Add shebang to server.js for npx compatibility
32
- const serverJsPath = "./dist/server.js";
31
+ // Rename ESM outputs to .mjs so both Node and Bun can execute them
32
+ fs.renameSync("./dist/server.js", "./dist/server.mjs");
33
+ fs.renameSync("./dist/instrumentation.js", "./dist/instrumentation.mjs");
34
+
35
+ // Add shebang to server.mjs for npx/bunx compatibility
36
+ const serverJsPath = "./dist/server.mjs";
33
37
  const serverJsContent = fs.readFileSync(serverJsPath, "utf8");
34
38
  const shebangContent = "#!/usr/bin/env node\n" + serverJsContent;
35
39
  fs.writeFileSync(serverJsPath, shebangContent);