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

Fix npm warning by using configured default license #2929

Merged

Conversation

mikemaccana
Copy link
Contributor

@mikemaccana mikemaccana commented Apr 25, 2024

Currently when a new project is made with anchor init, running anchor test will display a warning because the package.json is missing the license field:

warning package.json: No license field

This PR uses the system's configured default license (ie, what npm init -y would use) to set the license for the new project.

People can set their system's default license with npm config set init-license "<license name>". Eg

  • npm config set init-license "MIT" (if you prefer MIT to be the default)
  • npm config set init-license "UNLICENSED" (if you do not wish to make your code open source)

Note this is my first PR to a Rust project, so if you have any suggestions for the code please let me know!

Copy link

vercel bot commented Apr 25, 2024

@mikemaccana is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto added enhancement New feature or request cli labels Apr 25, 2024
Copy link
Collaborator

@acheroncrypto acheroncrypto left a comment

Choose a reason for hiding this comment

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

We could probably use a CHANGELOG entry for this warning fix, could you add that?

cli/src/lib.rs Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants