runtime-checker 1.0.0 → 1.1.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 +60 -26
- package/npm/bin/native/darwin-arm64/runtime-checker +0 -0
- package/npm/bin/native/darwin-x64/runtime-checker +0 -0
- package/npm/bin/native/linux-x64/runtime-checker +0 -0
- package/npm/bin/native/win32-x64/runtime-checker.exe +0 -0
- package/npm/bin/runtime-checker.js +7 -3
- package/package.json +5 -12
- package/Cargo.lock +0 -1972
- package/Cargo.toml +0 -46
- package/data/mdn/README.md +0 -30
- package/data/mdn/bun.ron +0 -1084
- package/data/mdn/chrome.ron +0 -7814
- package/data/mdn/deno.ron +0 -1497
- package/data/mdn/firefox.ron +0 -6452
- package/data/mdn/node.ron +0 -1311
- package/data/mdn/safari.ron +0 -6267
- package/data/mdn-bcd.version +0 -1
- package/data/node.ron +0 -3561
- package/npm/bin/native/runtime-checker.exe +0 -0
- package/npm/postinstall.js +0 -29
- package/npm/prepare-bin.js +0 -11
- package/src/analyzer.rs +0 -405
- package/src/bin/generate-mdn-data.rs +0 -517
- package/src/cli.rs +0 -71
- package/src/data.rs +0 -266
- package/src/engines.rs +0 -154
- package/src/help.rs +0 -192
- package/src/lib.rs +0 -251
- package/src/main.rs +0 -12
- package/src/report.rs +0 -819
- package/src/scanner.rs +0 -404
- package/src/version.rs +0 -101
package/README.md
CHANGED
|
@@ -1,26 +1,60 @@
|
|
|
1
|
-
# runtime-checker
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
# runtime-checker
|
|
2
|
+
|
|
3
|
+
Find the minimum runtime version needed for a JavaScript or TypeScript codebase.
|
|
4
|
+
|
|
5
|
+
It parses files with Oxc and checks runtime APIs, JavaScript syntax, module format, and native TypeScript usage. It can report requirements for Node.js, Deno, Bun, Safari, Chromium, and Firefox.
|
|
6
|
+
|
|
7
|
+
## install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install runtime-checker
|
|
11
|
+
pnpm add runtime-checker
|
|
12
|
+
bun add runtime-checker
|
|
13
|
+
deno add npm:runtime-checker
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## usage
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
runtime-checker <dir>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For app compatibility, scan the code you ship. For bundled apps, that usually means the build output, not just `src`.
|
|
23
|
+
|
|
24
|
+
## options
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
runtime-checker <dir> --summary
|
|
28
|
+
runtime-checker <dir> --runtime node
|
|
29
|
+
runtime-checker <dir> --inspect Symbol.asyncDispose
|
|
30
|
+
runtime-checker <dir> --fix
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- `--summary` prints only the result panel.
|
|
34
|
+
- `--runtime <all|node|deno|bun|safari|chrome|firefox>` limits output to one target.
|
|
35
|
+
- `--inspect <feature>` prints every detection for a feature.
|
|
36
|
+
- `--fix` updates `package.json` `engines.node` when the detected Node.js version is not satisfied.
|
|
37
|
+
|
|
38
|
+
## detects
|
|
39
|
+
|
|
40
|
+
- Runtime APIs such as `fetch`, `Temporal`, `fs.cp`, `sqlite.DatabaseSync`, and `Symbol.asyncDispose`.
|
|
41
|
+
- JavaScript syntax such as optional chaining, nullish coalescing, ESM, `await using`, and native TypeScript support.
|
|
42
|
+
- Node.js `engines.node` mismatches.
|
|
43
|
+
|
|
44
|
+
## output
|
|
45
|
+
|
|
46
|
+
```txt
|
|
47
|
+
Finished in 665ms using oxc (ast parsing) after scanning 307k lines of code.
|
|
48
|
+
|
|
49
|
+
Runtimes
|
|
50
|
+
- Node.js 24.0.0
|
|
51
|
+
- Deno 2.8.0
|
|
52
|
+
- Bun 1.3.0
|
|
53
|
+
|
|
54
|
+
Browsers
|
|
55
|
+
- Safari 26.0.0
|
|
56
|
+
- Chromium 149.0.0
|
|
57
|
+
- Firefox 141.0.0
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Use `--inspect <feature>` when you want to see every file and location that caused a requirement.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -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
|
|
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(
|
|
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), {
|
|
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.
|
|
3
|
+
"version": "1.1.0",
|
|
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": "
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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"
|