License
Gestiona las licencias en todo tu espacio de trabajo: sincroniza archivos LICENSE y encabezados 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»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-run- 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
Opciones
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 target lint está configurado para ejecutar el generador de sincronización de licencias y depende del target license-check
- aws-nx-plugin.config.mts Configuración para la sincronización de fuentes de licencia (
license.source) y verificación de dependencias (license.dependencies)
Encabezados y Archivos de Licencia
Sección titulada «Encabezados y Archivos de Licencia»El generador registra un generador de sincronización para ejecutarse como parte de tus targets lint, lo que garantiza que tus archivos fuente contengan los encabezados de licencia correctos, 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 target lint), el generador de sincronización de licencias se asegurará de que las licencias en tu proyecto coincidan con tu configuración. Si detecta que algo está desincronizado, recibirás un mensaje como este:
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 changesSelecciona Yes para sincronizar los cambios.
Comportamiento de Sincronización
Sección titulada «Comportamiento de Sincronización»El generador de sincronización de licencias realiza tres tareas principales:
1. Sincronizar Encabezados de Licencia en Archivos Fuente
Sección titulada «1. Sincronizar Encabezados de Licencia en Archivos Fuente»Cuando se ejecuta el generador de sincronización, se asegurará de que todos los archivos de código fuente en tu espacio de trabajo (según tu configuración) contengan el encabezado de licencia apropiado. El encabezado se escribe como el primer comentario de bloque o serie consecutiva de comentarios de línea en el archivo (además del shebang/hashbang si está presente en un archivo).
2. Sincronizar Archivos LICENSE
Sección titulada «2. Sincronizar Archivos LICENSE»Cuando se ejecuta el generador de sincronización, se asegurará de que el archivo LICENSE raíz corresponda a tu licencia configurada, así como de garantizar que todos los subproyectos en tu espacio de trabajo también contengan el archivo LICENSE correcto.
3. Sincronizar información de licencias en archivos de proyecto
Sección titulada «3. Sincronizar información de licencias en archivos de proyecto»Cuando se ejecuta el generador de sincronización, se asegurará de que los campos license en los archivos package.json y pyproject.toml estén configurados con tu licencia configurada.
Configuración de Encabezados y Archivos
Sección titulada «Configuración de Encabezados y Archivos»La configuración se define en el archivo aws-nx-plugin.config.mts en la raíz de tu espacio de trabajo.
SPDX y Titular de Derechos de Autor
Sección titulada «SPDX y Titular de Derechos de Autor»Tu licencia elegida puede actualizarse en cualquier momento a través de la propiedad de configuración spdx:
export default { license: { source: { spdx: 'MIT', }, },} satisfies AwsNxPluginConfig;Cuando se ejecuta el generador de sincronización, todos los archivos LICENSE, package.json y pyproject.toml se actualizarán para reflejar la licencia configurada.
Además, puedes configurar el titular de los derechos de autor y el año de copyright, que se incluyen en algunos archivos LICENSE:
export default { license: { source: { spdx: 'MIT', copyrightHolder: 'Amazon.com, Inc. or its affiliates', copyrightYear: 2025, }, },} satisfies AwsNxPluginConfig;Contenido del Encabezado de Licencia
Sección titulada «Contenido del Encabezado de Licencia»El contenido del encabezado de licencia se puede configurar de dos maneras:
- Usando contenido en línea:
export default { license: { source: { header: { content: { lines: [ 'Copyright: My Company, Incorporated.', 'Licensed under the MIT License', 'All rights reserved', ]; } // ... format configuration } } }} satisfies AwsNxPluginConfig;- Cargando desde un archivo:
export default { license: { source: { header: { content: { filePath: 'license-header.txt'; // relative to workspace root } // ... format configuration } } }} satisfies AwsNxPluginConfig;Formato del Encabezado
Sección titulada «Formato del Encabezado»Puedes especificar cómo deben formatearse los encabezados de licencia para diferentes tipos de archivo usando patrones glob. La configuración de formato admite comentarios de línea, comentarios de bloque o una combinación de ambos:
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;La configuración de formato admite:
blockStart: Texto escrito antes del contenido de la licencia (por ejemplo, para iniciar un comentario de bloque)lineStart: Texto antepuesto a cada línea del contenido de la licencialineEnd: Texto agregado al final de cada línea del contenido de la licenciablockEnd: Texto escrito después del contenido de la licencia (por ejemplo, para finalizar un comentario de bloque)
Sintaxis de Comentarios Personalizada
Sección titulada «Sintaxis de Comentarios Personalizada»Para tipos de archivo que no son compatibles de forma nativa, puedes especificar una sintaxis de comentarios personalizada para indicarle al generador de sincronización cómo identificar encabezados de licencia existentes en estos tipos de archivo.
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;Excluir Archivos de la Sincronización de Encabezados
Sección titulada «Excluir Archivos de la Sincronización de Encabezados»Por defecto, en un repositorio git, todos los archivos .gitignore se respetan para garantizar que solo se sincronicen los archivos gestionados por control de versiones. En repositorios que no son git, todos los archivos se consideran a menos que se excluyan explícitamente en la configuración.
Puedes excluir archivos adicionales de la sincronización de encabezados de licencia usando patrones glob:
export default { license: { source: { header: { content: { lines: ['My license header'], }, format: { '**/*.ts': { lineStart: '// ', }, }, exclude: ['**/generated/**', '**/dist/**', 'some-specific-file.ts'], }, }, },} satisfies AwsNxPluginConfig;Excluir Proyectos de la Sincronización de Archivos
Sección titulada «Excluir Proyectos de la Sincronización de Archivos»Todos los archivos LICENSE, archivos package.json y archivos pyproject.toml se sincronizan con la licencia configurada por defecto.
Puedes excluir proyectos o archivos específicos de la sincronización usando patrones 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;Deshabilitar la Sincronización de Licencias
Sección titulada «Deshabilitar la Sincronización de Licencias»La sincronización de fuentes de licencia se habilita mediante la presencia de la clave license.source en tu configuración. Para deshabilitarla:
- 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 volver a habilitar la sincronización de licencias, simplemente ejecuta el generador license nuevamente.
Verificaciones de Licencias de Dependencias
Sección titulada «Verificaciones de Licencias de Dependencias»El generador license también configura un target 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 target 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 archivos de bloqueo que realmente están 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, se configura un recolector de Python).
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 archivos de bloqueo y aws-nx-plugin.config.mts — las re-ejecuciones son instantáneas cuando nada ha cambiado.
Los recolectores 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 target lint de cada proyecto para que dependa del target 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 target license-check:
pnpm nx license-checkyarn nx license-checknpx nx license-checkbunx nx license-checkLa conexión es un dependsOn entre proyectos en el target lint de cada proyecto que apunta al target 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 anular 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 de permitidas, 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 entre mayúsculas y minú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 envían 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.
Recolectores
Sección titulada «Recolectores»Los recolectores descubren dependencias y extraen metadatos de licencia. Los recolectores 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 de Python presentes.
Para implementar un recolector 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 target 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;Deshabilitar las Verificaciones de Dependencias
Sección titulada «Deshabilitar las 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 deshabilitar las verificaciones para 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 deshabilitar 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.