@rikalabs/repo-lint 0.3.9 → 0.3.11

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,36 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn, spawnSync } = require("child_process");
4
+ const path = require("path");
5
+ const fs = require("fs");
6
+
7
+ const binName = process.platform === "win32" ? "repo-lint.exe" : "repo-lint";
8
+ const binPath = path.join(__dirname, binName);
9
+
10
+ // If binary missing, try to install it (lazy install)
11
+ if (!fs.existsSync(binPath)) {
12
+ console.error("repo-lint binary not found. Installing...");
13
+ const installScript = path.join(__dirname, "..", "install.js");
14
+
15
+ const result = spawnSync(process.execPath, [installScript], {
16
+ stdio: "inherit",
17
+ cwd: path.join(__dirname, ".."),
18
+ });
19
+
20
+ if (result.status !== 0 || !fs.existsSync(binPath)) {
21
+ console.error("\nFailed to install repo-lint binary.");
22
+ console.error("You can install manually:");
23
+ console.error(" - Download from: https://github.com/Rika-Labs/repo-lint/releases");
24
+ console.error(" - Or install via cargo: cargo install repo-lint");
25
+ process.exit(1);
26
+ }
27
+ }
28
+
29
+ const child = spawn(binPath, process.argv.slice(2), {
30
+ stdio: "inherit",
31
+ shell: false,
32
+ });
33
+
34
+ child.on("close", (code) => {
35
+ process.exit(code ?? 0);
36
+ });
package/install.js CHANGED
@@ -89,6 +89,11 @@ async function extractZip(buffer, destDir) {
89
89
  }
90
90
 
91
91
  async function install() {
92
+ if (process.env.REPO_LINT_SKIP_INSTALL || process.env.SKIP_REPO_LINT_INSTALL) {
93
+ console.log("Skipping repo-lint binary installation (skipped by env var)");
94
+ process.exit(0);
95
+ }
96
+
92
97
  try {
93
98
  const { binaryName, ext, platform } = getPlatformInfo();
94
99
  const version = `v${PACKAGE_VERSION}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rikalabs/repo-lint",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "description": "High-performance filesystem layout linter with TypeScript DSL config",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -55,7 +55,7 @@
55
55
  }
56
56
  },
57
57
  "bin": {
58
- "repo-lint": "./bin/repo-lint"
58
+ "repo-lint": "./bin/repo-lint.js"
59
59
  },
60
60
  "files": [
61
61
  "index.js",
package/bin/repo-lint DELETED
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { spawn } = require("child_process");
4
- const path = require("path");
5
- const fs = require("fs");
6
-
7
- const binName = process.platform === "win32" ? "repo-lint.exe" : "repo-lint";
8
- const binPath = path.join(__dirname, binName);
9
-
10
- if (!fs.existsSync(binPath)) {
11
- console.error("repo-lint binary not found. Try reinstalling the package:");
12
- console.error(" npm install repo-lint");
13
- process.exit(1);
14
- }
15
-
16
- const child = spawn(binPath, process.argv.slice(2), {
17
- stdio: "inherit",
18
- shell: false,
19
- });
20
-
21
- child.on("close", (code) => {
22
- process.exit(code ?? 0);
23
- });