fallow 0.2.0 → 1.0.4
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 +49 -38
- package/package.json +11 -11
- package/scripts/postinstall.js +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# fallow
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The codebase analyzer for JavaScript and TypeScript, built in Rust.
|
|
4
4
|
|
|
5
|
-
[](https://github.com/fallow-rs/fallow/actions/workflows/ci.yml)
|
|
6
6
|
[](https://www.npmjs.com/package/fallow)
|
|
7
|
-
[](https://github.com/
|
|
7
|
+
[](https://github.com/fallow-rs/fallow/blob/main/LICENSE)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Unused code, circular dependencies, code duplication, and complexity hotspots. Found in seconds, not minutes. fallow analyzes your codebase for unused files, exports, dependencies, and types, detects circular dependencies, and finds duplicated code blocks. **3-36x faster** than [knip](https://knip.dev) v5 (**2-14x faster** than knip v6), **20-33x faster** than [jscpd](https://github.com/kucherenko/jscpd) for duplication detection, with no Node.js runtime dependency.
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
@@ -17,56 +17,67 @@ npm install -g fallow
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
#
|
|
21
|
-
fallow
|
|
20
|
+
fallow check # Dead code analysis -- zero config, sub-second
|
|
21
|
+
fallow dupes # Duplication detection -- find copy-paste clones
|
|
22
|
+
fallow dupes --mode semantic # Catch clones with renamed variables
|
|
23
|
+
fallow fix --dry-run # Preview auto-removal of dead exports and deps
|
|
24
|
+
```
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
fallow watch
|
|
26
|
+
## What it finds
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
- **Unused files** -- not reachable from any entry point
|
|
29
|
+
- **Unused exports** -- exported symbols never imported elsewhere
|
|
30
|
+
- **Unused types** -- type aliases and interfaces never referenced
|
|
31
|
+
- **Unused dependencies** -- packages in `dependencies` never imported
|
|
32
|
+
- **Unused devDependencies** -- dev packages not referenced
|
|
33
|
+
- **Unused enum members** -- enum values never referenced
|
|
34
|
+
- **Unused class members** -- class methods and properties never referenced
|
|
35
|
+
- **Unresolved imports** -- import specifiers that cannot be resolved
|
|
36
|
+
- **Unlisted dependencies** -- imported packages missing from `package.json`
|
|
37
|
+
- **Duplicate exports** -- same symbol exported from multiple modules
|
|
38
|
+
- **Circular dependencies** -- import cycles in the module graph
|
|
39
|
+
- **Type-only dependencies** -- production deps only used via `import type`
|
|
40
|
+
|
|
41
|
+
## Code duplication
|
|
29
42
|
|
|
30
|
-
|
|
31
|
-
fallow
|
|
43
|
+
```bash
|
|
44
|
+
fallow dupes # Default: mild mode
|
|
45
|
+
fallow dupes --mode semantic # Catch clones with renamed variables
|
|
46
|
+
fallow dupes --threshold 5 # Fail CI if duplication exceeds 5%
|
|
47
|
+
fallow dupes --save-baseline # Save current duplication as baseline
|
|
32
48
|
```
|
|
33
49
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
1. **Unused files** - files not imported anywhere
|
|
37
|
-
2. **Unused exports** - exported symbols nobody imports
|
|
38
|
-
3. **Unused types** - exported type aliases and interfaces
|
|
39
|
-
4. **Unused dependencies** - packages in package.json not imported
|
|
40
|
-
5. **Unused devDependencies** - dev packages not referenced
|
|
41
|
-
6. **Unused enum members** - enum variants never accessed
|
|
42
|
-
7. **Unused class members** - methods/properties never used
|
|
43
|
-
8. **Unresolved imports** - imports that don't resolve to a file
|
|
44
|
-
9. **Unlisted dependencies** - imported packages not in package.json
|
|
45
|
-
10. **Duplicate exports** - same symbol exported from multiple files
|
|
50
|
+
4 detection modes (strict, mild, weak, semantic), clone family grouping with refactoring suggestions, baseline tracking, and cross-language TS/JS matching.
|
|
46
51
|
|
|
47
52
|
## Framework support
|
|
48
53
|
|
|
49
|
-
|
|
54
|
+
84 built-in plugins covering Next.js, Nuxt, Remix, SvelteKit, Gatsby, Astro, Angular, NestJS, Vite, Webpack, Vitest, Jest, Playwright, Cypress, Storybook, ESLint, TypeScript, Tailwind, Prisma, Drizzle, Turborepo, and many more. Auto-detected from your `package.json`.
|
|
50
55
|
|
|
51
56
|
## Configuration
|
|
52
57
|
|
|
53
|
-
Create a
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
[
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
Create a config file in your project root, or run `fallow init`:
|
|
59
|
+
|
|
60
|
+
```jsonc
|
|
61
|
+
// .fallowrc.json
|
|
62
|
+
{
|
|
63
|
+
"$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json",
|
|
64
|
+
"entry": ["src/workers/*.ts", "scripts/*.ts"],
|
|
65
|
+
"ignorePatterns": ["**/*.generated.ts"],
|
|
66
|
+
"rules": {
|
|
67
|
+
"unused-files": "error",
|
|
68
|
+
"unused-exports": "warn",
|
|
69
|
+
"unused-types": "off"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
63
72
|
```
|
|
64
73
|
|
|
65
|
-
|
|
74
|
+
Also supports TOML (`fallow init --toml` creates `fallow.toml`).
|
|
66
75
|
|
|
67
76
|
## Documentation
|
|
68
77
|
|
|
69
|
-
Full documentation
|
|
78
|
+
- [Full documentation](https://docs.fallow.tools)
|
|
79
|
+
- [GitHub repository](https://github.com/fallow-rs/fallow)
|
|
80
|
+
- [Plugin Authoring Guide](https://github.com/fallow-rs/fallow/blob/main/docs/plugin-authoring.md)
|
|
70
81
|
|
|
71
82
|
## License
|
|
72
83
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fallow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.4",
|
|
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": "git+https://github.com/
|
|
8
|
+
"url": "git+https://github.com/fallow-rs/fallow.git"
|
|
9
9
|
},
|
|
10
|
-
"homepage": "https://
|
|
10
|
+
"homepage": "https://docs.fallow.tools",
|
|
11
11
|
"bugs": {
|
|
12
|
-
"url": "https://github.com/
|
|
12
|
+
"url": "https://github.com/fallow-rs/fallow/issues"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"dead-code",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"detect-libc": "^2.0.0"
|
|
40
40
|
},
|
|
41
41
|
"optionalDependencies": {
|
|
42
|
-
"@fallow-cli/darwin-arm64": "0.
|
|
43
|
-
"@fallow-cli/darwin-x64": "0.
|
|
44
|
-
"@fallow-cli/linux-x64-gnu": "0.
|
|
45
|
-
"@fallow-cli/linux-arm64-gnu": "0.
|
|
46
|
-
"@fallow-cli/linux-x64-musl": "0.
|
|
47
|
-
"@fallow-cli/linux-arm64-musl": "0.
|
|
48
|
-
"@fallow-cli/win32-x64-msvc": "0.
|
|
42
|
+
"@fallow-cli/darwin-arm64": "1.0.4",
|
|
43
|
+
"@fallow-cli/darwin-x64": "1.0.4",
|
|
44
|
+
"@fallow-cli/linux-x64-gnu": "1.0.4",
|
|
45
|
+
"@fallow-cli/linux-arm64-gnu": "1.0.4",
|
|
46
|
+
"@fallow-cli/linux-x64-musl": "1.0.4",
|
|
47
|
+
"@fallow-cli/linux-arm64-musl": "1.0.4",
|
|
48
|
+
"@fallow-cli/win32-x64-msvc": "1.0.4"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/scripts/postinstall.js
CHANGED
|
@@ -27,7 +27,7 @@ const pkg = getPlatformPackage();
|
|
|
27
27
|
if (!pkg) {
|
|
28
28
|
console.warn(
|
|
29
29
|
`fallow: No prebuilt binary for ${process.platform}-${process.arch}. ` +
|
|
30
|
-
`You can build from source: https://github.com/
|
|
30
|
+
`You can build from source: https://github.com/fallow-rs/fallow`
|
|
31
31
|
);
|
|
32
32
|
process.exit(0);
|
|
33
33
|
}
|