fix(typescript): expose public enums to isolated consumers - #448
Open
Galin Iliev (galiniliev) wants to merge 1 commit into
Open
Galin Iliev (galiniliev) wants to merge 1 commit into
Galin Iliev (galiniliev) wants to merge 1 commit into
Conversation
Generate ordinary enums in the TypeScript SDK mirror so package declarations work with isolatedModules and verbatimModuleSyntax. Preserve canonical protocol sources and all emitted JavaScript values. Build before SDK tests and exercise an installed npm tarball through TypeScript compilation and plain Node execution, including numeric enum flags and reverse mappings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The TypeScript SDK publishes ambient
const enumdeclarations even though its JavaScript exports ordinary enum objects. Consumers usingisolatedModulesorverbatimModuleSyntaxtherefore fail with TS2748 when importing public enum values.Generate ordinary enums in the TypeScript SDK mirror while leaving the canonical protocol sources and other language generators unchanged. The packed-package regression compiles and runs real root/client/hosts/ws consumers, including numeric flags and reverse mappings. All 74 emitted JavaScript files remain byte-for-byte identical; all 49 runtime enum objects and values match the base build.
Validation:
skipLibCheck: false.npm run generate: passed.npm test: 445 passed.npm test: 67 passed, including isolated-module consumer modes.A separate non-gating root TypeScript probe reports ten unchanged baseline errors in unrelated scripts. No protocol or package version bump is included.