Repository navigation
root, web, docs: pnpm 12.4.0 upgrade. Remove Corepack. - #25641
Conversation
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| "@typescript-eslint/parser": "^8.65.0" | ||
| "@typescript-eslint/utils": "^8.65.0" | ||
| "@types/node": "^26.1.2" | ||
| "@types/node": "^26.4.0" |
There was a problem hiding this comment.
Bumping this intentionally to ensure that the lock files aren't stale after the pnpm upgrade.
| "@typescript-eslint/parser": "^8.65.0" | ||
| "@typescript-eslint/utils": "^8.65.0" | ||
| "@types/node": "^26.1.2" | ||
| "@types/node": "^26.4.0" |
There was a problem hiding this comment.
Bumping this intentionally to ensure that the lock files aren't stale after the pnpm upgrade.
✅ 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 #25641 +/- ##
==========================================
- Coverage 91.70% 91.67% -0.04%
==========================================
Files 1152 1160 +8
Lines 73507 73938 +431
Branches 4054 4054
==========================================
+ Hits 67413 67781 +368
- Misses 6052 6115 +63
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. |
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-a34ccff21d90166f53b7a098f8be4d3141af6ca9
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-a34ccff21d90166f53b7a098f8be4d3141af6ca9Afterwards, run the upgrade commands from the latest release notes. |
Bumps `packageManager` and `engines.pnpm` in all five manifests, and the pnpm image tag both Dockerfiles copy the binary out of. The Dockerfiles were still on 11.22.0 while the manifests said 11.25.0, so the image builds ran a different pnpm than local installs did. pnpm 12 records the package manager in the lockfile under `packageManagerDependencies`, which is the only lockfile change here.
`lint-catalogs` already compared the `catalog:` entries in each workspace. It now also checks the seven places that pin pnpm itself — the five `packageManager` fields and the two pnpm image tags — since nothing else noticed when the Dockerfiles fell three patches behind. It also requires the `+sha512.` suffix to be present and well formed. `pnpm self-update` strips it, which is how a bump turns into an unreviewed change of what `packageManager` identifies.
Corepack used to verify this hash for us, and nothing has since we stopped installing pnpm through it — pnpm's own version switcher reads the version and ignores the suffix. A stale hash would sit in package.json unnoticed until someone trusted it. `lint-runtime` now resolves the pinned version's `dist.integrity` from the registry, converts it from base64 to hex, and compares. On a mismatch it prints the corrected `packageManager` line to paste in. It also checks the pinned version satisfies `engines.pnpm`, which had drifted. An unreachable registry warns and skips rather than failing, so offline installs and a flaky registry don't break `pnpm lint`.
`corepack enable pnpm` is no longer the recommended way in; corepack is deprecated. Any recent pnpm switches to the pinned version on its own, so the setup guides just point at the pnpm installation guide. Also updates the minimum from 11.9 to 12.4, and the stale references in website/AGENTS.md to npm workspaces and `npm run --prefix`.
Replaces the JSDoc-annotated .mjs scripts with TypeScript, run directly by
Node's type stripping. No build step: the relative imports name the `.ts`
file that exists on disk, since Node does not rewrite `.js` to `.ts`.
Three fixes the types forced out of the JSDoc originals:
- `compareVersions` compared missing version parts as NaN, which is
neither greater nor less, so `compareVersions("24", "24.1.0")` reported
the two as equal. Missing parts now count as zero.
- `createTag` declared `bind` on every tag it returned, but only `$` is
given one. `node.bind("pnpm")` type-checked as the native
`Function.prototype.bind` and silently did something else.
- `peerDependenciesMeta` maps a package to flags, not to a version range.
`loadJSON` takes a type parameter rather than returning `any`, so callers
say what they're reading.
The root project had `files: []` and no references, so `tsc -b` checked nothing — the port would have drifted untyped. Adds a project for `scripts/node`, references it from the root, and runs `tsc -b` as part of `pnpm lint` and a `ci-lint-check-types` target. The scripts reach the logger through `#logger` rather than a deep relative path, so its declarations resolve instead of `any`. Only the `types` condition points into `packages/logger-js/out`; `default` stays a relative path, because `make node-preinstall` runs before `pnpm install` and has no node_modules to resolve a bare specifier against.
`types` resolved to `out/index.d.ts`, which re-exports `lib/shared.js` — the browser implementation — while the `node` condition runs `lib/node.js`. Importing the package by name on Node therefore described `ConsoleLogger` as the browser class, which has no `fixture` and a `prefix` returning a different type than the Node value does. Each condition now carries the declarations for the file it resolves to, with `types` first so it isn't shadowed by a later condition.
Node runs the TypeScript sources directly under type stripping, so the
`node` condition resolves `lib/node.ts` and needs no build step — which
matters because `make node-preinstall` runs before `pnpm install` and has
no node_modules to resolve against.
Node refuses to strip types for files whose real path is under
node_modules, so that arrangement only works through pnpm's workspace
symlink. `publishConfig.exports` therefore points published consumers at
the emitted JavaScript, and `files` no longer ships the sources at all.
Verified by installing the packed tarball as a plain npm dependency.
`rewriteRelativeImportExtensions` turns the `.ts` specifiers into `.js`
on emit. Pino's transport target can't be rewritten that way — it is a
runtime path, resolved in a worker thread, that hard-crashes when wrong —
so `node.ts` derives it from its own extension.
Two annotations carried over from the JSDoc were wrong: `child` never
reads `this`, and declaring `@this {Logger}` on it forced every caller to
prove it held a pino logger.
`@goauthentik/logger-js` was declared as an optional peer, but the plugin imported `createLogger` from it unconditionally, so a consumer who skipped the optional peer got a resolution error rather than a fallback. The peer range said `^1.0.1` while the package sits at 2.0.2, and the emitted .d.ts files referenced its types, so consumers needed it installed regardless. The package already ships a console-backed `createLogger` in `shared/`, which the client entry has been using all along; the plugin entry now uses it too. The logger shape it returns is declared here as `ConsoleLike`, so nothing about the public types requires a logging package either. `pino` went with it — it was only present so the logger's optional peer would resolve.
41beff7 to
53d6977
Compare
Both Dockerfiles run the runtime lint before installing, and still named the .mjs file the TypeScript port replaced, so `build-container` failed.
The previous commit dropped `@goauthentik/logger-js` outright, which threw out the integration along with the bug. The peer is wanted — it just has to be genuinely optional, so that someone using this plugin outside authentik isn't made to install a logging package to get an esbuild plugin. The plugin now imports it dynamically and falls back to the console-backed logger this package already ships. The peer range matches the version that actually exists, and the public types still describe the logger option as `ConsoleLike`, so consumers don't need the peer resolvable to type-check. Verified by installing the packed tarball with the peer absent.
Both carry breaking changes: logger-js moved its entry points and now resolves TypeScript sources on Node, and the plugin's `logger` option widened from a pino logger to any console-like object.
|
|
…25641 to version-2026.8) (#25887) Cherry-pick #25641 to version-2026.8 Original PR: #25641 Original commit: a0e05a4 Co-authored-by: Teffen Ellis <[email protected]> Co-authored-by: Jens Langhammer <[email protected]>
pnpm 12.4 isn't ready for the NixOS package yet. Restore the pnpm 11.20.0 pins, container images, and lockfile headers, keeping the rest of the #25641 backport. Co-authored-by: Playpen Agent <[email protected]>
pnpm 12.4 isn't ready for the NixOS package yet. Restore the pnpm 11.20.0 pins, container images, and lockfile headers, keeping the rest of the #25641 backport. Relax the Node.js devEngines check to warn so the >=24.20 bump doesn't hard-fail existing setups. Co-authored-by: Playpen Agent <[email protected]>
pnpm 12.4 isn't ready for the NixOS package yet. Restore the pnpm 11.20.0 pins, container images, and lockfile headers, keeping the rest of the #25641 backport. Relax the Node.js devEngines check to warn so the >=24.20 bump doesn't hard-fail existing setups. Co-authored-by: Playpen Agent <[email protected]>
Details
This PR upgrades pnpm to 12.4.0 across the root,
web, andwebsiteworkspaces, and removes Corepack. The pnpm team no-longer recommends Corepack as part of their setup. Given the gradual migration away from Corepack in the Node community, it looks like Corepack may be deprecated entirely, and instead allowing each package manager to enforce its own compatibility matrix.Corepack was the only thing verifying the
+sha512.suffix onpackageManager— pnpm's own version switcher reads the version and ignores the hash — so two lint checks take that job over:lint-runtimeresolves the pinned version'sdist.integrityfrom the registry, re-encodes it as hex, and compares. On a mismatch it prints the corrected line to paste in. It also checks the pin satisfiesengines.pnpm, which had drifted. An unreachable registry warns and skips rather than failing, so offline installs still work.lint-catalogsnow also covers the seven places that pin pnpm: fivepackageManagerfields and the two pnpm image tags. The Dockerfiles turned out to be three patches behind the manifests.While in here, the
scripts/nodehelpers andpackages/logger-jsmoved to TypeScript. Both run directly under Node's type stripping, so there's no build step, andtsc -bnow covers them — the root project hadfiles: []and was type-checking nothing.Notes on the two package changes
packages/logger-js—typesresolved to the browser implementation while thenodecondition ran the Node one, so importing it by name on Node described the wrong value. Each condition now carries its own declarations.publishConfig.exportspoints published consumers at the emitted JS, since Node refuses to strip types for files whose real path is undernode_modules.packages/esbuild-plugin-live-reload—@goauthentik/logger-jswas an optional peer that the plugin imported unconditionally, ranged^1.0.1against a package sitting at 2.0.2, and referenced from the emitted.d.ts. The package already ships a console-backedcreateLoggerthat the client entry uses; the plugin entry uses it now too, and the dependency is gone.How was this tested?
pnpm lint— type-check, runtime pins, catalog drift, spellchecktsc -bpasses at each point in the historymake node-preinstallin a worktree with nonode_modulesand nothing built, since it runs beforepnpm installpackages/logger-jspacked and installed as a plain npm dependency, confirming published consumers get the emitted JS