fallow 0.1.0 → 0.1.1

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/bin/fallow CHANGED
@@ -5,17 +5,17 @@ const { join } = require('path');
5
5
  const { existsSync } = require('fs');
6
6
 
7
7
  const PLATFORMS = {
8
- 'darwin-arm64': '@nicholasgasior/fallow-darwin-arm64',
9
- 'darwin-x64': '@nicholasgasior/fallow-darwin-x64',
10
- 'linux-x64': '@nicholasgasior/fallow-linux-x64-gnu',
11
- 'linux-arm64': '@nicholasgasior/fallow-linux-arm64-gnu',
12
- 'win32-x64': '@nicholasgasior/fallow-win32-x64-msvc',
8
+ 'darwin-arm64': ['@fallow-cli/darwin-arm64'],
9
+ 'darwin-x64': ['@fallow-cli/darwin-x64'],
10
+ 'linux-x64': ['@fallow-cli/linux-x64-gnu', '@fallow-cli/linux-x64-musl'],
11
+ 'linux-arm64': ['@fallow-cli/linux-arm64-gnu', '@fallow-cli/linux-arm64-musl'],
12
+ 'win32-x64': ['@fallow-cli/win32-x64-msvc'],
13
13
  };
14
14
 
15
15
  const platformKey = `${process.platform}-${process.arch}`;
16
- const pkg = PLATFORMS[platformKey];
16
+ const candidates = PLATFORMS[platformKey];
17
17
 
18
- if (!pkg) {
18
+ if (!candidates) {
19
19
  console.error(`Unsupported platform: ${platformKey}`);
20
20
  console.error(`Supported platforms: ${Object.keys(PLATFORMS).join(', ')}`);
21
21
  process.exit(1);
@@ -23,18 +23,23 @@ if (!pkg) {
23
23
 
24
24
  let binaryPath;
25
25
 
26
- // Try to find the binary in node_modules
27
- try {
28
- const pkgDir = require.resolve(`${pkg}/package.json`);
29
- const binaryName = process.platform === 'win32' ? 'fallow.exe' : 'fallow';
30
- binaryPath = join(pkgDir, '..', binaryName);
31
- } catch {
32
- console.error(`Could not find ${pkg}. Run 'npm install' to install platform-specific binary.`);
33
- process.exit(1);
26
+ // Try each candidate package (gnu first, then musl fallback)
27
+ for (const pkg of candidates) {
28
+ try {
29
+ const pkgDir = require.resolve(`${pkg}/package.json`);
30
+ const binaryName = process.platform === 'win32' ? 'fallow.exe' : 'fallow';
31
+ const candidate = join(pkgDir, '..', binaryName);
32
+ if (existsSync(candidate)) {
33
+ binaryPath = candidate;
34
+ break;
35
+ }
36
+ } catch {
37
+ // Package not installed, try next candidate
38
+ }
34
39
  }
35
40
 
36
- if (!existsSync(binaryPath)) {
37
- console.error(`Binary not found at ${binaryPath}`);
41
+ if (!binaryPath) {
42
+ console.error(`Could not find fallow binary for ${platformKey}. Run 'npm install' to install platform-specific binary.`);
38
43
  process.exit(1);
39
44
  }
40
45
 
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "fallow",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Find unused files, exports, and dependencies in JavaScript/TypeScript projects",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/nicholasgasior/fallow"
8
+ "url": "https://github.com/bartwaardenburg/fallow"
9
+ },
10
+ "homepage": "https://github.com/bartwaardenburg/fallow",
11
+ "bugs": {
12
+ "url": "https://github.com/bartwaardenburg/fallow/issues"
9
13
  },
10
14
  "keywords": [
11
15
  "dead-code",
@@ -17,6 +21,9 @@
17
21
  "typescript",
18
22
  "javascript"
19
23
  ],
24
+ "engines": {
25
+ "node": ">=16"
26
+ },
20
27
  "bin": {
21
28
  "fallow": "bin/fallow"
22
29
  },
@@ -28,10 +35,12 @@
28
35
  "postinstall": "node scripts/postinstall.js"
29
36
  },
30
37
  "optionalDependencies": {
31
- "@nicholasgasior/fallow-darwin-arm64": "0.1.0",
32
- "@nicholasgasior/fallow-darwin-x64": "0.1.0",
33
- "@nicholasgasior/fallow-linux-x64-gnu": "0.1.0",
34
- "@nicholasgasior/fallow-linux-arm64-gnu": "0.1.0",
35
- "@nicholasgasior/fallow-win32-x64-msvc": "0.1.0"
38
+ "@fallow-cli/darwin-arm64": "0.1.0",
39
+ "@fallow-cli/darwin-x64": "0.1.0",
40
+ "@fallow-cli/linux-x64-gnu": "0.1.0",
41
+ "@fallow-cli/linux-arm64-gnu": "0.1.0",
42
+ "@fallow-cli/linux-x64-musl": "0.1.0",
43
+ "@fallow-cli/linux-arm64-musl": "0.1.0",
44
+ "@fallow-cli/win32-x64-msvc": "0.1.0"
36
45
  }
37
46
  }
@@ -1,29 +1,36 @@
1
1
  // Verify the correct platform-specific package was installed
2
2
  const PLATFORMS = {
3
- 'darwin-arm64': '@nicholasgasior/fallow-darwin-arm64',
4
- 'darwin-x64': '@nicholasgasior/fallow-darwin-x64',
5
- 'linux-x64': '@nicholasgasior/fallow-linux-x64-gnu',
6
- 'linux-arm64': '@nicholasgasior/fallow-linux-arm64-gnu',
7
- 'win32-x64': '@nicholasgasior/fallow-win32-x64-msvc',
3
+ 'darwin-arm64': ['@fallow-cli/darwin-arm64'],
4
+ 'darwin-x64': ['@fallow-cli/darwin-x64'],
5
+ 'linux-x64': ['@fallow-cli/linux-x64-gnu', '@fallow-cli/linux-x64-musl'],
6
+ 'linux-arm64': ['@fallow-cli/linux-arm64-gnu', '@fallow-cli/linux-arm64-musl'],
7
+ 'win32-x64': ['@fallow-cli/win32-x64-msvc'],
8
8
  };
9
9
 
10
10
  const platformKey = `${process.platform}-${process.arch}`;
11
- const pkg = PLATFORMS[platformKey];
11
+ const candidates = PLATFORMS[platformKey];
12
12
 
13
- if (!pkg) {
13
+ if (!candidates) {
14
14
  console.warn(
15
15
  `fallow: No prebuilt binary for ${platformKey}. ` +
16
- `You can build from source: https://github.com/nicholasgasior/fallow`
16
+ `You can build from source: https://github.com/bartwaardenburg/fallow`
17
17
  );
18
18
  process.exit(0);
19
19
  }
20
20
 
21
- try {
22
- require.resolve(pkg);
23
- } catch {
21
+ const found = candidates.some((pkg) => {
22
+ try {
23
+ require.resolve(`${pkg}/package.json`);
24
+ return true;
25
+ } catch {
26
+ return false;
27
+ }
28
+ });
29
+
30
+ if (!found) {
24
31
  console.warn(
25
- `fallow: Platform package ${pkg} not installed. ` +
32
+ `fallow: No platform package installed for ${platformKey}. ` +
26
33
  `This may happen if you used --no-optional. ` +
27
- `Run 'npm install ${pkg}' to fix.`
34
+ `Run 'npm install' to fix.`
28
35
  );
29
36
  }