Skip to content

Add --table-mapping and --strip-helpers CLI options#74

Closed
keithharvey wants to merge 1 commit intorhys-vdw:mainfrom
keithharvey:bifurcated
Closed

Add --table-mapping and --strip-helpers CLI options#74
keithharvey wants to merge 1 commit intorhys-vdw:mainfrom
keithharvey:bifurcated

Conversation

@keithharvey
Copy link
Copy Markdown
Collaborator

@keithharvey keithharvey commented Feb 26, 2026

Summary

Two new CLI options for generating context-specific type subsets from the same source files:

  • --table-mapping "OldName:NewName" remaps the first segment of qualified table names in the output (e.g. Spring.GetGameFrameSpringSynced.GetGameFrame). Can be specified multiple times.
  • --strip-helpers removes standalone helper type definitions (classes, enums, aliases) from the output, keeping only function and table declarations. Prevents duplicate types when generating context-specific outputs alongside per-file outputs.

Motivation

The Recoil engine exposes a single Spring table in Lua, but different contexts (synced vs unsynced) have access to different subsets of functions. These options allow generating SpringSynced and SpringUnsynced type libraries from the same C++ sources without duplicating shared helper types that already exist in the per-file output.

Enabled Recoil PR

beyond-all-reason/RecoilEngine#2799

Changes

  • src/tableMapping.ts — new DocProcessor that remaps table name prefixes
  • src/stripHelpers.ts — new DocProcessor that filters out non-function/table docs
  • src/cli.ts — two new CLI options
  • src/index.tsprocessDocs now accepts ProcessDocsOptions object (backward compatible)
  • 16 new tests across tableMapping.test.ts and stripHelpers.test.ts
  • Version bump to 3.4.0

LLM Disclosure

Opus 4.6 with a lot of prodding and testing by me.

keithharvey added a commit to keithharvey/RecoilEngine that referenced this pull request Mar 1, 2026
Publishes an EmmyLua type for Spring Synced/Unsynced/Shared. This allows us to create SpringMocks similar to

depends on [lua-doc-extractor beyond-all-reason#74](rhys-vdw/lua-doc-extractor#74)
@keithharvey keithharvey marked this pull request as ready for review March 1, 2026 20:50
keithharvey added a commit to keithharvey/RecoilEngine that referenced this pull request Mar 10, 2026
Publishes an EmmyLua type for Spring Synced/Unsynced/Shared. This allows us to create SpringMocks similar to

depends on [lua-doc-extractor beyond-all-reason#74](rhys-vdw/lua-doc-extractor#74)
keithharvey added a commit to keithharvey/RecoilEngine that referenced this pull request Mar 11, 2026
Publishes an EmmyLua type for Spring Synced/Unsynced/Shared. This allows us to create SpringMocks similar to

depends on [lua-doc-extractor beyond-all-reason#74](rhys-vdw/lua-doc-extractor#74)
--table-mapping "OldName:NewName" remaps the first segment of qualified
table names in function, table, field, enum, and global attributes.
Useful for generating context-specific types (e.g. Spring -> SpringSynced).

--strip-helpers removes standalone helper type definitions (classes,
enums, aliases) from the output, keeping only function and table
declarations. Prevents duplicate type definitions when generating
context-specific outputs alongside per-file outputs.

Bump version to 3.4.0.
@keithharvey
Copy link
Copy Markdown
Collaborator Author

keithharvey commented Mar 15, 2026

Closing in favor of #77

keithharvey added a commit to keithharvey/RecoilEngine that referenced this pull request Mar 17, 2026
Publishes an EmmyLua type for Spring Synced/Unsynced/Shared. This allows us to create SpringMocks similar to

depends on [lua-doc-extractor beyond-all-reason#74](rhys-vdw/lua-doc-extractor#74)
keithharvey added a commit to keithharvey/RecoilEngine that referenced this pull request Mar 17, 2026
Publishes an EmmyLua type for Spring Synced/Unsynced/Shared. This allows us to create SpringMocks similar to

depends on [lua-doc-extractor beyond-all-reason#74](rhys-vdw/lua-doc-extractor#74)
keithharvey added a commit to keithharvey/RecoilEngine that referenced this pull request Mar 17, 2026
Publishes an EmmyLua type for Spring Synced/Unsynced/Shared. This allows us to create SpringMocks similar to

depends on [lua-doc-extractor beyond-all-reason#74](rhys-vdw/lua-doc-extractor#74)
keithharvey added a commit to keithharvey/RecoilEngine that referenced this pull request Mar 19, 2026
Publishes an EmmyLua type for Spring Synced/Unsynced/Shared. This allows us to create SpringMocks similar to

depends on [lua-doc-extractor beyond-all-reason#74](rhys-vdw/lua-doc-extractor#74)
keithharvey added a commit to keithharvey/RecoilEngine that referenced this pull request Mar 20, 2026
Publishes an EmmyLua type for Spring Synced/Unsynced/Shared. This allows us to create SpringMocks similar to

depends on [lua-doc-extractor beyond-all-reason#74](rhys-vdw/lua-doc-extractor#74)
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.

1 participant