Skip to content

Commit

Permalink
Merge pull request #603 from xmtp/rygine/mono-repo
Browse files Browse the repository at this point in the history
Migrate to monorepo
  • Loading branch information
rygine authored May 8, 2024
2 parents bdd7d20 + 302585f commit 4418f22
Show file tree
Hide file tree
Showing 159 changed files with 1,324 additions and 2,732 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
16 changes: 16 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-git",
{
"repo": "xmtp/xmtp-js"
}
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ on:
push:
branches:
- main
- beta
- releases/beta

permissions:
contents: read
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
Expand Down Expand Up @@ -37,8 +36,12 @@ jobs:
run: yarn
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Release
- name: Publish
uses: changesets/action@v1
with:
title: 'release: version packages'
commit: 'release: version packages'
publish: yarn publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: corepack enable
- name: Install dependencies
run: yarn
- run: ./dev/docker-compose up -d
- run: ./dev/up
- run: yarn test:node
env:
NODE_OPTIONS: '-r dd-trace/ci/init'
Expand All @@ -45,5 +45,5 @@ jobs:
run: corepack enable
- name: Install dependencies
run: yarn
- run: ./dev/docker-compose up -d
- run: ./dev/up
- run: yarn test:browser
154 changes: 49 additions & 105 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,113 +1,45 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock
# dependencies
node_modules

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
# testing
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# misc
.DS_Store
*.pem

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity
# debug
yarn-debug.log*
yarn-error.log*

# dotenv environment variables file
.env
.env.test
# local env files
.env*

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# turbo
.turbo

# Next.js build output
.next
out
# logs
logs
*.log

# Nuxt.js build / generate output
.nuxt
# editor directories and files
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# build artifacts
lib
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
build

# yarn
.pnp.*
Expand All @@ -118,11 +50,23 @@ dist
!.yarn/sdks
!.yarn/versions

# generated docs
docs/
tmp/
# typedocs
docs
tmp

# next.js
.next
out
next-env.d.ts

# vercel
.vercel

.DS_STORE
# typescript
*.tsbuildinfo

# remix
.cache

# Benchmark results
bench/results
packages/js-sdk/bench/results
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions .husky/commit-msg

This file was deleted.

8 changes: 0 additions & 8 deletions .husky/common.sh

This file was deleted.

3 changes: 0 additions & 3 deletions .husky/pre-commit

This file was deleted.

7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@
"editor.tabSize": 2,
"editor.detectIndentation": false,
"files.insertFinalNewline": true,
"cSpell.words": ["Ciphertext", "Waku", "authn"]
"cSpell.words": ["Ciphertext", "Waku", "authn"],
"eslint.workingDirectories": [
{
"mode": "auto"
}
]
}
31 changes: 4 additions & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ This repository uses the [Yarn package manager](https://yarnpkg.com/). To use it
### Useful commands

- `yarn`: Installs all dependencies
- `yarn bench`: Run the benchmarking suite
- `yarn build`: Builds the JS SDK
- `yarn build`: Builds all packages in the `/packages` folder
- `yarn clean`: Remove all `node_modules``.turbo`, and build folders, clear Yarn cache
- `yarn format`: Run prettier format and write changes
- `yarn format:check`: Run prettier format check
- `yarn test`: Run the unit test suite
Expand All @@ -50,29 +50,6 @@ Please add unit tests when appropriate and ensure that all unit tests are passin

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 using `yarn link` or `npm link` 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 `yarn build` in the `xmtp-js` directory and then reload the app.

### Auto-releasing and commit conventions
## 🚢 Publishing

A new version of this package will be automatically published whenever there is a merge to the `main` branch. Specifically, new GitHub releases and tags will be created, and a new NPM package version will be published. The release version increment type is derived from the format of the commit messages that were bundled in the merge to `main`, using [semantic-release commit message conventions](https://github.com/semantic-release/semantic-release#commit-message-format).

The table below shows example commits and the resulting release type for a `pencil` project:

<!-- prettier-ignore-start -->
| Commit message | Release type |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| `docs: describe scribble feature` | No Release |
| `test: fix failing unit test` | No Release |
| `fix: stop graphite breaking when too much pressure applied` | ~~Patch~~ Fix Release |
| `feat: add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
| `perf: remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release <br /> (Note that the `BREAKING CHANGE:` token must be in the footer of the commit) |
<!-- prettier-ignore-end -->

This is currently configured to use the [Angular Commit Message Conventions](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format). e.g. `feat: add message signing` would cause a minor release.

If there are multiple commits within a single pull request, each commit will be listed as a separate bullet point in the [release notes](https://github.com/xmtp/xmtp-js/releases) and bundled together in a release of the highest increment type specified.

If your commit messages are not to your liking, it is permitted to rewrite the history on your branch and force-push it before merging it. Make sure you are never force-pushing on `main`, and that the following is in your `~/.gitconfig` file.

```
[push]
default = simple
```
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.
1 change: 0 additions & 1 deletion commitlint.config.cjs

This file was deleted.

5 changes: 0 additions & 5 deletions dev/up
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#!/bin/bash
set -e

if [[ $OSTYPE != 'darwin'* ]]; then
echo "MacOS required to run dev/up"
exit 1
fi

if ! which docker &>/dev/null; then
echo "Docker required to run dev/up. Install it and run this again."
exit 1
Expand Down
Loading

0 comments on commit 4418f22

Please sign in to comment.