Repository navigation
gpn-kit: an offline validator / scaffolder / packer for GP-Next mods (unofficial, feedback wanted) #486
FengYue427
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi! I've been looking at how GP-Next mods get authored and noticed that several mistakes are only warned about, or silently accepted, and only show up after you zip, import and restart the game. So I built a small command-line tool that checks them locally first.
What it does (https://github.com/FengYue427/gpn-kit, Apache-2.0, same license as this website's repo)
gpn init: scaffold a data or JS mod that already passes validation
gpn validate: check a mod folder or a .zip
gpn pack: validate, then zip with pack.json at the root and / path separators
What validate checks, all taken from the docs under Mod files and manifest, Merge Rules and Language Packs:
pack.json: uuid rules, apiVersion, js.* combinations, depends, gpNextVersion range syntax, requiredGpNextFeatures, and misspelled field names
jsons/features and jsons/objects patches: field names (case-sensitive), value types and entry keys, checked against the original 0.15.0 JSON, with "did you mean" hints
the jsons/ layout, patching.json, lang.json, the JS entry file, and ZIP safety (path traversal, backslash paths)
Example: "SunCost": "100" gets "original type is number", and "Cooldwn" gets "did you mean Cooldown?".
How far to trust it
I have not loaded its output in the real game. Everything comes from the docs and the published JSON archive, so "passes the tool" does not guarantee "loads in game".
As a sanity check I ran every file in game-json-0.15.0.zip through it as if it were a patch: 0 errors. There are 18 warnings, all from entries in PropertySheets.json that have no aliases in the original data.
A name that doesn't exist in the original data is only a warning when it is very close to an existing one, since mods can legitimately add new entries.
About the data file. The repo includes
schema-0.15.0.json
, generated from the published game-json-0.15.0.zip. It contains only field names, value types and entry identifiers (such as CODENAME), no text, values, assets or levels. If you would rather it not be redistributed, just say so and I will remove it. Users can regenerate it with the included script and pass it with --schema, so nothing else depends on it.
Questions (I'd rather ask than guess)
Is a named export setup supported, or only export default { setup(ctx) {} }? Every example uses the default export, so the tool only gives an info note for the other form.
Is JSON5 accepted for pack.json, or only for patches? I currently parse pack.json as strict JSON.
Is the list of requiredGpNextFeatures IDs in the docs complete? The tool treats unknown IDs as a warning only.
The Types & Fields table for PlantFeatures lists TYPE, but the 0.15.0 data has TAGS and no TYPE. Is the table out of date?
It is unofficial and not affiliated with the team. If the rules look wrong, I'm happy to fix them. Thanks for GP-Next!
All reactions