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

stripe apps create fails inside monorepo with non-SPDX license in root package.json #865

Open
tvanantwerp opened this issue Jul 3, 2023 · 0 comments
Labels

Comments

@tvanantwerp
Copy link

Describe the bug
When using a monorepo with a root-level package.json with a non-SPDX license (e.g., the ~~proprietary~~ license specified in a generated Stripe App package.json), the Stripe App creation script fails with the following error:

🖊️ Enter details of your new Stripe app (these can be changed later)
App ID: com.example.stripe-app
Display name: Stripe App
✔ Created skeleton files
✔ Created default view
✔ Wrote package.json
yarn add v1.22.19
warning ../../package.json: License should be a valid SPDX license expression
info No lockfile found.
warning [email protected]: License should be a valid SPDX license expression
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
error Workspaces can only be enabled in private projects.
exit status 1

This failure results in an unfinished Stripe App setup. It does generate a package.json and several supporting files, but it is incomplete. I've only noticed problems with the package.json file, such as these below:

  "dependencies": null,
  "engines": {
    "node": "\u003e=14"
  },

No yarn.lock file is generated on error.

I've been able to replicate this error for both pnpm workspaces and yarn workspaces.

To Reproduce
Steps to reproduce the behavior:

  1. Create a monorepo directory, e.g., mkdir my-stripe-app-monorepo
  2. Initialize a new Node project by creating a package.json
  3. Change the license to a non-SPDX license, e.g. ~~proprietary~~
  4. Set up workspaces
    • Create a packages directory
    • For yarn: add the following to package.json
      "workspaces": [
        "packages/*"
      ]
      
    • For pnpm: create pnpm-workspaces.yml and add the following:
      packages:
          - 'packages/*'
      
  5. cd packages and run stripe apps create my_stripe_app

Expected behavior
Creation of a new Stripe App as a monorepo package should not fail if it doesn't recognize the root-level package.json's license field as an SPDX license.

Desktop (please complete the following information):

  • OS: macOS 13.4.1
  • yarn: 1.22.19
  • pnpm: 8.6.6
  • Stripe CLI: 1.15.0
  • Stripe Apps CLI: 1.5.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants