Skip to content

Commit

Permalink
docs/chore: prep for v0.0.36
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronCQL committed Oct 16, 2023
1 parent 487c8f4 commit f5a344e
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 28 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## `v0.0.36` [breaking change]

### Features

- Added `MnemonicWallet` to allow programmatic signing and broadcasting of txs without relying on a 3rd party wallet/signer (see examples directory)
- Simplified wallet APIs **[breaking change]**
- `getAccount()`: reworked to `getAuthInfo()`, but consumers are no longer required to call this method to broadcast transactions
- `pollTx()`: removed and combined with `broadcastTx()`
- `estimateFee()`: second parameter now accepts the `feeMultiplier` directly (still optional)
- `broadcastTx()`: second parameter now accepts the `fee` from the result of `estimateFee()` (no longer optional)
- `broadcastTxWithFeeEstimation()`: newly added function that combines `estimateFee` and `broadcastTx`
- Handle account sequence mismatch errors directly in `ConnectedWallet.estimateFee()` by retrying once with the correct sequence

### Miscellaneous

- Removed the various `fromXxxToYyy` encoding/decoding functions within `cosmes/codec` in favour of `@scure/base` **[breaking change]**
- The `@scure/base` pkg is re-exported in `cosmes/codec`
- Consumers should import the correct encoder or decoder directly from `cosmes/codec`: eg. change `fromHexToUint8Array(...)` to `base16.decode(...)`
- Re-exported `@keplr-wallet/types` from `cosmes/registry`

## `v0.0.35`

### Features
Expand Down
71 changes: 48 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

- [Directory Structure](#directory-structure)
- [Getting Started](#getting-started)
- [Installing](#installing)
- [Adding Dependencies](#adding-dependencies)
- [Building For Production](#building-for-production)
- [Developing](#developing)
- [Building](#building)
- [Publishing](#publishing)
- [Testing \& CI](#testing--ci)
- [Design Decisions](#design-decisions)
- [Minimise Bundle Size](#minimise-bundle-size)
Expand All @@ -19,67 +21,90 @@

This is a [pure ESM package](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c), written in TypeScript and managed by [pnpm](https://pnpm.io).

- [`/benchmarks`](./benchmarks) - contains bundle size comparisons between `cosmes` and other packages like Cosmos Kit
- [`/examples`](./examples) - contains example applications that consume from the `cosmes` package
- [`/scripts`](./scripts) - contains internal scripts for use in this monorepo
- [`/src`](./src) - contains the source code for the `cosmes` package

## Getting Started

### Installing

Firstly, install all dependencies by running:

```sh
# To install all dependencies
pnpm install
pnpm i
```

### Adding Dependencies

Dependencies that are not `devDependencies` should be added as `peerDependencies`. See ["No Bundling"](#no-bundling) for more information.

To add a new dev dependency, run:

```sh
# To add a new dev dependency
pnpm add -D [dependency_name]

# To add a new dependency
# This also automatically adds it as a dev dependency
pnpm add --save-peer [dependency_name]
```

### Building For Production
To add a new peer dependency (note that it is also automatically added as a dev dependency), run:

```sh
# [OPTIONAL] To regenerate the code built using scripts
pnpm gen:protobufs
pnpm gen:registry

# To build to the `dist` directory
pnpm build
pnpm add --save-peer [dependency_name]
```

### Developing

All examples in the `/examples` directory are independent packages that contain a symlink to the root `cosmes` package. This allows us to develop the `cosmes` package and test it in the examples at the same time.

To start developing with hot reload:
Firstly, to watch the `cosmes` package and rebuild on changes, run the following in the root of the project:

```sh
# First, watch the package and rebuild on changes
pnpm build # If the root `dist` directory does not exist
# Run `pnpm build` first if this is your first time running this command
pnpm dev
```

# Then, in a separate terminal, start the example app
cd examples/[app_name]
Then, in a separate terminal, start the example app:

```sh
cd examples/solid-vite
pnpm install # If necessary
pnpm dev
```

### Building

All generated files should be committed to the repository. The convention is to prefix the commands with `gen:`. If there is a need to regenerate the files, run:

```sh
pnpm gen:protobufs
pnpm gen:registry
```

To build the package to the `dist` folder, run:

```sh
pnpm build
```

### Publishing

To publish the package to NPM, run:

```sh
pnpm publish
```

### Testing & CI

The full test suite includes building, linting, type checking, and unit tests.
To run all unit tests, run:

```sh
# To run tests
pnpm test
```

# To run the full test suite, including linting and typechecking
To emulate the full test suite (linting, typechecking, unit tests) that is automatically run in CI, run:

```sh
pnpm test:suite
```

Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[![npm version](https://badge.fury.io/js/cosmes.svg)](https://www.npmjs.com/package/cosmes)

A tree-shakeable, framework agnostic, [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) alternative of [CosmJS](https://github.com/cosmos/cosmjs) and [Cosmos Kit](https://cosmoskit.com). Generates bundles up to 10x smaller than Cosmos Kit.
A tree-shakeable, framework agnostic, [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) alternative of [CosmJS](https://github.com/cosmos/cosmjs) and [Cosmos Kit](https://cosmoskit.com) (**generate bundles up to 10x smaller than Cosmos Kit**).

- [Features](#features)
- [Installing](#installing)
Expand All @@ -19,7 +19,7 @@ A tree-shakeable, framework agnostic, [pure ESM](https://gist.github.com/sindres
- [`cosmes/wallet`](#cosmeswallet)
- [Benchmarks](#benchmarks)
- [Results](#results)
- [Contributing](#contributing)
- [See More](#see-more)

## Features

Expand Down Expand Up @@ -144,6 +144,7 @@ See the [`benchmarks`](./benchmarks) folder, where the JS bundle size of CosmES
| Cosmos Kit v1 | 6004 KB | 1392 KB |
| Cosmos Kit v2 | 6273 KB | 1453 KB |

## Contributing
## See More

See [`CONTRIBUTING.md`](./CONTRIBUTING.md).
- [Changelog](./CHANGELOG.md) - for notable changes
- [Contributing](./CONTRIBUTING.md) - if you want to contribute to this project
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cosmes",
"version": "0.0.35",
"version": "0.0.36",
"private": false,
"packageManager": "pnpm@8.3.0",
"sideEffects": false,
Expand Down

0 comments on commit f5a344e

Please sign in to comment.