Giter Site home page Giter Site logo

sponsorkit's People

Contributors

antfu avatar anubra266 avatar azu avatar bluwy avatar carlocorradini avatar dohooo avatar endel avatar fb55 avatar frostming avatar geopjr avatar ghostdevv avatar innocenzi avatar isbecker avatar kecrily avatar loosheng avatar modyqyw avatar olrtg avatar patak-dev avatar starhearthunt avatar sukkaw avatar ycs77 avatar yunyoujun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sponsorkit's Issues

3rd party providers support

Clear and concise description of the problem

As title

Suggested solution

As title

Alternative

No response

Additional context

No response

Validations

OpenCollective should use monthly amount instead of total

Describe the bug

I just tried this by adding both GitHub Sponsors and Open Collective tokens. The way this tool handle each is different.

For GitHub, it's taking into account the monthly value (as it should), but for Open Collective it's using the total, which results is a wrong output image.

Reproduction

Use GitHub and OpenCollective at the same time and see that they use different values.

System Info

System:
    OS: macOS 12.6
    CPU: (10) arm64 Apple M1 Pro
    Memory: 89.61 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v16.13.1/bin/yarn
    npm: 8.6.0 - ~/.nvm/versions/node/v16.13.1/bin/npm
  Browsers:
    Brave Browser: 101.1.38.115
    Chrome: 108.0.5359.94
    Firefox: 107.0.1
    Firefox Developer Edition: 108.0
    Safari: 16.0

Used Package Manager

yarn

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Add an option to sort sponsors by the length of time a user has been sponsored

Clear and concise description of the problem

Currently, sponsorkit only allows sorting sponsors by sponsoring tiers.
That's great for some cases, but I'd like to sort them by the length of time a user has been a sponsor, like over 1 year, 6 months, 3 months, etc..., because continuous support is also an important thing for FLOSS maintainers, at least I believe so.
(Someone also may not want to reveal sponsors' tiers explicitly.)

Suggested solution

The current implementation is tied to the sponsoring tiers so some tweaks to the config would be needed as well as sorting implementation.
I've implemented this in a quite dirty way (replacing tiers directly instead of adding an option): JohnTitor@f7d7b13
(The above way works fine for me, but it'd be great if upstream supported this use case so that I don't have to worry about my fork :))

Alternative

No response

Additional context

Thank you for the wonderful tool by the way!

Validations

[Bug Report]: defaultComposer maybe have bug

Background

Description

When i use this project to generator my sponsors meta info. I found when i remove Backers . And set anthor tier monthlyDollars as 1. I got a mistake.

Just like

image

In my consola

image

Expcet

I noticed that if I run the example it defaults to a blank which is normal. But there may be cases where the user deletes these isn't it? I think defaultComposer should judge 0 and null(undefined) respectively.
Currently. In defaultComposer logic is const finalSponsors = config.tiers!.filter(i => i.monthlyDollars == null || i.monthlyDollars === 0)

Support custom provider for wechat, alipay, etc.

Clear and concise description of the problem

Now sponsorkit only supports platform sponsors. It is hard to add sponsors sponsored by wechat, alipay, etc.

Suggested solution

We can specify a file read by unconfig, named custom-sponsors.config.ts or something. The file exports sponsors, matching type Sponsorship[].

Alternative

No response

Additional context

This is a raw idea. I will make a pr if this idea is possible.

Validations

bug(opencollective): `monthlyDollars` and `isOneTime` are not correct

Describe the bug

First of all, thank you very much for this great project!

I am trying to retrieve the sponsorship details of this collective: https://opencollective.com/capawesome

The following two properties of the retrieved sponsorships are often incorrect: isOneTime and monthlyDollars.

Example 1:

Transaction: https://opencollective.com/capawesome/contributions/660052

The transaction was executed once (non-recurring). However, I receive the following values:

{
  "sponsor": {
    "name": "CTS Software",
    "type": "User",
    "login": "guest-2cf739c1",
    "avatarUrl": "https://images.opencollective.com/guest-2cf739c1/avatar/460.png",
    "websiteUrl": null,
    "linkUrl": "https://opencollective.com/guest-2cf739c1",
    "avatarUrlHighRes": "...",
    "avatarUrlMediumRes": "...",
    "avatarUrlLowRes": "..."
  },
  "isOneTime": false,
  "monthlyDollars": 5000,
  "privacyLevel": "PUBLIC",
  "tierName": "โšก Custom Plugin",
  "createdAt": "2023-06-01T15:04:33.286Z",
  "provider": "opencollective"
}

isOneTime has the value false, but should be true.

Example 2:

Transactions:

This sponsor contributes 300$ per month and has contributed twice so far. However, I receive the following values:

{
  "sponsor": {
    "name": "AppScreens",
    "type": "User",
    "login": "appscreens",
    "avatarUrl": "https://images.opencollective.com/appscreens/62776aa/avatar/460.png",
    "websiteUrl": "https://appscreens.com/",
    "linkUrl": "https://opencollective.com/appscreens",
    "avatarUrlHighRes": "...",
    "avatarUrlMediumRes": "...",
    "avatarUrlLowRes": "..."
  },
  "isOneTime": true,
  "monthlyDollars": 600,
  "privacyLevel": "PUBLIC",
  "tierName": "",
  "createdAt": "2023-09-17T22:16:49.416Z",
  "provider": "opencollective"
}

monthlyDollars has the value 600, but should have 300.

Reproduction

https://github.com/capawesome-team/static

System Info

System:
    OS: macOS 14.0
    CPU: (10) arm64 Apple M1 Pro
    Memory: 136.63 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.18.2 - /opt/homebrew/opt/node@18/bin/node
    npm: 9.8.1 - /opt/homebrew/opt/node@18/bin/npm
    pnpm: 8.10.2 - /opt/homebrew/bin/pnpm
  Browsers:
    Brave Browser: 96.1.32.115
    Chrome: 119.0.6045.159
    Safari: 17.0

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

GitHub token is required

What I have as files :

  • ./workflows/sponsor_gen.yml
  • ./package.json (like this one)
  • ./sponsor.config.ts with defaults configs.

In settings, I've got SPONSORS_TOKEN in Actions secrets with org:read and user:read perms.

When I run the action, I've got this error :

Run npm run build
  npm run build
  shell: /usr/bin/bash -e {0}
  env:
    SPONSORKIT_GITHUB_TOKEN: ***
    SPONSORKIT_GITHUB_LOGIN: thomasbnt

> build
> sponsorkit

[log] 
SponsorKit v0.[2](https://github.com/thomasbnt/sponsors/runs/5741141885?check_suite_focus=true#step:5:2).2

[info] Fetching sponsorships from github...
Error: GitHub token is required
    at fetchGitHubSponsors (/home/runner/work/sponsors/sponsors/node_modules/.pnpm/[email protected]/node_modules/sponsorkit/dist/chunks/index.cjs:284:11)
    at Object.fetchSponsors (/home/runner/work/sponsors/sponsors/node_modules/.pnpm/[email protected]/node_modules/sponsorkit/dist/chunks/index.cjs:279:12)
    at run (/home/runner/work/sponsors/sponsors/node_modules/.pnpm/[email protected]/node_modules/sponsorkit/dist/cli.cjs:[3](https://github.com/thomasbnt/sponsors/runs/5741141885?check_suite_focus=true#step:5:3)[9](https://github.com/thomasbnt/sponsors/runs/5741141885?check_suite_focus=true#step:5:9):32)
    at async Object.handler (/home/runner/work/sponsors/sponsors/node_modules/.pnpm/[email protected]/node_modules/sponsorkit/dist/cli.cjs:[13](https://github.com/thomasbnt/sponsors/runs/5741141885?check_suite_focus=true#step:5:13)0:3)
Error: Process completed with exit code 1.

How I can resolve this error?

feat: add custom hooks to add sponsors

Clear and concise description of the problem

For those who have not opened a sponsor but have received sponsorship from WeChat or other methods, I hope to have a custom hook that can pass in the user's github name and a sponsorship time, and then merge it into all sponsors.

Suggested solution

{
 customSponsors:[
  {
    username:'username',
    sponsortime:'now',
    ...
  }
 ]
}

Alternative

No response

Additional context

No response

Validations

Patreon Support

Is it possible for this to have patreon support or is it out of scope?

Text overlaping on presets.large

Describe the bug

Text overlaps on presets.large, similar to #3: https://github.com/GeopJr/GeopJr/blob/main/sponsors.svg

It was generated using GitHub actions on the latest tag using this config and this action workflow

Reproduction

The above mentioned workflow, config and github login should reproduce it

System Info

(This is from action runner)


  System:
    OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
    CPU: (2) x64 Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
    Memory: 5.86 GB / 6.78 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.15.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.5.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 111.0.5563.146
    Chromium: 111.0.5547.0
    Firefox: 111.0.1

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

OpenCollective subscriptions don't expire

Describe the bug

sponsorkit fetches the members of a collective on OpenCollective. This includes previous sponsors that are no longer active.

Additionally, the monthly amount is also off:

On OpenCollective, it is possible to change the amount associated with a tier on OpenCollective (unlike GitHub Sponsors, which requires tiers to be retired to change their amounts). The currently logic will return the current amount of the tier, not the amount actually payed by the sponsor.

If a sponsor didn't pay as part of a tier, then the total amount contributed by that sponsor is returned as the monthly price, which will lead to a much higher placement in the tiers.

The same applies to individual accounts (#32).

Reproduction

Fetch sponsors for https://opencollective.com/cheerio

System Info

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Past GitHub sponsors are randomly generated

Describe the bug

I have a cron workflow which is supposed to refresh github sponsors every night.

However, I see that every night it's generating a new image and committing the changes, leading to polluting the master branch.
When I check the svg file diff, it's just about swapping the places of the past sponsors.

image

I think the sponsorkit should stable sort the fetched sponsors, so that the images are generated in the same way, so that the cron workflow will skip commit as no changes detected by git.

In local mode, cache.json plays the role of the moderator, detecting no changes in fetched data.
However, in a cron workflow it might be harder to achieve.
If I delete it, it's again randomizing order of past sponsors.

Reproduction

https://github.com/MichalLytek/type-graphql/blob/master/.github/workflows/sponsor.yml

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD Ryzen 7 5700X 8-Core Processor
    Memory: 12.78 GB / 15.58 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.19.0/bin/yarn
    npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Patreon not saving sponsors

Describe the bug

Patreon sponsors are not saved

Reproduction

https://github.com/anubra266/static

System Info

Github action and locally

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

`[email protected]` is not published on npm

Describe the bug

The latest version of sponsorkit on npm is still 0.9.1

Reproduction

https://www.npmjs.com/package/sponsorkit?activeTab=versions

System Info

System:
    OS: macOS 14.4
    CPU: (12) arm64 Apple M2 Max
    Memory: 1.34 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.0 - ~/Library/Caches/fnm_multishells/31908_1710819745664/bin/node
    Yarn: 1.22.21 - ~/Library/Caches/fnm_multishells/31908_1710819745664/bin/yarn
    npm: 10.2.3 - ~/Library/Caches/fnm_multishells/31908_1710819745664/bin/npm
    pnpm: 8.15.4 - ~/Library/Caches/fnm_multishells/31908_1710819745664/bin/pnpm
    bun: 1.0.31 - ~/.npm-global/bin/bun
  Browsers:
    Chrome: 122.0.6261.129
    Chrome Canary: 124.0.6366.1
    Safari: 17.4

Used Package Manager

n/a

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Display the past sponsors.

Clear and concise description of the problem

Maybe we can display the past sponsors because I saw GitHub shows it in the sponsor profile.

Suggested solution

    {
      title: 'Past Sponsors',
      monthlyDollars: -1,
      preset: presets.base,
    },

Alternative

No response

Additional context

No response

Validations

Allow to provide raw entries manually

Clear and concise description of the problem

I have a use case where the company will "sponsor" privately. There will be no records of it on Patreon / GitHub / etc. It would be great to allow providing a raw list of sponsors that are maintained manually.

Suggested solution

I think this could be implemented either via a "JSON" provider - that reads the contents from a JSON file, or manual entries that could be placed directly on the sponsor.config.ts file.

The advantage of using the sponsor.config.ts is that auto-completion would make it easy to manually write entries. Implementing via JSON provider in the other hand would allow some custom automation to generate the raw entries.

Alternative

No response

Additional context

Please let me know what you think, I'd love to contribute with a PR for this.

Validations

Afadian [ๅ”ฎๅ–ๅ•†ๅ“] don't expire

Describe the bug

The json is

 {
    "sponsor": {
      "type": "User",
      "login": "2f81b9544cc211eab9b352540025c377",
      "name": "bi8bo",
      "avatarUrl": "https://pic1.afdiancdn.com/user/2f81b9544cc211eab9b352540025c377/avatar/36cb8815b17691ea6dcb76e4a7cdca4b_w640_h640_s46.jpg",
      "linkUrl": "https://afdian.net/u/2f81b9544cc211eab9b352540025c377"
    },
    "monthlyDollars": 12.307692307692308,
    "privacyLevel": "PUBLIC",
    "tierName": "Afdian",
    "createdAt": "2022-02-27T05:48:54.000Z",
    "expireAt": "2036-12-31T16:00:00.000Z",
    "isOneTime": true,
    "provider": "afdian",
    "raw": {
      "sponsor_plans": [
        {
          "can_ali_agreement": 0,
          "plan_id": "08eb414c930711ec8d4d52540025c377",
          "rank": 2147483647,
          "user_id": "e97ad8460df611eab74952540025c377",
          "status": 1,
          "name": "",
          "pic": "",
          "desc": "",
          "price": "80.00",
          "update_time": 1645441896,
          "timing": {
            "timing_on": 0,
            "timing_off": 0
          },
          "pay_month": 1,
          "show_price": "80.00",
          "show_price_after_adjust": "",
          "has_coupon": 0,
          "coupon": [],
          "favorable_price": -1,
          "independent": 0,
          "permanent": 0,
          "can_buy_hide": 1,
          "need_address": 0,
          "product_type": 1,
          "sale_limit_count": -1,
          "need_invite_code": false,
          "bundle_stock": 0,
          "bundle_sku_select_count": 0,
          "config": {},
          "has_plan_config": 0,
          "expire_time": 2114352000,
          "sku_processed": [
            {
              "sku_id": "08fdc2b8930711ecb30352540025c377",
              "count": 1,
              "name": "้ป˜่ฎคๅž‹ๅท",
              "album_id": "",
              "pic": "",
              "stock": ""
            }
          ],
          "rankType": 30
        }
      ],
      "current_plan": {
        "can_ali_agreement": 0,
        "plan_id": "08eb414c930711ec8d4d52540025c377",
        "rank": 2147483647,
        "user_id": "e97ad8460df611eab74952540025c377",
        "status": 1,
   "name": "",
          "pic": "",
          "desc": "",
        "price": "80.00",
        "update_time": 1645441896,
        "timing": {
          "timing_on": 0,
          "timing_off": 0
        },
        "pay_month": 1,
        "show_price": "80.00",
        "show_price_after_adjust": "",
        "has_coupon": 0,
        "coupon": [],
        "favorable_price": -1,
        "independent": 0,
        "permanent": 0,
        "can_buy_hide": 1,
        "need_address": 0,
        "product_type": 1,
        "sale_limit_count": -1,
        "need_invite_code": false,
        "bundle_stock": 0,
        "bundle_sku_select_count": 0,
        "config": {},
        "has_plan_config": 0,
        "expire_time": 2114352000,
        "sku_processed": [
          {
            "sku_id": "08fdc2b8930711ecb30352540025c377",
            "count": 1,
            "name": "้ป˜่ฎคๅž‹ๅท",
            "album_id": "",
            "pic": "",
            "stock": ""
          }
        ],
        "rankType": 30
      },
      "all_sum_amount": "80.00",
      "first_pay_time": 1645940934,
      "last_pay_time": 1645940934,
      "user": {
        "user_id": "2f81b9544cc211eab9b352540025c377",
        "name": "bi8bo",
        "avatar": "https://pic1.afdiancdn.com/user/2f81b9544cc211eab9b352540025c377/avatar/36cb8815b17691ea6dcb76e4a7cdca4b_w640_h640_s46.jpg",
        "user_private_id": "cef6ca339705e53384f3867031edc5844d5873ee"
      }
    }
  },

This is the [ๅ”ฎๅ–ๅ•†ๅ“](https://afdian.net/setting/shop), and for a onetime sponsor. But not expired.

    "createdAt": "2022-02-27T05:48:54.000Z",
    "expireAt": "2036-12-31T16:00:00.000Z",
    "isOneTime": true,

Reproduction

I cannot provide reproduction. There is already a complete JSON above, or you can add product sales on "็ˆฑๅ‘็”ต"

System Info

System:
    OS: macOS 14.0
    CPU: (8) arm64 Apple M2
    Memory: 192.31 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/.n/bin/node
    Yarn: 1.22.19 - ~/.n/bin/yarn
    npm: 8.19.4 - ~/.n/bin/npm
    pnpm: 8.7.0 - ~/.n/bin/pnpm
    Watchman: 2023.09.04.00 - /opt/homebrew/bin/watchman
  Browsers:
    Safari: 17.0

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

GitHub Tier is null

Describe the bug

When I launch sponsorkit, I get this error:

TypeError: Cannot read properties of null (reading 'isOneTime')
    at xxx/node_modules/.pnpm/[email protected]/node_modules/sponsorkit/dist/index.cjs:478:25

Looking more into it, it seems that GitHub is returning null to the tier field now!

query {
  organization(login: "MY_ORG") {
    sponsorshipsAsMaintainer(first: 100) {
      totalCount
      pageInfo {
        endCursor
        hasNextPage
      }
      nodes {
        createdAt
        privacyLevel
        tier {             # <-- This field is null
          name
          isOneTime
          monthlyPriceInCents
          monthlyPriceInDollars
        }
        sponsorEntity {
          __typename
          ...on Organization {
            login
            name
            avatarUrl
            websiteUrl
          }
          ...on User {
            login
            name
            avatarUrl
            websiteUrl
          }
        }
      }
    }
  }
}

I did check in the online https://docs.github.com/en/graphql/overview/explorer of github, and yes, I get all sponsors, but no tier information (it's null).

I don't know from when, as it was working well before ๐Ÿ‘
Any idea of where to ask for GitHub API changes ?

Should this case of tier null be handle? (I could do a PR, but I'm not sure it's wanted... as we lose a lot of info.)
Let me know

Reproduction

https://github.com/HoudiniGraphql/sponsors

System Info

System:
    OS: macOS 14.2.1
    CPU: (12) arm64 Apple M3 Pro
    Memory: 372.11 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.2.0 - ~/.nvm/versions/node/v21.2.0/bin/node
    Yarn: 1.22.21 - ~/.nvm/versions/node/v21.2.0/bin/yarn
    npm: 10.2.3 - ~/.nvm/versions/node/v21.2.0/bin/npm
    pnpm: 8.10.5 - ~/Library/pnpm/pnpm
    bun: 1.0.12 - ~/.bun/bin/bun
  Browsers:
    Chrome: 121.0.6167.160
    Safari: 17.2.1

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

Hello!

I've tried running the example and ended up with the following error when running the CLI:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:363:5)
    at validateString (node:internal/validators:119:11)
    at Object.resolve (node:path:1102:7)
    at run (/Users/remirousselet/dev/rrousselgit/freezed/node_modules/sponsorkit/dist/cli.cjs:34:20)
    at async Object.handler (/Users/remirousselet/dev/rrousselgit/freezed/node_modules/sponsorkit/dist/cli.cjs:132:3) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Diving into the sources, the problem appears to be the loadConfig function, and how loadEnv sets outputDir to undefined, which ends-up overriding the default config

TL;DR what happens is:

const defaultConfig = { outputDir: 'Hello' }
const env = { outputDir: undefined }

function loadConfig() {
  return {
    ...defaultConfig,
    ...env
  }
}


console.log(loadConfig()) // { outputDir: undefined }

The API of get past sponsors is supported by official.

Describe the bug

https://github.com/orgs/community/discussions/38393#discussioncomment-4585678

Reproduction

_

System Info

_

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.