From 90b56f874e8f859530ad60b1bfbd4c8cdd8a1caf Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Wed, 10 Jan 2024 11:45:37 -0600 Subject: [PATCH 1/5] chore: remove unused buf script --- script/buf.sh | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100755 script/buf.sh diff --git a/script/buf.sh b/script/buf.sh deleted file mode 100755 index 5e96c8fcf..000000000 --- a/script/buf.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -# Based loosely off of the script here https://docs.buf.build/ci-cd/setup -# Fixed a bug in their script + added support for checking if buf is already installed - -set -eu - -if which buf &>/dev/null; then - echo "Existing buf version found. No need to install" - exit 0 -fi - - -# Use your desired buf version -BUF_VERSION=1.0.0 -# Putting this in a location likely to already be in the $PATH -BIN_DIR="$npm_config_prefix/bin" - -URL="https://github.com/bufbuild/buf/releases/download/v$BUF_VERSION/buf-$(uname -s)-$(uname -m)" -echo "Downloading buf from $URL" - -curl -sSL $URL -o "$BIN_DIR/buf" -chmod +x "$BIN_DIR/buf" From a51324403bf4eafb2f81c3df21f976e0aa9d96ba Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Wed, 10 Jan 2024 11:45:59 -0600 Subject: [PATCH 2/5] chore: add `.node-version` file --- .node-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .node-version diff --git a/.node-version b/.node-version new file mode 100644 index 000000000..e6db45a90 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +18.14.0 From cbc382ab465101201ab41ac28fc8138153cfdaaa Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Wed, 10 Jan 2024 11:56:39 -0600 Subject: [PATCH 3/5] chore: remove `clean:proto` command --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 79d096d53..b16011571 100644 --- a/package.json +++ b/package.json @@ -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", From 32333555e91ae227add56d3425293d533bbcb43c Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Wed, 10 Jan 2024 11:57:13 -0600 Subject: [PATCH 4/5] fix: fix `files` key in `package.json` --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b16011571..d70ea03a4 100644 --- a/package.json +++ b/package.json @@ -72,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", From 78f979f17aa5dcdae46b746804c38efeaebbc3a8 Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Wed, 10 Jan 2024 11:57:45 -0600 Subject: [PATCH 5/5] docs: update CONTRIBUTING.md --- CONTRIBUTING.md | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 039feae71..ea2ce85c0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 `. 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 @@ -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 -```