Skip to content

Add type stubs for generated modules#2696

Draft
jonathanKingston wants to merge 3 commits into
mainfrom
jkt/auto/bundler-generated-module-shims-f384
Draft

Add type stubs for generated modules#2696
jonathanKingston wants to merge 3 commits into
mainfrom
jkt/auto/bundler-generated-module-shims-f384

Conversation

@jonathanKingston
Copy link
Copy Markdown
Contributor

@jonathanKingston jonathanKingston commented May 13, 2026

Asana Task/Github Issue:

Description

Testing Steps

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

Note

Low Risk
Adds TypeScript declaration stubs for build-generated modules and adjusts .gitignore to track only those .d.ts files; no runtime logic changes.

Overview
Adds TypeScript declaration stubs for build-generated artifacts (build/locales/*-locales.d.ts and injected/.../surrogates-generated.d.ts) so imports type-check without committing generated JS.

Updates .gitignore to ignore the build/ output while explicitly allowing build/locales/*.d.ts to be tracked.

Reviewed by Cursor Bugbot for commit a07a041. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-authored-by: Jonathan Kingston <jonathanKingston@users.noreply.github.com>
@github-actions github-actions Bot added the semver-minor New feature — triggers minor version bump label May 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

[Beta] Generated file diff

Time updated: Fri, 22 May 2026 10:13:38 GMT

New Files
    - locales/ctl-locales.d.ts
  • locales/duckplayer-locales.d.ts

❌ File only exists in new changeset

daxtheduck
daxtheduck previously approved these changes May 13, 2026
Co-authored-by: Jonathan Kingston <jonathanKingston@users.noreply.github.com>
@daxtheduck daxtheduck dismissed their stale review May 13, 2026 15:44

Dismissing stale approval — new commits pushed, awaiting Cursor re-review.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

Build Branch

Branch pr-releases/jkt/auto/bundler-generated-module-shims-f384
Commit cbc0541a3c
Updated May 22, 2026 at 10:12:56 AM UTC

Static preview entry points

QR codes (mobile preview)
Entry point QR code
Docs QR for docs preview
Static pages QR for static pages preview
Integration pages QR for integration pages preview

Integration commands

npm (Android / Extension):

npm i github:duckduckgo/content-scope-scripts#pr-releases/jkt/auto/bundler-generated-module-shims-f384

Swift Package Manager (Apple):

.package(url: "https://github.com/duckduckgo/content-scope-scripts.git", branch: "pr-releases/jkt/auto/bundler-generated-module-shims-f384")

git submodule (Windows):

git -C submodules/content-scope-scripts fetch origin pr-releases/jkt/auto/bundler-generated-module-shims-f384
git -C submodules/content-scope-scripts checkout origin/pr-releases/jkt/auto/bundler-generated-module-shims-f384
Pin to exact commit

npm (Android / Extension):

npm i github:duckduckgo/content-scope-scripts#cbc0541a3c3c1e0fa04a86ad2c77e2de82d6388e

Swift Package Manager (Apple):

.package(url: "https://github.com/duckduckgo/content-scope-scripts.git", revision: "cbc0541a3c3c1e0fa04a86ad2c77e2de82d6388e")

git submodule (Windows):

git -C submodules/content-scope-scripts fetch origin pr-releases/jkt/auto/bundler-generated-module-shims-f384
git -C submodules/content-scope-scripts checkout cbc0541a3c3c1e0fa04a86ad2c77e2de82d6388e

@github-actions github-actions Bot added semver-patch Bug fix / internal — no release needed and removed semver-minor New feature — triggers minor version bump labels May 13, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Web Compatibility Assessment

No warning/error findings.

Info: .gitignore and the new declaration stubs in build/locales/*.d.ts and injected/src/features/tracker-protection/surrogates-generated.d.ts do not change injected runtime behavior, API wrapping, DOM interaction, platform entry points, or feature config gating.

Security Assessment

No warning/error/critical findings.

Info: The PR adds type-only module declarations and ignore-rule exceptions only. It does not introduce new global reads, messaging paths, origin handling, postMessage, network requests, iframe access, or changes to captured-globals.js, message-bridge, wrapper-utils.js, or DDGProxy.

Risk Level

Low Risk: type stubs and .gitignore changes only; the generated module shapes match the existing generators/import sites, and npm run tsc passes.

Recommendations

No blocking changes recommended. Keep the stubs synchronized with injected/scripts/buildLocales.js and injected/scripts/buildSurrogates.js if those generators change export shapes later.

Open in Web View Automation 

Sent by Cursor Automation: Web compat and sec

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Cursor review was not successful.

This PR requires a manual review and approval from a member of one of the following teams:

  • @duckduckgo/content-scope-scripts-owners
  • @duckduckgo/apple-devs
  • @duckduckgo/android-devs
  • @duckduckgo/team-windows-development
  • @duckduckgo/extension-owners
  • @duckduckgo/config-aor
  • @duckduckgo/breakage-aor
  • @duckduckgo/breakage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-patch Bug fix / internal — no release needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants