Licence
Gérez les licences dans votre espace de travail : synchronisez les fichiers LICENSE et les en-têtes de code source pour votre propre code (license.source), et vérifiez que chaque dépendance respecte une liste de licences autorisées (license.dependencies).
Utilisation
Section intitulée « Utilisation »Exécuter le générateur
Section intitulée « Exécuter le générateur »- Installez le Nx Console VSCode Plugin si ce n'est pas déjà fait
- Ouvrez la console Nx dans VSCode
- Cliquez sur
Generate (UI)dans la section "Common Nx Commands" - Recherchez
@aws/nx-plugin - license - Remplissez les paramètres requis
- Cliquez sur
Generate
pnpm nx g @aws/nx-plugin:licenseyarn nx g @aws/nx-plugin:licensenpx nx g @aws/nx-plugin:licensebunx nx g @aws/nx-plugin:licenseVous pouvez également effectuer une simulation pour voir quels fichiers seraient modifiés
pnpm nx g @aws/nx-plugin:license --dry-runyarn nx g @aws/nx-plugin:license --dry-runnpx nx g @aws/nx-plugin:license --dry-runbunx nx g @aws/nx-plugin:license --dry-run| Paramètre | Type | Par défaut | Description |
|---|---|---|---|
| license | Apache-2.0 | MIT | ASL | Apache-2.0 | Identifiant de licence SPDX pour la licence choisie |
| copyrightHolder | string | Amazon.com, Inc. or its affiliates | Le détenteur des droits d'auteur, inclus dans le fichier LICENSE et les en-têtes des fichiers source par défaut. |
| dependencyCheck | boolean | true | Configure une cible license-check qui échoue lorsque les dépendances déclarent des licences en dehors de la liste autorisée configurée. |
| preferInstallDependencies | boolean | true | Indique s'il faut privilégier l'installation des dépendances après l'exécution du générateur. Définir sur false pour différer l'installation lors de l'exécution de plusieurs générateurs en lot (une installation s'exécute quand même si nécessaire pour que les générateurs suivants puissent calculer le graphe de projet Nx) ; installer une seule fois à la fin. |
Résultat du générateur
Section intitulée « Résultat du générateur »Le générateur créera ou mettra à jour les fichiers suivants :
- nx.json La cible lint est configurée pour exécuter le générateur de synchronisation des licences et dépend de la cible license-check
- aws-nx-plugin.config.mts Configuration pour la synchronisation des sources de licence (
license.source) et la vérification des dépendances (license.dependencies)
En-têtes et fichiers de licence
Section intitulée « En-têtes et fichiers de licence »Le générateur enregistre un générateur de synchronisation qui s’exécute dans le cadre de vos cibles lint pour garantir que vos fichiers sources contiennent les en-têtes de licence corrects, que vos projets contiennent des fichiers LICENSE, et que les métadonnées de licence sont définies dans package.json et pyproject.toml.
Workflow
Section intitulée « Workflow »Lorsque vous construisez vos projets (et qu’une cible lint s’exécute), le générateur de synchronisation des licences vérifiera que les licences correspondent à votre configuration. Si des incohérences sont détectées, vous recevrez un message tel que :
NX The workspace is out of sync
[@aws/nx-plugin:license#sync]: Project LICENSE files are out of sync:- LICENSE- packages/<my-project>LICENSE
Project package.json files are out of sync:- package.json
Project pyproject.toml files are out of sync:- pyproject.toml- packages/<my-python-project>/pyproject.toml
License headers are out of sync in the following source files:- packages/<my-project>/src/index.ts- packages/<my-python-project>/main.py
This will result in an error in CI.
? Would you like to sync the identified changes to get your workspace up to date?Yes, sync the changes and run the tasksNo, run the tasks without syncing the changesSélectionnez Yes pour synchroniser les modifications.
Comportement de synchronisation
Section intitulée « Comportement de synchronisation »Le générateur effectue trois tâches principales :
1. Synchronisation des en-têtes de licence
Section intitulée « 1. Synchronisation des en-têtes de licence »Le générateur vérifie que tous les fichiers sources contiennent l’en-tête de licence approprié. L’en-tête est écrit comme premier commentaire de bloc ou série de commentaires linéaires (après un shebang le cas échéant).
2. Synchronisation des fichiers LICENSE
Section intitulée « 2. Synchronisation des fichiers LICENSE »Le générateur vérifie que le fichier racine LICENSE et ceux des sous-projets correspondent à la licence configurée.
3. Synchronisation des informations de licence dans les fichiers de projet
Section intitulée « 3. Synchronisation des informations de licence dans les fichiers de projet »Le générateur met à jour les champs license des fichiers package.json et pyproject.toml selon la licence configurée.
Configuration des en-têtes et fichiers
Section intitulée « Configuration des en-têtes et fichiers »La configuration se trouve dans aws-nx-plugin.config.mts à la racine.
SPDX et détenteur du copyright
Section intitulée « SPDX et détenteur du copyright »La licence peut être modifiée via la propriété spdx :
export default { license: { source: { spdx: 'MIT', }, },} satisfies AwsNxPluginConfig;Les fichiers LICENSE, package.json et pyproject.toml seront mis à jour en conséquence.
Le détenteur du copyright et l’année peuvent aussi être configurés :
export default { license: { source: { spdx: 'MIT', copyrightHolder: 'Amazon.com, Inc. or its affiliates', copyrightYear: 2025, }, },} satisfies AwsNxPluginConfig;Contenu des en-têtes de licence
Section intitulée « Contenu des en-têtes de licence »Le contenu peut être défini de deux façons :
- Contenu inline :
export default { license: { source: { header: { content: { lines: [ 'Copyright: My Company, Incorporated.', 'Licensed under the MIT License', 'All rights reserved', ]; } // ... format configuration } } }} satisfies AwsNxPluginConfig;- Chargement depuis un fichier :
export default { license: { source: { header: { content: { filePath: 'license-header.txt'; // relatif à la racine } // ... format configuration } } }} satisfies AwsNxPluginConfig;Format des en-têtes
Section intitulée « Format des en-têtes »Le format des en-têtes peut être spécifié par type de fichier :
export default { license: { source: { header: { content: { lines: ['Copyright notice here'], }, format: { // Line comments '**/*.ts': { lineStart: '// ', }, // Block comments '**/*.css': { blockStart: '/*', blockEnd: '*/', }, // Block comments with line prefixes '**/*.java': { blockStart: '/*', lineStart: ' * ', blockEnd: ' */', }, // Line comments with header/footer '**/*.py': { blockStart: '# ------------', lineStart: '# ', blockEnd: '# ------------', }, }, }, }, },} satisfies AwsNxPluginConfig;Options supportées :
blockStart: Texte avant le contenulineStart: Préfixe de lignelineEnd: Suffixe de ligneblockEnd: Texte après le contenu
Syntaxe de commentaire personnalisée
Section intitulée « Syntaxe de commentaire personnalisée »Pour les formats non supportés :
export default { license: { source: { header: { content: { lines: ['My license header'], }, format: { '**/*.xyz': { lineStart: '## ', }, }, commentSyntax: { xyz: { line: '##', // Define line comment syntax }, abc: { block: { // Define block comment syntax start: '<!--', end: '-->', }, }, }, }, }, },} satisfies AwsNxPluginConfig;Exclusion de fichiers de la synchronisation des en-têtes
Section intitulée « Exclusion de fichiers de la synchronisation des en-têtes »Fichiers exclus par défaut selon .gitignore. Exclusion supplémentaire possible :
export default { license: { source: { header: { content: { lines: ['My license header'], }, format: { '**/*.ts': { lineStart: '// ', }, }, exclude: ['**/generated/**', '**/dist/**', 'some-specific-file.ts'], }, }, },} satisfies AwsNxPluginConfig;Exclusion de projets de la synchronisation des fichiers
Section intitulée « Exclusion de projets de la synchronisation des fichiers »Exclusion de projets/fichiers via motifs glob :
export default { license: { source: { files: { exclude: [ // do not sync LICENSE file, package.json or pyproject.toml 'packages/excluded-project', // do not sync LICENSE file, but sync package.json and/or pyproject.toml 'apps/internal/LICENSE', ]; } } }} satisfies AwsNxPluginConfig;Désactivation de la synchronisation des licences
Section intitulée « Désactivation de la synchronisation des licences »La synchronisation des sources de licence est activée par la présence de la clé license.source dans votre configuration. Pour la désactiver :
- Supprimez la section
license.sourcede votre configuration dansaws-nx-plugin.config.mts(vous pouvez conserverlicense.dependenciessi vous souhaitez toujours vérifier les licences des dépendances) - Si vous souhaitez également supprimer complètement le générateur de synchronisation, retirez le générateur
@aws/nx-plugin:license#syncdetargetDefaults.lint.syncGenerators
Pour réactiver, exécutez à nouveau le générateur license.
Vérification des licences des dépendances
Section intitulée « Vérification des licences des dépendances »Le générateur license configure également une cible license-check qui échoue lorsqu’une des dépendances de votre projet (ou toute dépendance transitive) déclare une licence qui n’est pas dans votre liste autorisée.
Comment ça fonctionne
Section intitulée « Comment ça fonctionne »Le générateur écrit une cible license-check dans votre project.json racine :
{ "targets": { "license-check": { "executor": "@aws/nx-plugin:license-check", "cache": true, "inputs": [ "{workspaceRoot}/pnpm-lock.yaml", "{workspaceRoot}/aws-nx-plugin.config.mts" ], "options": {} } }}Les inputs sont calculés pour votre espace de travail : seuls les fichiers de verrouillage réellement présents sont inclus, ainsi que aws-nx-plugin.config.mts, plus un glob {workspaceRoot}/**/uv.lock lorsque la vérification des dépendances Python est activée (c’est-à-dire qu’un collecteur Python est configuré).
Vous pouvez exécuter la vérification directement :
pnpm nx license-checkyarn nx license-checknpx nx license-checkbunx nx license-checkLes résultats sont mis en cache par rapport à vos fichiers de verrouillage et aws-nx-plugin.config.mts — les ré-exécutions sont instantanées lorsque rien n’a changé.
Les collecteurs déterminent ce qui est analysé. Le npmCollector utilise license-checker-rseidelsohn, et le pythonCollector utilise pip-licenses. Si aucune dépendance installée n’est trouvée, la vérification réussit sans rien à inspecter.
Exécution dans le cadre de lint/build
Section intitulée « Exécution dans le cadre de lint/build »La vérification des licences des dépendances s’exécute automatiquement chaque fois que vous exécutez lint ou build sur n’importe quel projet de votre espace de travail. Le générateur license configure la cible lint de chaque projet pour qu’elle dépende de la cible racine license-check, et les générateurs de projet (ts#* et py#*) font de même lorsqu’ils s’exécutent — ainsi la vérification est configurée quel que soit l’ordre d’exécution des générateurs.
Cela signifie que vous n’avez pas besoin d’exécuter la vérification explicitement, bien que vous puissiez toujours le faire avec la cible license-check :
pnpm nx license-checkyarn nx license-checknpx nx license-checkbunx nx license-checkLe câblage est un dependsOn inter-projets sur la cible lint de chaque projet qui pointe vers la cible racine license-check. Pour ignorer la vérification lors d’un lint ou d’un build, définissez la variable d’environnement LICENSE_DEPENDENCY_CHECK=skip :
pnpm LICENSE_DEPENDENCY_CHECK=skip lintyarn LICENSE_DEPENDENCY_CHECK=skip lintnpm run LICENSE_DEPENDENCY_CHECK=skip lintbun LICENSE_DEPENDENCY_CHECK=skip lintConfiguration
Section intitulée « Configuration »Par défaut, la vérification utilise un ensemble intégré de licences permissives courantes (MIT, Apache-2.0, BSD, ISC, etc.) exporté sous le nom DEFAULT_LICENSE_ALLOWLIST. Vous pouvez l’étendre ou le remplacer dans votre configuration :
import { AwsNxPluginConfig } from '@aws/nx-plugin';import { DEFAULT_LICENSE_ALLOWLIST } from '@aws/nx-plugin/sdk/license';
export default { license: { // ... dependencies: { allow: [...DEFAULT_LICENSE_ALLOWLIST, { spdxId: 'LGPL-2.1-or-later', fullName: 'GNU Lesser General Public License v2.1 or later', aliases: [] }], exceptions: [ { package: 'some-package', reason: 'Audited manually — ships MIT text without SPDX field' }, ], }, },} satisfies AwsNxPluginConfig;Default License Allowlist
| SPDX ID | Full Name |
|---|---|
0BSD | BSD Zero Clause License |
AFL-2.1 | Academic Free License v2.1 |
AFL-3.0 | Academic Free License v3.0 |
AMD-newlib | AMD newlib License |
AML | Apple MIT License |
AML-glslang | AML glslang variant License |
ANTLR-PD | ANTLR Software Rights Notice |
ANTLR-PD-fallback | ANTLR Software Rights Notice with license fallback |
APAFML | Adobe Postscript AFM License |
AdaCore-doc | AdaCore Doc License |
Adobe-Display-PostScript | Adobe Display PostScript License |
Adobe-Glyph | Adobe Glyph List License |
Adobe-Utopia | Adobe Utopia Font License |
Apache-1.1 | Apache License 1.1 |
Apache-2.0 | Apache License 2.0 |
Apache-2.0 WITH LLVM-exception | Apache License 2.0 with LLVM Exception |
Artistic-1.0 | Artistic License 1.0 |
Artistic-1.0-Perl | Artistic License 1.0(Perl) |
Artistic-2.0 | Artistic License 2.0 |
Artistic-dist | Artistic License 1.0 (dist) |
BSD-1-Clause | BSD 1-Clause License |
BSD-2-Clause | BSD 2-clause "Simplified" License |
BSD-2-Clause-Darwin | BSD 2-Clause - Ian Darwin variant |
BSD-2-Clause-FreeBSD | BSD 2-clause FreeBSD License |
BSD-2-Clause-NetBSD | BSD 2-clause NetBSD License |
BSD-2-Clause-Views | BSD 2-Clause with views sentence |
BSD-2-Clause-first-lines | BSD 2-Clause - first lines requirement |
BSD-2-Clause-pkgconf-disclaimer | BSD 2-Clause pkgconf disclaimer variant |
BSD-3-Clause | BSD 3-clause "New" or "Revised" License |
BSD-3-Clause-Attribution | BSD with attribution |
BSD-3-Clause-HP | Hewlett-Packard BSD variant license |
BSD-3-Clause-LBNL | Lawrence Berkeley National Labs BSD variant license |
BSD-3-Clause-Modification | BSD 3-Clause Modification |
BSD-3-Clause-Open-MPI | BSD 3-Clause Open MPI variant |
BSD-3-Clause-Sun | BSD 3-Clause Sun Microsystems |
BSD-3-Clause-acpica | BSD 3-Clause acpica variant |
BSD-3-Clause-flex | BSD 3-Clause Flex variant |
BSD-4.3RENO | BSD 4.3 RENO License |
BSD-Source-Code | BSD Source Code Attribution |
BSD-Source-beginning-file | BSD Source Code Attribution - beginning of file variant |
BSL-1.0 | Boost Software License 1.0 |
Baekmuk | Baekmuk License |
Beerware | Beerware License |
Bitstream-Charter | Bitstream Charter Font License |
Bitstream-Vera | Bitstream Vera Font License |
BlueOak-1.0.0 | Blue Oak Model License 1.0.0 |
Boehm-GC | Boehm-Demers-Weiser GC License |
Boehm-GC-without-fee | Boehm-Demers-Weiser GC License (without fee) |
Brian-Gladman-2-Clause | Brian Gladman 2-Clause License |
Brian-Gladman-3-Clause | Brian Gladman 3-Clause License |
CC-BY-2.0 | Creative Commons Attribution 2.0 |
CC-BY-2.5 | Creative Commons Attribution 2.5 |
CC-BY-2.5-AU | Creative Commons Attribution 2.5 Australia |
CC-BY-3.0 | Creative Commons Attribution 3.0 |
CC-BY-3.0-AU | Creative Commons Attribution 3.0 Australia |
CC-BY-3.0-IGO | Creative Commons Attribution 3.0 IGO |
CC-BY-3.0-US | Creative Commons Attribution 3.0 United States |
CC-BY-4.0 | Creative Commons Attribution 4.0 |
CC-PDDC | Creative Commons Public Domain Dedication and Certification |
CC0-1.0 | Creative Commons Zero v1.0 Universal |
CDDL-1.0 | Common Development and Distribution License 1.0 |
CDDL-1.1 | Common Development and Distribution License 1.1 |
CFITSIO | CFITSIO License |
CMU-Mach-nodoc | CMU Mach - no notices-in-documentation variant |
CNRI-Jython | CNRI Jython License |
CNRI-Python | CNRI Python License |
CPOL-1.02 | Code Project Open License 1.02 |
Clips | Clips License |
Cornell-Lossless-JPEG | Cornell Lossless JPEG License |
Cronyx | Cronyx License |
CryptoSwift | CryptoSwift License |
DEC-3-Clause | DEC 3-Clause License |
DocBook-DTD | DocBook DTD License |
DocBook-Schema | DocBook Schema License |
DocBook-Stylesheet | DocBook Stylesheet License |
DocBook-XML | DocBook XML License |
EFL-2.0 | Eiffel Forum License v2.0 |
EPL-1.0 | Eclipse Public License 1.0 |
EPL-2.0 | Eclipse Public License 2.0 |
Entessa | Entessa Public License v1.0 |
FBM | Fuzzy Bitmap License |
FSFAP | FSF All Permissive License |
FSFAP-no-warranty-disclaimer | FSF All Permissive License (without Warranty) |
FSFULLR | FSF Unlimited License (with License Retention) |
FSFULLRSD | FSF Unlimited License (with License Retention and Short Disclaimer) |
FSFULLRWD | FSF Unlimited License (With License Retention and Warranty Disclaimer) |
FTL | Freetype Project License |
Fair | Fair License |
Ferguson-Twofish | Ferguson Twofish License |
FreeBSD-DOC | FreeBSD Documentation License |
Furuseth | Furuseth License |
GD | GD License |
Graphics-Gems | Graphics Gems License |
Gutmann | Gutmann License |
HDF5 | HDF5 License |
HIDAPI | HIDAPI License |
HP-1986 | Hewlett-Packard 1986 License |
HP-1989 | Hewlett-Packard 1989 License |
HPND | Historical Permission Notice and Disclaimer |
HPND-DEC | Historical Permission Notice and Disclaimer - DEC variant |
HPND-Fenneberg-Livingston | Historical Permission Notice and Disclaimer - Fenneberg-Livingston variant |
HPND-INRIA-IMAG | Historical Permission Notice and Disclaimer - INRIA-IMAG variant |
HPND-Intel | Historical Permission Notice and Disclaimer - Intel variant |
HPND-Kevlin-Henney | Historical Permission Notice and Disclaimer - Kevlin Henney variant |
HPND-MIT-disclaimer | Historical Permission Notice and Disclaimer with MIT disclaimer |
HPND-Markus-Kuhn | Historical Permission Notice and Disclaimer - Markus Kuhn variant |
HPND-Netrek | Historical Permission Notice and Disclaimer - Netrek variant |
HPND-Pbmplus | Historical Permission Notice and Disclaimer - Pbmplus variant |
HPND-UC | Historical Permission Notice and Disclaimer - University of California variant |
HPND-doc | Historical Permission Notice and Disclaimer - documentation variant |
HPND-doc-sell | Historical Permission Notice and Disclaimer - documentation sell variant |
HPND-merchantability-variant | Historical Permission Notice and Disclaimer - merchantability variant |
HPND-sell-MIT-disclaimer-xserver | Historical Permission Notice and Disclaimer - sell xserver variant with MIT disclaimer |
HPND-sell-regexpr | Historical Permission Notice and Disclaimer - sell regexpr variant |
HPND-sell-variant | Historical Permission Notice and Disclaimer - sell variant |
HPND-sell-variant-MIT-disclaimer | HPND sell variant with MIT disclaimer |
HPND-sell-variant-MIT-disclaimer-rev | HPND sell variant with MIT disclaimer - reverse |
HTMLTIDY | HTML Tidy License |
ICU | ICU License |
IJG | Independent JPEG Group License |
IJG-short | Independent JPEG Group License - short |
ISC | ISC License |
ISC-Veillard | ISC Veillard variant |
ImageMagick | ImageMagick License |
Inner-Net-2.0 | Inner Net License v2.0 |
JPNIC | Japan Network Information Center License |
JSON | JSON License |
Jam | Jam License |
Kastrup | Kastrup License |
Knuth-CTAN | Knuth CTAN License |
LOOP | Common Lisp LOOP License |
LZMA-SDK-9.11-to-9.20 | LZMA SDK License (versions 9.11 to 9.20) |
LZMA-SDK-9.22 | LZMA SDK License (versions 9.22 and beyond) |
Leptonica | Leptonica License |
Libpng | libpng License |
LicenseRef-NoVersion-Apache | Apache Software License |
LicenseRef-NoVersion-BSD | BSD License |
LicenseRef-Proprietary-NVIDIA-CUDA-Python-2021 | NVIDIA Software License for CUDA Python (2021) |
LicenseRef-Proprietary-NVIDIA-Math-Libraries-SDK-2022 | License Agreement for NVIDIA Math Libraries SDKs (2022) |
LicenseRef-Proprietary-NVIDIA-Nsight-Systems-2024 | Software License Agreement for NVIDIA Nsight Systems (2024) |
LicenseRef-Proprietary-NVIDIA-SDK-nvTIFF-2022 | License Agreement for NVIDIA SDKs with nvTIFF Supplement (2022) |
LicenseRef-Proprietary-NVIDIA-TensorRT-2021 | Software License Agreement for NVIDIA TensorRT (2021) |
LicenseRef-Proprietary-NVIDIA-Warp | Software License Agreement for NVIDIA Warp |
LicenseRef-com.oracle-BCL | Oracle Binary Code License |
LicenseRef-scancode-amazon-sl | Amazon Software License |
LicenseRef-scancode-apple-excl | Apple Java Extensions |
LicenseRef-scancode-indiana-extreme | Indiana University Extreme! Lab Software 1.1.1 |
LicenseRef-scancode-wordnet | WordNet 3.0 license |
Linux-OpenIB | Linux Kernel Variant of OpenIB.org license |
Linux-man-pages-1-para | Linux man-pages - 1 paragraph |
MIPS | MIPS License |
MIT | MIT License |
MIT-0 | MIT No Attribution License |
MIT-CMU | CMU License |
MIT-Click | MIT Click License |
MIT-Festival | MIT Festival Variant |
MIT-Khronos-old | MIT Khronos - old variant |
MIT-Modern-Variant | MIT License Modern Variant |
MIT-Wu | MIT Tom Wu Variant |
MIT-open-group | MIT Open Group variant |
MIT-testregex | MIT testregex Variant |
MITNFA | MIT +no-false-attribs license |
MMIXware | MMIXware License |
MPL-1.1 | Mozilla Public License 1.1 |
MPL-2.0 | Mozilla Public License 2.0 |
MPL-2.0-no-copyleft-exception | Mozilla Public License 2.0 (no copyleft exception) |
MS-PL | Microsoft Public License |
Mackerras-3-Clause | Mackerras 3-Clause License |
Mackerras-3-Clause-acknowledgment | Mackerras 3-Clause - acknowledgment variant |
Martin-Birgmeier | Martin Birgmeier License |
Minpack | Minpack License |
MirOS | MirOS Licence |
MulanPSL-2.0 | Mulan Permissive Software License, Version 2 |
NCBI-PD | NCBI Public Domain Notice |
NCL | NCL Source Code License |
NCSA | University of Illinois/NCSA Open Source License |
NICTA-1.0 | NICTA Public Software License, Version 1.0 |
NIST-PD | NIST Public Domain Notice |
NIST-Software | NIST Software License |
NLPL | No Limit Public License |
NTIA-PD | NTIA Public Domain Notice |
NTP | NTP License |
NTP-0 | NTP No Attribution |
Net-SNMP | Net-SNMP License |
OAR | OAR License |
OFFIS | OFFIS License |
OFL-1.0 | SIL Open Font License 1.0 |
OFL-1.0-RFN | SIL Open Font License 1.0 with Reserved Font Name |
OFL-1.0-no-RFN | SIL Open Font License 1.0 with no Reserved Font Name |
OFL-1.1 | SIL Open Font License 1.1 |
OFL-1.1-RFN | SIL Open Font License 1.1 with Reserved Font Name |
OFL-1.1-no-RFN | SIL Open Font License 1.1 with no Reserved Font Name |
OGC-1.0 | OGC Software License, Version 1.0 |
OLDAP-2.0 | Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B) |
OLDAP-2.0.1 | Open LDAP Public License v2.0.1 |
OLDAP-2.1 | Open LDAP Public License v2.1 |
OLDAP-2.2 | Open LDAP Public License v2.2 |
OLDAP-2.2.1 | Open LDAP Public License v2.2.1 |
OLDAP-2.2.2 | Open LDAP Public License 2.2.2 |
OLDAP-2.3 | Open LDAP Public License v2.3 |
OLDAP-2.4 | Open LDAP Public License v2.4 |
OLDAP-2.5 | Open LDAP Public License v2.5 |
OLDAP-2.6 | Open LDAP Public License v2.6 |
OLDAP-2.7 | Open LDAP Public License v2.7 |
OLDAP-2.8 | Open LDAP Public License v2.8 |
OpenSSL | OpenSSL License |
OpenSSL-standalone | OpenSSL License - standalone |
PADL | PADL License |
PDDL-1.0 | ODC Public Domain Dedication & License 1.0 |
PHP-3.0 | PHP License v3.0 |
PHP-3.01 | PHP LIcense v3.01 |
PSF-2.0 | Python Software Foundation License 2.0 |
Pixar | Pixar License |
PostgreSQL | PostgreSQL License |
Python-2.0 | Python License 2.0 |
Python-2.0.1 | Python License 2.0.1 |
Ruby | Ruby License |
Ruby-pty | Ruby pty extension license |
SAX-PD-2.0 | Sax Public Domain Notice 2.0 |
SGI-B-2.0 | SGI Free Software License B v2.0 |
SL | SL License |
SMLNJ | Standard ML of New Jersey License |
SMPPL | Secure Messaging Protocol Public License |
SSH-OpenSSH | SSH OpenSSH license |
SSH-short | SSH short notice |
SSLeay-standalone | SSLeay License - standalone |
Soundex | Soundex License |
Spencer-86 | Spencer License 86 |
Spencer-94 | Spencer License 94 |
Spencer-99 | Spencer License 99 |
StandardML-NJ | Standard ML of New Jersey License |
Sun-PPP | Sun PPP License |
Sun-PPP-2000 | Sun PPP License (2000) |
SunPro | SunPro License |
Symlinks | Symlinks License |
TCL | Tcl/Tk |
TCP-wrappers | TCP Wrappers License |
TPDL | Time::ParseDate License |
TPL-1.0 | THOR Public License 1.0 |
TTWL | Text-Tabs+Wrap License |
TTYP0 | TTYP0 License |
TU-Berlin-1.0 | Technische Universitaet Berlin License 1.0 |
TU-Berlin-2.0 | Technische Universitaet Berlin License 2.0 |
TermReadKey | TermReadKey License |
ThirdEye | ThirdEye License |
TrustedQSL | TrustedQSL License |
UCAR | UCAR License |
UMich-Merit | Michigan/Merit Networks License |
UPL-1.0 | Universal Permissive License v1.0 |
Ubuntu-font-1.0 | Ubuntu Font Licence v1.0 |
Unicode-3.0 | Unicode License v3 |
Unicode-DFS-2015 | Unicode License Agreement - Data Files and Software (2015) |
Unicode-DFS-2016 | Unicode License Agreement - Data Files and Software (2016) |
UnixCrypt | UnixCrypt License |
Unlicense | Unlicense |
Unlicense-libtelnet | Unlicense - libtelnet variant |
Unlicense-libwhirlpool | Unlicense - libwhirlpool variant |
Vim | Vim License |
W3C | W3C Software and Notice License |
W3C-19980720 | W3C Software Notice and License (1998-07-20) |
W3C-20150513 | W3C Software Notice and Document License (2015-05-13) |
WTFPL | Do What The F*ck You Want To Public License |
Widget-Workshop | Widget Workshop License |
X11 | X11 License |
X11-distribute-modifications-variant | X11 License Distribution Modification Variant |
X11-swapped | X11 swapped final paragraphs |
XFree86-1.1 | XFree86 License 1.1 |
Xdebug-1.03 | Xdebug License v 1.03 |
Xfig | Xfig License |
Xnet | X.Net License |
ZPL-2.1 | Zope Public License 2.1 |
Zed | Zed License |
Zeeff | Zeeff License |
Zlib | zlib License |
any-OSI-perl-modules | Any OSI License - Perl Modules |
bcrypt-Solar-Designer | bcrypt Solar Designer License |
blessing | SQLite Blessing |
bzip2-1.0.6 | bzip2 and libbzip2 License v1.0.6 |
check-cvs | check-cvs License |
checkmk | Checkmk License |
curl | curl License |
cve-tou | Common Vulnerability Enumeration ToU License |
dtoa | David M. Gay dtoa License |
fwlw | fwlw License |
generic-xts | Generic XTS License |
gtkbook | gtkbook License |
hdparm | hdparm License |
jove | Jove License |
libpng-1.6.35 | PNG Reference Library License v1 (for libpng 0.5 through 1.6.35) |
libpng-2.0 | PNG Reference Library version 2 |
libselinux-1.0 | libselinux public domain notice |
libtiff | libtiff License |
libutil-David-Nugent | libutil David Nugent License |
lsof | lsof License |
magaz | magaz License |
mailprio | mailprio License |
man2html | man2html License |
metamail | metamail License |
mpi-permissive | mpi Permissive License |
mplus | mplus Font License |
pkgconf | pkgconf License |
snprintf | snprintf License |
softSurfer | softSurfer License |
ssh-keyscan | ssh-keyscan License |
swrule | swrule License |
threeparttable | threeparttable License |
ulem | ulem License |
w3m | w3m License |
xkeyboard-config-Zinoviev | xkeyboard-config Zinoviev License |
xlock | xlock License |
xpp | XPP License |
zlib-acknowledgement | zlib/libpng License with Acknowledgement |
Personnalisation de la liste autorisée
Section intitulée « Personnalisation de la liste autorisée »Pour restreindre la liste autorisée, remplacez DEFAULT_LICENSE_ALLOWLIST par votre propre tableau. Pour l’étendre, décomposez la valeur par défaut et ajoutez des entrées. Les entrées sont comparées par identifiant SPDX, nom complet de licence ou l’un des alias listés (insensible à la casse).
Exceptions par paquet
Section intitulée « Exceptions par paquet »Utilisez exceptions pour les paquets qui échouent à la vérification — soit parce que leur licence n’est pas dans la liste autorisée, soit parce qu’ils sont livrés sans métadonnées de licence détectables. Le champ reason est requis pour que les réviseurs puissent voir pourquoi l’exception a été accordée.
exceptions: [ { package: 'union', version: '0.5.0', reason: 'Package ships verbatim MIT text without declaring license', },];Les générateurs qui introduisent des dépendances avec des métadonnées problématiques (par exemple le générateur de serveur MCP) ajoutent automatiquement les exceptions requises à votre configuration lorsqu’ils s’exécutent.
Collecteurs
Section intitulée « Collecteurs »Les collecteurs découvrent les dépendances et extraient les métadonnées de licence. Les collecteurs intégrés sont npmCollector() (analyse node_modules) et pythonCollector() (analyse les environnements virtuels Python). Le générateur de licence configure npmCollector() par défaut et ajoute pythonCollector() lorsque des projets Python sont présents.
Pour implémenter un collecteur personnalisé, conformez-vous à l’interface LicenseCollector :
import type { LicenseCollector } from '@aws/nx-plugin/sdk/license';
const myCollector = (): LicenseCollector => ({ name: 'my-ecosystem', traceCommand: 'my-tool why <package>', async collect({ workspaceRoot }) { return [ { name: 'some-dep', version: '1.0.0', rawLicense: 'MIT', ecosystem: 'my-ecosystem' }, ]; },});Le hook onDependency
Section intitulée « Le hook onDependency »license.dependencies accepte un callback optionnel onDependency qui est invoqué une fois pour chaque dépendance découverte, qu’elle réussisse ou échoue la vérification. Il reçoit { package, spdx }, où package est le nom du paquet et spdx est l’expression de licence SPDX résolue. Le spdx d’une exception a la priorité sur la licence brute déclarée, et spdx peut être une chaîne vide si aucune licence n’a été déclarée.
C’est un moyen pratique d’afficher toutes les licences de votre projet. Exécutez la cible license-check pour voir la sortie :
import { AwsNxPluginConfig } from '@aws/nx-plugin';import { DEFAULT_LICENSE_ALLOWLIST } from '@aws/nx-plugin/sdk/license';
export default { license: { dependencies: { allow: DEFAULT_LICENSE_ALLOWLIST, onDependency: ({ package: pkg, spdx }) => { console.log(`${pkg} - ${spdx}`); }, }, },} satisfies AwsNxPluginConfig;Désactivation des vérifications de dépendances
Section intitulée « Désactivation des vérifications de dépendances »La vérification des licences des dépendances est activée par la présence de la clé license.dependencies dans votre configuration.
Pour désactiver les vérifications pour une seule exécution, définissez la variable d’environnement LICENSE_DEPENDENCY_CHECK=skip :
pnpm LICENSE_DEPENDENCY_CHECK=skip lintyarn LICENSE_DEPENDENCY_CHECK=skip lintnpm run LICENSE_DEPENDENCY_CHECK=skip lintbun LICENSE_DEPENDENCY_CHECK=skip lintPour désactiver de manière permanente, supprimez la clé license.dependencies de votre configuration dans aws-nx-plugin.config.mts. Vous pouvez également ré-exécuter le générateur license avec --dependencyCheck=false pour le générer sans cette fonctionnalité.