feat(workspaces): multi-module + multi-platform plugin support#38
Merged
Conversation
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.
932901d to
6066894
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runWorkspacesrunner with per-workspace output buffering, multi-value--workspace/--excludeselection acrossbuild/test/docs/clean/run, and--concurrencycaps.dependencies,jdk, andscriptscascade additively from root (workspace wins;nullopts out).compatibilitymerges field-by-field so a workspace can override justplatformswithout losingversions.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), andpluggy doctor --fix.pluggy build --watch,pluggy devauto-picks the only shipping workspace,pluggy docs/testhonour per-workspacedocs: false/test: falseopt-outs.multi-module(api + core + plugin) andmulti-platform(LuckPerms-shaped: api + core + paper + velocity + bungee + sponge).pluggy initdetects workspace-root templates fromtemplate.jsonmetadata (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