diff --git a/examples/snippets/README.md b/examples/snippets/README.md index 05216ba79f..afb31345d1 100644 --- a/examples/snippets/README.md +++ b/examples/snippets/README.md @@ -1,13 +1,13 @@ ## Setup -1. From the stripe-node root folder, run `yarn build` to build the modules. +1. From the stripe-node root folder, run `yarn build` or `yarn build-dev` to build the modules. `yarn build-dev` produces source maps for each of the SDK .ts files. This is optional but very useful when troubleshooting SDK behavior. 2. Then, from this snippets folder, run `yarn` to install node dependencies for the example snippets. This will reference the local Stripe SDK modules created in step 1. If on step 2 you see an error `Error: unsure how to copy this: /Users/jar/stripe/sdks/node/.git/fsmonitor--daemon.ipc`: run `rm /path/to/node/sdk/.git/fsmonitor--daemon.ipc && yarn` This file is used by a file monitor built into git. Removing it temporarily does not seem to affect its operation, and this one liner will let `yarn` succeed. -Note that if you modify the stripe-node code, you must delete your snippets `node_modules` folder and rerun these steps. +Note that if you modify the stripe-node code, rerun step 1 and then run `yarn upgrade stripe` from this folder to pull in the new built package. ## Running an example diff --git a/examples/snippets/package.json b/examples/snippets/package.json index ba3738f172..386c40adb4 100644 --- a/examples/snippets/package.json +++ b/examples/snippets/package.json @@ -6,7 +6,7 @@ "license": "ISC", "dependencies": { "express": "^4.21.0", - "stripe": "file:../../", + "stripe": "file:../..", "ts-node": "^10.9.2", "typescript": "^5.6.2" } diff --git a/examples/snippets/yarn.lock b/examples/snippets/yarn.lock index 622721e44e..237eb79535 100644 --- a/examples/snippets/yarn.lock +++ b/examples/snippets/yarn.lock @@ -48,9 +48,9 @@ integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== "@types/node@>=8.1.0": - version "22.6.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.6.1.tgz#e531a45f4d78f14a8468cb9cdc29dc9602afc7ac" - integrity sha512-V48tCfcKb/e6cVUigLAaJDAILdMP0fUW6BidkPK4GpGjXcfbnoHasCZDwz3N3yVt5we2RHm4XTQCpv0KJz9zqw== + version "22.7.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.4.tgz#e35d6f48dca3255ce44256ddc05dee1c23353fcc" + integrity sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg== dependencies: undici-types "~6.19.2" @@ -524,7 +524,7 @@ statuses@2.0.1: integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== "stripe@file:../..": - version "16.12.0" + version "17.0.0" dependencies: "@types/node" ">=8.1.0" qs "^6.11.0" diff --git a/package.json b/package.json index 3e0097d0f1..ab21af0f07 100644 --- a/package.json +++ b/package.json @@ -61,8 +61,11 @@ "license": "MIT", "scripts": { "build": "yarn build-esm && yarn build-cjs", + "build-dev": "yarn build-esm-dev && yarn build-cjs-dev", "build-esm": "mkdir -p esm && tsc -p tsconfig.esm.json && echo '{\"type\":\"module\"}' > esm/package.json", + "build-esm-dev": "mkdir -p esm && tsc -p tsconfig.esm.json --sourceMap true && echo '{\"type\":\"module\"}' > esm/package.json", "build-cjs": "mkdir -p cjs && tsc -p tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > cjs/package.json", + "build-cjs-dev": "mkdir -p cjs && tsc -p tsconfig.cjs.json --sourceMap true && echo '{\"type\":\"commonjs\"}' > cjs/package.json", "clean": "rm -rf ./.nyc_output ./node_modules/.cache ./coverage ./esm ./cjs", "prepack": "yarn install && yarn build", "mocha": "nyc mocha",