-
Notifications
You must be signed in to change notification settings - Fork 254
Add funding support & npm fund subcommand
#54
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
Closed
Closed
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5a656d7
Add `funding` support & `npm fund` subcommand
darcyclarke 4aea934
Update RFC to reflect feedback
darcyclarke e90aa10
Link blog post: Supporting Open Source Maintainers
darcyclarke bec90dd
Update 0017-add-funding-support.md
darcyclarke 42e7df7
Update accepted/0017-add-funding-support.md
darcyclarke 24a1218
Update RFC Spec based on feedback
darcyclarke d1069d5
Update examples to reflect deduping & doc url/type
darcyclarke 43b9cc4
Update example for npm fund <pkg>
darcyclarke cb3ce08
Fix typo
darcyclarke ca66e8d
Remove unresolved & bikeshedding
darcyclarke 972c630
Fix redundancies
darcyclarke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| # Add `funding` support to `package.json` | ||
|
|
||
| ## Summary | ||
|
|
||
| This RFC identifies an initial means of tooling to describe & notify consumers of a package's monetary support information. `npm` has been [vocal about our commitment](https://blog.npmjs.org/post/187382017885/supporting-open-source-maintainers) to providing a means for package maintainers to more sustainably support their work & this reflects an initial step toward that goal. | ||
|
|
||
| ## Motivation | ||
|
|
||
| Package maintainers want to clearly indentify how their software is currently, or could be in the future, supported monetarily. | ||
|
|
||
| ## Detailed Explanation | ||
|
|
||
| * See [Prior Art](#prior-art) | ||
| * Provide a means to **reference** existing backers or funding opportunities in `package.json` | ||
| * Provide a means to **define the type** of backing or funding opportunities in `package.json` | ||
| * Provide a means to **notify** package consumers of backers or funding opportunites with the cli | ||
| * Provide a means to **view** dependency's backers or funding opportunites with the cli | ||
| * Provide a means to **view** a package's backers or funding opportunites | ||
|
|
||
| ## Rationale & Alternatives | ||
| * Rationale: This is a straightforward and easily implemented solution to take the first step toward supporting Open Source Package Maintainence sustainability | ||
darcyclarke marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * Rationale: Building this functionality into the package management layer is the only reliable way to push funding notifications to the vast majority of developers who already use npm | ||
| * Alternative: Continue to rely on third-party, opt-in, tools & platforms that only support a fraction of the desired audience | ||
| * Alternative: Continue debating a larger, more complex schema /w correspondingly more complex tooling | ||
|
|
||
| ## Implementation | ||
|
|
||
| * Add a `funding` field to `package.json` | ||
| * supports a string URL or object with... | ||
| * keys that support arbitrary string identifiers | ||
| * ex. `"sponsor"`, `"sponsors"`, `"donations"`, `"bounties"`, `"contributors"`, `"patrons"` etc. | ||
darcyclarke marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * values that represent a string URL or an array of URLs | ||
| * Add notification at the end of output of package installation that references the number of packages with `funding` defined | ||
| * ex. `23 packages are looking for funding. Run "npm fund" to find out more.` | ||
darcyclarke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * Add `--no-fund` flag to opt-out of the funding notification when installing | ||
darcyclarke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * Add `npm fund <pkg>` subcommand: | ||
| * if a singular URL is defined for the specified package's `funding` field, it will try to open it using the `--browser` config param (similar to `npm repo <pkg>`) | ||
darcyclarke marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * if an object is defined for the specified package's `funding` field, it will print out the tree of values | ||
darcyclarke marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * if no package is specified, `npm` will try to print out a tree of all the funding references defined in the current project's installed dependencies | ||
darcyclarke marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
darcyclarke marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * Add a visual representation for the funding field/value on package pages on `npmjs.com` | ||
|
|
||
|
|
||
| **Examples of `funding` usage in `package.json`:** | ||
| ``` | ||
| { | ||
| ... | ||
| "funding": "https://www.patreon.com/my-account" | ||
| ... | ||
| } | ||
| ``` | ||
| ``` | ||
| { | ||
| ... | ||
| "funding": { | ||
| "foundations": "https://openjsf.org/" | ||
| } | ||
| ... | ||
| } | ||
| ``` | ||
| ``` | ||
| { | ||
| ... | ||
| "funding": { | ||
| "corporations": [ | ||
| "https://microsoft.com/", | ||
| "https://google.com/" | ||
| ] | ||
| } | ||
| ... | ||
| } | ||
| ``` | ||
| ``` | ||
| { | ||
| ... | ||
| "funding": { | ||
| "sponsor": [ | ||
| "https://github.com/users/my-account/sponsorship", | ||
| "https://opencollective.com/my-account", | ||
| "https://www.patreon.com/my-account" | ||
| ], | ||
| "sponsors": "https://github.com/users/my-account/sponsorship#sponsors", | ||
| "contributors": "https://opencollective.com/my-account#section-contributors", | ||
| "patrons": [ | ||
| "https://patrons-site-one.com/", | ||
| "https://patrons-site-two.com/", | ||
| "https://patrons-site-three.com/" | ||
| ] | ||
| } | ||
| ... | ||
| } | ||
darcyclarke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| **Example of `npm fund <pkg>`:** | ||
darcyclarke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` | ||
| $ npm fund example-package | ||
| └─ example-package | ||
| ├─ sponsor | ||
| │ ├─ 0: https://github.com/users/my-account/sponsorship | ||
darcyclarke marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| │ ├─ 1: https://opencollective.com/my-account | ||
| │ └─ 2: https://www.patreon.com/my-account | ||
| ├─ sponsors: https://github.com/users/my-account/sponsorship#sponsors | ||
| ├─ contributors: https://opencollective.com/my-account#section-contributors | ||
| └─ patrons | ||
| ├─ 0: https://patrons-site-one.com/ | ||
| ├─ 1: https://patrons-site-two.com/ | ||
| └─ 2: https://patrons-site-three.com/ | ||
| ``` | ||
|
|
||
| ## Prior Art | ||
|
|
||
| * [Open Collective](https://github.com/opencollective/opencollective) | ||
| * [GitHub Sponsors](https://github.com/sponsors) | ||
| * [License Zero](https://licensezero.com/) | ||
| * [GitCoin](https://gitcoin.co/products) | ||
| * [Feross: `thanks`](https://github.com/feross/thanks) | ||
| * [Feross: `funding`](https://github.com/feross/funding) | ||
| * [Indieweb: payment](https://indieweb.org/payment) | ||
| * [microformats: `rel-payment`](http://microformats.org/wiki/rel-payment) | ||
| * [Shields.io: Funding](https://shields.io/category/funding) | ||
| * [ThanksApp: Donate Spec](https://github.com/ThanksApp/donate-spec) | ||
| * [Bevry: `sponsored`](https://github.com/bevry-archive/sponsored) | ||
| * [OGAG: `civic.json`](http://open.dc.gov/civic.json/) | ||
|
|
||
| #### Other Work & Conversations | ||
|
|
||
| 1. <i id="r1"></i>[PM WG: "Document support levels" Draft](https://github.com/nodejs/package-maintenance/blob/master/docs/drafts/PACKAGE-SUPPORT.md) | ||
| 2. <i id="r2"></i>[PM WG: "Document support levels" Blog post to announce](https://github.com/nodejs/package-maintenance/issues/228) | ||
| 3. <i id="r3"></i>[PM WG: "Document support levels" Blog post to validate](https://github.com/nodejs/package-maintenance/issues/244) | ||
| 4. <i id="r4"></i>[PM WG: `support` field `license` Issue](https://github.com/nodejs/package-maintenance/issues/218) | ||
| 5. <i id="r5"></i>[PM WG: "Future direction of `support` field" Issue](https://github.com/nodejs/package-maintenance/issues/241) | ||
| 6. <i id="r6"></i>[npm: `sustainability` PR](https://github.com/npm/cli/pull/187) | ||
| 7. <i id="r7"></i>[npm: `support` PR](https://github.com/npm/cli/pull/246) | ||
| 8. <i id="r8"></i>[`thanks`: "Read URL from `package.json`" Issue](https://github.com/feross/thanks/issues/2) | ||
| 9. <i id="r9"></i>[`funding`: "Collaborate with the PM WG" Issue](https://github.com/feross/funding/issues/15) | ||
| 10. <i id="r10"></i>[Differences between: "author", "contributors", "maintainers" & "owner"](https://github.com/npm/www/issues/133#issuecomment-284906561) | ||
|
|
||
| ## Unresolved Questions and Bikeshedding | ||
| * [ ] Highlight this proposal to the [Package Maintaince WG](https://github.com/nodejs/package-maintenance/) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.