Skip to content

Commit 2f607e4

Browse files
authored
Add just recipe to build with source maps (#2202)
1 parent 77b5190 commit 2f607e4

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

examples/snippets/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Setup
22

3-
1. From the stripe-node root folder, run `yarn build` to build the modules.
3+
1. From the stripe-node root folder, run `just build` or `just build-dev` to build the modules. `just build-dev` produces source maps for each of the SDK .ts files. This is optional but very useful when troubleshooting SDK behavior.
44
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.
55

66
If on step 2 you see an error `Error: unsure how to copy this: /Users/jar/stripe/sdks/node/.git/fsmonitor--daemon.ipc`:

justfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,23 @@ integrations-test: build
2727
# run the full test suite; you probably want `test`
2828
ci-test: install test types-test integrations-test
2929

30-
_build mode packageType: install
30+
_build mode packageType tscArgs: install
3131
mkdir -p {{ mode }}
32-
tsc -p tsconfig.{{ mode }}.json
32+
tsc -p tsconfig.{{ mode }}.json {{ tscArgs }}
3333
echo '{"type":"{{ packageType }}"}' > {{ mode }}/package.json
3434

3535
[private]
36-
build-esm: (_build "esm" "module")
36+
build-esm *args="": (_build "esm" "module" args)
3737

3838
[private]
39-
build-cjs: (_build "cjs" "commonjs")
39+
build-cjs *args="": (_build "cjs" "commonjs" args)
4040

4141
# generate CJS and ESM versions of the package; mostly used as a pre-req for other steps
4242
build: build-esm build-cjs
4343

44+
# generate CJS and ESM versions of the package including sourceMaps for each build
45+
build-dev: (build-esm "--sourceMap" "true") (build-cjs "--sourceMap" "true")
46+
4447
# ⭐ run style checks, fixing issues if possible
4548
lint: (lint-check "--fix")
4649

0 commit comments

Comments
 (0)