Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: non-production dependency checking #22

Closed
wants to merge 2 commits into from
Closed

feat: non-production dependency checking #22

wants to merge 2 commits into from

Conversation

bradleypriest
Copy link
Contributor

Add support for not passing the --production flag through to the license-checker library.
The default behaviour has not changed, but the command now optionally supports --environment=all and --environment=development to pass the relevant flags to license-checker.

I went with this flag because if we were to mirror the flags of license-checker it would change the default behaviour.

Open to suggestions for other naming, alternatively we could add a --no-production flag.

Add support for adjusting the default of checking production dependencies only
@kingnebby
Copy link
Contributor

Thanks for the PR! I'll look into this soon.

src/index.ts Outdated
@@ -21,16 +21,39 @@ program
.version(pkg.version, "-v, --version")
.option("--summary", "Prints a summary report")
.option("-i, --interactive", "Runs in interactive mode.")
.option(
"--environment [environment]",
"Which dependencies to check. (production, development, all)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we should just simplify this to either production or both. Is there a use case for checking only development dependencies? The reason to do only prod is because a lot of licenses has legal language around distribution and only the prod deps should be getting published to npm or packaged (for example in a container).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable to me, I only added development in for completeness of API compatibility with license-checker.

].join("\n")
let { stdout } = spawnSync("ts-node", ["./src/index.ts", "--summary", "--environment=all"], {})
expect(stdout.toString("utf8")).to.equal(expectedResult)
}).timeout(20000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding a test!

@kingnebby
Copy link
Contributor

Thanks for your patience on this, we actually put someone on it, but they were/are running a windows environment which caused some complications so we got sidetracked with that. It's still on my list!

@kingnebby
Copy link
Contributor

I needed to merge in the latest master so I did that on a branch in this repo then merged. Thanks for your contribution!

@kingnebby kingnebby closed this Aug 23, 2020
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.

None yet

2 participants