update d.ts and .js files (generated JS pipeline)#1720
Conversation
There was a problem hiding this comment.
Pull request overview
Treats js/module.{js,d.ts} and siblings as tsc outputs of js/module.ts, regenerates them to remove drift, and adds CI enforcement that the committed outputs stay in sync. Also bumps the tsc target to es2020 and drops the deprecated suppressImplicitAnyIndexErrors. One unrelated C++ change removes an audioEncoder InstanceAccessor.
Changes:
- Regenerated
js/module.js,js/module.d.ts, andjs/type_check.js; aligned declarations withmodule.ts(addedcopyFilters/getMediaState/getItemsInRange/active/previous/is_first/is_last/last, removed deadIDisplay/startup/shutdown/initialized/version/duplicatesetFilterOrder, switchedIModuleto readonly fields, etc.). - Added
ci/check-js-generated.shplus.github/workflows/check-js-generated.ymlto regenerate and fail on stale committed outputs;local:buildnow chainsbuild:javascript; README documents the workflow;tsconfig.jsonupdated (target es2020, dropsuppressImplicitAnyIndexErrors). - Removed the
audioEncoderInstanceAccessor fromEnhancedBroadcastingSimpleStreaming(unrelated to PR purpose).
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the regenerated-JS workflow and CI check. |
| package.json | local:build now runs build:javascript first. |
| js/tsconfig.json | Bumps target to es2020 and drops suppressImplicitAnyIndexErrors. |
| js/module.ts | Source-of-truth updates: removes IDisplay*, startup/shutdown/initialized/version, duplicate setFilterOrder, IProperty.status, IProperties.status; adds copyFilters, active, getMediaState, getItemsInRange, previous/is_first/is_last, last, transition/scene send* methods, load, JSDoc for sendMessage; reshapes IModule/IModuleFactory. |
| js/module.d.ts | Regenerated declaration output matching module.ts. |
| js/module.js | Regenerated JS output (TS factor-out exports, formatting, try/catch reflow). |
| js/type_check.js | Regenerated with hoisted exports.X = X assignments. |
| ci/check-js-generated.sh | New script that fails if git status reports changes under js/ after regeneration. |
| .github/workflows/check-js-generated.yml | New CI job that runs build:javascript then the check script. |
| obs-studio-client/source/enhanced-broadcasting-simple-streaming.cpp | Removes the audioEncoder InstanceAccessor (unrelated to PR purpose; see comment). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| &osn::EnhancedBroadcastingSimpleStreaming::SetEnableTwitchVOD), | ||
| InstanceAccessor("audioEncoder", &osn::EnhancedBroadcastingSimpleStreaming::GetAudioEncoder, | ||
| &osn::EnhancedBroadcastingSimpleStreaming::SetAudioEncoder), | ||
| InstanceAccessor("useAdvanced", &osn::EnhancedBroadcastingSimpleStreaming::GetUseAdvanced, |
There was a problem hiding this comment.
This is a false positive: audioEncoder is still registered on EnhancedBroadcastingSimpleStreaming — staging declared the same InstanceAccessor("audioEncoder", ...) twice (this Init block had it at both the videoEncoder-adjacent line and again after enableTwitchVOD). This hunk removes only the duplicate second registration; the first remains, so stream.audioEncoder get/set still work and the referenced tests are unaffected. Net effect is a no-op de-duplication.
…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>
94f86aa to
9ce94d0
Compare
Description
Make
js/module.tsthe single source of truth and treat the shipped JS surface as generated tsc output:js/module.{js,d.ts}and theindex.*/type_check.*siblings are tsc outputs ofjs/tsconfig.json. The npm package ships them as-is, so they stay committed, but they must matchtscoutput.yarn build:javascriptregenerates them;yarn local:buildchains it..github/workflows/check-js-generated.yml(viaci/check-js-generated.sh) regenerates and fails the build if any committedjs/output is stale.tsconfig.json: target es6 → es2020, drop the deprecatedsuppressImplicitAnyIndexErrors.module.tsand the committed declarations (removed deadIDisplay/startup/shutdown, addedcopyFilters/getMediaState/getItemsInRange/active, removed a duplicatesetFilterOrder, etc.).Enums are intentionally left as
const enum— converting them to regular enums puts their runtime objects inmodule.jsand breaks consumers (e.g. desktop) that import enum values and rely on const-enum inlining to keep osn out of their bundle.Motivation and Context
The committed
js/outputs were hand-maintained and had drifted frommodule.ts. This removes the manual step (generate + CI-enforce) and corrects the drifted declarations.How Has This Been Tested?
yarn build:javascript— clean compile (tsc exit 0).ci/check-js-generated.shreports a clean tree after regeneration.Types of changes
Checklist: