Skip to content

update d.ts and .js files#1687

Open
summeroff wants to merge 6 commits intostagingfrom
js_tsc_build_pipeline
Open

update d.ts and .js files#1687
summeroff wants to merge 6 commits intostagingfrom
js_tsc_build_pipeline

Conversation

@summeroff
Copy link
Copy Markdown
Contributor

Description

add script to keep module.d.ts and module.js files consistent with module.ts

Motivation and Context

How Has This Been Tested?

Types of changes

  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

Comment thread .github/workflows/check-js-generated.yml Fixed
Copy link
Copy Markdown
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 PR adds automation and documentation to keep the committed JavaScript/TypeScript declaration outputs under js/ in sync with their TypeScript sources (notably js/module.ts), and updates the JS build configuration accordingly.

Changes:

  • Adds a GitHub Actions workflow + CI script to regenerate js/ outputs and fail when committed generated files are out of date.
  • Updates local build flow to run the JS generation step before building/installing native artifacts.
  • Updates js/tsconfig.json (target bump to ES2020 and removes a deprecated compiler option) and refreshes committed generated outputs (js/*.js, js/*.d.ts).

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
README.md Documents that js/module.ts is the source of truth and how/where generated outputs are enforced.
package.json Chains build:javascript into local:build to reduce drift locally.
js/type_check.js Updated committed tsc output to match current generation.
js/tsconfig.json Updates TS emit target to ES2020 and removes suppressImplicitAnyIndexErrors.
js/module.js Updated committed tsc output to match current generation.
js/module.d.ts Updated committed declaration output to match current generation.
ci/check-js-generated.sh New CI helper script to detect stale generated outputs after running yarn build:javascript.
.github/workflows/check-js-generated.yml New workflow to run JS generation and invoke the stale-check script on PRs/pushes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ci/check-js-generated.sh Outdated
Comment thread ci/check-js-generated.sh
Comment on lines +1 to +8
#!/bin/bash
# Verify that the committed tsc outputs under js/ match what regenerating
# from js/module.ts would produce. CI runs `yarn build:javascript` first,
# so any modified file at this point is a stale generated file.
dirty=$(git ls-files --modified js/)

set +x
if [[ $dirty ]]; then
Comment thread js/module.js
return sourcesSize;
}
exports.getSourcesSize = getSourcesSize;
;
summeroff and others added 5 commits May 5, 2026 18:41
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@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

None yet

Development

Successfully merging this pull request may close these issues.

3 participants