Skip to content

Commit

Permalink
Merge pull request #513 from xmtp/rygine/update-docs
Browse files Browse the repository at this point in the history
Update CONTRIBUTING docs, remove unused scripts, cleanup `package.json`
  • Loading branch information
rygine authored Jan 10, 2024
2 parents 581cd47 + 78f979f commit 2861504
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 48 deletions.
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.14.0
48 changes: 25 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,48 @@
# Contributing

If you're seeing this document, you are an early contributor to the development and success of XMTP. We welcome your questions, feedback, suggestions, and code contributions.
Thank you for considering contributing to this repo! Community contributions like yours are key to the development and adoption of XMTP. Your questions, feedback, suggestions, and code contributions are welcome!

## ❔ Questions

Have a question? We welcome you to ask it in [Q&A discussions](https://github.com/orgs/xmtp/discussions/categories/q-a).
Have a question about how to build with XMTP? Ask your question and learn with the community in the [XMTP Community Forums](https://community.xmtp.org/).

## 🐞 Bugs

Bugs should be reported as GitHub Issues. Please confirm there isn't already an open issue and include detailed steps to reproduce.
Report a bug using [GitHub Issues](https://github.com/xmtp/xmtp-js/issues).

## ✨ Feature Requests

These should also be submitted as GitHub Issues. Again, please confirm there isn't already an open issue. Let us know what use cases this feature would unlock so that we can investigate and prioritize.
Request a feature using [GitHub Issues](https://github.com/xmtp/xmtp-js/issues).

## 🔀 Pull Requests

PRs are encouraged, but we suggest starting with a Feature Request to temperature-check first. If the PR would involve a major change to the protocol, it should be fleshed out as an [XMTP Improvement Proposal](https://github.com/xmtp/XIPs/blob/main/XIPs/xip-0-purpose-process.md) before work begins.
PRs are encouraged, but consider starting with a feature request to temperature-check first. If the PR involves a major change to the protocol, the work should be fleshed out as an [XMTP Improvement Proposal](https://community.xmtp.org/t/xip-0-xip-purpose-process-guidelines/475) before work begins.

After a pull request is submitted, a single approval is required to merge it.

## 🔧 Developing

### Testing and validation
### Prerequisites

#### Node

Please add unit tests for your feature, and ensure that all unit tests are passing before submitting a pull request. All test commands are described in `package.json` and executed via `npm run <command>`. Note that the unit tests require a backend node to be running locally - the `test:setup` step can be run a single time to start the node in the background, and `test` can be run as many times as desired afterwards.
Please make sure you have a compatible version as specified in `package.json`. We recommend using a Node version manager such as [nvm](https://github.com/nvm-sh/nvm) or [nodenv](https://github.com/nodenv/nodenv).

Manual validation requires setting up a client app such as the [example app](https://github.com/xmtp/example-chat-react). Once you have cloned and run the example app, it will use a published npm version of `xmtp-js` by default. You can point it to your local `xmtp-js` repository by running `npm i file:~/path/to/xmtp-js` from the `example-chat-react` directory, which will update its `package.json`. Once the example app is running, any further changes you make to `xmtp-js` will be reflected in the app after you run `npm build` in the `xmtp-js` directory and then reload the app.
### Useful commands

After a pull request is submitted, a single approval is required to merge it.
- `npm install`: Installs all dependencies
- `npm run bench`: Run the benchmarking suite
- `npm run build`: Builds all SDK packages
- `npm test`: Run the unit test suite
- `npm run test:setup`: Start a local development node using Docker (only needs to be run once)
- `npm run lint`: Lint with ESLint
- `npm run typecheck`: Typecheck with `tsc`

### Testing and validation

Please add unit tests when appropriate and ensure that all unit tests are passing before submitting a pull request. Note that some unit tests require a backend node to be running locally. The `test:setup` command can be run a single time to start the node in the background using Docker.

Manual validation requires setting up a client app such as the [example app](https://github.com/xmtp/example-chat-react). Once you have cloned and run the example app, it will use a published npm version of `xmtp-js` by default. You can point it to your local `xmtp-js` repository by running `npm i file:~/path/to/xmtp-js` from the `example-chat-react` directory, which will update its `package.json`. Once the example app is running, any further changes you make to `xmtp-js` will be reflected in the app after you run `npm run build` in the `xmtp-js` directory and then reload the app.

### Auto-releasing and commit conventions

Expand Down Expand Up @@ -54,17 +70,3 @@ If your commit messages are not to your liking, it is permitted to rewrite the h
[push]
default = simple
```

### Prerequisites

#### Node

Please make sure you have a Node version compatible with that specified in the root `.nvmrc` file. We recommend using `nvm` to manage local node versions - find install instructions appropriate for your system [here](https://github.com/nvm-sh/nvm#installing-and-updating).

#### Buf

You will need to install [Buf](https://buf.build/) in your environment in order to `npm build` this package from source.

```bash
brew install bufbuild/buf/buf
```
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@
"build:web": "tsup --platform browser --target esnext",
"build:bundler": "tsup --config tsup.bundler.config.ts",
"build:docs": "rimraf docs && mkdir -p tmp && cp README.md tmp/ && sed -i.bak '/badge.svg/d' tmp/README.md && typedoc --excludePrivate --readme tmp/README.md src/index.ts",
"clean": "npm run clean:dist && npm run clean:proto",
"clean": "npm run clean:dist",
"clean:dist": "rimraf dist",
"clean:proto": "rimraf -g src/proto/*.ts",
"package": "npm pack",
"prepublishOnly": "npm run build",
"updateSnapVersion": "npm view @xmtp/snap --json | jq '{\"version\": .version, \"package\": .name}' > ./src/snapInfo.json",
Expand All @@ -73,7 +72,9 @@
"dist/index.js",
"dist/index.js.map",
"dist/web/index.js",
"dist/web/index.js.map"
"dist/web/index.js.map",
"dist/bundler/index.js",
"dist/bundler/index.js.map"
],
"keywords": [
"xmtp",
Expand Down
22 changes: 0 additions & 22 deletions script/buf.sh

This file was deleted.

0 comments on commit 2861504

Please sign in to comment.