Read-only mirror of https://github.com/jeap-admin-ch/jeap-frontend-license-checker — Bundesamt für Informatik und Telekommunikation. Issues & pull requests at the source. Catalog: https://www.opensource.admin.ch/en/softwares/riuyoy https://www.opensource.admin.ch/en/softwares/riuyoy
  • TypeScript 92.8%
  • JavaScript 7.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Matthias Fritschi 9e95a2836a JEAP-7398 Fix the docs link that broke the documentation site build
The README linked into docs/policy.md with an anchor. The documentation site copies a
repository's docs/ files up beside the README-derived landing page and rewrites
docs/<file>.md links to point at the sibling, but that rewrite requires the link to end
in ".md)" and so does not match one carrying a #fragment. The link survived unrewritten,
resolved to a path that does not exist on the site, and failed the Docusaurus link check.

The link now points at the page and names the section in the text, which reads correctly
both in the repository and on the site.
2026-08-19 10:28:18 +02:00
.github JEAP-7398 Added the jEAP frontend license checker 2026-08-18 15:53:35 +02:00
docs JEAP-7398 Harden the notice generation and the configuration handling 2026-08-18 15:53:35 +02:00
src JEAP-7398 Link the copied license texts from the notice file 2026-08-18 16:47:12 +02:00
test JEAP-7398 Link the copied license texts from the notice file 2026-08-18 16:47:12 +02:00
.editorconfig JEAP-7398 Added the jEAP frontend license checker 2026-08-18 15:53:35 +02:00
.gitignore JEAP-7398 Added the jEAP frontend license checker 2026-08-18 15:53:35 +02:00
.npmrc JEAP-7398 Added the jEAP frontend license checker 2026-08-18 15:53:35 +02:00
.prettierignore JEAP-7398 Added the jEAP frontend license checker 2026-08-18 15:53:35 +02:00
.prettierrc.json JEAP-7398 Added the jEAP frontend license checker 2026-08-18 15:53:35 +02:00
AGENTS.md JEAP-7398 Fail the check when the dependency tree could not be scanned completely 2026-08-18 15:53:35 +02:00
CHANGELOG.md JEAP-7398 Fix the docs link that broke the documentation site build 2026-08-19 10:28:18 +02:00
CONTRIBUTING.md JEAP-7398 Added the jEAP frontend license checker 2026-08-18 15:53:35 +02:00
eslint.config.mjs JEAP-7398 Added the jEAP frontend license checker 2026-08-18 15:53:35 +02:00
LICENSE JEAP-7398 Added the jEAP frontend license checker 2026-08-18 15:53:35 +02:00
package-lock.json JEAP-7398 Added the jEAP frontend license checker 2026-08-18 15:53:35 +02:00
package.json JEAP-7398 Fix the docs link that broke the documentation site build 2026-08-19 10:28:18 +02:00
publiccode.yml JEAP-7398 Fix the docs link that broke the documentation site build 2026-08-19 10:28:18 +02:00
README.md JEAP-7398 Fix the docs link that broke the documentation site build 2026-08-19 10:28:18 +02:00
SECURITY.md JEAP-7398 Added the jEAP frontend license checker 2026-08-18 15:53:35 +02:00
THIRD-PARTY-LICENSES.md JEAP-7398 Ship the full license texts with the third-party notices 2026-08-18 15:53:35 +02:00
tsconfig.json JEAP-7398 Added the jEAP frontend license checker 2026-08-18 15:53:35 +02:00
tsconfig.test.json JEAP-7398 Added the jEAP frontend license checker 2026-08-18 15:53:35 +02:00

jEAP Frontend License Checker

License policy checker and third-party notice generator for jEAP frontend projects.

jeap-frontend-license-checker inspects the npm dependencies installed in a project, checks their licenses against a license policy and fails the build when a dependency is not covered. It also generates the third-party notice file that lists those dependencies and their licenses.

The accepted permissive licenses ship with the tool. A project without configuration is already checked against the jEAP policy and only declares the exceptions it actually needs.

The tool has no runtime dependencies.

Installation

npm install --save-dev @jeap/jeap-frontend-license-checker

Wire it into the project's scripts:

{
  "scripts": {
    "check-licenses": "jeap-frontend-license-checker",
    "generate-license-file": "jeap-frontend-license-checker notices --out ../THIRD-PARTY-FRONTEND-LICENSES.md"
  }
}

Usage

npx jeap-frontend-license-checker            # check the installed dependencies
npx jeap-frontend-license-checker notices    # write the third-party notices

The short alias jeap-license-check is installed as well.

Run jeap-frontend-license-checker --help for the full list of options; the settings behind them are documented in docs/configuration.md.

Exit codes:
  0  the check passed
  1  the license policy was violated
  2  the invocation or the configuration is wrong
  3  the dependency tree could not be scanned completely

The check only reports success when it examined everything. A dependency that could not be resolved or read makes the scan incomplete and fails the run, because a package nobody looked at must not be able to pass. See the "Incomplete scans" section of docs/policy.md.

Configuration

Everything is optional. Put the settings into jeap-license-check.json next to the project's package.json, or into a jeapLicenseCheck key inside package.json:

{
  "exceptions": {
    "@quadrel-enterprise-ui/*": {
      "reason": "Runtime dependencies whose published npm packages omit SPDX license metadata."
    }
  }
}

See docs/configuration.md for every setting and docs/policy.md for the licenses the built-in policy accepts.

Why this tool

The tool it replaces resolved a wildcard exception by taking everything before the first @ of a package key. For a scoped package such as @scope/package@1.2.3 that yields an empty package name, so @scope/package@* never matched and every exempted scoped package had to be pinned to an exact version — breaking the build on each dependency update. On top of that, the license policy lived in each project, so a new transitive dependency with an already approved license broke the build as well.

This tool splits a package key at its last @, ships the policy with the checker, and evaluates SPDX expressions instead of requiring an exception per dual licensed package.

Documentation

Topic Description
Getting started Adding the checker to a project
Notices The third-party notice file and the license texts
Configuration Every configuration setting
Policy The licenses the built-in policy accepts, and how to change it
Migration Replacing the previous license checker
Development Local development, scripts and CI
Publishing and versioning Release process
npm publishing setup One-time maintainer setup

License

This project is licensed under the Apache License 2.0.