Skip to content

feat(workspaces): multi-module + multi-platform plugin support#38

Merged
ch99q merged 1 commit into
mainfrom
ch99q/multi-module-plugins
May 12, 2026
Merged

feat(workspaces): multi-module + multi-platform plugin support#38
ch99q merged 1 commit into
mainfrom
ch99q/multi-module-plugins

Conversation

@ch99q
Copy link
Copy Markdown
Collaborator

@ch99q ch99q commented May 12, 2026

Summary

  • Workspaces now feel like a real graph: parallel topological builds via a new runWorkspaces runner with per-workspace output buffering, multi-value --workspace / --exclude selection across build/test/docs/clean/run, and --concurrency caps.
  • Inheritance extended: dependencies, jdk, and scripts cascade additively from root (workspace wins; null opts out). compatibility merges field-by-field so a workspace can override just platforms without losing versions.
  • New commands: pluggy workspaces (table listing), pluggy workspace add|remove|rename (graph mutations with crash-recoverable child-first writes and a pre-flight collision check on rename), pluggy graph (text + Mermaid), pluggy explain (post-inheritance origin tags), pluggy clean, pluggy run <script> (with -- passthrough and ${project.x} / ${workspace.x} substitution, no-shell spawn), and pluggy doctor --fix.
  • Existing commands learn: pluggy build --watch, pluggy dev auto-picks the only shipping workspace, pluggy docs/test honour per-workspace docs: false / test: false opt-outs.
  • New templates: multi-module (api + core + plugin) and multi-platform (LuckPerms-shaped: api + core + paper + velocity + bungee + sponge). pluggy init detects workspace-root templates from template.json metadata (no hardcoded id allowlist). Docs added for every new command and the workspaces guide updated for inheritance, selection flags, and opt-out fields.

Test plan

  • `vp test` (662 passed, 4 pre-existing skips)
  • `vp lint` / `vp check` (clean)
  • Manual: scaffolded `pluggy init --template multi-module` and built end-to-end (api + core + plugin, plugin jar shades the others).
  • Manual: scaffolded `pluggy init --template multi-platform --mc-version 1.21.8` and built every workspace; verified bungee's `${project.apiVersion}` resolves Waterfall 1.21.
  • Manual: rename collision case (rename "api" → "shared" when a sibling has an unrelated "shared" modrinth dep) fails pre-flight with no partial state.

Adds a real workspace-graph experience on top of the existing `workspaces`
field: parallel topological builds, per-workspace opt-out flags, multi-value
selection, watch mode, per-workspace output buffering, and scaffolding for
both single-plugin (api/core/plugin) and LuckPerms-shaped multi-platform
layouts.

Inheritance: `dependencies`, `jdk`, and `scripts` cascade additively from
root (workspace wins on collision; `null` opts out). `compatibility` merges
field-by-field so a workspace can override just `platforms` without losing
`versions`.

Selection: `--workspace` accepts a repeated/comma-separated list across
`build`, `test`, `docs`, `clean`, and `run`. New `--exclude` subtracts from
the default sweep with a hard-fail when the result would orphan a
dependent. `--concurrency` caps parallel execution.

New commands: `pluggy workspaces` (table listing), `pluggy workspace
add|remove|rename` (graph mutations with crash-recoverable child-first
writes; rename pre-flights for dep-key collisions), `pluggy graph` (text
+ Mermaid), `pluggy explain` (post-inheritance origin tags), `pluggy clean`
(sweep `bin/`), `pluggy run <script>` (named scripts with `--` passthrough,
`${project.x}` / `${workspace.x}` substitution, no-shell spawn), and
`pluggy doctor --fix` (lockfile prune + missing-workspace prune).

Existing commands learn: `pluggy build --watch`, `--concurrency`,
`--workspace <names>`, `--exclude`; `pluggy dev` auto-picks the only
shipping workspace; `pluggy docs|test` honour `docs: false` / `test: false`
opt-outs with explicit `--workspace` override.

Templates: `multi-module` (api + core + plugin) and `multi-platform`
(api + core + paper + velocity + bungee + sponge, LuckPerms-shaped). Both
detected by their `template.json` declaring `projectJsonExtras.workspaces`,
so `pluggy init` skips the `main` prompt without an id-allowlist hardcode.
The bungee workspace uses `${project.apiVersion}` so its Waterfall version
tracks the user's MC choice.

Foundation: `runWorkspaces()` runner (dynamic semaphore, upstream-failure
propagation, per-workspace output buffering via AsyncLocalStorage),
`writeProjectFile()` helper, friendly `E_WORKSPACE_DEP_NOT_BUILT` when a
workspace dep jar is missing.

Docs cover every new command and update the workspaces guide for inheritance,
selection flags, and the per-workspace opt-out fields.
@ch99q ch99q force-pushed the ch99q/multi-module-plugins branch from 932901d to 6066894 Compare May 12, 2026 10:40
@ch99q ch99q merged commit e8b905e into main May 12, 2026
4 checks passed
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