Skip to content

Add gdscript and godot package definitions - #133

Open
TeeJS wants to merge 2 commits into
neuledge:mainfrom
TeeJS:gdscript-godot-packages-clean
Open

Add gdscript and godot package definitions#133
TeeJS wants to merge 2 commits into
neuledge:mainfrom
TeeJS:gdscript-godot-packages-clean

Conversation

@TeeJS

@TeeJS TeeJS commented Sep 5, 2026

Copy link
Copy Markdown

Add GDScript and Godot Engine package definitions

Adds two registry definitions built from godotengine/godot-docs:

  • registry/gdscript/gdscript.yaml — the GDScript language
  • registry/godot/godot.yaml — the Godot engine: full class reference + tutorials

Both use the self-named-directory convention the registry README prescribes for projects
not distributed by a package manager, alongside registry/python/python.yaml and
registry/java/java.yaml.

Build results

Built at godot-docs commit 6d86d7c7f3b8f4f56c71e113022d72fe80b2c84d
(branch stable, 2026-08-05, = Godot 4.7):

definition docs_path files sections tokens skipped size
gdscript/gdscript tutorials/scripting/gdscript 9 129 60,921 0 0.45 MB
godot/godot (whole repo) 1,604 14,488 8,136,611 0 48.03 MB

Zero skipped files in both. .rst is already a supported input format, so no new parsing
is required. Both definitions were validated by running the repository's own
loadDefinition() and listDefinitions() — including the whole-tree scan, since one bad
definition fails the nightly publish for every other package.

Why gdscript is scoped narrowly

tutorials/scripting/gdscript yields 129 sections, which is below the README's "a few
hundred" guideline, so it is worth explaining why that is deliberate rather than a
misconfigured docs_path.

The obvious wider path, tutorials/scripting, yields 515 sections — but they break down as:

area sections
c_sharp/ 208 (40%)
gdscript/ 129 (25%)
scripting/ root 97
cpp/ 41
debug/ 40

C# is the largest block in what would ship as a GDScript package, and it wins the most
important queries. Top-5 results from that build, ranked exactly as search.ts ranks them
(bm25(chunks_fts, 5.0, 10.0, 1.0) * -1, ORDER BY score DESC, after buildQuery()):

Since git sources have no exclude_paths (only zip sources do), the C# and C++ subtrees
cannot be pruned from tutorials/scripting. Narrowing the path is the only way to get a
GDScript package that returns GDScript. The same queries against the narrow build return
gdscript_basics: Signals ×3, gdscript_exports ×4, and static_typing ×4 — every top hit
on target.

One further consequence of the narrow scope, stated plainly because a reviewer will hit it:
when a query matches a built-in function name, the gdscript package returns
lexically-plausible but topically-wrong results rather than nothing, because those words
appear incidentally in tutorial prose.

query gdscript package returns actually documented in
preload gdscript_basics: Keywords, Classes classes/class_@gdscript.rst
range gdscript_exports: Limiting editor input ranges classes/class_@gdscript.rst
push_error static_typing: How to use static typing classes/class_@globalscope.rst
get_node gdscript_styleguide: Static typing classes/class_node.rst
inst (no results) classes/class_@gdscript.rst

All five resolve correctly in the godot package. This is intended routing rather than a
defect — classes/ is unreachable from any tutorial path — but it is why the gdscript
description names the built-ins explicitly and points at the godot package for them,
instead of only mentioning "engine APIs".

Everything the narrow path omits (autoloads, resources, groups, the scene tree,
overridable functions, debugging, multiplayer RPC) is covered by the godot package,
which also carries class_@gdscript.rst and class_@globalscope.rst — the built-in
functions (preload, load, assert, range, str) that live in classes/ and are
unreachable from any tutorial path. Each definition's description points at the other so
an agent can route between them.

Notes for reviewers

  • ref: stablegodot-docs has no git tags at all, and no ReadTheDocs htmlzip
    archives are published (all such URLs 404), so neither the tag-pattern nor the
    versioned-by-zip shape applies. The stable branch tracks the current Godot release and
    advances on its own, and source_commit is populated so skip-if-unchanged works.
  • Path separators — building on Windows produces doc_path values with backslashes
    (tutorials\scripting\...). That is a local artifact of readLocalDocsFiles on Windows,
    not a problem with these definitions; Linux CI produces forward slashes. Please don't
    "fix" the YAML paths for it.
  • Unrelated pre-existing Windows issue (not introduced here, no fix included) — running
    listDefinitions() on Windows throws
    Definition name "@apollo/client" doesn't match filename "@apollo\client.yaml", because
    loadDefinition() compares a relative() path against a /-joined name. It reproduces
    on main with these definitions removed, so it is not caused by this PR and does not
    affect Linux CI. Flagging it rather than fixing it here to keep this PR to one concern; a
    split(sep).join("/") on the derived name would resolve it.
  • Sizegodot is 48.03 MB, against the client's 512 MB DEFAULT_MAX_DOWNLOAD_BYTES
    and fetched on demand. A classes-only variant was measured (10,960 sections, 38.8 MB);
    it saves 9 MB and loses every tutorial, so it was rejected.

Attribution

godotengine/godot-docs is licensed CC-BY 3.0 Unported (verified from its
LICENSE.txt). Both definitions carry repository: pointing at the upstream repo.

@changeset-bot

changeset-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f5cf345

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Two unversioned definitions built from godotengine/godot-docs at ref
stable (Godot 4.7):

  gdscript/gdscript  docs_path tutorials/scripting/gdscript
                     9 files, 129 sections, 60,921 tokens, 0 skipped
  godot/godot        whole repo
                     1,604 files, 14,488 sections, 8,136,611 tokens, 0 skipped

Built at godot-docs 6d86d7c7f3b8f4f56c71e113022d72fe80b2c84d and
reproduced independently three times across node 22/24 and context
1.2.4/1.2.5 with identical file, section and token counts.

gdscript is scoped to the GDScript subtree rather than to
tutorials/scripting because the wider path is 40% C# by section count
(208 of 515), and C# wins the ranking for the most common lookups --
under the product's own bm25 weights, none of the top five results for
"signal" is GDScript. Git sources have no exclude_paths, so narrowing
the path is the only way to get a GDScript package that returns
GDScript. Everything the narrow path omits, including the @GDscript and
@globalscope built-ins in classes/, is covered by the godot package, and
each description points at the other.

godot-docs is licensed CC-BY 3.0 Unported.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@TeeJS
TeeJS force-pushed the gdscript-godot-packages-clean branch from 32983ce to 3a87423 Compare September 5, 2026 02:03

@moshest moshest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this — the descriptions are unusually careful, and I checked the claims in them rather than taking them at face value. Everything factual holds up:

  • ref: stable exists on godotengine/godot-docs.
  • docs_path: tutorials/scripting/gdscript exists and contains exactly the 9 files your description advertises (basics, advanced, exports, static typing, style guide, warning system, doc comments, format string).
  • The class reference is committed here — classes/ has 1079 .rst files including class_@gdscript.rst and class_@globalscope.rst. Worth stating explicitly because the similar-looking systemd case in #116 fails precisely here (its man pages are generated at build time, not committed), so "official docs repo" doesn't imply the reference is actually in it. Yours is.

I also built both definitions locally, since CI doesn't cover registry YAML:

package sections tokens
gdscript 129 60,921
godot 14,488 8,136,608

Both build successfully.

One thing worth changing before merge

godot has no docs_path, so it indexes the whole repository — which includes tutorials/scripting/gdscript/, the entire contents of the gdscript package. The two descriptions tell readers to use one for syntax and the other for engine APIs, but as written godot is a superset and those 9 files get indexed twice.

The schema already supports the fix (registry/java/java.yaml uses exclude_paths):

source:
  type: git
  url: https://github.com/godotengine/godot-docs
  ref: stable
  exclude_paths:
    - "tutorials/scripting/gdscript/**"

That makes the split you describe actually true.

Two notes for the maintainer, not asks of you

  • Size. 8.1M tokens is by far the largest definition here — 133× your gdscript package, and ~37× the systemd prototype measured in #116. I found no documented size ceiling in the registry code, so this isn't a rule violation, just worth a deliberate decision rather than an accidental one.
  • No CI ran on this PR (zero check runs), and separately ci.yml doesn't validate registry/*.yaml at all — it lints/builds/tests the TS packages only. A definition with a wrong ref or docs_path would pass review and first fail in the 06:00 nightly. That's a gap in our tooling, not in your contribution.

Not approving since the exclude_paths question is the author's call, but the definitions themselves are sound and I'm happy to see them land.


Generated by Claude Code

moshest added a commit that referenced this pull request Sep 6, 2026
ci.yml lints, builds and tests the TypeScript packages; nothing there reads
registry/*.yaml. A definition naming a branch or docs_path that does not exist
passed review and CI unchallenged, then failed at 06:00 UTC in the nightly
registry-update, long after the PR that introduced it was merged. #133 made it
concrete: two new definitions arrived with zero check runs.

This builds the definitions a PR adds or modifies, on the PR, using the
existing test-registry CLI. Only changed ones, so cost tracks the diff rather
than the 113-definition registry.

Proven with a deliberate probe rather than assumed: a definition pointing at a
nonexistent branch triggered the workflow and failed it with "Remote branch
this-branch-does-not-exist-xyz not found in upstream origin", exit 1. The probe
and its removal are kept as separate commits so the evidence stays in history.
A nonexistent docs_path also exits 1 rather than producing an empty package,
which was the failure mode worth ruling out.

moshest commented Sep 6, 2026

Copy link
Copy Markdown
Member

Correcting my review above: the exclude_paths suggestion doesn't work, and you already said so in your description.

I verified it in the code rather than leaving it as competing claims — GitSourceSchema (packages/registry/src/definition.ts:27-39) declares only type, url, ref, docs_path and lang, and both excludePaths call sites in build.ts (lines 100 and 142) sit inside source.type === "zip" branches. exclude_paths is zip-only exactly as you wrote. I generalised from registry/java/java.yaml without checking that it's a zip source. Disregard that part — there's nothing for you to change.

Your routing rationale answers the overlap point too, and with measurements I didn't have: C# taking 40% of tutorials/scripting and winning signal, await and export is a concrete reason to narrow the path, not a stylistic preference. The duplication between the two packages is real but unavoidable without git-source exclude_paths, and the cross-referencing descriptions are the right handling given that.

Adding exclude_paths to git sources looks like a contained change — the schema field plus plumbing it into the git branch alongside the zip one — but that belongs in its own PR, not stacked onto this one.

Two things on CI, since this PR has never had any:

  • Workflow runs on it are gated. The Registry Validate run is sitting at action_required, so a maintainer has to approve it before anything executes. That's why you've seen zero checks throughout, and it isn't anything you did.
  • I synced your branch with main so it picks up ci: build changed registry definitions on the pull request #134, which builds changed registry definitions on the PR. That's a merge commit, not a rebase, so your local checkout stays valid.

For what it's worth, I built both definitions locally before any of that: gdscript 129 sections / 60,921 tokens and godot 14,488 sections / 8,136,608 tokens, matching your table. The classes/ question I wanted to check — whether the class reference is actually committed rather than generated at build time, which is what sinks the systemd case in #116 — comes out in your favour: 1079 .rst files including class_@gdscript.rst and class_@globalscope.rst.


Generated by Claude Code

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.

2 participants