Skip to content

fix: num64 == "long" generates broken helper files#844

Open
ahm23 wants to merge 1 commit intohyperweb-io:mainfrom
ahm23:fix/num64-Long-helpers-using-binary-deps
Open

fix: num64 == "long" generates broken helper files#844
ahm23 wants to merge 1 commit intohyperweb-io:mainfrom
ahm23:fix/num64-Long-helpers-using-binary-deps

Conversation

@ahm23
Copy link
Copy Markdown

@ahm23 ahm23 commented Apr 10, 2026

When configured to use Long for 64-bit numbers instead of bigint, certain helper files like helper-func-types.ts are still being generated to import ./binary and use BinaryReader/BinaryWriter for param type definitions, where they shouldn't be.

src/types/binary.ts, src/types/utf8.ts, and src/types/varint.ts are not even generated when configured to use Long for 64-bit numbers, so while it's not only incorrect, it also causes build issues in packages importing a package generated using telescope because of the missing imports.

This change makes the helper templates use the right encoding/decoding mechanisms, and removes broken imports:

  • num64: "bigint" continues to use BinaryReader / BinaryWriter from ./binary
  • num64: "long" now uses _m0.Reader / _m0.Writer from protobufjs/minimal as it should

@ahm23 ahm23 changed the title fix: num64 == "long" no longer generates files with incorrect and mis… fix: num64 == "long" generates broken helper files Apr 10, 2026
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