|
| 1 | +# AGENTS.md - WurstSetup / Grill Notes |
| 2 | + |
| 3 | +This repo builds the Grill CLI and project setup tooling. The generated map-project agent notes live in `templates/AGENTS.md`; keep this root file focused on WurstSetup itself. |
| 4 | + |
| 5 | +## Current Architecture |
| 6 | + |
| 7 | +- Project config models come from `com.github.wurstscript:wurst-project-config`; do not reintroduce local DAO copies. |
| 8 | +- Local helpers in `config/ProjectConfigModels.kt` should stay thin: typealiases plus immutable copy helpers for shared records. |
| 9 | +- `YamlHelper.dumpProjectConfig` intentionally serializes a pruned YAML map instead of the shared records directly. This preserves the old user-facing `wurst.build` behavior by omitting null/default nested fields. |
| 10 | +- `wbschema.json` should stay lenient and aligned with the shared config parser, especially for `scriptMode`, `wc3Patch`, and nullable legacy fields. |
| 11 | + |
| 12 | +## WC3 Patch And Core JASS |
| 13 | + |
| 14 | +- `CoreJassProvider.DEFAULT_PATCH` is `v2.0`. |
| 15 | +- Core JASS is fetched from `wurstscript/jass-history`. |
| 16 | +- Friendly patch targets must resolve through the shared parser / `Wc3PatchTarget` style rules: |
| 17 | + - below `1.29` => pre-1.29 behavior and stdlib |
| 18 | + - `1.29` through `1.31` => classic |
| 19 | + - `1.32+`, `1.36`, `2.0`, and `Reforged-*` => Reforged |
| 20 | +- Do not add alias hacks for broken jass-history folder names. Fix `wurstscript/jass-history` instead. |
| 21 | +- Bundled core JASS fallbacks are patch-specific. Do not silently use the old `reforged` bundle as the `v2.0` fallback. |
| 22 | +- Keep provenance in `_build/core-jass.properties`; mismatched cached `common.j` / `blizzard.j` should be refreshed. |
| 23 | + |
| 24 | +## Generate Workflow |
| 25 | + |
| 26 | +- `grill generate` should write a schema-valid minimal `wurst.build`. |
| 27 | +- Keep `dependencies`, `scriptMode`, and `wc3Patch`. |
| 28 | +- `buildMapData` should only seed known fields: `name`, `fileName`, and `author`. Do not emit nested default scaffolding like `scenarioData`, `optionsFlags`, `players: []`, `forces: []`, or `loadingScreen: null`. |
| 29 | +- Generate supports `--wc3-path <dir>`. It should detect/show the Warcraft III client family and warn if it does not match the selected project patch target. |
| 30 | +- The VS Code setting `wurst.wc3path` should only be written for a valid detected/selected WC3 folder. |
| 31 | + |
| 32 | +## Install / Userdir |
| 33 | + |
| 34 | +- Grill installs itself to `~/.wurst/grill-cli/grill.jar`. |
| 35 | +- The Gradle task `make_for_userdir` must keep that jar refreshed for local testing. |
| 36 | +- `remove wurstscript` must not delete the whole `~/.wurst` folder; it should remove compiler artifacts only and leave Grill/runtime state intact. |
| 37 | +- Tests should not mutate the real user install. Use the `wurst.install.dir` system property override when testing installation/removal behavior. |
| 38 | + |
| 39 | +## Compiler Interaction |
| 40 | + |
| 41 | +- Build/typecheck should not require parsing the installed Warcraft executable when `wc3Patch` is pinned. |
| 42 | +- Run/launch is different: the selected WC3 executable controls launch arguments. If the client family and project patch target differ, warn and allow choosing another WC3 folder. |
| 43 | +- Keep compiler-facing patch behavior tested in the WurstScript repo as well; Grill and compiler can diverge if only one side is tested. |
| 44 | + |
| 45 | +## Test Commands |
| 46 | + |
| 47 | +Run the full WurstSetup suite before publishing: |
| 48 | + |
| 49 | +```bash |
| 50 | +./gradlew test |
| 51 | +``` |
| 52 | + |
| 53 | +Useful focused checks: |
| 54 | + |
| 55 | +```bash |
| 56 | +./gradlew test --tests GenerateTests --tests YamlHelperTests --tests Wc3ClientDetectorTests |
| 57 | +./gradlew test --tests CMDTests.testUnInstallCmd |
| 58 | +./gradlew make_for_userdir |
| 59 | +``` |
| 60 | + |
| 61 | +`git diff --check` should be clean apart from Windows CRLF warnings. |
0 commit comments