Skip to content

Commit cd26d80

Browse files
authored
Updates after post-mortem (#12)
1 parent d0dcd09 commit cd26d80

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### What
2+
3+
** CHANGEME: What are you changing? **
4+
5+
### Why
6+
7+
** CHANGEME: Why are these changes needed? **
8+
9+
### SDK Release Checklist
10+
11+
- [ ] Have you added an integration test for the changes?
12+
- [ ] Have you built the gem locally and made queries against it successfully?

.github/workflows/publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ jobs:
1717
run: npm install
1818
- name: Build package
1919
run: npm run build
20+
- name: Run tests
21+
env:
22+
SANDBOX_API_KEY: ${{ secrets.SANDBOX_API_KEY }}
23+
run: npm test
2024
- name: Publish package
2125
run: npm publish --access public
2226
env:

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,57 @@ patch.preferences.deletePreference(preferenceId);
138138
const page = 1; // Pass in which page of preferences you'd like
139139
patch.preferences.retrievePreferences({ page });
140140
```
141+
142+
## Development
143+
144+
### Build and manually test
145+
146+
To build and test the package locally, run:
147+
148+
```
149+
$ npm run build
150+
```
151+
152+
This will generate a `dist` folder with the compiled code. Next you want to link the package and use it in a different folder.
153+
154+
In the patch-node folder, run:
155+
156+
```
157+
$ npm link
158+
```
159+
160+
Navigate to a different, empty folder:
161+
162+
```
163+
$ cd ..
164+
$ mkdir test-patch-node
165+
$ cd test-patch-node
166+
```
167+
168+
In that repository, run the following command to use the locally built package:
169+
170+
```
171+
$ npm link @patch-technology/patch
172+
```
173+
174+
This will create a `node_modules` directory in your test repository which will symlink to your locally built package. To test out the package, open a node REPL and import the package and run some queries.
175+
176+
```
177+
$ node
178+
> const Patch = require('@patch-technology/patch')
179+
> Patch.default('<PATCH_API_KEY>').projects.retrieveProjects().then((response) => console.log(response))
180+
```
181+
182+
### Run the specs
183+
184+
Before running the tests, make sure you set the test API key! (please use test API keys and not production ones, they usually start with `key_test_`)
185+
186+
```
187+
$ export SANDBOX_API_KEY=<PATCH_TEST_API_KEY>
188+
```
189+
190+
Then you are ready to run the tests:
191+
192+
```
193+
$ npm run test
194+
```

0 commit comments

Comments
 (0)