You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[NX Console](https://nx.dev/core-features/integrate-with-editors) - Visual Studio Code extension for NX workspace management
112
113
113
-
The following commands will help you start developing with this repository.
114
+
# Quick Start
114
115
115
-
First, install the dependencies via yarn:
116
+
To start developing with this repository:
116
117
118
+
1. Install dependencies:
117
119
```
118
120
yarn
119
121
```
120
122
121
123
## Building
122
124
123
-
You can build the project with the following commands:
125
+
Build the project using one of these commands:
124
126
125
127
```
126
-
// for local development - It stripped away operations that don't matter for local dev
128
+
// For local development (optimized, excludes production-only operations)
127
129
yarn build:dev
128
130
129
-
// you should never need to use yarn build unless you want to test or publish it
131
+
// For testing and publishing (full build with all operations)
130
132
yarn build
131
133
```
132
134
@@ -148,21 +150,7 @@ yarn test:local
148
150
149
151
`nx generate @nx/js:library`
150
152
151
-
## Create a new react demo app using the Lit JS SDK
152
-
153
-
```sh
154
-
yarn tools --create --react contracts-sdk --demo
155
-
```
156
153
157
-
## Deleting a package or app
158
-
159
-
```
160
-
// delete an app from ./app/<app-name>
161
-
yarn delete:app <app-name>
162
-
163
-
// delete a package from ./packages/<package-name>
164
-
yarn delete:package <package-name>
165
-
```
166
154
167
155
## Building
168
156
@@ -210,138 +198,154 @@ Having done this setup, this is what the development cycle looks like moving for
210
198
2. Rebuild specific package
211
199
3. Rebuild client application.
212
200
213
-
### Building changes to Rust source
214
-
215
-
If changes are made to `packages/wasm` see [here](./packages/wasm/README.md) for info on building from source.
216
-
217
-
## Publishing
201
+
### Building Rust Components
218
202
219
-
You must have at least nodejs v18 to do this.
203
+
For changes to WebAssembly components in `packages/wasm`, refer to the [WebAssembly build guide](./packages/wasm/README.md).
220
204
221
-
1. Install the latest packages with `yarn install`
205
+
## Publishing New Versions
222
206
223
-
2. Run `yarn bump` to bump the version
207
+
Prerequisites:
208
+
- Node.js v18.0.0 or later
224
209
225
-
3. Build all the packages with `yarn build`
210
+
Publishing steps:
211
+
1. Update dependencies: `yarn install`
212
+
2. Increment version: `yarn bump`
213
+
3. Build packages: `yarn build`
214
+
4. Run tests:
215
+
- Unit tests: `yarn test:unit`
216
+
- E2E tests: `yarn test:local`
217
+
5. Generate documentation: `yarn gen:docs --push`
218
+
6. Publish packages: `yarn publish:packages`
219
+
7. Commit with message: "Published version X.X.X"
226
220
227
-
4. Run the unit tests with `yarn test:unit` & e2e node tests `yarn test:local` locally & ensure that they pass
221
+
## Testing Guide
228
222
229
-
5. Update the docs with `yarn gen:docs --push`
223
+
### Available Test Commands
230
224
231
-
6. Finally, publish with `yarn publish:packages`
225
+
| Command | Description |
226
+
|---------|-------------|
227
+
|`yarn test:unit`| Run unit tests for all packages |
228
+
|`yarn test:local`| Launch E2E tests with Cypress and serve React test app |
232
229
233
-
7. Commit these changes "Published version X.X.X"
234
-
235
-
## Testing
236
-
237
-
### Quick Start on E2E Testing
238
-
239
-
The following will serve the react testing app and launch the cypress e2e testing after
240
-
241
-
```sh
242
-
yarn test:local
243
-
```
244
-
245
-
### Unit Tests
246
-
247
-
```sh
248
-
yarn test:unit
249
-
```
230
+
### Running Tests
231
+
1. Unit Tests:
232
+
```sh
233
+
yarn test:unit
234
+
```
250
235
251
-
## Testing with a Local Lit Node
236
+
2. End-to-End Tests:
237
+
```sh
238
+
yarn test:local
239
+
```
240
+
This command:
241
+
- Starts the React testing application
242
+
- Launches Cypress test runner
243
+
- Executes E2E test suites
252
244
253
-
First, deploy your Lit Node Contracts, since the correct addresses will be pulled from the `../lit-assets/blockchain/contracts/deployed-lit-node-contracts-temp.json` file.
245
+
## Local Development with Lit Node
254
246
255
-
Set these two env vars:
247
+
### Setup Local Environment
248
+
1. Deploy Lit Node Contracts (addresses will be read from `../lit-assets/blockchain/contracts/deployed-lit-node-contracts-temp.json`)
This SDK uses custom error classes derived from [@openagenda/verror](https://github.com/OpenAgenda/verror) to handle errors between packages and to the SDK consumers.
285
-
Normal error handling is also supported as VError extends the native Error class, but using VError allows for better error composition and information propagation.
286
-
You can check their documentation for the extra fields that are added to the error object and methods on how to handle them in a safe way.
284
+
## Overview
285
+
The SDK implements a robust error handling system using [@openagenda/verror](https://github.com/OpenAgenda/verror). This system provides:
286
+
- Detailed error information with cause tracking
287
+
- Error composition and chaining
288
+
- Additional context through metadata
289
+
- Compatibility with native JavaScript Error handling
0 commit comments