Licencia
Administra las licencias en todo tu espacio de trabajo: sincroniza archivos LICENSE y cabeceras de código fuente para tu propio código (license.source), y verifica que cada dependencia cumpla con una lista de licencias permitidas (license.dependencies).
Ejecutar el generador
Sección titulada «Ejecutar el generador»- Instale el Nx Console VSCode Plugin si aún no lo ha hecho
- Abra la consola Nx en VSCode
- Haga clic en
Generate (UI)en la sección "Common Nx Commands" - Busque
@aws/nx-plugin - license - Complete los parámetros requeridos
- Haga clic en
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:licenseTambién puede realizar una ejecución en seco para ver qué archivos se cambiarían
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-runOpciones
Sección titulada «Opciones»| Parámetro | Tipo | Predeterminado | Descripción |
|---|---|---|---|
| license | Apache-2.0 | MIT | ASL | Apache-2.0 | Identificador SPDX de licencia para la licencia elegida |
| copyrightHolder | string | Amazon.com, Inc. or its affiliates | El titular de los derechos de autor, incluido en el archivo LICENSE y en los encabezados de los archivos fuente por defecto. |
| dependencyCheck | boolean | true | Configura un target de verificación de licencias que falla cuando las dependencias declaran licencias fuera de la lista permitida configurada. |
| preferInstallDependencies | boolean | true | Si se prefiere instalar las dependencias después de que se ejecute el generador. Establecer en false para diferir la instalación al ejecutar múltiples generadores en lote (la instalación aún se ejecuta si es necesaria para que los generadores subsecuentes puedan calcular el grafo de proyectos de Nx); instalar una vez al final. |
Salida del generador
Sección titulada «Salida del generador»El generador creará o actualizará los siguientes archivos:
- nx.json El objetivo lint se configura para ejecutar el generador de sincronización de licencias y depende del objetivo license-check
- aws-nx-plugin.config.mts Configuración para sincronización de código fuente de licencia (
license.source) y verificación de dependencias (license.dependencies)
Cabeceras y archivos de licencia
Sección titulada «Cabeceras y archivos de licencia»El generador registra un generador de sincronización que se ejecuta como parte de tus objetivos lint, asegurando que tus archivos fuente contengan las cabeceras de licencia correctas, tus proyectos contengan archivos LICENSE, y los metadatos de licencia estén configurados en package.json y pyproject.toml.
Flujo de trabajo
Sección titulada «Flujo de trabajo»Cada vez que construyas tus proyectos (y se ejecute un objetivo lint), el generador de sincronización de licencias asegurará que las licencias en tu proyecto coincidan con tu configuración. Si detecta discrepancias, recibirás un mensaje como:
NX El espacio de trabajo está desincronizado
[@aws/nx-plugin:license#sync]: Archivos LICENSE del proyecto están desincronizados:- LICENSE- packages/<my-project>LICENSE
Archivos package.json del proyecto están desincronizados:- package.json
Archivos pyproject.toml del proyecto están desincronizados:- pyproject.toml- packages/<my-python-project>/pyproject.toml
Cabeceras de licencia desincronizadas en los siguientes archivos fuente:- packages/<my-project>/src/index.ts- packages/<my-python-project>/main.py
Esto resultará en un error en CI.
¿Deseas sincronizar los cambios identificados para actualizar el espacio de trabajo?Sí, sincronizar los cambios y ejecutar las tareasNo, ejecutar las tareas sin sincronizar los cambiosSelecciona Sí para sincronizar los cambios.
Comportamiento de sincronización
Sección titulada «Comportamiento de sincronización»El generador realiza tres tareas principales:
1. Sincronizar cabeceras de licencia en archivos fuente
Sección titulada «1. Sincronizar cabeceras de licencia en archivos fuente»El generador asegura que todos los archivos fuente en tu espacio de trabajo (según tu configuración) contengan la cabecera de licencia apropiada. La cabecera se escribe como el primer comentario de bloque o serie de comentarios de línea consecutivos en el archivo (excluyendo shebang/hashbang si está presente).
2. Sincronizar archivos LICENSE
Sección titulada «2. Sincronizar archivos LICENSE»El generador asegura que el archivo raíz LICENSE y los archivos LICENSE de subproyectos correspondan a tu licencia configurada.
3. Sincronizar información de licencia en archivos de proyecto
Sección titulada «3. Sincronizar información de licencia en archivos de proyecto»El generador asegura que los campos license en archivos package.json y pyproject.toml coincidan con tu licencia configurada.
Configuración de cabeceras y archivos
Sección titulada «Configuración de cabeceras y archivos»La configuración se define en el archivo aws-nx-plugin.config.mts en la raíz del espacio de trabajo.
SPDX y Titular de derechos
Sección titulada «SPDX y Titular de derechos»Puedes actualizar la licencia mediante la propiedad spdx:
export default { license: { source: { spdx: 'MIT', }, },} satisfies AwsNxPluginConfig;Al ejecutar el generador, todos los archivos LICENSE, package.json y pyproject.toml se actualizarán según la licencia configurada.
También puedes configurar el titular de derechos y el año de copyright:
export default { license: { source: { spdx: 'MIT', copyrightHolder: 'Amazon.com, Inc. or its affiliates', copyrightYear: 2025, }, },} satisfies AwsNxPluginConfig;Contenido de cabecera de licencia
Sección titulada «Contenido de cabecera de licencia»El contenido de la cabecera se puede configurar de dos formas:
- Contenido inline:
export default { license: { source: { header: { content: { lines: [ 'Copyright: My Company, Incorporated.', 'Licensed under the MIT License', 'All rights reserved', ]; } // ... formato de configuración } } }} satisfies AwsNxPluginConfig;- Cargando desde archivo:
export default { license: { source: { header: { content: { filePath: 'license-header.txt'; // relativo a la raíz del workspace } // ... formato de configuración } } }} satisfies AwsNxPluginConfig;Formato de cabecera
Sección titulada «Formato de cabecera»Puedes especificar el formato de cabeceras para diferentes tipos de archivo usando patrones glob. Soporta comentarios de línea, bloque o combinaciones:
export default { license: { source: { header: { content: { lines: ['Aviso de copyright aquí'], }, format: { // Comentarios de línea '**/*.ts': { lineStart: '// ', }, // Comentarios de bloque '**/*.css': { blockStart: '/*', blockEnd: '*/', }, // Comentarios de bloque con prefijos '**/*.java': { blockStart: '/*', lineStart: ' * ', blockEnd: ' */', }, // Comentarios con encabezado/pie '**/*.py': { blockStart: '# ------------', lineStart: '# ', blockEnd: '# ------------', }, }, }, }, },} satisfies AwsNxPluginConfig;Opciones de formato soportadas:
blockStart: Texto antes del contenido de licencialineStart: Prefijo para cada línealineEnd: Sufijo para cada líneablockEnd: Texto después del contenido
Sintaxis de comentarios personalizada
Sección titulada «Sintaxis de comentarios personalizada»Para tipos de archivo no soportados nativamente, puedes especificar sintaxis de comentarios personalizada para indicar al generador cómo identificar cabeceras de licencia existentes en estos tipos de archivo.
export default { license: { source: { header: { content: { lines: ['Mi cabecera de licencia'], }, format: { '**/*.xyz': { lineStart: '## ', }, }, commentSyntax: { xyz: { line: '##', // Sintaxis de comentario de línea }, abc: { block: { // Define block comment syntax start: '<!--', end: '-->', }, }, }, }, }, },} satisfies AwsNxPluginConfig;Excluir archivos de sincronización de cabeceras
Sección titulada «Excluir archivos de sincronización de cabeceras»Por defecto se respetan los .gitignore. En repositorios no-git, se excluyen mediante configuración:
export default { license: { source: { header: { content: { lines: ['Mi cabecera de licencia'], }, format: { '**/*.ts': { lineStart: '// ', }, }, exclude: ['**/generated/**', '**/dist/**', 'some-specific-file.ts'], }, }, },} satisfies AwsNxPluginConfig;Excluir proyectos de sincronización de archivos
Sección titulada «Excluir proyectos de sincronización de archivos»Puedes excluir proyectos o archivos específicos:
export default { license: { source: { files: { exclude: [ // Excluir LICENSE, package.json y pyproject.toml 'packages/excluded-project', // Excluir solo LICENSE 'apps/internal/LICENSE', ]; } } }} satisfies AwsNxPluginConfig;Desactivar sincronización de licencias
Sección titulada «Desactivar sincronización de licencias»La sincronización de código fuente de licencia se habilita mediante la presencia de la clave license.source en tu configuración. Para desactivarla:
- Elimina la sección
license.sourcede tu configuración enaws-nx-plugin.config.mts(puedes mantenerlicense.dependenciessi aún deseas la verificación de licencias de dependencias) - Si también deseas eliminar completamente el generador de sincronización, elimina el generador
@aws/nx-plugin:license#syncdetargetDefaults.lint.syncGenerators
Para reactivarlo, ejecuta el generador license nuevamente.
Verificación de licencias de dependencias
Sección titulada «Verificación de licencias de dependencias»El generador license también configura un objetivo license-check que falla cuando una de las dependencias de tu proyecto (o cualquier dependencia transitiva) declara una licencia que no está en tu lista de permitidas.
Cómo se ejecuta
Sección titulada «Cómo se ejecuta»El generador escribe un objetivo license-check en tu project.json raíz:
{ "targets": { "license-check": { "executor": "@aws/nx-plugin:license-check", "cache": true, "inputs": [ "{workspaceRoot}/pnpm-lock.yaml", "{workspaceRoot}/aws-nx-plugin.config.mts" ], "options": {} } }}Los inputs se calculan para tu espacio de trabajo: solo se incluyen los lockfiles que están realmente presentes, junto con aws-nx-plugin.config.mts, más un glob {workspaceRoot}/**/uv.lock cuando la verificación de dependencias de Python está habilitada (es decir, cuando un colector de Python está configurado).
Puedes ejecutar la verificación directamente:
pnpm nx license-checkyarn nx license-checknpx nx license-checkbunx nx license-checkLos resultados se almacenan en caché contra tus lockfiles y aws-nx-plugin.config.mts — las re-ejecuciones son instantáneas cuando nada ha cambiado.
Los colectores determinan qué se escanea. El npmCollector usa license-checker-rseidelsohn, y el pythonCollector usa pip-licenses. Si no se encuentran dependencias instaladas, la verificación pasa sin nada que inspeccionar.
Ejecutar como parte de lint/build
Sección titulada «Ejecutar como parte de lint/build»La verificación de licencias de dependencias se ejecuta automáticamente cada vez que ejecutas lint o build en cualquier proyecto de tu espacio de trabajo. El generador license conecta el objetivo lint de cada proyecto para que dependa del objetivo license-check raíz, y los generadores de proyecto (ts#* y py#*) hacen lo mismo cuando se ejecutan — por lo que la verificación se conecta independientemente del orden en que se ejecuten los generadores.
Esto significa que no necesitas ejecutar la verificación explícitamente, aunque aún puedes hacerlo con el objetivo license-check:
pnpm nx license-checkyarn nx license-checknpx nx license-checkbunx nx license-checkLa conexión es un dependsOn entre proyectos en el objetivo lint de cada proyecto que apunta al objetivo license-check raíz. Para omitir la verificación durante un lint o build, establece la variable de entorno 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 lintConfiguración
Sección titulada «Configuración»Por defecto, la verificación usa un conjunto integrado de licencias permisivas comunes (MIT, Apache-2.0, BSD, ISC, etc.) exportado como DEFAULT_LICENSE_ALLOWLIST. Puedes extender o sobrescribir esto en tu configuración:
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 |
Personalizar la lista de permitidas
Sección titulada «Personalizar la lista de permitidas»Para restringir la lista, reemplaza DEFAULT_LICENSE_ALLOWLIST con tu propio array. Para extenderla, expande el valor predeterminado y agrega entradas. Las entradas se comparan por id SPDX, nombre completo de licencia o cualquiera de los alias listados (sin distinción de mayúsculas).
Excepciones por paquete
Sección titulada «Excepciones por paquete»Usa exceptions para paquetes que fallan la verificación — ya sea porque su licencia no está en la lista de permitidas, o porque se distribuyen sin metadatos de licencia detectables. El campo reason es obligatorio para que los revisores puedan ver por qué se otorgó la excepción.
exceptions: [ { package: 'union', version: '0.5.0', reason: 'Package ships verbatim MIT text without declaring license', },];Los generadores que introducen dependencias con metadatos problemáticos (por ejemplo, el generador de servidor MCP) agregan automáticamente las excepciones requeridas a tu configuración cuando se ejecutan.
Colectores
Sección titulada «Colectores»Los colectores descubren dependencias y extraen metadatos de licencia. Los colectores integrados son npmCollector() (escanea node_modules) y pythonCollector() (escanea entornos virtuales de Python). El generador de licencias configura npmCollector() por defecto y agrega pythonCollector() cuando hay proyectos Python presentes.
Para implementar un colector personalizado, cumple con la interfaz 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' }, ]; },});El hook onDependency
Sección titulada «El hook onDependency»license.dependencies acepta un callback opcional onDependency que se invoca una vez por cada dependencia descubierta, independientemente de si pasa o falla la verificación. Recibe { package, spdx }, donde package es el nombre del paquete y spdx es la expresión de licencia SPDX resuelta. El spdx de una excepción tiene precedencia sobre la licencia declarada sin procesar, y spdx puede ser una cadena vacía si no se declaró ninguna licencia.
Esta es una forma práctica de imprimir todas las licencias en tu proyecto. Ejecuta el objetivo license-check para ver la salida:
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;Desactivar verificaciones de dependencias
Sección titulada «Desactivar verificaciones de dependencias»La verificación de licencias de dependencias se habilita mediante la presencia de la clave license.dependencies en tu configuración.
Para desactivar las verificaciones en una sola ejecución, establece la variable de entorno 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 lintPara desactivar permanentemente, elimina la clave license.dependencies de tu configuración en aws-nx-plugin.config.mts. También puedes volver a ejecutar el generador license con --dependencyCheck=false para generar sin ella.