Comments (11)
Maybe there could also be an option to support no license, and have it automatically set private: "true"
in the package.json to avoid unintentionally publishing a package. (Or this flag could be provided by a separate option)
from projen.
Sounds good to me. Contributions are welcome
from projen.
Instead of copying all the license, can't we just download them from https://github.com/github/choosealicense.com ?
from projen.
Is anything else download by projen
yet ? Can we ,yes? @eladb thoughts?
from projen.
Technically, synthesis includes yarn/npm install
, which implies we are downloading stuff, so I am quite comfortable with this...
from projen.
Hi! I just decided to give it a try with a very simple solution: a flag "licensed".
- If the flag is true (default value) the behavior is the current one.
- If the flag is false:
- No LICENSE file is generated
- No entry regarding LICENSE is added to .gitignore
- package.json license is set to "UNLICENSED"
Any thoughts?
from projen.
Could we make the features you listed in the "false" section to automatically happen if license: 'UNLICENSED'
is provided, to eliminate the extra flag? I feel like this would be a logical default behavior as long as it's documented in the docstring
from projen.
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:
- A flag to enable/disable adding a license (what I am doing with this PR). I am not quite sure if "licensed" is good naming, better would be just "license", but I just wanted to have a path to deprecate "license" and tell users they should use licenseOptions to set the SPDX ID in the future.
- A licenseOptions field that, based on some ideas from this issue, I imagine could have fields like:
- URL to download the license from
- Tokens to replace with author name, year, project url, etc. in the downloaded license (e.g. [name of copyright owner] is used for the licenses stored in the repo).
- spdxId
If we would like to add the possibility of downloading the licenses I think it would make sense to keep the flag.
from projen.
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.
from projen.
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 licenseOptions
like you suggested. I don't really have a strong opinion here.
Tokens to replace with author name, year, project url, etc. in the downloaded license (e.g. [name of copyright owner] is used for the licenses stored in the repo).
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.
from projen.
Thanks a lot for the feedback!
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
licenseOptions
like you suggested. I don't really have a strong opinion here.
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.
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.
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.
from projen.
Related Issues (20)
- feat(react): Node Library to publish (to NPM) that supports React/JSX HOT 6
- Links in README for built-in project types are broken HOT 1
- AWS CDK CLI not accessible in Python CDK projects HOT 1
- Where to find Project type Docs during Doc Migration to new site? HOT 1
- Fix .gitignore generation on Windows
- Allow github release to be explicitly set as latest or explicitly not be latest
- Add dependency via CLI/projen task HOT 2
- manual publishing in a (GitLab) CI environment breaks because of alternative behavior when CI environment variable is set HOT 9
- feat(typescript): tsconfig paths handled automatically by ts-jest pathsToModuleMapper HOT 2
- cross-platform: use forward slash as directory separator for all platforms HOT 5
- Publishing v0.79.2 to Maven Central failed HOT 3
- `awscdk-app-py` project does not fully respect `--app-entrypoint` value
- Error messages for npx projen new are not helpful HOT 2
- Issues with New Child Project Release Feature and Duplicate Projen Package Installation HOT 15
- Tsconfig CompilerOptions missing `incremental` and `downlevelIteration`
- GitHub Job interface made into or complemented with a class that has helpers to aid building a job HOT 5
- After upgrading to projen: error TS1110: Type expected. HOT 3
- Add support for Gitlab trigger:forward keyword
- `projen upgrade` fails due to `pnpx` deprecation HOT 2
- setting `--commitGenerated` to false causes npx projen to fail when ran in a pipeline or cloned repository. HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from projen.