Skip to content

chore: check import cycles with fallow - #16

Merged
christianhg merged 1 commit into
mainfrom
chore/fallow-cycles
Nov 20, 2026
Merged

christianhg merged 1 commit into
mainfrom
chore/fallow-cycles

Conversation

@christianhg

@christianhg christianhg commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Adds fallow as a check for import cycles, beside knip, the same setup as in the editor. fallow is pinned to exactly 3.43.2, pnpm check:fallow runs it, and .fallowrc.json turns on only the cycle rule and leaves out import() inside functions. The package has no cycles today, so the check starts green.

The shared checks workflow gets a matching fallow job in a separate PR in portabletext/.github, which runs pnpm check:fallow in every repo that calls it. That PR lands after this one, because the job fails where the script is missing.


Note

Low Risk
Dev-only tooling and config with no runtime or production behavior changes.

Overview
Introduces fallow (3.43.2, pinned) as a dev dependency and adds pnpm check:fallow (fallow dead-code) alongside existing checks like knip.

.fallowrc.json enables only circular-dependencies as an error; all other fallow rules stay off. Cycle detection ignores lazy import() via circularDependencies.ignoreLazyImports. The repo is expected to pass this check from day one.

Reviewed by Cursor Bugbot for commit 3c00ed7. Bugbot is set up for automated code reviews on this repo. Configure here.

Add `fallow` 3.43.2 and a `check:fallow` script that fails on any import
cycle. Only the circular dependency rule is on, and imports inside a
function (`import()`) are left out. knip stays the check for unused code.
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Bundle Stats

✅ No significant changes.

All scenario measurements (1)

🗺️ View treemap · Artifacts

Scenario Kind Bundle (raw / gzip) Gzip change Import time Import change
⚪ @portabletext/plugin-sdk-value export 242.1 KB / 32.8 KB None None None

Significant means at least 1.0 KB and 1% gzip, or at least 5 ms and 10% import time.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedfallow@​3.43.210010010096100

View full report

@christianhg
christianhg marked this pull request as ready for review November 20, 2026 19:29
@christianhg
christianhg merged commit 891b779 into main Nov 20, 2026
25 checks passed
@christianhg
christianhg deleted the chore/fallow-cycles branch November 20, 2026 19:33

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3c00ed7. Configure here.

Comment thread package.json
},
"scripts": {
"build": "pkg-utils build --strict --check",
"check:fallow": "fallow dead-code",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fallow cache directory not ignored

Low Severity

pnpm check:fallow writes incremental cache under .fallow/, but .gitignore does not exclude that directory. fallow init adds it automatically, and this repo already ignores similar tool caches such as .vitest and .bundle-stats. Local runs can therefore stage generated cache files.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3c00ed7. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant