@jarkkojs/readseek-api 0.10.1 → 0.10.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/README.md +5 -4
- package/dist/index.js +6 -6
- package/package.json +2 -11
- package/bin/readseek.cjs +0 -61
package/README.md
CHANGED
|
@@ -9,12 +9,13 @@ bounded Node/Bun process runners.
|
|
|
9
9
|
npm install @jarkkojs/readseek-api
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
`@jarkkojs/readseek` installs the optional platform binary and provides the
|
|
13
|
+
`readseek` CLI. Linux packages supply `bin/readseek.AppImage`; macOS and Windows
|
|
14
|
+
supply native executables. The CLI and Node/Bun runners set
|
|
14
15
|
`APPIMAGE_EXTRACT_AND_RUN=1` for Linux child processes, so FUSE is not required.
|
|
15
16
|
Custom process launchers should pass `readSeekProcessEnvironment()` as their
|
|
16
|
-
child environment.
|
|
17
|
-
|
|
17
|
+
child environment. Installing the API also installs `@jarkkojs/readseek` and its
|
|
18
|
+
platform binary; plugins declare both packages directly.
|
|
18
19
|
|
|
19
20
|
## Example
|
|
20
21
|
|
package/dist/index.js
CHANGED
|
@@ -1026,18 +1026,18 @@ function resolveReadSeekBinaryFromPackages(resolver = resolveFromPackage, option
|
|
|
1026
1026
|
const platformPackage = READSEEK_PLATFORM_PACKAGES[key];
|
|
1027
1027
|
if (!platformPackage) {
|
|
1028
1028
|
const supported = Object.keys(READSEEK_PLATFORM_PACKAGES).join(", ");
|
|
1029
|
-
throw new Error(`@jarkkojs/readseek
|
|
1029
|
+
throw new Error(`@jarkkojs/readseek ships no binary for ${key}; it supports ${supported}`);
|
|
1030
1030
|
}
|
|
1031
|
-
const metaPackage = options.metaPackage ?? "@jarkkojs/readseek
|
|
1032
|
-
const metaPackageJson = resolve(`${metaPackage}/package.json`);
|
|
1033
|
-
const metaPackageDir = path.dirname(metaPackageJson);
|
|
1031
|
+
const metaPackage = options.metaPackage ?? "@jarkkojs/readseek";
|
|
1034
1032
|
let packageJsonPath;
|
|
1035
1033
|
try {
|
|
1036
|
-
|
|
1037
|
-
|
|
1034
|
+
const metaPackageJson = resolve(`${metaPackage}/package.json`);
|
|
1035
|
+
const metaPackageDir = path.dirname(metaPackageJson);
|
|
1038
1036
|
packageJsonPath = resolve(`${platformPackage}/package.json`, {
|
|
1039
1037
|
paths: [metaPackageDir]
|
|
1040
1038
|
});
|
|
1039
|
+
} catch {
|
|
1040
|
+
packageJsonPath = resolve(`${platformPackage}/package.json`);
|
|
1041
1041
|
}
|
|
1042
1042
|
const binaryPath = path.join(path.dirname(packageJsonPath), "bin", readSeekBinaryName(platform));
|
|
1043
1043
|
accessSync(binaryPath, fsConstants.X_OK);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jarkkojs/readseek-api",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "Shared ReadSeek CLI contract, validation, argv builders, and bounded process runners",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -13,9 +13,6 @@
|
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://gitlab.com/jarkkojs/readseek/-/issues"
|
|
15
15
|
},
|
|
16
|
-
"bin": {
|
|
17
|
-
"readseek": "bin/readseek.cjs"
|
|
18
|
-
},
|
|
19
16
|
"exports": {
|
|
20
17
|
".": {
|
|
21
18
|
"types": "./dist/index.d.ts",
|
|
@@ -25,7 +22,6 @@
|
|
|
25
22
|
"./package.json": "./package.json"
|
|
26
23
|
},
|
|
27
24
|
"files": [
|
|
28
|
-
"bin/",
|
|
29
25
|
"dist/",
|
|
30
26
|
"README.md"
|
|
31
27
|
],
|
|
@@ -48,12 +44,6 @@
|
|
|
48
44
|
"ast-grep",
|
|
49
45
|
"hashline"
|
|
50
46
|
],
|
|
51
|
-
"optionalDependencies": {
|
|
52
|
-
"@jarkkojs/readseek-darwin-arm64": "0.10.1",
|
|
53
|
-
"@jarkkojs/readseek-linux-arm64": "0.10.1",
|
|
54
|
-
"@jarkkojs/readseek-linux-x64": "0.10.1",
|
|
55
|
-
"@jarkkojs/readseek-win32-x64": "0.10.1"
|
|
56
|
-
},
|
|
57
47
|
"devDependencies": {
|
|
58
48
|
"@types/node": "^22.0.0",
|
|
59
49
|
"fast-check": "4.10.0",
|
|
@@ -61,6 +51,7 @@
|
|
|
61
51
|
"vitest": "^4.1.0"
|
|
62
52
|
},
|
|
63
53
|
"dependencies": {
|
|
54
|
+
"@jarkkojs/readseek": "^0.10.2",
|
|
64
55
|
"@bgotink/kdl": "0.4.0",
|
|
65
56
|
"@sinclair/typebox": "0.34.52"
|
|
66
57
|
}
|
package/bin/readseek.cjs
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
// Copyright (C) Jarkko Sakkinen 2026
|
|
4
|
-
|
|
5
|
-
const { execFileSync } = require('node:child_process');
|
|
6
|
-
const fs = require('node:fs');
|
|
7
|
-
const path = require('node:path');
|
|
8
|
-
|
|
9
|
-
function resolveBinary() {
|
|
10
|
-
const platform = `${process.platform}-${process.arch}`;
|
|
11
|
-
const packages = {
|
|
12
|
-
'darwin-arm64': '@jarkkojs/readseek-darwin-arm64',
|
|
13
|
-
'linux-arm64': '@jarkkojs/readseek-linux-arm64',
|
|
14
|
-
'linux-x64': '@jarkkojs/readseek-linux-x64',
|
|
15
|
-
'win32-x64': '@jarkkojs/readseek-win32-x64',
|
|
16
|
-
};
|
|
17
|
-
const packageName = packages[platform];
|
|
18
|
-
if (!packageName) {
|
|
19
|
-
throw new Error(
|
|
20
|
-
`unsupported platform: ${platform}; supported platforms: ${Object.keys(packages).join(', ')}`
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
const binaryName = process.platform === 'linux' ? 'readseek.AppImage'
|
|
24
|
-
: process.platform === 'win32' ? 'readseek.exe' : 'readseek';
|
|
25
|
-
|
|
26
|
-
let packageDir;
|
|
27
|
-
try {
|
|
28
|
-
packageDir = path.dirname(
|
|
29
|
-
require.resolve(`${packageName}/package.json`, { paths: [__dirname] })
|
|
30
|
-
);
|
|
31
|
-
} catch {
|
|
32
|
-
throw new Error(
|
|
33
|
-
`package ${packageName} is not installed; ` +
|
|
34
|
-
'install the optional platform-specific dependency'
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const binaryPath = path.join(packageDir, 'bin', binaryName);
|
|
39
|
-
if (!fs.existsSync(binaryPath)) {
|
|
40
|
-
throw new Error(`binary not found: ${binaryPath}`);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return binaryPath;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
try {
|
|
47
|
-
const binary = resolveBinary();
|
|
48
|
-
const args = process.argv.slice(2);
|
|
49
|
-
execFileSync(binary, args, {
|
|
50
|
-
stdio: 'inherit',
|
|
51
|
-
env: process.platform === 'linux'
|
|
52
|
-
? { ...process.env, APPIMAGE_EXTRACT_AND_RUN: '1' }
|
|
53
|
-
: process.env,
|
|
54
|
-
});
|
|
55
|
-
} catch (err) {
|
|
56
|
-
if (typeof err.status === 'number') {
|
|
57
|
-
process.exit(err.status);
|
|
58
|
-
}
|
|
59
|
-
console.error(err.message);
|
|
60
|
-
process.exit(1);
|
|
61
|
-
}
|