Skip to content

root, web, docs: pnpm 12.4.0 upgrade. Remove Corepack. - #25641

Merged
GirlBossRush merged 14 commits into
mainfrom
pnpm-sans-corepack
Sep 9, 2026
Merged

GirlBossRush merged 14 commits into
mainfrom
pnpm-sans-corepack

Conversation

@GirlBossRush

@GirlBossRush GirlBossRush commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Details

This PR upgrades pnpm to 12.4.0 across the root, web, and website workspaces, 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 on packageManager — pnpm's own version switcher reads the version and ignores the hash — so two lint checks take that job over:

  • lint-runtime resolves the pinned version's dist.integrity from 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 satisfies engines.pnpm, which had drifted. An unreachable registry warns and skips rather than failing, so offline installs still work.
  • lint-catalogs now also covers the seven places that pin pnpm: five packageManager fields and the two pnpm image tags. The Dockerfiles turned out to be three patches behind the manifests.

While in here, the scripts/node helpers and packages/logger-js moved to TypeScript. Both run directly under Node's type stripping, so there's no build step, and tsc -b now covers them — the root project had files: [] and was type-checking nothing.

Notes on the two package changes

packages/logger-js — types resolved to the browser implementation while the node condition ran the Node one, so importing it by name on Node described the wrong value. Each condition now carries its own declarations. publishConfig.exports points published consumers at the emitted JS, since Node refuses to strip types for files whose real path is under node_modules.

packages/esbuild-plugin-live-reload — @goauthentik/logger-js was an optional peer that the plugin imported unconditionally, ranged ^1.0.1 against a package sitting at 2.0.2, and referenced from the emitted .d.ts. The package already ships a console-backed createLogger that 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, spellcheck
  • every commit checked out individually, confirming the scripts run and tsc -b passes at each point in the history
  • make node-preinstall in a worktree with no node_modules and nothing built, since it runs before pnpm install
  • packages/logger-js packed and installed as a plain npm dependency, confirming published consumers get the emitted JS

@GirlBossRush GirlBossRush added this to the Release 2026.8.1 milestone Sep 1, 2026
@GirlBossRush GirlBossRush self-assigned this Sep 1, 2026
@GirlBossRush
GirlBossRush requested review from a team as code owners September 1, 2026 15:41
@GirlBossRush
GirlBossRush requested a review from a team as a code owner September 1, 2026 15:41
@GirlBossRush GirlBossRush added the backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8 label Sep 1, 2026
@GirlBossRush
GirlBossRush requested a review from a team as a code owner September 1, 2026 15:41
@netlify

netlify Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit a34ccff
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6aa0482f81a82528f4d6c559
😎 Deploy Preview https://deploy-preview-25641--authentik-storybook.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.

@netlify

netlify Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 13430f1
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6aa04547d8d128000830421b
😎 Deploy Preview https://deploy-preview-25641--authentik-integrations.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.

Comment thread pnpm-workspace.yaml Outdated
"@typescript-eslint/parser": "^8.65.0"
"@typescript-eslint/utils": "^8.65.0"
"@types/node": "^26.1.2"
"@types/node": "^26.4.0"

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.

Bumping this intentionally to ensure that the lock files aren't stale after the pnpm upgrade.

Comment thread website/pnpm-workspace.yaml Outdated
"@typescript-eslint/parser": "^8.65.0"
"@typescript-eslint/utils": "^8.65.0"
"@types/node": "^26.1.2"
"@types/node": "^26.4.0"

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.

Bumping this intentionally to ensure that the lock files aren't stale after the pnpm upgrade.

@netlify

netlify Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit a34ccff
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6aa04896d775ee1b89b01b3d
😎 Deploy Preview https://deploy-preview-25641--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 requested a review from BeryJu September 1, 2026 15:43
@GirlBossRush GirlBossRush moved this from Todo to Needs review in authentik Core Sep 1, 2026
@codecov

codecov Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.67%. Comparing base (c3737e3) to head (a34ccff).
⚠️ Report is 136 commits behind head on main.
✅ All tests successful. No failed tests found.

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              
Flag Coverage Δ
conformance 34.34% <ø> (-0.05%) ⬇️
e2e 39.04% <ø> (+<0.01%) ⬆️
integration 30.97% <ø> (-0.02%) ⬇️
rust 42.92% <ø> (ø)
unit 93.21% <ø> (-0.04%) ⬇️
unit-migrate 93.23% <ø> (-0.04%) ⬇️

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.

@rissson rissson changed the title core, web, docs: pnpm 11.25.0 upgrade. Remove Corepack. root, web, docs: pnpm 11.25.0 upgrade. Remove Corepack. Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026 •

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-a34ccff21d90166f53b7a098f8be4d3141af6ca9
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-a34ccff21d90166f53b7a098f8be4d3141af6ca9

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

@github-project-automation github-project-automation Bot moved this from Needs review to In Progress in authentik Core Sep 8, 2026
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.
@GirlBossRush GirlBossRush changed the title root, web, docs: pnpm 11.25.0 upgrade. Remove Corepack. root, web, docs: pnpm 12.4.0 upgrade. Remove Corepack. Sep 8, 2026
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.
@GirlBossRush
GirlBossRush merged commit a0e05a4 into main Sep 9, 2026
235 of 237 checks passed
@GirlBossRush
GirlBossRush deleted the pnpm-sans-corepack branch September 9, 2026 00:14
@github-project-automation github-project-automation Bot moved this from In Progress to Done in authentik Core Sep 9, 2026
@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

⚠️ Cherry-pick to version-2026.8 has conflicts: #25887

GirlBossRush added a commit that referenced this pull request Sep 9, 2026
Original PR: #25641
Original commit: a0e05a4
BeryJu added a commit that referenced this pull request Sep 17, 2026
…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]>
GirlBossRush added a commit that referenced this pull request Sep 23, 2026
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]>
GirlBossRush added a commit that referenced this pull request Sep 23, 2026
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]>
GirlBossRush added a commit that referenced this pull request Sep 23, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants