Skip to content

update d.ts and .js files (generated JS pipeline)#1720

Merged
summeroff merged 5 commits into
stagingfrom
js_tsc_build_pipeline2
Jun 2, 2026
Merged

update d.ts and .js files (generated JS pipeline)#1720
summeroff merged 5 commits into
stagingfrom
js_tsc_build_pipeline2

Conversation

@summeroff

Copy link
Copy Markdown
Contributor

Description

Make js/module.ts the single source of truth and treat the shipped JS surface as generated tsc output:

  • js/module.{js,d.ts} and the index.* / type_check.* siblings are tsc outputs of js/tsconfig.json. The npm package ships them as-is, so they stay committed, but they must match tsc output.
  • yarn build:javascript regenerates them; yarn local:build chains it.
  • New CI workflow .github/workflows/check-js-generated.yml (via ci/check-js-generated.sh) regenerates and fails the build if any committed js/ output is stale.
  • tsconfig.json: target es6 → es2020, drop the deprecated suppressImplicitAnyIndexErrors.
  • Regenerating surfaced and fixed real drift between module.ts and the committed declarations (removed dead IDisplay/startup/shutdown, added copyFilters/getMediaState/getItemsInRange/active, removed a duplicate setFilterOrder, etc.).

Enums are intentionally left as const enum — converting them to regular enums puts their runtime objects in module.js and 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 from module.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.sh reports a clean tree after regeneration.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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, and js/type_check.js; aligned declarations with module.ts (added copyFilters/getMediaState/getItemsInRange/active/previous/is_first/is_last/last, removed dead IDisplay/startup/shutdown/initialized/version/duplicate setFilterOrder, switched IModule to readonly fields, etc.).
  • Added ci/check-js-generated.sh plus .github/workflows/check-js-generated.yml to regenerate and fail on stale committed outputs; local:build now chains build:javascript; README documents the workflow; tsconfig.json updated (target es2020, drop suppressImplicitAnyIndexErrors).
  • Removed the audioEncoder InstanceAccessor from EnhancedBroadcastingSimpleStreaming (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.

Comment on lines 45 to 46
&osn::EnhancedBroadcastingSimpleStreaming::SetEnableTwitchVOD),
InstanceAccessor("audioEncoder", &osn::EnhancedBroadcastingSimpleStreaming::GetAudioEncoder,
&osn::EnhancedBroadcastingSimpleStreaming::SetAudioEncoder),
InstanceAccessor("useAdvanced", &osn::EnhancedBroadcastingSimpleStreaming::GetUseAdvanced,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a false positive: audioEncoder is still registered on EnhancedBroadcastingSimpleStreamingstaging 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.

summeroff and others added 5 commits June 1, 2026 23:39
…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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.

@summeroff summeroff merged commit 09b4363 into staging Jun 2, 2026
21 checks passed
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