Skip to content

Commit

Permalink
Merge pull request #156 from xmtp/rygine/doc-updates
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
rygine authored Jan 10, 2024
2 parents f3f5f7b + f7ddd8e commit d39c972
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 34 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
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.14.0
41 changes: 39 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Thank you for considering contributing to this repo! Community contributions lik

## ❔ Questions

Have a question about how to build with XMTP? Ask your question and learn with the community in the [Q&A discussion forum](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

Expand All @@ -16,4 +16,41 @@ Request a feature using [GitHub Issues](https://github.com/xmtp/xmtp-web/issues)

## 🔀 Pull requests

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://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

### Prerequisites

#### Node

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).

#### Yarn

This repository uses the [Yarn package manager](https://yarnpkg.com/). To use it, enable [Corepack](https://yarnpkg.com/corepack), if it isn't already, by running `corepack enable`.

### Useful commands

- `yarn`: Installs all dependencies
- `yarn build`: Builds the `packages/react-sdk` package
- `yarn clean`: Remove all `node_modules``.turbo`, and build folders, clear Yarn cache
- `yarn quickstart`: Builds `packages/react-sdk`, then runs the `examples/react-vite` example in dev mode.
- `yarn format`: Run prettier format and write changes on all packages
- `yarn format:check`: Run prettier format check on all packages
- `yarn lint`: Lint all packages
- `yarn test`: Test all packages
- `yarn test:setup`: Start a local development node using Docker (only needs to be run once)
- `yarn typecheck`: Typecheck all packages

### 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 running a client app such as this [example app](/examples/react-vite/). The example apps use their associated SDK located in this repo. SDKs must be built before running one of its example apps. To see updates in realtime, build the SDK in watch mode, which will watch for changes and trigger a rebuild.

## 🚢 Publishing

This repository uses [changesets](https://github.com/changesets/changesets) to publish updates. Pull requests must contain a changeset in order for changes to be published. The [changeset-bot](https://github.com/apps/changeset-bot) will guide you through this process.
27 changes: 3 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,11 @@ To learn more about the contents of this repository, see this README and the REA

- [`eslint-config-xmtp-web`](https://github.com/xmtp/xmtp-web/blob/main/packages/eslint-config-xmtp-web): An opinionated ESLint configuration for XMTP web projects
- [`react-sdk`](https://github.com/xmtp/xmtp-web/blob/main/packages/react-sdk): React XMTP client SDK
- [`react-components`](https://github.com/xmtp/xmtp-web/blob/main/packages/react-components)**Experimental**: React components for building React apps with XMTP
- [`tsconfig`](https://github.com/xmtp/xmtp-web/blob/main/packages/tsconfig): Internal package for sharing `tsconfig.json` files

### Examples

- [`react-quickstart`](https://github.com/xmtp/xmtp-web/blob/main/examples/react-quickstart): A quickstart example app using [React](https://react.dev/)[Vite](https://vitejs.dev/), and [RainbowKit](https://www.rainbowkit.com/)
- [`react-vite`](https://github.com/xmtp/xmtp-web/blob/main/examples/react-vite): A quickstart example app using [React](https://react.dev/)[Vite](https://vitejs.dev/), and [RainbowKit](https://www.rainbowkit.com/)

## Requirements
## Contributing

- Node 18+
- React 16.14+
- Yarn v3+ is required only when working with this repo. See [Yarn Installation](https://yarnpkg.com/getting-started/install).
> **Tip**
> If you have an earlier version of yarn installed, try running `yarn set version berry` to upgrade to a compatible version.
## Developing

After installing the requirements, run `yarn && yarn dev` to start developing.

## Useful commands

- `yarn build`: Builds the `packages/react-sdk` and `packages/react-components` packages
- `yarn clean`: Remove all `node_modules``.turbo`, and build folders, clear Yarn cache
- `yarn quickstart`: Builds `packages/react-sdk` and `packages/react-components`, then runs the `examples/react-quickstart` app in dev mode.
- `yarn format`: Run prettier format and write changes on all packages
- `yarn format:check`: Run prettier format check on all packages
- `yarn lint`: Lint all packages
- `yarn test`: Test all packages
- `yarn typecheck`: Typecheck all packages
See our [contribution guide](./CONTRIBUTING.md) to learn more about contributing to this project.
9 changes: 4 additions & 5 deletions examples/react-vite/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# React quickstart app
# React Vite example app

![Status](https://img.shields.io/badge/Project_Status-Beta-yellow)

Use this React quickstart app as a tool to start building an app with XMTP. This basic messaging app has an intentionally unopinionated UI to help make it easier for you to build with.
Use this React Vite example app as a tool to start building an app with XMTP. This basic messaging app has an intentionally unopinionated UI to help make it easier for you to build with.

The app is built using the [React XMTP client SDK](/packages/react-sdk/README.md), [React](https://react.dev/), [Vite](https://vitejs.dev/), and [RainbowKit](https://www.rainbowkit.com/).

Expand All @@ -16,13 +16,12 @@ To learn more about XMTP and get answers to frequently asked questions, see the

### Limitations

This React quickstart app isn't a complete solution. For example, the list of conversations doesn't update when new messages arrive in existing conversations.
This React Vite example app isn't a complete solution. For example, the list of conversations doesn't update when new messages arrive in existing conversations.

## Developing

1. In `packages/react-sdk`, run `yarn build` to build the SDK.

2. In `examples/react-quickstart`, run `yarn dev` to start developing.
2. In `examples/react-vite`, run `yarn dev` to start developing.

## Useful commands

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"publish": "yarn build && changeset publish",
"quickstart": "turbo run quickstart",
"test": "FORCE_COLOR=1 turbo run test",
"test:setup": "./dev/up",
"test:teardown": "./dev/down",
"typecheck": "FORCE_COLOR=1 turbo run typecheck"
},
"devDependencies": {
Expand Down
21 changes: 21 additions & 0 deletions packages/eslint-config-xmtp-web/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 XMTP (xmtp.org)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions packages/eslint-config-xmtp-web/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# XMTP ESLint configuration for the web

Shared ESLint configuration for XMTP web projects.
2 changes: 1 addition & 1 deletion packages/react-sdk/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 XMTP Labs (xmtp.com)
Copyright (c) 2024 XMTP (xmtp.org)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions packages/react-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ window.Buffer = window.Buffer ?? Buffer;

## Reference docs

Access the XMTP React SDK [reference documentation](https://xmtp.github.io/xmtp-web/modules.html).
Access the XMTP React SDK [reference documentation](https://xmtp.github.io/xmtp-web/).

## Local-first architecture

Expand Down Expand Up @@ -948,7 +948,7 @@ const MessageContent = ({ message }) => {

Run `yarn dev` to build the SDK and watch for changes, which will trigger a rebuild.

## Useful commands
### Useful commands

- `yarn build`: Builds the SDK
- `yarn clean`: Removes `node_modules``lib`, and `.turbo` folders
Expand Down

0 comments on commit d39c972

Please sign in to comment.