Skip to content

Conversation

@GirlBossRush
Copy link
Contributor

Details

This PR concludes the majority of #1368, allowing us to take advantage of NPMs workspaces, TypeScript's project-wide compiler, and our packaged linter configurations.

Overall, the changes in this PR should keep existing code behaviors as they were, sometimes at the expense of turning off ESLint's more aggressive "nightmare mode" rules. A follow up PR will address disabled rules and avoid intermixing too much linter noise.


Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

@GirlBossRush GirlBossRush self-assigned this Apr 11, 2025
@GirlBossRush GirlBossRush requested review from a team as code owners April 11, 2025 02:48
@netlify
Copy link

netlify bot commented Apr 11, 2025

Deploy Preview for authentik-docs failed. Why did it fail? →

Name Link
🔨 Latest commit a4f92f5
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/68004f5f30fe000008ebb22d

@netlify
Copy link

netlify bot commented Apr 11, 2025

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit a4f92f5
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/68004f5fd49cb80008f56f8b
😎 Deploy Preview https://deploy-preview-14002--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 site configuration.

{
"version": "2.0.0",
"tasks": [
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

"prefix": "#<num>",
"url": "https://github.com/goauthentik/authentik/issues/<num>",
"ignoreCase": false
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

trim_trailing_whitespace = true
insert_final_newline = true

[*.html]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

@@ -0,0 +1,51 @@
# Prettier Ignorefile
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Migrated and deduped from individual packages

"ms-python.black-formatter",
"ms-python.debugpy",
"ms-python.python",
"ms-python.vscode-pylance",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

@@ -1,16 +1,16 @@
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

package.json Outdated
"packages/*"
],
"prettier": "@goauthentik/prettier-config",
"packageManager": "[email protected]+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Auto set by NPM when workspaces are defined. Running npm will continue to work as expected without introducing a dependency on Yarn.

@codecov
Copy link

codecov bot commented Apr 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.60%. Comparing base (c15c0cb) to head (a4f92f5).
Report is 24 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14002      +/-   ##
==========================================
- Coverage   92.74%   91.60%   -1.15%     
==========================================
  Files         799      799              
  Lines       41230    41230              
==========================================
- Hits        38240    37767     -473     
- Misses       2990     3463     +473     
Flag Coverage Δ
e2e ?
integration 24.10% <ø> (ø)
unit 90.60% <ø> (ø)

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

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +4 to +13
"excludeDirectories": [
"**/.git", // Git
"**/.yarn", // Yarn
"**/.vscode", // VS Code
"**/.vscode-test-web", // VS Code Web Test
"**/dist", // Distributed build files
"**/out", // Output build files
"**/.drafts", // Drafts
"**/.github", // GitHub
"**/node_modules" // Node modules
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Each additional excluded directory improves the performance of watcher mode type checking, allowing TypeScript to skip cruft within imported node modules.

export function updateURLParams(params: { [key: string]: unknown }, replace = true): void {
export function updateURLParams(nextParams: { [key: string]: unknown }, replace = true): void {
const currentParams = getURLParams();
for (const key in params) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Linter detected use of for in loop.

Comment on lines -43 to +47
this.states = [];

this.host.actions.map((act, idx) => {
this.states.push({
action: act,
state: ActionState.pending,
idx: idx,
});
});
this.states = this.host.actions.map((act, idx) => ({
action: act,
state: ActionState.pending,
idx: idx,
}));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix for linter warning of Array.prototype.map as side-effects.

Comment on lines -1 to 3
@@ -1,4 +1,3 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
// ^^^^^^^^^^^ Because TSC cannot handle metaprogramming, and metaprogramming
// via `defineProperties` is how we installed the OUID finders for the various
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Followed up in #13745

Comment on lines +15 to +16
// TODO: We should enable this when when we're ready to enforce it.
"noUncheckedIndexedAccess": false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eventually enforcing this is quite the journey but worth it.

@@ -1,8 +1,8 @@
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

@@ -1,9 +1,8 @@
import "mdast-util-to-hast";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

@@ -1,10 +1,8 @@
import "mdast-util-to-hast";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

@@ -1,10 +1,9 @@
import "mdast-util-to-hast";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

@@ -1,5 +1,5 @@
import { generateVersionDropdown } from "./src/utils.js";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

@@ -1,12 +1,6 @@
import React, {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

throw new Error(`Invalid semver version: ${semver}`);
}

const yearCutoff = new Date().getFullYear() - 2;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

--ifm-badge-background-color: var(--ifm-color-warning-contrast-background);
--ifm-badge-color: var(--ifm-color-warning-contrast-foreground);
--ifm-badge-border-color: var(--ifm-color-warning-contrast-foreground);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

* - the markdown content does not already contain a top-level h1 heading
*
* @vendor docusaurus
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

@@ -1,5 +1,5 @@
import React from "react";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

* This component is a swizzled version of the original DocItemContent component.
*
* Similar to Docusaurus' default `DocItemContent`, this component renders
* the content of a documentation page. However, it also adds support for
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

@@ -1,13 +1,12 @@
import React, { type ReactNode } from "react";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

@@ -1,27 +1,36 @@
const html = String.raw;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

@@ -1,7 +1,8 @@
import test from "node:test";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹 File diff only contains linter changes.

@GirlBossRush GirlBossRush force-pushed the monorepo-v3 branch 3 times, most recently from 45926a6 to 4a62cbd Compare April 12, 2025 02:50
@github-actions
Copy link
Contributor

github-actions bot commented Apr 12, 2025

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

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

@GirlBossRush GirlBossRush force-pushed the monorepo-v3 branch 4 times, most recently from ca2e478 to b46ba98 Compare April 15, 2025 00:13
@GirlBossRush GirlBossRush mentioned this pull request Apr 16, 2025
6 tasks
web: Update config.

Flesh out build.

Fix issue surrounding build.

Fix paths.

Update workspaces.

Fix build steps.

Apply linter. Temporarily remove problem rules.

Add ignorefile. Prep for formatting.

Lint website.

Lint web, repo packages.

Refine Prettier usage. Fix imports.

Tidy build.

Move node ignore files.

Remove unused.

Update job. Fix lint step.

Build before compiling.

Use root for paths.

Fix issues surrounding import references, types, package names.

Fix build paths.

Tidy.

Enforce prefix.

Apply prefixes to imports.

Enable linter, compiler, etc.

Fix references. Update names.

Mark optional.

Revise mounts. Fix build order.

Update package.json.

Ignore all docusaurus.

Fix paths, types.

Clean up build steps, names.

Fix paths.

website: Fix nested paragraphs build warning.

web: Enforce module resolution.

Use consistent LTS version.

Track Node version.

Use default resolution.

Test main entrypoint.

Fix Node v20 compatibility.

Add task names.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants