Skip to content

v2 migration guide_guidesmiths

jonatan-martinez edited this page Sep 19, 2023 · 2 revisions

Overview

This document aims to provide a guide for users upgrading from v1 to v2. Since this library is in an early stage, we might implement some breaking changes in order to make it more convenient to use, based on users' feedback. Apologies in advance for the possible inconvenience.

💣 Breaking changes

failOn option no longer accepts commas

On v1, you needed to provide the licenses to the failOn option as a list of comma-separated values:

npx @guidesmiths/license-checker --failOn license1,license2

We thought that it would be handier to get rid of the comma and accept several licenses in this fashion:

npx @guidesmiths/license-checker --failOn license1 license2

❗ Please, be aware that if you continue passing the comma-separated values on v2, it will be handled as a unique license name, which is probably something you do not want.

✨ Other changes

failOn accepts RegExp

We acknowledge that having to pass the exact values of the licenses is a bit cumbersome, especially taking into consideration the number of variants that some may have. To make that process a bit less painful, the failOn option accepts regular expressions now:

npx @guidesmiths/license-checker --failOn /license1/ license2

In this example, the content enclosed in slashes (license1) would be interpreted as a RegExp when matching your dependency packages' licenses. For instance, if you are interested in being alerted of any GPL variants, you may pass /GPL/. It will detect all its possible variants (GPL, LGPL, AGPL, etc).

logo


Licence checker

🏡     Home

💻   Releases

📣   Issues

@onebeyond

Version 2

@guidesmiths

Version 2

Clone this wiki locally