@aihu/compiler 1.2.0 → 1.3.0
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/README.md +17 -17
- package/dist/index.d.ts +296 -139
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/resolve-binary.js +1 -1
- package/package.json +12 -12
package/dist/resolve-binary.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{dirname as e,join as t,resolve as n}from"node:path";import{accessSync as r,constants as i,statSync as a}from"node:fs";import{
|
|
1
|
+
import{dirname as e,join as t,resolve as n}from"node:path";import{accessSync as r,constants as i,statSync as a}from"node:fs";import{fileURLToPath as o}from"node:url";import{createRequire as s}from"node:module";const c=e(o(import.meta.url));function l(){if(typeof process>`u`||!process.platform||!process.arch)return null;switch(`${process.platform}-${process.arch}`){case`darwin-arm64`:return{platformId:`darwin-arm64`,packageName:`@aihu/compiler-darwin-arm64`,binFile:`aihu-compile`};case`darwin-x64`:return{platformId:`darwin-x64`,packageName:`@aihu/compiler-darwin-x64`,binFile:`aihu-compile`};case`linux-x64`:return{platformId:`linux-x64-gnu`,packageName:`@aihu/compiler-linux-x64-gnu`,binFile:`aihu-compile`};case`linux-arm64`:return{platformId:`linux-arm64-gnu`,packageName:`@aihu/compiler-linux-arm64-gnu`,binFile:`aihu-compile`};case`win32-x64`:return{platformId:`win32-x64-msvc`,packageName:`@aihu/compiler-win32-x64-msvc`,binFile:`aihu-compile.exe`};default:return null}}let u=null;function d(e){try{let t=a(e);return!t.isFile()||t.size===0?!1:(r(e,i.X_OK),!0)}catch{return!1}}function f(){if(u!==null)return u;let r=process.env.AIHU_COMPILE_BIN;if(r){if(!d(r))throw Error(`[@aihu/compiler] AIHU_COMPILE_BIN is set to '${r}', which is not an executable file.`);return u=r,u}let i=l(),a=process.platform===`win32`?`.exe`:``,o=[n(c,`../../../target/release`,`aihu-compile${a}`),n(c,`../../../target/debug`,`aihu-compile${a}`),n(c,`../bin`,`aihu-compile${a}`)];for(let e of o)if(d(e))return u=e,u;if(i){let n=s(import.meta.url);try{let r=t(e(n.resolve(`${i.packageName}/package.json`)),i.binFile);if(d(r))return u=r,u}catch{}}throw p(i,o)}function p(e,t){return Error(e===null?`[@aihu/compiler] No prebuilt aihu-compile binary for this platform.\n\n Platform: ${typeof process<`u`?`${process.platform}-${process.arch}`:`unknown`}\n\n @aihu/compiler ships prebuilt binaries for darwin-arm64, darwin-x64,\n linux-x64-gnu (glibc), linux-arm64-gnu (glibc) and win32-x64-msvc.\n Your platform is not in that set.\n\n To build from source you need a Rust toolchain, then run from the repo root:\n cargo build --release -p aihu-compile\n\n Checked dev fallback paths: ${t.join(`, `)}`:`[@aihu/compiler] Native compiler binary not found for this platform.\n\n Platform: ${e.platformId}\n Expected package: ${e.packageName}\n Expected file: ${e.packageName}/${e.binFile}\n\n This binary is distributed as an optionalDependency of @aihu/compiler.\n Your package manager may have skipped it (optionalDependencies are\n silently dropped on install failure).\n\n To reinstall:\n npm install @aihu/compiler\n # or: pnpm install or: bun install\n\n If you are working in the aihu monorepo, build from source instead:\n cargo build --release -p aihu-compile\n Checked dev fallback paths: ${t.join(`, `)}`)}export{d as isUsableExecutable,f as resolveCompilerBinary};
|
|
2
2
|
//# sourceMappingURL=resolve-binary.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aihu/compiler",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
"codemod:template-syntax": "bun js/codemods/template-syntax/run-migration.ts"
|
|
32
32
|
},
|
|
33
33
|
"optionalDependencies": {
|
|
34
|
-
"@aihu/compiler-darwin-arm64": "0.1.
|
|
35
|
-
"@aihu/compiler-darwin-x64": "0.1.
|
|
36
|
-
"@aihu/compiler-linux-x64-gnu": "0.1.
|
|
37
|
-
"@aihu/compiler-linux-arm64-gnu": "0.1.
|
|
38
|
-
"@aihu/compiler-win32-x64-msvc": "0.1.
|
|
39
|
-
"@aihu/compiler-native-darwin-arm64": "0.1.
|
|
40
|
-
"@aihu/compiler-native-darwin-x64": "0.1.
|
|
41
|
-
"@aihu/compiler-native-linux-x64-gnu": "0.1.
|
|
42
|
-
"@aihu/compiler-native-linux-arm64-gnu": "0.1.
|
|
43
|
-
"@aihu/compiler-native-win32-x64-msvc": "0.1.
|
|
34
|
+
"@aihu/compiler-darwin-arm64": "0.1.54",
|
|
35
|
+
"@aihu/compiler-darwin-x64": "0.1.54",
|
|
36
|
+
"@aihu/compiler-linux-x64-gnu": "0.1.54",
|
|
37
|
+
"@aihu/compiler-linux-arm64-gnu": "0.1.54",
|
|
38
|
+
"@aihu/compiler-win32-x64-msvc": "0.1.54",
|
|
39
|
+
"@aihu/compiler-native-darwin-arm64": "0.1.19",
|
|
40
|
+
"@aihu/compiler-native-darwin-x64": "0.1.19",
|
|
41
|
+
"@aihu/compiler-native-linux-x64-gnu": "0.1.19",
|
|
42
|
+
"@aihu/compiler-native-linux-arm64-gnu": "0.1.19",
|
|
43
|
+
"@aihu/compiler-native-win32-x64-msvc": "0.1.19"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"vite": ">=5.0.0"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@aihu/css-engine": "0.6.
|
|
54
|
+
"@aihu/css-engine": "0.6.1"
|
|
55
55
|
},
|
|
56
56
|
"description": "Single File Component (.aihu) compiler — Rust binary + JS glue.",
|
|
57
57
|
"repository": {
|