Files
authentik/packages/fonts/package.json
Teffen Ellis 7ec8872937 packages/fonts: consolidate the RedHat and PatternFly icon faces into @goauthentik/fonts (#24461)
* packages/fonts: extract the RedHat variable faces into @goauthentik/fonts

The RedHat typefaces were checked in twice: web/fonts/RedHat held the six
variable faces the app actually loads, and packages/theme carried its own
copy of those plus twenty-four static weights. The variable files were
byte-identical in both places, but the two @font-face sets disagreed on
naming — web bound "RedHatText" to the variable face while the theme
bound it to the static Regular and used "RedHatTextVF" for the variable
one.

Move web's set, which is the canonical one, into a new assets-only
package and drop the theme's copy entirely. The theme now only names the
families; @goauthentik/fonts binds them to files. Nothing about what the
browser loads changes: same bytes, same family names, same vendor layer.

The package has no build step, and only faces.css needs an exports entry
— the url() references beside it resolve relative to that file in both
ESBuild and Vite.

ESBuild's `outbase` is now pinned to the monorepo root. Assets pulled
from a workspace package outside web/ otherwise land under a `..`
segment, which ESBuild sanitizes to `_.._`; Go's `//go:embed dist/*` in
static_outpost.go skips any segment starting with `_`, so the faces would
have gone missing from the embedded outpost build.

* packages/fonts: move the PatternFly icon faces into @goauthentik/fonts

The pficon and Font Awesome faces were declared inside the vendored
PatternFly icon stylesheets, with the font files sitting beside them
under web/src/styles/global/vendor/assets/. That put font bytes in three
places across the repo and tied the faces to stylesheets we re-vendor
whenever PatternFly moves.

Move both families next to the RedHat faces and declare them in a new
icons.css, kept separate from faces.css so a consumer can take the brand
text faces without the icon fonts. The icon classes stay with PatternFly
— only the @font-face rules and the files move. Same bytes: the emitted
assets keep their content hashes.

pficon.scss went too. It was an unreferenced Sass source whose
`$pf-global--fonticon-path` variable had nothing to resolve against.

The copies in shadow/patternfly-base.css are left alone. They come from
the PatternFly package and their font URLs are already stubbed out by the
bundled-text loader, because @font-face has no effect inside a shadow
root — components inherit the faces registered on the document.

* packages/fonts: record the licensing of every bundled font

The package declared MIT and shipped only Red Hat's OFL text, which
described neither what it redistributes nor what redistribution requires.
Three upstreams are bundled, under three different terms:

  RedHat text faces   OFL-1.1, (c) The Red Hat Project Authors
  pficon              MIT, (c) Red Hat, Inc., via PatternFly
  Font Awesome 5 Free OFL-1.1 for the font files, CC-BY-4.0 for the
                      icons they encode, (c) Fonticons, Inc.

Declare that as an SPDX expression, add the package's own MIT text, and
ship each upstream's license alongside a NOTICE.md recording provenance
per file. OFL 1.1 requires the copyright notice and license to travel
with any redistributed copy, and CC BY 4.0 requires attribution where the
icons are displayed; `files` now carries all of it into the tarball.

Two things NOTICE.md is explicit about rather than papering over:
@patternfly/patternfly ships no license file, so the MIT text here is Red
Hat's own copied from the sibling @patternfly/icons package; and Font
Awesome's published license carries a copyright line tracking its current
release rather than the 5.x release these files came from.
2026-08-06 15:10:43 +01:00

71 lines
2.4 KiB
JSON

{
"name": "@goauthentik/fonts",
"version": "1.0.0",
"description": "The typefaces authentik ships: the RedHat variable faces and the PatternFly icon faces.",
"license": "MIT AND OFL-1.1 AND CC-BY-4.0",
"repository": {
"type": "git",
"url": "git+https://github.com/goauthentik/authentik.git",
"directory": "packages/fonts"
},
"scripts": {
"prettier": "prettier --write .",
"prettier-check": "prettier --check ."
},
"type": "module",
"exports": {
"./package.json": "./package.json",
"./faces.css": "./faces.css",
"./icons.css": "./icons.css"
},
"devDependencies": {
"@goauthentik/prettier-config": "link:../prettier-config",
"prettier": "catalog:",
"prettier-plugin-packagejson": "catalog:"
},
"files": [
"faces.css",
"icons.css",
"*.woff",
"*.woff2",
"LICENSE.txt",
"NOTICE.md",
"licenses/**"
],
"engines": {
"node": ">=24"
},
"devEngines": {
"runtime": {
"name": "node",
"version": ">=24",
"onFail": "ignore"
},
"packageManager": {
"name": "pnpm",
"version": ">=11.5.1",
"onFail": "ignore"
}
},
"prettier": "@goauthentik/prettier-config",
"publishConfig": {
"access": "public"
},
"#exports-comment": [
"Only the two stylesheets need entries. The `url(\"./RedHatTextVF.woff2\")`",
"references inside them are resolved relative to the stylesheet by the",
"consuming bundler, not through this exports map.",
"faces.css holds the RedHat brand text faces; icons.css holds the icon",
"faces PatternFly components render glyphs from. They are separate so a",
"consumer can take the brand faces without the icon fonts.",
"There is no build step — the package is checked-in assets."
],
"#license-comment": [
"The package itself is MIT (LICENSE.txt). The font files it redistributes",
"are not: the RedHat faces are OFL-1.1, Font Awesome's font files are",
"OFL-1.1 with the icons under CC-BY-4.0, and pficon is MIT via PatternFly.",
"NOTICE.md records the provenance and license of each file, and licenses/",
"carries the full texts. Both ship in the published package."
]
}