binja 0.4.1 → 0.4.2
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/dist/cli.js +3 -2
- package/dist/index.js +3 -2
- package/dist/native/index.d.ts.map +1 -1
- package/dist/native/index.js +3 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -40,14 +40,15 @@ __export(exports_native, {
|
|
|
40
40
|
NativeLexer: () => NativeLexer
|
|
41
41
|
});
|
|
42
42
|
import { dlopen, FFIType, ptr, CString } from "bun:ffi";
|
|
43
|
-
import { join } from "path";
|
|
43
|
+
import { join, basename } from "path";
|
|
44
44
|
import { existsSync } from "fs";
|
|
45
45
|
function getLibraryPath() {
|
|
46
46
|
const platform = process.platform;
|
|
47
47
|
const arch = process.arch;
|
|
48
48
|
const libExt = platform === "darwin" ? "dylib" : platform === "win32" ? "dll" : "so";
|
|
49
49
|
const libName = `libbinja.${libExt}`;
|
|
50
|
-
const
|
|
50
|
+
const dirName = basename(import.meta.dir);
|
|
51
|
+
const projectRoot = dirName === "native" ? join(import.meta.dir, "..", "..") : join(import.meta.dir, "..");
|
|
51
52
|
const searchPaths = [
|
|
52
53
|
join(projectRoot, "native", `${platform}-${arch}`, libName),
|
|
53
54
|
join(projectRoot, "native", libName),
|
package/dist/index.js
CHANGED
|
@@ -40,14 +40,15 @@ __export(exports_native, {
|
|
|
40
40
|
NativeLexer: () => NativeLexer
|
|
41
41
|
});
|
|
42
42
|
import { dlopen, FFIType, ptr, CString } from "bun:ffi";
|
|
43
|
-
import { join } from "path";
|
|
43
|
+
import { join, basename } from "path";
|
|
44
44
|
import { existsSync } from "fs";
|
|
45
45
|
function getLibraryPath() {
|
|
46
46
|
const platform = process.platform;
|
|
47
47
|
const arch = process.arch;
|
|
48
48
|
const libExt = platform === "darwin" ? "dylib" : platform === "win32" ? "dll" : "so";
|
|
49
49
|
const libName = `libbinja.${libExt}`;
|
|
50
|
-
const
|
|
50
|
+
const dirName = basename(import.meta.dir);
|
|
51
|
+
const projectRoot = dirName === "native" ? join(import.meta.dir, "..", "..") : join(import.meta.dir, "..");
|
|
51
52
|
const searchPaths = [
|
|
52
53
|
join(projectRoot, "native", `${platform}-${arch}`, libName),
|
|
53
54
|
join(projectRoot, "native", libName),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/native/index.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;CAwBZ,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/native/index.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;CAwBZ,CAAA;AAkIV;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAG3C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,GAAG,IAAI,CAO7C;AAED;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,YAAY,CAAY;IAChC,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,WAAW,CAAY;IAC/B,OAAO,CAAC,QAAQ,CAAiB;gBAErB,MAAM,EAAE,MAAM;IAgC1B,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAKnC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAKpC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAKlC,QAAQ,IAAI,OAAO;IAKnB,YAAY,IAAI,MAAM;IAKtB,YAAY,IAAI,MAAM;IAKtB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAQpC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;IASpC,YAAY,IAAI,WAAW,EAAE;IAQ7B,IAAI,IAAI,IAAI;IAOZ,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;CAGzB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAYpD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,CAOtD"}
|
package/dist/native/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/native/index.ts
|
|
3
3
|
import { dlopen, FFIType, ptr, CString } from "bun:ffi";
|
|
4
|
-
import { join } from "path";
|
|
4
|
+
import { join, basename } from "path";
|
|
5
5
|
import { existsSync } from "fs";
|
|
6
6
|
var TokenType = {
|
|
7
7
|
TEXT: 0,
|
|
@@ -82,7 +82,8 @@ function getLibraryPath() {
|
|
|
82
82
|
const arch = process.arch;
|
|
83
83
|
const libExt = platform === "darwin" ? "dylib" : platform === "win32" ? "dll" : "so";
|
|
84
84
|
const libName = `libbinja.${libExt}`;
|
|
85
|
-
const
|
|
85
|
+
const dirName = basename(import.meta.dir);
|
|
86
|
+
const projectRoot = dirName === "native" ? join(import.meta.dir, "..", "..") : join(import.meta.dir, "..");
|
|
86
87
|
const searchPaths = [
|
|
87
88
|
join(projectRoot, "native", `${platform}-${arch}`, libName),
|
|
88
89
|
join(projectRoot, "native", libName),
|