Skip to content

feat(init): discover monorepo packages from Cargo, Go and Gradle workspaces - #1309

Merged
BryanFRD merged 2 commits into
mainfrom
feat/init-workspace-discovery
Oct 10, 2026
Merged

BryanFRD merged 2 commits into
mainfrom
feat/init-workspace-discovery

Conversation

@BryanFRD

Copy link
Copy Markdown
Contributor

Closes #333

ferrflow init now lists the packages declared by the repository workspace and offers to scaffold one package per member. npm and pnpm were already read by migrate; this moves that code to config/workspace_discovery and adds:

  • Cargo: [workspace] members and exclude
  • Go: use lines and blocks in go.work
  • Gradle: include calls in settings.gradle(.kts)

Cargo members that inherit version.workspace = true collapse to a single root package, since FerrFlow cannot version them individually. Declining the prompt keeps the manual flow.

The changelog entry ships in this PR; the CLI docs (EN and FR) describe the prompt.

@BryanFRD
BryanFRD enabled auto-merge (squash) October 10, 2026 13:07

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One blocking finding (inline): the shared discover now feeds non-JS packages into the changesets migration, which then scaffolds package.json paths for them.

Nit: the Gradle regex only reads include arguments that sit on the same line as include, so a multi-line include(\n ":a",\n ":b"\n) silently discovers nothing. Worth a test, or a note in the docs.
Nit: discover now walks the tree up to depth 6 once per ecosystem that declares a workspace (up to four walks). Fine for now; one walk that checks every source would be cheaper on large repos.

The init flow, Cargo version.workspace collapse (the Toml reader handles [workspace.package].version at the root) and the tests look right.

Comment thread src/config/migrate/changesets.rs Outdated

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The blocking finding is fixed in f198aa1: changesets now calls discover_node, so it only scaffolds JS packages, and discover_node_ignores_other_ecosystems tests that. The multi-line Gradle include( nit is fixed too and has a test. Nothing new to block on.

@BryanFRD
BryanFRD merged commit 4cf1d1d into main Oct 10, 2026
33 checks passed
@BryanFRD
BryanFRD deleted the feat/init-workspace-discovery branch October 10, 2026 13:39
ferrflow Bot added a commit that referenced this pull request Oct 10, 2026
## [7.30.0] - 2026-10-10

### Features

- feat(init): discover monorepo packages from Cargo, Go and Gradle workspaces (#1309)
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.

feat(init): auto-discover monorepo packages from workspace config

1 participant