fallow 0.2.0 → 1.0.3

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 CHANGED
@@ -1,12 +1,12 @@
1
1
  # fallow
2
2
 
3
- Find dead code in JavaScript and TypeScript projects. Written in Rust.
3
+ The codebase analyzer for JavaScript and TypeScript, built in Rust.
4
4
 
5
- [![CI](https://github.com/BartWaardenburg/fallow/actions/workflows/ci.yml/badge.svg)](https://github.com/BartWaardenburg/fallow/actions/workflows/ci.yml)
5
+ [![CI](https://github.com/fallow-rs/fallow/actions/workflows/ci.yml/badge.svg)](https://github.com/fallow-rs/fallow/actions/workflows/ci.yml)
6
6
  [![npm](https://img.shields.io/npm/v/fallow.svg)](https://www.npmjs.com/package/fallow)
7
- [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/bartwaardenburg/fallow/blob/main/LICENSE)
7
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/fallow-rs/fallow/blob/main/LICENSE)
8
8
 
9
- Fallow detects unused files, exports, dependencies, types, enum members, and class members across your codebase. It is a drop-in alternative to [knip](https://knip.dev) that runs **25-50x faster** on real-world projects by using the [Oxc](https://oxc.rs) parser instead of the TypeScript compiler.
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
- # Analyze your project
21
- fallow check
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
- # Watch mode
24
- fallow watch
26
+ ## What it finds
25
27
 
26
- # Auto-fix unused exports and dependencies
27
- fallow fix --dry-run
28
- fallow fix
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
- # JSON output for CI
31
- fallow check --format json
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
- ## What it finds
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
- Auto-detects and configures entry points for: Next.js, Vite, Vitest, Jest, Storybook, Remix, Astro, Nuxt, Angular, Playwright, Prisma, ESLint, TypeScript, Webpack, Tailwind, GraphQL Codegen, React Router.
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 `fallow.toml` in your project root:
54
-
55
- ```toml
56
- [entry]
57
- patterns = ["src/index.ts", "src/main.ts"]
58
-
59
- [ignore]
60
- files = ["**/*.test.ts", "**/*.spec.ts"]
61
- exports = ["src/public-api.ts"]
62
- dependencies = ["@types/*"]
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
- Or generate one: `fallow init`
74
+ Also supports TOML (`fallow init --toml` creates `fallow.toml`).
66
75
 
67
76
  ## Documentation
68
77
 
69
- Full documentation at [github.com/bartwaardenburg/fallow](https://github.com/bartwaardenburg/fallow).
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.2.0",
3
+ "version": "1.0.3",
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/BartWaardenburg/fallow.git"
8
+ "url": "git+https://github.com/fallow-rs/fallow.git"
9
9
  },
10
- "homepage": "https://github.com/BartWaardenburg/fallow",
10
+ "homepage": "https://docs.fallow.tools",
11
11
  "bugs": {
12
- "url": "https://github.com/BartWaardenburg/fallow/issues"
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.2.0",
43
- "@fallow-cli/darwin-x64": "0.2.0",
44
- "@fallow-cli/linux-x64-gnu": "0.2.0",
45
- "@fallow-cli/linux-arm64-gnu": "0.2.0",
46
- "@fallow-cli/linux-x64-musl": "0.2.0",
47
- "@fallow-cli/linux-arm64-musl": "0.2.0",
48
- "@fallow-cli/win32-x64-msvc": "0.2.0"
42
+ "@fallow-cli/darwin-arm64": "1.0.3",
43
+ "@fallow-cli/darwin-x64": "1.0.3",
44
+ "@fallow-cli/linux-x64-gnu": "1.0.3",
45
+ "@fallow-cli/linux-arm64-gnu": "1.0.3",
46
+ "@fallow-cli/linux-x64-musl": "1.0.3",
47
+ "@fallow-cli/linux-arm64-musl": "1.0.3",
48
+ "@fallow-cli/win32-x64-msvc": "1.0.3"
49
49
  }
50
50
  }
@@ -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/bartwaardenburg/fallow`
30
+ `You can build from source: https://github.com/fallow-rs/fallow`
31
31
  );
32
32
  process.exit(0);
33
33
  }