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 missing GitHub Sponsor for npm fund #7707

Merged
merged 3 commits into from
May 24, 2024
Merged

Fix missing GitHub Sponsor for npm fund #7707

merged 3 commits into from
May 24, 2024

Conversation

ybiquitous
Copy link
Member

@ybiquitous ybiquitous commented May 24, 2024

We forgot to add our GitHub Sponsor to package.json (funding) when we started it.

$ npm fund stylelint
1: opencollective funding available at the following URL: https://opencollective.com/stylelint
2: github funding available at the following URL: https://github.com/sponsors/stylelint
Run `npm fund [<package-spec>] --which=1`, for example, to open the first funding URL listed in that package

In addition, this improves the financial section in the contribution guide:

  • Add GitHub Sponsor
  • Simplify links to Open Collective, including unsupported #backer or #sponsor

Which issue, if any, is this issue related to?

None.

Is there anything in the PR that needs further explanation?

I've also added a changelog item so that users can notice this npm fund change, but I can remove it if anyone don't consider it appropriate in the changelog.

We forgot to add our GitHub Sponsor to `package.json` when we started it.

```sh-session
$ npm fund stylelint
1: opencollective funding available at the following URL: https://opencollective.com/stylelint
2: github funding available at the following URL: https://github.com/sponsors/stylelint
Run `npm fund [<package-spec>] --which=1`, for example, to open the first funding URL listed in that package
```

In addition, this improves the financial section in the contribution guide:

- Add GitHub Sponsor
- Simplify links to Open Collective, including unsupported `#backer` or `#sponsor`
Copy link

changeset-bot bot commented May 24, 2024

🦋 Changeset detected

Latest commit: b887263

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ybiquitous ybiquitous mentioned this pull request May 24, 2024
4 tasks
@ybiquitous
Copy link
Member Author

[out of topic] I'd like to apply these funding settings to other packages in https://github.com/stylelint, such as stylelint-config-recommended. If anyone knows how to achieve this easily, please let us know. 🙏🏼

Ref https://github.com/search?q=org%3Astylelint+funding+path%3Apackage.json&type=code

Copy link
Member

@romainmenke romainmenke left a comment

Choose a reason for hiding this comment

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

LGTM!

Thank you for this

@romainmenke
Copy link
Member

romainmenke commented May 24, 2024

I'd like to apply these funding settings to other packages in https://github.com/stylelint, such as stylelint-config-recommended. If anyone knows how to achieve this easily, please let us know.

We always need to add the exact same snippet in each package.json of a published npm package, right?

Edit:

Maybe doing all the releases to have this information publicly available is most of the work?

@ybiquitous
Copy link
Member Author

ybiquitous commented May 24, 2024

@romainmenke Thanks for the quick review. 😄

We always need to add the exact same snippet in each package.json of a published npm package, right?

Exactly. I think it's better for all published packages in @stylelint to have the same funding field in their package.json. But, this is a tedious task, although it's rarely changed. 😅

EDIT: And, yes. We have to publish packages with their updated funding.

CONTRIBUTING.md Outdated Show resolved Hide resolved
@ybiquitous ybiquitous merged commit c0b52c5 into main May 24, 2024
17 checks passed
@ybiquitous ybiquitous deleted the add-github-sponsor branch May 24, 2024 08:37
@ybiquitous
Copy link
Member Author

[note] This snippet automatically updates the funding field in package.json:

#!/usr/bin/env node --experimental-default-type=module
import { execSync } from "child_process";

const funding = JSON.parse(
  execSync('npm view "stylelint" "funding" --json').toString(),
);

execSync('npm pkg delete "funding"', { stdio: "inherit" });

funding.forEach(({ type, url }, i) => {
  execSync(
    `npm pkg set "funding[${i}].type=${type}" "funding[${i}].url=${url}"`,
    { stdio: "inherit" },
  );
});

console.log('Updated package.json');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants