Skip to content

feat: license-kit dependency scan config - transitive & dev dependencies; adjusted behaviour for --error-on-weak#47

Merged
artus9033 merged 8 commits intomainfrom
feat/license-kit-dependency-scan-config
Jun 18, 2025
Merged

feat: license-kit dependency scan config - transitive & dev dependencies; adjusted behaviour for --error-on-weak#47
artus9033 merged 8 commits intomainfrom
feat/license-kit-dependency-scan-config

Conversation

@artus9033
Copy link
Copy Markdown
Collaborator

@artus9033 artus9033 commented Jun 18, 2025

This PR introduces new, optional, flags to the license-kit CLI's copyleft & report commands:

Flag / Option Description Default
--tm, --transitive-deps-mode [mode] Controls, which transitive dependencies are included:
  • 'all'
  • 'from-external-only' (only transitive dependencies of direct dependencies specified by non-workspace:... specifiers)
  • 'from-workspace-only' (only transitive dependencies of direct dependencies specified by workspace: specifier)
  • 'none'
'all'
--dm, --dev-deps-mode [mode]
  • 'root-only' (only direct devDependencies from the scanned project's root package.json)
  • 'none'
'none'

The changes are non-breaking w.r.t. the library users.

This PR also introduces an adjustment of copyleft behaviour w.r.t. the value of --error-on-weak command:

  • exit code is set as follows:
    • 0 - no copyleft licenses found
    • 1 - strong copyleft licenses found
    • 2 - weak copyleft licenses found (if --error-on-weak is set)
  • the message for detected weak copyleft messages is logged using console.error + ❌ or console.warn + ⚠️ depending on whether --error-on-weak is set to (appropriately) true or false

This PR depends on #45 to be merged (and in turn on #44). To see just a comparison of the changes in this PR for the time #45 is not merged yet, please see the diff of shared-deps-scan-options...feat/license-kit-dependency-scan-config.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 18, 2025

🦋 Changeset detected

Latest commit: d68c88c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
license-kit Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@artus9033 artus9033 requested a review from mateusz1913 June 18, 2025 08:59
@artus9033 artus9033 force-pushed the feat/license-kit-dependency-scan-config branch from 752d94e to b3a64bb Compare June 18, 2025 11:39
Comment thread packages/license-kit/src/index.ts
@artus9033 artus9033 changed the title feat: license-kit dependency scan config - transitive & dev dependencies feat: license-kit dependency scan config - transitive & dev dependencies; adjusted behaviour for --error-on-weak Jun 18, 2025
@artus9033 artus9033 merged commit a836940 into main Jun 18, 2025
1 of 6 checks passed
@artus9033 artus9033 deleted the feat/license-kit-dependency-scan-config branch June 18, 2025 12:28
@github-actions github-actions Bot mentioned this pull request Jun 18, 2025
@artus9033 artus9033 mentioned this pull request Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants