You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Its not possible to deploy a stripe app using stripe apps upload from an npm workspace. A conventional structure for monorepos (for example using turborepo) would be to have multiple apps and packages in the same repository. In this setup using npm workspaces (i believe the same is true for all JS package managers) there is no compatible way to use the stripe apps CLI.
Issue
When running stripe apps upload in an npm workspace the CLI will error with
× Failed to package files
failed to find any package manager lockfiles, run yarn/npm install with a version that produces lockfiles
This is because the lockfile is not co-located with the app in a monorepo setup.
If we run the command in the project root where the lockfile is located the CLI will error with
error reading stripe app manifest file. open stripe-app.json: no such file or directory
Both make sense but this means that its not possible to host a stripe app in a monorepo without janky workarounds.
Expected Behavior
I expect the CLI to find the package-lock.json in the root of the project. Or, failing that, allow me to point the CLI to the package-lock.json or point the CLI to the stripe manifest in another location.
Steps to reproduce
Setup a turbo repo with npx create-turbo@latest.
Create an app for stripe in the apps directory and setup
Attempt stripe apps upload in the workspace directory
Workaround
I am not sure this is reliable as the package-lock.json will contain references to workspaces that are relative to the project root but this gets around the error and allows the app to upload.
#!/bin/bash
# Exit on any error
set -e
# Store original directory
ORIGINAL_DIR=$(pwd)
# Change to apps/stripe directory
cd apps/stripe
# Remove existing lock file if it exists
rm -f package-lock.json
# Copy package-lock.json from project root to apps/stripe directory
cp ../../package-lock.json ./
# Run stripe apps upload
stripe apps upload
# Remove the lock file after upload
rm -f package-lock.json
# Return to original directory
cd "$ORIGINAL_DIR"
# Exit successfully
exit 0
The text was updated successfully, but these errors were encountered:
Its not possible to deploy a stripe app using
stripe apps upload
from an npm workspace. A conventional structure for monorepos (for example using turborepo) would be to have multiple apps and packages in the same repository. In this setup using npm workspaces (i believe the same is true for all JS package managers) there is no compatible way to use the stripe apps CLI.Issue
When running
stripe apps upload
in an npm workspace the CLI will error withThis is because the lockfile is not co-located with the app in a monorepo setup.
If we run the command in the project root where the lockfile is located the CLI will error with
Both make sense but this means that its not possible to host a stripe app in a monorepo without janky workarounds.
Expected Behavior
I expect the CLI to find the package-lock.json in the root of the project. Or, failing that, allow me to point the CLI to the package-lock.json or point the CLI to the stripe manifest in another location.
Steps to reproduce
npx create-turbo@latest
.Workaround
I am not sure this is reliable as the package-lock.json will contain references to workspaces that are relative to the project root but this gets around the error and allows the app to upload.
The text was updated successfully, but these errors were encountered: