fallow 2.46.0 → 2.47.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 +12 -23
- package/bin/fallow-lsp +12 -23
- package/bin/fallow-mcp +12 -23
- package/package.json +11 -9
- package/scripts/platform-package.js +28 -0
- package/scripts/platform-package.test.js +26 -0
- package/scripts/postinstall.js +11 -22
package/bin/fallow
CHANGED
|
@@ -3,32 +3,21 @@
|
|
|
3
3
|
const { execFileSync } = require('child_process');
|
|
4
4
|
const { join } = require('path');
|
|
5
5
|
const { existsSync } = require('fs');
|
|
6
|
+
const { getPlatformPackage } = require('../scripts/platform-package');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (platform === 'win32' && arch === 'x64') {
|
|
12
|
-
return '@fallow-cli/win32-x64-msvc';
|
|
13
|
-
}
|
|
14
|
-
if (platform === 'darwin') {
|
|
15
|
-
return `@fallow-cli/darwin-${arch}`;
|
|
16
|
-
}
|
|
17
|
-
if (platform === 'linux') {
|
|
18
|
-
try {
|
|
19
|
-
const { familySync } = require('detect-libc');
|
|
20
|
-
const libc = familySync() === 'musl' ? 'musl' : 'gnu';
|
|
21
|
-
return `@fallow-cli/linux-${arch}-${libc}`;
|
|
22
|
-
} catch {
|
|
23
|
-
// musl binaries are statically linked and work on both glibc and musl systems
|
|
24
|
-
return `@fallow-cli/linux-${arch}-musl`;
|
|
25
|
-
}
|
|
8
|
+
const pkg = (() => {
|
|
9
|
+
if (process.platform !== 'linux') {
|
|
10
|
+
return getPlatformPackage(process.platform, process.arch);
|
|
26
11
|
}
|
|
27
12
|
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
try {
|
|
14
|
+
const { familySync } = require('detect-libc');
|
|
15
|
+
return getPlatformPackage(process.platform, process.arch, familySync());
|
|
16
|
+
} catch {
|
|
17
|
+
// musl binaries are statically linked and work on both glibc and musl systems
|
|
18
|
+
return getPlatformPackage(process.platform, process.arch, 'musl');
|
|
19
|
+
}
|
|
20
|
+
})();
|
|
32
21
|
|
|
33
22
|
if (!pkg) {
|
|
34
23
|
console.error(`Unsupported platform: ${process.platform}-${process.arch}`);
|
package/bin/fallow-lsp
CHANGED
|
@@ -3,32 +3,21 @@
|
|
|
3
3
|
const { execFileSync } = require('child_process');
|
|
4
4
|
const { join } = require('path');
|
|
5
5
|
const { existsSync } = require('fs');
|
|
6
|
+
const { getPlatformPackage } = require('../scripts/platform-package');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (platform === 'win32' && arch === 'x64') {
|
|
12
|
-
return '@fallow-cli/win32-x64-msvc';
|
|
13
|
-
}
|
|
14
|
-
if (platform === 'darwin') {
|
|
15
|
-
return `@fallow-cli/darwin-${arch}`;
|
|
16
|
-
}
|
|
17
|
-
if (platform === 'linux') {
|
|
18
|
-
try {
|
|
19
|
-
const { familySync } = require('detect-libc');
|
|
20
|
-
const libc = familySync() === 'musl' ? 'musl' : 'gnu';
|
|
21
|
-
return `@fallow-cli/linux-${arch}-${libc}`;
|
|
22
|
-
} catch {
|
|
23
|
-
// musl binaries are statically linked and work on both glibc and musl systems
|
|
24
|
-
return `@fallow-cli/linux-${arch}-musl`;
|
|
25
|
-
}
|
|
8
|
+
const pkg = (() => {
|
|
9
|
+
if (process.platform !== 'linux') {
|
|
10
|
+
return getPlatformPackage(process.platform, process.arch);
|
|
26
11
|
}
|
|
27
12
|
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
try {
|
|
14
|
+
const { familySync } = require('detect-libc');
|
|
15
|
+
return getPlatformPackage(process.platform, process.arch, familySync());
|
|
16
|
+
} catch {
|
|
17
|
+
// musl binaries are statically linked and work on both glibc and musl systems
|
|
18
|
+
return getPlatformPackage(process.platform, process.arch, 'musl');
|
|
19
|
+
}
|
|
20
|
+
})();
|
|
32
21
|
|
|
33
22
|
if (!pkg) {
|
|
34
23
|
console.error(`Unsupported platform: ${process.platform}-${process.arch}`);
|
package/bin/fallow-mcp
CHANGED
|
@@ -3,32 +3,21 @@
|
|
|
3
3
|
const { execFileSync } = require('child_process');
|
|
4
4
|
const { join } = require('path');
|
|
5
5
|
const { existsSync } = require('fs');
|
|
6
|
+
const { getPlatformPackage } = require('../scripts/platform-package');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (platform === 'win32' && arch === 'x64') {
|
|
12
|
-
return '@fallow-cli/win32-x64-msvc';
|
|
13
|
-
}
|
|
14
|
-
if (platform === 'darwin') {
|
|
15
|
-
return `@fallow-cli/darwin-${arch}`;
|
|
16
|
-
}
|
|
17
|
-
if (platform === 'linux') {
|
|
18
|
-
try {
|
|
19
|
-
const { familySync } = require('detect-libc');
|
|
20
|
-
const libc = familySync() === 'musl' ? 'musl' : 'gnu';
|
|
21
|
-
return `@fallow-cli/linux-${arch}-${libc}`;
|
|
22
|
-
} catch {
|
|
23
|
-
// musl binaries are statically linked and work on both glibc and musl systems
|
|
24
|
-
return `@fallow-cli/linux-${arch}-musl`;
|
|
25
|
-
}
|
|
8
|
+
const pkg = (() => {
|
|
9
|
+
if (process.platform !== 'linux') {
|
|
10
|
+
return getPlatformPackage(process.platform, process.arch);
|
|
26
11
|
}
|
|
27
12
|
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
try {
|
|
14
|
+
const { familySync } = require('detect-libc');
|
|
15
|
+
return getPlatformPackage(process.platform, process.arch, familySync());
|
|
16
|
+
} catch {
|
|
17
|
+
// musl binaries are statically linked and work on both glibc and musl systems
|
|
18
|
+
return getPlatformPackage(process.platform, process.arch, 'musl');
|
|
19
|
+
}
|
|
20
|
+
})();
|
|
32
21
|
|
|
33
22
|
if (!pkg) {
|
|
34
23
|
console.error(`Unsupported platform: ${process.platform}-${process.arch}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fallow",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.47.1",
|
|
4
4
|
"description": "Codebase intelligence for TypeScript and JavaScript. Finds unused code, duplication, circular dependencies, complexity hotspots, and architecture drift. Optional runtime intelligence layer (Fallow Runtime) adds production execution evidence. Rust-native, sub-second, 90 framework plugins.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,18 +35,20 @@
|
|
|
35
35
|
"README.md"
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
|
-
"postinstall": "node scripts/postinstall.js"
|
|
38
|
+
"postinstall": "node scripts/postinstall.js",
|
|
39
|
+
"test:platform": "node --test scripts/platform-package.test.js"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
42
|
"detect-libc": "2.1.2"
|
|
42
43
|
},
|
|
43
44
|
"optionalDependencies": {
|
|
44
|
-
"@fallow-cli/darwin-arm64": "2.
|
|
45
|
-
"@fallow-cli/darwin-x64": "2.
|
|
46
|
-
"@fallow-cli/linux-x64-gnu": "2.
|
|
47
|
-
"@fallow-cli/linux-arm64-gnu": "2.
|
|
48
|
-
"@fallow-cli/linux-x64-musl": "2.
|
|
49
|
-
"@fallow-cli/linux-arm64-musl": "2.
|
|
50
|
-
"@fallow-cli/win32-
|
|
45
|
+
"@fallow-cli/darwin-arm64": "2.47.1",
|
|
46
|
+
"@fallow-cli/darwin-x64": "2.47.1",
|
|
47
|
+
"@fallow-cli/linux-x64-gnu": "2.47.1",
|
|
48
|
+
"@fallow-cli/linux-arm64-gnu": "2.47.1",
|
|
49
|
+
"@fallow-cli/linux-x64-musl": "2.47.1",
|
|
50
|
+
"@fallow-cli/linux-arm64-musl": "2.47.1",
|
|
51
|
+
"@fallow-cli/win32-arm64-msvc": "2.47.1",
|
|
52
|
+
"@fallow-cli/win32-x64-msvc": "2.47.1"
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function getPlatformPackage(platform, arch, libcFamily) {
|
|
2
|
+
if (platform === 'win32') {
|
|
3
|
+
if (arch === 'x64') return '@fallow-cli/win32-x64-msvc';
|
|
4
|
+
if (arch === 'arm64') return '@fallow-cli/win32-arm64-msvc';
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (platform === 'darwin') {
|
|
9
|
+
if (arch === 'x64' || arch === 'arm64') {
|
|
10
|
+
return `@fallow-cli/darwin-${arch}`;
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (platform === 'linux') {
|
|
16
|
+
const libc = libcFamily === 'musl' ? 'musl' : 'gnu';
|
|
17
|
+
if (arch === 'x64' || arch === 'arm64') {
|
|
18
|
+
return `@fallow-cli/linux-${arch}-${libc}`;
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = {
|
|
27
|
+
getPlatformPackage,
|
|
28
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const test = require('node:test');
|
|
2
|
+
const assert = require('node:assert/strict');
|
|
3
|
+
|
|
4
|
+
const { getPlatformPackage } = require('./platform-package');
|
|
5
|
+
|
|
6
|
+
test('maps Windows x64 and arm64 to MSVC packages', () => {
|
|
7
|
+
assert.equal(getPlatformPackage('win32', 'x64'), '@fallow-cli/win32-x64-msvc');
|
|
8
|
+
assert.equal(getPlatformPackage('win32', 'arm64'), '@fallow-cli/win32-arm64-msvc');
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('maps Linux packages with libc awareness', () => {
|
|
12
|
+
assert.equal(getPlatformPackage('linux', 'x64', 'gnu'), '@fallow-cli/linux-x64-gnu');
|
|
13
|
+
assert.equal(getPlatformPackage('linux', 'arm64', 'musl'), '@fallow-cli/linux-arm64-musl');
|
|
14
|
+
assert.equal(getPlatformPackage('linux', 'arm64'), '@fallow-cli/linux-arm64-gnu');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('maps macOS packages by architecture', () => {
|
|
18
|
+
assert.equal(getPlatformPackage('darwin', 'x64'), '@fallow-cli/darwin-x64');
|
|
19
|
+
assert.equal(getPlatformPackage('darwin', 'arm64'), '@fallow-cli/darwin-arm64');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('returns null for unsupported targets', () => {
|
|
23
|
+
assert.equal(getPlatformPackage('win32', 'ia32'), null);
|
|
24
|
+
assert.equal(getPlatformPackage('linux', 'ppc64'), null);
|
|
25
|
+
assert.equal(getPlatformPackage('freebsd', 'x64'), null);
|
|
26
|
+
});
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
function getPlatformPackage() {
|
|
3
|
-
const platform = process.platform;
|
|
4
|
-
const arch = process.arch;
|
|
1
|
+
const { getPlatformPackage } = require('./platform-package');
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (platform === 'darwin') {
|
|
10
|
-
return `@fallow-cli/darwin-${arch}`;
|
|
11
|
-
}
|
|
12
|
-
if (platform === 'linux') {
|
|
13
|
-
try {
|
|
14
|
-
const { familySync } = require('detect-libc');
|
|
15
|
-
const libc = familySync() === 'musl' ? 'musl' : 'gnu';
|
|
16
|
-
return `@fallow-cli/linux-${arch}-${libc}`;
|
|
17
|
-
} catch {
|
|
18
|
-
return `@fallow-cli/linux-${arch}-gnu`;
|
|
19
|
-
}
|
|
3
|
+
const pkg = (() => {
|
|
4
|
+
if (process.platform !== 'linux') {
|
|
5
|
+
return getPlatformPackage(process.platform, process.arch);
|
|
20
6
|
}
|
|
21
7
|
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
try {
|
|
9
|
+
const { familySync } = require('detect-libc');
|
|
10
|
+
return getPlatformPackage(process.platform, process.arch, familySync());
|
|
11
|
+
} catch {
|
|
12
|
+
return getPlatformPackage(process.platform, process.arch);
|
|
13
|
+
}
|
|
14
|
+
})();
|
|
26
15
|
|
|
27
16
|
if (!pkg) {
|
|
28
17
|
console.warn(
|