Skip to content

Conversation

@mootz12
Copy link
Contributor

@mootz12 mootz12 commented Jan 6, 2026

What

Sanitize all identifier names, strings, and docs before generating typescript bindings

Why

Prevents build errors

Known limitations

Does not check for protected JS names (like class).

@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Jan 6, 2026
@mootz12 mootz12 requested a review from Copilot January 6, 2026 22:14
@mootz12 mootz12 changed the base branch from main to release/v23.4.1 January 6, 2026 22:14
@mootz12 mootz12 requested a review from leighmcculloch January 6, 2026 22:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds comprehensive sanitization for TypeScript bindings generation to prevent build errors caused by unsafe characters in identifiers, strings, and documentation comments. The implementation introduces three sanitization functions and applies them throughout the code generation pipeline.

Key changes:

  • Added three sanitization functions: sanitize_doc, sanitize_identifier, and sanitize_string
  • Applied sanitization to all identifier names, string literals, and documentation strings across the TypeScript code generation
  • Added comprehensive test coverage for the sanitization functions and their integration points

Copy link
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for noting in the PR and the code that the sanitising doesn't prevent invalid names or keyword collision. That is something we should address here separately and/or in the js-stellar-sdk so that contracts that collide are still supported.

@leighmcculloch
Copy link
Member

Thanks for noting in the PR and the code that the sanitising doesn't prevent invalid names or keyword collision. That is something we should address here separately and/or in the js-stellar-sdk so that contracts that collide are still supported.

Opened:

@mootz12 mootz12 merged commit a152ec2 into release/v23.4.1 Jan 7, 2026
29 of 30 checks passed
@mootz12 mootz12 deleted the fix-ts-comment-injection branch January 7, 2026 00:38
@github-project-automation github-project-automation bot moved this from Backlog (Not Ready) to Done in DevX Jan 7, 2026
mootz12 added a commit that referenced this pull request Jan 7, 2026
mootz12 added a commit that referenced this pull request Jan 7, 2026
* Bump version to 23.4.1
* fix: sanitize typescript bindings (#2349)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants