Skip to content

Commit 1a1faf0

Browse files
committed
Adding npm link docs
1 parent 314b644 commit 1a1faf0

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

packages/sdk/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,63 @@ The [quickstart](https://pipedream.com/docs/connect/quickstart) is the easiest w
1919
## Example app
2020

2121
Clone and run the [example app](https://github.com/PipedreamHQ/pipedream-connect-examples/) to get started.
22+
23+
## Developing on the SDK
24+
25+
Clone this repo and initialize global dependencies. We use `asdf` to manage these dependencies — [install it here](https://asdf-vm.com/). Then run
26+
27+
```bash
28+
asdf install
29+
```
30+
31+
Install deps locally:
32+
33+
```bash
34+
npm i
35+
```
36+
37+
To build the package:
38+
39+
```bash
40+
npm run build
41+
```
42+
43+
You can use `npm link` to point other code to the local version of the SDK you're developing on. This lets you test the SDK in other local apps, end-to-end.
44+
45+
First run `npm link` in the `sdk` directory:
46+
47+
```bash
48+
# From repo root
49+
cd packages/sdk
50+
npm link
51+
```
52+
53+
Since we're using a fixed version of Node.js (provided by `asdf` above), this will install the package to the `asdf` Node environment. To use this package elsewhere, you'll need to use the same version of Node.js. Please reference the latest version of [the `.tool-versions` file](https://github.com/PipedreamHQ/pipedream/blob/master/.tool-versions) and add that either to the `.tool-versions` file in your local project where you'd like to use the SDK.
54+
55+
For example:
56+
57+
```bash
58+
cd your_project_directory
59+
echo `nodejs 22.10.0` >> `.tool-versions` # Please reference the latest version being used in the Pipedream public repo
60+
```
61+
62+
Then, in your local project, run
63+
64+
```bash
65+
npm link @pipedream/sdk
66+
```
67+
68+
To confirm you successfully installed the correct version of the SDK, tied to your local copy of the Pipedream SDK:
69+
70+
```bash
71+
cd node_modules/@pipedream
72+
ls -l
73+
```
74+
75+
and you should see the `sdk` package pointing to your local directory:
76+
77+
```bash
78+
❯ ls -l
79+
total 0
80+
lrwxr-xr-x 1 dylburger staff 34 Oct 29 20:09 sdk -> ../../../../pipedream/packages/sdk
81+
```

0 commit comments

Comments
 (0)