Skip to content

web: Replace JSDoc types with TypeScript - #25525

Open
GirlBossRush wants to merge 1 commit into
mainfrom
node-compatible-typescript
Open

web: Replace JSDoc types with TypeScript#25525
GirlBossRush wants to merge 1 commit into
mainfrom
node-compatible-typescript

Conversation

@GirlBossRush

@GirlBossRush GirlBossRush commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

This PR swaps our JSDoc types for TypeScript files using Node's built-in type stripping. Every module reachable from scripts/build-web.ts is now real TypeScript — the build scripts, the bundler plugins, logger/, paths/, and @goauthentik/core.

Module resolution

The imports/exports maps in web/package.json and web/packages/core/package.json now point at the .ts sources directly, instead of pairing a .js runtime entry with a generated .d.ts under out/. Types resolve on a clean checkout without needing a declaration build first.

Type stripping does not rewrite .js specifiers back to .ts, so relative imports name the real file on disk and web/tsconfig.json enables allowImportingTsExtensions. packages/core follows the packages/geo precedent — noEmit plus erasableSyntaxOnly. I did not set erasableSyntaxOnly for web itself, because decorators in src/ aren't erasable.

Node runs TypeScript directly now, so the build scripts, bundler plugins,
and `@goauthentik/core` no longer need to be JavaScript annotated with
JSDoc. Every module reachable from `scripts/build-web.ts` is now real
TypeScript, run under Node's type stripping.

The package.json `imports`/`exports` maps point at the `.ts` sources
instead of pairing a `.js` runtime entry with a generated `.d.ts` under
`out/`, so types resolve on a clean checkout without a declaration build
first. Type stripping does not rewrite `.js` specifiers back to `.ts`,
so relative imports name the real file on disk and `web/tsconfig.json`
enables `allowImportingTsExtensions`.

Two suppressions in the locale scripts turned out to be a real
soundness gap rather than the `@lit/localize-tools` bug the tsconfig
comment claimed. `Config["output"]` is a union, and `outputDir` is only
required on its runtime variant, so the unnarrowed access was
legitimately `string | undefined`. `build-locales` only works in
runtime mode, so it now validates `output.mode` up front the way it
already validated `interchange.format`; the narrowing that follows
removes both the cast and the `@ts-expect-error`, and a misconfigured
`lit-localize.json` fails with a clear message instead of a TypeError
inside the library. Regenerating all 18 locale modules produces
byte-identical output.

Co-Authored-By: Playpen Agent <279763771+playpen-agent@users.noreply.github.com>
@GirlBossRush
GirlBossRush requested a review from a team as a code owner August 26, 2026 22:33
@netlify

netlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit f968342
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a8f69ba7f9f0700080dc6d5
😎 Deploy Preview https://deploy-preview-25525--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@GirlBossRush GirlBossRush self-assigned this Aug 26, 2026
@GirlBossRush GirlBossRush added the area:frontend Features or issues related to the browser, TypeScript, Node.js, etc label Aug 26, 2026
@GirlBossRush GirlBossRush moved this from Todo to In review in authentik Core Aug 26, 2026
@GirlBossRush GirlBossRush moved this from In review to Needs review in authentik Core Aug 26, 2026
@GirlBossRush GirlBossRush changed the title web: replace JSDoc types with TypeScript sources for build tooling web: Replace JSDoc types with TypeScript Aug 26, 2026
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.63%. Comparing base (95e7586) to head (f968342).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25525      +/-   ##
==========================================
- Coverage   91.67%   91.63%   -0.04%     
==========================================
  Files        1151     1151              
  Lines       73416    73416              
  Branches     4054     4054              
==========================================
- Hits        67301    67276      -25     
- Misses       6073     6098      +25     
  Partials       42       42              
Flag Coverage Δ
conformance 34.41% <ø> (+<0.01%) ⬆️
e2e 39.07% <ø> (+<0.01%) ⬆️
integration 30.56% <ø> (-0.45%) ⬇️
rust 42.92% <ø> (ø)
unit 93.22% <ø> (+<0.01%) ⬆️
unit-migrate 93.23% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

Copy link
Copy Markdown
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-f96834299af5db40ab703d04c287367a3f44944d
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-f96834299af5db40ab703d04c287367a3f44944d

Afterwards, run the upgrade commands from the latest release notes.

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

Labels

area:frontend Features or issues related to the browser, TypeScript, Node.js, etc

Projects

Status: Needs review

Development

Successfully merging this pull request may close these issues.

1 participant