runtime-checker 1.0.0 → 1.0.4

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 CHANGED
@@ -1,26 +1,26 @@
1
- # runtime-checker
2
- Detects the minimum version needed for **Node.js**, **Bun**, **Deno** and browsers to execute your codebase.
3
-
4
- ## Installation
5
- ```sh
6
- deno add npm:runtime-checker
7
- bun add runtime-checker
8
- pnpm add runtime-checker
9
- npm install runtime-checker
10
- ```
11
-
12
- ## Usage
13
- `$ runtime-checker <dir>`
14
-
15
- ### Arguments
16
- `--fast:` uses [fff](https://github.com/dmtrKovalenko/fff) instead of oxc AST parsing. Faster<sup>1</sup>, but less accurate.
17
-
18
- <sup>1</sup> fff is only faster (and actually slower!) than oxc when your codebase is around 250,000~ or more lines of code, from testing on a Windows machine with a 9800X3D.
19
-
20
- `--fix`: Automatically fixes your `engines.node` field to a supported version if an issue is found.
21
-
22
- `--inspect <symbol, e.g.: Symbol.asyncDispose>`: Shows each detection of a specific symbol
23
-
24
- `--summary`: Only prints the summary
25
-
26
- `--runtime <all|deno|bun|node|safari|chrome|firefox>`: Only shows the results for a specific runtime
1
+ # runtime-checker
2
+ Detects the minimum version needed for **Node.js**, **Bun**, **Deno** and browsers to execute your codebase.
3
+
4
+ ## Installation
5
+ ```sh
6
+ deno add npm:runtime-checker
7
+ bun add runtime-checker
8
+ pnpm add runtime-checker
9
+ npm install runtime-checker
10
+ ```
11
+
12
+ ## Usage
13
+ `$ runtime-checker <dir>`
14
+
15
+ ### Arguments
16
+ `--fast:` uses [fff](https://github.com/dmtrKovalenko/fff) instead of oxc AST parsing. Faster<sup>1</sup>, but less accurate.
17
+
18
+ <sup>1</sup> fff is only faster (and actually slower!) than oxc when your codebase is around 250,000~ or more lines of code, from testing on a Windows machine with a 9800X3D.
19
+
20
+ `--fix`: Automatically fixes your `engines.node` field to a supported version if an issue is found.
21
+
22
+ `--inspect <symbol, e.g.: Symbol.asyncDispose>`: Shows each detection of a specific symbol
23
+
24
+ `--summary`: Only prints the summary
25
+
26
+ `--runtime <all|deno|bun|node|safari|chrome|firefox>`: Only shows the results for a specific runtime
@@ -6,14 +6,18 @@ import { fileURLToPath } from "node:url";
6
6
 
7
7
  const root = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
8
8
  const exe = process.platform === "win32" ? "runtime-checker.exe" : "runtime-checker";
9
- const native = join(root, "npm", "bin", "native", exe);
9
+ const target = `${process.platform}-${process.arch}`;
10
+ const native = join(root, "npm", "bin", "native", target, exe);
10
11
 
11
12
  if (!existsSync(native)) {
12
- console.error("runtime-checker native binary is missing. Try reinstalling the package.");
13
+ console.error(`runtime-checker does not have a native binary for ${target}.`);
14
+ console.error("The npm package may be corrupted, or this platform is not supported yet.");
13
15
  process.exit(1);
14
16
  }
15
17
 
16
- const child = spawnSync(native, process.argv.slice(2), { stdio: "inherit" });
18
+ const child = spawnSync(native, process.argv.slice(2), {
19
+ stdio: "inherit",
20
+ });
17
21
 
18
22
  if (child.error) {
19
23
  console.error(child.error.message);
package/package.json CHANGED
@@ -1,37 +1,30 @@
1
1
  {
2
2
  "name": "runtime-checker",
3
- "version": "1.0.0",
3
+ "version": "1.0.4",
4
4
  "description": "Detect minimum runtime versions required by JavaScript and TypeScript codebases.",
5
5
  "license": "BSD-3-Clause",
6
6
  "type": "module",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/usebarekey/runtime-checker.git"
9
+ "url": "git+https://github.com/usebarekey/runtime-checker.git"
10
10
  },
11
11
  "homepage": "https://github.com/usebarekey/runtime-checker",
12
12
  "bugs": {
13
13
  "url": "https://github.com/usebarekey/runtime-checker/issues"
14
14
  },
15
15
  "bin": {
16
- "runtime-checker": "./npm/bin/runtime-checker.js"
16
+ "runtime-checker": "npm/bin/runtime-checker.js"
17
17
  },
18
18
  "files": [
19
- "Cargo.lock",
20
- "Cargo.toml",
21
19
  "LICENSE",
22
20
  "README.md",
23
- "data",
24
- "npm",
25
- "src"
21
+ "npm/bin"
26
22
  ],
27
23
  "scripts": {
28
24
  "build": "cargo build --release",
29
25
  "check": "cargo clippy --all-targets -- -D warnings",
30
26
  "test": "cargo test",
31
- "postinstall": "node ./npm/postinstall.js",
32
- "prepack": "cargo build --release && node ./npm/prepare-bin.js",
33
- "publish:npm": "npm publish --access public --provenance",
34
- "publish:jsr": "npx --yes jsr publish"
27
+ "publish:npm": "npm publish --access public"
35
28
  },
36
29
  "publishConfig": {
37
30
  "access": "public"