solid-jsx-oxc 0.1.0-alpha.7 → 0.1.0-alpha.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.
- package/binding.d.ts +1 -0
- package/index.d.ts +6 -7
- package/index.js +16 -14
- package/package.json +5 -13
- package/solid-jsx-oxc.darwin-arm64.node +0 -0
package/binding.d.ts
CHANGED
package/index.d.ts
CHANGED
|
@@ -74,17 +74,16 @@ export function transform(source: string, options?: TransformOptions): Transform
|
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* Low-level transform function from the native binding.
|
|
77
|
-
* Prefers snake_case option names.
|
|
78
77
|
*/
|
|
79
78
|
export function transformJsx(source: string, options?: {
|
|
80
|
-
|
|
81
|
-
generate?: string;
|
|
79
|
+
moduleName?: string;
|
|
80
|
+
generate?: 'dom' | 'ssr' | 'universal' | string;
|
|
82
81
|
hydratable?: boolean;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
delegateEvents?: boolean;
|
|
83
|
+
wrapConditionals?: boolean;
|
|
84
|
+
contextToCustomElements?: boolean;
|
|
86
85
|
filename?: string;
|
|
87
|
-
|
|
86
|
+
sourceMap?: boolean;
|
|
88
87
|
} | null): TransformResult;
|
|
89
88
|
|
|
90
89
|
export interface PresetResult {
|
package/index.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* solid-jsx-oxc - OXC-based JSX compiler for SolidJS
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* It provides the same interface as babel-preset-solid.
|
|
4
|
+
* ESM entry point - provides the same interface as babel-preset-solid.
|
|
6
5
|
*/
|
|
7
6
|
|
|
8
|
-
import { createRequire } from 'module';
|
|
9
|
-
|
|
7
|
+
import { createRequire } from 'node:module';
|
|
8
|
+
import { platform, arch } from 'node:process';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
import { dirname, join } from 'node:path';
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// Detect platform and architecture
|
|
15
|
-
const platform = process.platform;
|
|
16
|
-
const arch = process.arch;
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
14
|
|
|
18
15
|
// Map Node.js platform/arch to binary file suffix
|
|
19
16
|
const platformMap = {
|
|
@@ -28,18 +25,21 @@ const platformMap = {
|
|
|
28
25
|
const platformKey = `${platform}-${arch}`;
|
|
29
26
|
const nativeTarget = platformMap[platformKey];
|
|
30
27
|
|
|
28
|
+
// Try to load the native module
|
|
29
|
+
let nativeBinding = null;
|
|
30
|
+
|
|
31
31
|
try {
|
|
32
32
|
if (nativeTarget) {
|
|
33
33
|
// Try platform-specific binary first
|
|
34
|
-
nativeBinding = require(
|
|
34
|
+
nativeBinding = require(join(__dirname, `solid-jsx-oxc.${nativeTarget}.node`));
|
|
35
35
|
} else {
|
|
36
36
|
// Fallback to generic name
|
|
37
|
-
nativeBinding = require('
|
|
37
|
+
nativeBinding = require(join(__dirname, 'solid-jsx-oxc.node'));
|
|
38
38
|
}
|
|
39
39
|
} catch (e) {
|
|
40
40
|
// Fallback message if native module not found
|
|
41
41
|
console.warn(`solid-jsx-oxc: Native module not found for ${platformKey}. Run \`npm run build\` to compile.`);
|
|
42
|
-
console.warn(e.message);
|
|
42
|
+
console.warn(e instanceof Error ? e.message : String(e));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -103,7 +103,9 @@ export function preset(context, options = {}) {
|
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Low-level transform function from the native binding
|
|
108
|
+
*/
|
|
107
109
|
export const transformJsx = nativeBinding ? nativeBinding.transformJsx : null;
|
|
108
110
|
|
|
109
111
|
// Default export for convenience
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-jsx-oxc",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.9",
|
|
4
4
|
"description": "OXC-based JSX compiler for SolidJS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./index.d.ts",
|
|
11
|
-
"
|
|
11
|
+
"import": "./index.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
@@ -60,17 +60,9 @@
|
|
|
60
60
|
"release:next": "bun scripts/release.mjs next"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@napi-rs/cli": "^3.5.
|
|
63
|
+
"@napi-rs/cli": "^3.5.0"
|
|
64
64
|
},
|
|
65
65
|
"engines": {
|
|
66
|
-
"node": ">=
|
|
67
|
-
},
|
|
68
|
-
"optionalDependencies": {
|
|
69
|
-
"solid-jsx-oxc-darwin-x64": "0.1.0-alpha.7",
|
|
70
|
-
"solid-jsx-oxc-darwin-arm64": "0.1.0-alpha.7",
|
|
71
|
-
"solid-jsx-oxc-linux-x64-gnu": "0.1.0-alpha.7",
|
|
72
|
-
"solid-jsx-oxc-win32-x64-msvc": "0.1.0-alpha.7",
|
|
73
|
-
"solid-jsx-oxc-linux-arm64-gnu": "0.1.0-alpha.7",
|
|
74
|
-
"solid-jsx-oxc-win32-arm64-msvc": "0.1.0-alpha.7"
|
|
66
|
+
"node": ">= 18"
|
|
75
67
|
}
|
|
76
|
-
}
|
|
68
|
+
}
|
|
Binary file
|