easc 0.0.8 → 0.0.9

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.
Files changed (2) hide show
  1. package/bin/easc.js +22 -9
  2. package/package.json +1 -1
package/bin/easc.js CHANGED
@@ -6,20 +6,33 @@ import { existsSync } from "fs";
6
6
  import { createRequire } from "module";
7
7
 
8
8
  const __dirname = dirname(fileURLToPath(import.meta.url));
9
- const require = createRequire(import.meta.url);
10
- const tsxPath = require.resolve("tsx/esm");
11
9
  const indexPath = join(__dirname, "..", "index.ts");
12
-
13
10
  const envPath = join(process.cwd(), ".env");
14
- const nodeArgs = ["--import", tsxPath];
15
11
 
16
- if (existsSync(envPath)) {
17
- nodeArgs.push("--env-file", envPath);
18
- }
12
+ // Detect if running under Bun
13
+ const isBun = typeof Bun !== "undefined";
19
14
 
20
- nodeArgs.push(indexPath, ...process.argv.slice(2));
15
+ let runtime, args;
16
+
17
+ if (isBun) {
18
+ runtime = "bun";
19
+ args = [];
20
+ if (existsSync(envPath)) {
21
+ args.push("--env-file", envPath);
22
+ }
23
+ args.push(indexPath, ...process.argv.slice(2));
24
+ } else {
25
+ runtime = "node";
26
+ const require = createRequire(import.meta.url);
27
+ const tsxPath = require.resolve("tsx/esm");
28
+ args = ["--import", tsxPath];
29
+ if (existsSync(envPath)) {
30
+ args.push("--env-file", envPath);
31
+ }
32
+ args.push(indexPath, ...process.argv.slice(2));
33
+ }
21
34
 
22
- const child = spawn("node", nodeArgs, { stdio: "inherit" });
35
+ const child = spawn(runtime, args, { stdio: "inherit" });
23
36
 
24
37
  child.on("exit", (code) => {
25
38
  process.exit(code || 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easc",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Expo App Services for Cloudflare - Deploy tool for Expo OTA updates to Cloudflare Workers",
5
5
  "type": "module",
6
6
  "license": "MIT",