Refactor DaisyCommands to 2.0 runtime and typed DSL#16
Conversation
- Replace mutable command model with compiled `CommandRuntime` dispatcher - Migrate DSL/API toward typed `ArgumentRef<T>` and new `command/sub/execute` style - Switch to Paper `registerCommands(...)` registration and remove old `SubCommand` - Add migration guide, rewrite README for 2.0, and add core runtime tests
- Bump Kotlin from 2.3.0 to 2.3.20 - Upgrade Gradle wrapper to 9.4.1 - Switch upload-artifact action from v6 to v4 - Delete README.md
- Add a new README covering 2.0 DSL usage, features, and installation - Rewrite MIGRATION.md with before/after API examples and upgrade checklist - Clarify deprecated 1.x shims and emphasize Paper-only 2.0 registration flow
- Bump library/version docs to 3.0.0 and target Paper 1.21.11 - Remove legacy `DaisyCommand` compatibility API and string-key context access - Extend runtime DSL with first-class flags/options, defaults, validation, and suggestions - Refresh migration/README guidance and fix CI artifact upload path
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis major version upgrade (1.0.0 → 3.0.0) transforms DaisyCommands into a Kotlin-only, Paper-focused framework. Changes include: removal of Java compatibility APIs, introduction of a new Changes
Sequence Diagram(s)sequenceDiagram
participant Builder as DSL Builder<br/>(CommandBuilder)
participant Compiler as Command Compiler
participant CompiledCmd as CompiledCommand
participant Runtime as CommandRuntime
participant Handler as Handler<br/>(execute block)
Builder->>Compiler: CommandSpec with<br/>arguments, handlers,<br/>children
Compiler->>Compiler: Validate node rules,<br/>argument constraints,<br/>build lookup tables
Compiler->>CompiledCmd: Create compiled<br/>executable structure
Note over CompiledCmd: Ready for execution
CompiledCmd->>Runtime: execute(sender, args,<br/>config)
Runtime->>Runtime: Resolve target node<br/>via arg traversal
Runtime->>Runtime: Check permission &<br/>sender constraint
Runtime->>Runtime: Parse arguments<br/>(options, flags,<br/>positionals)
Runtime->>Runtime: Check requirements<br/>& cooldown bypass
Runtime->>Handler: Invoke handler with<br/>ResolvedArguments
Handler->>Handler: Access typed args<br/>via ArgumentRef<T>
Handler-->>Runtime: Execute completes
Runtime->>Runtime: Apply cooldown<br/>if successful
Runtime-->>CompiledCmd: Execution result
sequenceDiagram
participant Parser as DaisyParser<T>
participant ParseCtx as ParseContext<br/>(with Platform)
participant Platform as DaisyPlatform<br/>(BukkitPlatform)
participant Bukkit as Bukkit API
Parser->>ParseCtx: parse(input, context)
ParseCtx->>Platform: Resolve player/world/<br/>other types via<br/>context.platform
Platform->>Bukkit: Bukkit.getPlayer(name)<br/>Bukkit.getWorld(name)
Bukkit-->>Platform: Return resolved entity
Platform-->>ParseCtx: Provide resolved object
ParseCtx-->>Parser: Return typed T or<br/>parse failure
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can enable review details to help with troubleshooting, context usage and more.Enable the |
CommandRuntimedispatcherArgumentRef<T>and newcommand/sub/executestyleregisterCommands(...)registration and remove oldSubCommandSummary by CodeRabbit
Release Notes - v3.0.0
New Features
Documentation
Chores