@shareai-lab/kode 1.0.95 → 1.0.97

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/cli.js +6 -4
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -57,8 +57,10 @@ function runWithTsxImport() {
57
57
  importArg = pathToFileURL(tsxImportPath).href
58
58
  }
59
59
  } catch {}
60
+ const { pathToFileURL } = require('node:url')
61
+ const cliUrl = pathToFileURL(cliPath).href
60
62
  const baseArgs = ['--no-warnings=ExperimentalWarning', '--enable-source-maps']
61
- const child = spawn(process.execPath, [...baseArgs, '--import', importArg, cliPath, ...args], {
63
+ const child = spawn(process.execPath, [...baseArgs, '--import', importArg, cliUrl, ...args], {
62
64
  stdio: 'inherit',
63
65
  env: { ...process.env, YOGA_WASM_PATH: path.join(__dirname, 'yoga.wasm') },
64
66
  })
@@ -71,7 +73,7 @@ function runWithTsxImport() {
71
73
 
72
74
  function runWithTsxCLI() {
73
75
  if (!tsxCliPath) return fail()
74
- const child = spawn(process.execPath, [tsxCliPath, cliPath, ...args], {
76
+ const child = spawn(process.execPath, [tsxCliPath, '--esm', cliPath, ...args], {
75
77
  stdio: 'inherit',
76
78
  env: { ...process.env, YOGA_WASM_PATH: path.join(__dirname, 'yoga.wasm') },
77
79
  })
@@ -87,8 +89,8 @@ function fail() {
87
89
  }
88
90
 
89
91
  if (process.platform === 'win32') {
90
- // On Windows, tsx CLI is the most reliable
91
- runWithTsxCLI()
92
+ // On Windows, use Node --import tsx with proper file:// URLs
93
+ runWithTsxImport()
92
94
  } else {
93
95
  if (hasBun()) runWithBun()
94
96
  else runWithTsxImport()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shareai-lab/kode",
3
- "version": "1.0.95",
3
+ "version": "1.0.97",
4
4
  "bin": {
5
5
  "kode": "cli.js",
6
6
  "kwa": "cli.js",