@shareai-lab/kode 1.1.8 → 1.1.11
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/cli.js +8 -2
- package/package.json +1 -1
- package/src/entrypoints/cli.tsx +4 -4
package/cli.js
CHANGED
|
@@ -39,7 +39,10 @@ function runWithNode() {
|
|
|
39
39
|
: path.join(binDir, 'tsx')
|
|
40
40
|
|
|
41
41
|
const runPathTsx = () => {
|
|
42
|
-
const
|
|
42
|
+
const tsxArgs = process.platform === 'win32'
|
|
43
|
+
? ['--tsconfig-raw', '{"compilerOptions":{"module":"ESNext"}}', cliPath, ...args]
|
|
44
|
+
: [cliPath, ...args];
|
|
45
|
+
const child2 = spawn('tsx', tsxArgs, {
|
|
43
46
|
stdio: 'inherit',
|
|
44
47
|
shell: process.platform === 'win32',
|
|
45
48
|
env: { ...process.env, YOGA_WASM_PATH: path.join(__dirname, 'yoga.wasm') },
|
|
@@ -52,7 +55,10 @@ function runWithNode() {
|
|
|
52
55
|
child2.on('exit', (code2) => process.exit(code2 || 0))
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
const
|
|
58
|
+
const tsxLocalArgs = process.platform === 'win32'
|
|
59
|
+
? ['--tsconfig-raw', '{"compilerOptions":{"module":"ESNext"}}', cliPath, ...args]
|
|
60
|
+
: [cliPath, ...args];
|
|
61
|
+
const child = spawn(tsxPath, tsxLocalArgs, {
|
|
56
62
|
stdio: 'inherit',
|
|
57
63
|
shell: process.platform === 'win32',
|
|
58
64
|
env: { ...process.env, YOGA_WASM_PATH: path.join(__dirname, 'yoga.wasm') },
|
package/package.json
CHANGED
package/src/entrypoints/cli.tsx
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --no-warnings=ExperimentalWarning --enable-source-maps
|
|
2
|
+
import { fileURLToPath } from 'node:url'
|
|
3
|
+
import { dirname, join } from 'node:path'
|
|
2
4
|
import { initSentry } from '../services/sentry'
|
|
3
5
|
import { PRODUCT_COMMAND, PRODUCT_NAME } from '../constants/product'
|
|
4
6
|
initSentry() // Initialize Sentry as early as possible
|
|
@@ -7,14 +9,12 @@ initSentry() // Initialize Sentry as early as possible
|
|
|
7
9
|
// Resolve yoga.wasm relative to this file when missing using ESM-friendly APIs
|
|
8
10
|
try {
|
|
9
11
|
if (!process.env.YOGA_WASM_PATH) {
|
|
10
|
-
const {
|
|
11
|
-
const { dirname, join } = await import('node:path')
|
|
12
|
-
const { existsSync } = await import('node:fs')
|
|
12
|
+
const { existsSync: fsExistsSync } = require('fs')
|
|
13
13
|
const __filename = fileURLToPath(import.meta.url)
|
|
14
14
|
const __dirname = dirname(__filename)
|
|
15
15
|
const devCandidate = join(__dirname, '../../yoga.wasm')
|
|
16
16
|
// Prefer dev path; wrapper already sets env for normal runs
|
|
17
|
-
process.env.YOGA_WASM_PATH =
|
|
17
|
+
process.env.YOGA_WASM_PATH = fsExistsSync(devCandidate)
|
|
18
18
|
? devCandidate
|
|
19
19
|
: process.env.YOGA_WASM_PATH
|
|
20
20
|
}
|