Skip to content

Commit

Permalink
Developer Ease Of Use Pt. 2 (#77)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
Michael Cohen and Meemaw authored May 5, 2022
1 parent 70d1878 commit a9e3939
Show file tree
Hide file tree
Showing 9 changed files with 3,835 additions and 4,892 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ProjectOpenSea/developer-experience
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
npx lint-staged
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn check-types
npm run check-types
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ A Javascript SDK for receiving updates from the OpenSea Stream API - pushed over

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.

# Setup
# Installation

Run `nvm use`
And then `npm install`
We recommend switching to Node.js version 16 to make sure common crypto dependencies work. Our minimum supported version is 16.11.0.

- Install this package with `npm install @opensea/stream-js`

# Getting Started

Expand Down
95 changes: 95 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Contributing to OpenSea Stream API JS SDK

## Developing

We PR off of feature branches that get submitted to `main`. This is the branch that all pull
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.

To develop locally:

1. [clone](https://help.github.com/articles/cloning-a-repository/) this repo to your local device.

```sh
git clone https://github.com/ProjectOpenSea/stream-js
```

2. Create a new branch:
```
git checkout -b MY_BRANCH_NAME
```
3. If you have Node Version Manager, run `nvm use` to ensure a compatible version is being used.

4. Install the dependencies with:
```
npm install
```
5. Start developing and watch for code changes:
```
npm run dev
```
6. Look into `package.json` to see what other run configurations (such as `test`, `check-types`, and `lint:check`) you can use.

## Building

You can build the project, including all type definitions, with:

```bash
npm run build
```

### Running tests

```sh
yarn test
```

### Linting

To check the formatting of your code:

```sh
npm run prettier
```

If you get errors, you can fix them with:

```sh
npm run prettier:fix
```

### Set as a local dependency in package.json

While developing and debugging changes to this SDK, you can 'test-run' them locally inside another package using `npm link`.

1. Inside this repo, run

```sh
npm link
```

2. In your other package's root directory, make sure to remove `@opensea/stream-js` from `node_modules` with:

```sh
rm -rf ./node_modules/@opensea/stream-js
```

3. In your other package's root directory, run:

```sh
npm link @opensea/stream-js
```

to re-install all of the dependencies.

Note that this SDK will be copied from the locally compiled version as opposed to from being downloaded from the NPM registry.

4. Run your application as you normally would.

## Publishing

Repository admins can use `npm version patch` to create a new patch version.

- For minor version updates, use `npm version minor`.
- For major version updates, use `npm version major`.

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).
14 changes: 4 additions & 10 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
---
title: OpenSea Stream API SDK
excerpt: Documentation for the Javascript SDK for the OpenSea Stream API.
category: 5b62171c27d11100030d47d8
slug: openssea-stream-api-sdk
---

# OpenSea Stream API - JavaScript SDK

[![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)
Expand All @@ -22,10 +15,11 @@ A Javascript SDK for receiving updates from the OpenSea Stream API - pushed over

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.

# Setup
# Installation

We recommend switching to Node.js version 16 to make sure common crypto dependencies work. Our minimum supported version is 16.11.0.

Run `nvm use`
And then `npm install`
- Install this package with `npm install @opensea/stream-js`

# Getting Started

Expand Down
Loading

0 comments on commit a9e3939

Please sign in to comment.