no-mistakes 0.5.0 → 0.6.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.
@@ -0,0 +1 @@
1
+ Native binary placeholder. Replaced by scripts/install.js during npm postinstall.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "no-mistakes",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Static codebase analysis tools for TS/JS dependencies, dependents, and symbols",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -9,11 +9,12 @@
9
9
  "directory": "packages/no-mistakes"
10
10
  },
11
11
  "bin": {
12
- "no-mistakes": "bin/no-mistakes.js"
12
+ "no-mistakes": "bin/no-mistakes"
13
13
  },
14
14
  "files": [
15
15
  "bin/",
16
16
  "scripts/install.js",
17
+ "scripts/install/",
17
18
  "README.md",
18
19
  "LICENSE"
19
20
  ],
@@ -24,6 +25,6 @@
24
25
  "postinstall": "node scripts/install.js"
25
26
  },
26
27
  "dependencies": {
27
- "no-mistakes-core": "^0.5.0"
28
+ "no-mistakes-core": "0.6.0"
28
29
  }
29
30
  }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ module.exports = require("no-mistakes-core");
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
 
4
4
  const { join } = require("node:path");
5
- const { install } = require("no-mistakes-core");
5
+ const { install } = require("./install/index");
6
6
 
7
7
  const PACKAGE_ROOT = join(__dirname, "..");
8
8
 
@@ -11,7 +11,8 @@ async function main(installFn = install, io = process, logger = console) {
11
11
  const pkg = require(join(PACKAGE_ROOT, "package.json"));
12
12
  const destination = await installFn("no-mistakes", "jonathanong/no-mistakes", {
13
13
  version: pkg.version,
14
- vendorDir: join(PACKAGE_ROOT, "vendor"),
14
+ vendorDir: join(PACKAGE_ROOT, "bin"),
15
+ destinationName: "no-mistakes",
15
16
  envVar: "NO_MISTAKES_RELEASE_BASE_URL",
16
17
  checkExisting: true,
17
18
  });
@@ -1,42 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- const { spawn } = require("node:child_process");
5
- const { join } = require("node:path");
6
-
7
- function binaryPath(platform = process.platform) {
8
- const binName = platform === "win32" ? "no-mistakes.exe" : "no-mistakes";
9
- return join(__dirname, "..", "vendor", binName);
10
- }
11
-
12
- function run(
13
- argv = process.argv.slice(2),
14
- platform = process.platform,
15
- io = process,
16
- spawnFn = spawn,
17
- ) {
18
- const child = spawnFn(binaryPath(platform), argv, {
19
- stdio: "inherit",
20
- });
21
-
22
- child.on("exit", (code, signal) => {
23
- if (code !== null) {
24
- io.exit(code);
25
- return;
26
- }
27
- if (signal !== null) {
28
- io.exit(1);
29
- return;
30
- }
31
- io.exit(0);
32
- });
33
-
34
- child.on("error", (error) => {
35
- console.error(error);
36
- io.exit(1);
37
- });
38
- }
39
-
40
- if (require.main === module) run();
41
-
42
- module.exports = { binaryPath, run };