-
Notifications
You must be signed in to change notification settings - Fork 381
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
Feature request: Support custom licenses #122
Comments
Maybe there could also be an option to support no license, and have it automatically set |
Sounds good to me. Contributions are welcome |
Instead of copying all the license, can't we just download them from https://github.com/github/choosealicense.com ? |
Is anything else download by |
Technically, synthesis includes |
Hi! I just decided to give it a try with a very simple solution: a flag "licensed".
Any thoughts? |
Could we make the features you listed in the "false" section to automatically happen if |
Currently, the argument "license" receives an SPDX identifier. There is already an SPDX identifier called "UNLICENSE" and I think it could lead to mistakes. An alternative would be to use something like "NO_LICENSE" (I only set package.json to UNLICENSED because otherwise, npm complains about the string not being an SPDX identifier, i.e., it is a special value for npm). Another option would be to use a union type. Actually, I imagine that to accommodate new improvements regarding licenses it would make sense to have 2 fields in the future:
If we would like to add the possibility of downloading the licenses I think it would make sense to keep the flag. |
Just rereading the thread I think probably @pgarbe just meant specifying the SPDX identifier as we do currently and use by default only choosealicense.com to download the licenses. That would not require the user to provide the URL since it could be generated programmatically and then licenseOptions would not be needed. |
Ah that makes sense - thanks for the helpful explanation! Yeah I guess I wouldn't mind using 'NO_LICENSE' to avoid confusion, but it's fair that a flag works just as well. Or putting all related fields in a
Some of these placeholder substitutions are currently handled using other fields: Lines 35 to 38 in e4f5d43
Any other missing placeholders substitutions should definitely be added! But whenever possible, these fields should be passed from the rest of the project options -- not provided via license-specific options. This way the user only has to specify properties at the project level (such as the author name, year, etc.), and the fields will automatically propagate to all appropriate files, including the license. That said it's also helpful to have escape hatches for specifying things like custom license texts, for example. |
Thanks a lot for the feedback!
I don't have a strong opinion either, so I will just let it stay as it is currently. I set the PR to ready for review.
Definitely, I was thinking of cases where the information would be specific for the license, but I can see that that is not very likely. |
* Small fix to util test function directorySnapshot: return was preventing the function to transverse the whole tree. * Added filtering to util test function synthSnapshot to limit size of the snapshot Fixes #122
Problem
It seems that currently Projen supports following licenses:
Apache-2.0
MIT
MPL-2.0
… but for internally distributed (within a company) constructs / projects one should be able to set the license to something else (proprietary license).
Proposed solution
One idea could be allowing to specify the license as string:
Proposed Workaround
For a workaround one could use in
.projenrc.js
:… but that doesn't work since Projen applies
!/LICENSE
after that:So at least having some way of "forcing" manual
project.gitignore.exclude
operations to be appended at the end would solve the issue.The text was updated successfully, but these errors were encountered: