web: Replace JSDoc types with TypeScript - #25525
Open
GirlBossRush wants to merge 1 commit into
Open
Conversation
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>
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Contributor
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your 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)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your 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-f96834299af5db40ab703d04c287367a3f44944dAfterwards, run the upgrade commands from the latest release notes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR swaps our JSDoc types for TypeScript files using Node's built-in type stripping. Every module reachable from
scripts/build-web.tsis now real TypeScript — the build scripts, the bundler plugins,logger/,paths/, and@goauthentik/core.Module resolution
The
imports/exportsmaps inweb/package.jsonandweb/packages/core/package.jsonnow point at the.tssources directly, instead of pairing a.jsruntime entry with a generated.d.tsunderout/. Types resolve on a clean checkout without needing a declaration build first.Type stripping does not rewrite
.jsspecifiers back to.ts, so relative imports name the real file on disk andweb/tsconfig.jsonenablesallowImportingTsExtensions.packages/corefollows thepackages/geoprecedent —noEmitpluserasableSyntaxOnly. I did not seterasableSyntaxOnlyforwebitself, because decorators insrc/aren't erasable.