Skip to content

Commit a9e3939

Browse files
Michael CohenMeemaw
andauthored
Developer Ease Of Use Pt. 2 (#77)
* 0.0.6 * Replace package-lock.json with yarn.lock * v0.0.5 * Enforce minimum version and tsconfig updates to improve ease-of-use * update yarn command * Fix imports, back to npm, contributing.md * Update package.json Co-authored-by: Matej Šnuderl <[email protected]> * Reverting export style + fix contributing.md * 0.0.6 Co-authored-by: Matej Šnuderl <[email protected]>
1 parent 70d1878 commit a9e3939

File tree

9 files changed

+3835
-4892
lines changed

9 files changed

+3835
-4892
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @ProjectOpenSea/developer-experience

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn lint-staged
4+
npx lint-staged

.husky/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn check-types
4+
npm run check-types

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ A Javascript SDK for receiving updates from the OpenSea Stream API - pushed over
1515

1616
This is a best effort delivery messaging system. Messages that are not received due to connection errors will not be re-sent. Messages may be delievered out of order. This SDK is offered as a beta experience as we work with developers in the ecosystem to make this a more robust and reliable system.
1717

18-
# Setup
18+
# Installation
1919

20-
Run `nvm use`
21-
And then `npm install`
20+
We recommend switching to Node.js version 16 to make sure common crypto dependencies work. Our minimum supported version is 16.11.0.
21+
22+
- Install this package with `npm install @opensea/stream-js`
2223

2324
# Getting Started
2425

contributing.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Contributing to OpenSea Stream API JS SDK
2+
3+
## Developing
4+
5+
We PR off of feature branches that get submitted to `main`. This is the branch that all pull
6+
requests should be made against. Version releases are bumped using `npm version patch`. Make sure to include the `Developer-Experience` team on any PR you submit.
7+
8+
To develop locally:
9+
10+
1. [clone](https://help.github.com/articles/cloning-a-repository/) this repo to your local device.
11+
12+
```sh
13+
git clone https://github.com/ProjectOpenSea/stream-js
14+
```
15+
16+
2. Create a new branch:
17+
```
18+
git checkout -b MY_BRANCH_NAME
19+
```
20+
3. If you have Node Version Manager, run `nvm use` to ensure a compatible version is being used.
21+
22+
4. Install the dependencies with:
23+
```
24+
npm install
25+
```
26+
5. Start developing and watch for code changes:
27+
```
28+
npm run dev
29+
```
30+
6. Look into `package.json` to see what other run configurations (such as `test`, `check-types`, and `lint:check`) you can use.
31+
32+
## Building
33+
34+
You can build the project, including all type definitions, with:
35+
36+
```bash
37+
npm run build
38+
```
39+
40+
### Running tests
41+
42+
```sh
43+
yarn test
44+
```
45+
46+
### Linting
47+
48+
To check the formatting of your code:
49+
50+
```sh
51+
npm run prettier
52+
```
53+
54+
If you get errors, you can fix them with:
55+
56+
```sh
57+
npm run prettier:fix
58+
```
59+
60+
### Set as a local dependency in package.json
61+
62+
While developing and debugging changes to this SDK, you can 'test-run' them locally inside another package using `npm link`.
63+
64+
1. Inside this repo, run
65+
66+
```sh
67+
npm link
68+
```
69+
70+
2. In your other package's root directory, make sure to remove `@opensea/stream-js` from `node_modules` with:
71+
72+
```sh
73+
rm -rf ./node_modules/@opensea/stream-js
74+
```
75+
76+
3. In your other package's root directory, run:
77+
78+
```sh
79+
npm link @opensea/stream-js
80+
```
81+
82+
to re-install all of the dependencies.
83+
84+
Note that this SDK will be copied from the locally compiled version as opposed to from being downloaded from the NPM registry.
85+
86+
4. Run your application as you normally would.
87+
88+
## Publishing
89+
90+
Repository admins can use `npm version patch` to create a new patch version.
91+
92+
- For minor version updates, use `npm version minor`.
93+
- For major version updates, use `npm version major`.
94+
95+
When creating a new version, submit a PR listing all the chanages that you'd like to roll out with this change (since the last major version).

docs/README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
---
2-
title: OpenSea Stream API SDK
3-
excerpt: Documentation for the Javascript SDK for the OpenSea Stream API.
4-
category: 5b62171c27d11100030d47d8
5-
slug: openssea-stream-api-sdk
6-
---
7-
81
# OpenSea Stream API - JavaScript SDK
92

103
[![https://badges.frapsoft.com/os/mit/mit.svg?v=102](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://opensource.org/licenses/MIT)
@@ -22,10 +15,11 @@ A Javascript SDK for receiving updates from the OpenSea Stream API - pushed over
2215

2316
This is a best effort delivery messaging system. Messages that are not received due to connection errors will not be re-sent. Messages may be delievered out of order. This SDK is offered as a beta experience as we work with developers in the ecosystem to make this a more robust and reliable system.
2417

25-
# Setup
18+
# Installation
19+
20+
We recommend switching to Node.js version 16 to make sure common crypto dependencies work. Our minimum supported version is 16.11.0.
2621

27-
Run `nvm use`
28-
And then `npm install`
22+
- Install this package with `npm install @opensea/stream-js`
2923

3024
# Getting Started
3125

0 commit comments

Comments
 (0)