Files
authentik/web/paths/node.js
Ken Sternberg 562368683a web: build system had some legacy stuff that I found confusing while working on the CSS ordering (#20698)
* .

* Did I miss something?

* That was a stupid spelling error.

* This was an unpopular move.
2026-04-13 15:37:21 +00:00

100 lines
2.8 KiB
JavaScript

/**
* @file Paths used by the web package.
*
* @runtime node
*/
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { DistDirectoryName } from "#paths";
const relativeDirname = dirname(fileURLToPath(import.meta.url));
//#region Base paths
/**
* @typedef {'@goauthentik/web'} WebPackageIdentifier
*/
/**
* The root of the web package.
*
* @runtime node
*/
export const PackageRoot = /** @type {WebPackageIdentifier} */ (resolve(relativeDirname, ".."));
/**
* Path to the web package's distribution directory.
*
* This is where the built files are located after running the build process.
*
* @runtime node
*/
export const DistDirectory = /** @type {`${WebPackageIdentifier}/${typeof DistDirectoryName}`} */ (
resolve(PackageRoot, DistDirectoryName)
);
//#endregion
//#region Entry points
/**
* @typedef {{ in: string, out: string }} EntryPointTarget
*
* ESBuild entrypoint target.
* Matches the type defined in the ESBuild context.
*/
/**
* Entry points available for building.
*
* @satisfies {Record<string, EntryPointTarget>}
*
* @runtime node
*/
export const EntryPoint = /** @type {const} */ ({
Admin: {
in: resolve(PackageRoot, "src", "admin", "index.entrypoint.ts"),
out: resolve(DistDirectory, "admin", "AdminInterface"),
},
User: {
in: resolve(PackageRoot, "src", "user", "index.entrypoint.ts"),
out: resolve(DistDirectory, "user", "UserInterface"),
},
Flow: {
in: resolve(PackageRoot, "src", "flow", "index.entrypoint.ts"),
out: resolve(DistDirectory, "flow", "FlowInterface"),
},
StandaloneAPI: {
in: resolve(PackageRoot, "src", "standalone", "api-browser/index.entrypoint.ts"),
out: resolve(DistDirectory, "standalone", "api-browser", "index"),
},
StandaloneLoading: {
in: resolve(PackageRoot, "src", "standalone", "loading/index.entrypoint.ts"),
out: resolve(DistDirectory, "standalone", "loading", "index"),
},
RAC: {
in: resolve(PackageRoot, "src", "rac", "index.entrypoint.ts"),
out: resolve(DistDirectory, "rac", "index"),
},
Polyfill: {
in: resolve(PackageRoot, "src", "polyfill", "index.entrypoint.ts"),
out: resolve(DistDirectory, "poly"),
},
InterfaceStyles: {
in: resolve(PackageRoot, "src", "styles", "authentik", "interface.global.css"),
out: resolve(DistDirectory, "styles", "interface"),
},
StaticStyles: {
in: resolve(PackageRoot, "src", "styles", "authentik", "static.global.css"),
out: resolve(DistDirectory, "styles", "static"),
},
FlowStyles: {
in: resolve(PackageRoot, "src", "styles", "authentik", "flows.global.css"),
out: resolve(DistDirectory, "styles", "flow"),
},
});
//#endregion