Skip to content

Commit 7f2e4eb

Browse files
Adding examples for both Vite, Webpack, and NodeJS (#4)
* Adding examples for both Vite & Webpack * Testing new @namada/sdk package * feat: move vite example over to multicore * fix: vite dev multicore (#5) * fix: vite dev multicore * fix: vite plugin for worker optimize deps * feat: plugin simplified * feat: import plugin * Reference new SDK-JS plugin name * Use published SDK & vite plugin * feat: bump versions * feat: adding basic Node app (TS) * feat: adding more node sdk stuff * feat: working NodeJS example * feat: provide both multicore and single core vite examples * feat: update webpack, basic readmes * Add docs link to top-level readme --------- Co-authored-by: Mateusz Jasiuk <mateusz.jasiuk@gmail.com>
1 parent ae6e237 commit 7f2e4eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+16422
-3060
lines changed

README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,15 @@
33
This repository contains examples of how to instantiate and use the Namada SDK for JavaScript/Typescript.
44
It's main purpose is to show how to set up the SDK for Web or NodeJS applications.
55

6-
## Installation
6+
See the following example projects and follow setup instructions:
77

8-
First, update values in [consts.ts](./src/config/consts.ts) to match your environment.
8+
- [Vite](./vite/)
9+
- [Vite (Multicore)](./vite-multicore/)
10+
- [Webpack](./webpack/)
11+
- [NodeJS](./node/)
912

10-
```bash
11-
# Install dependencies
12-
yarn
13+
## Documentation
1314

14-
# Test Bond Tx in browser
15-
yarn test:web
16-
```
15+
The `@namada/sdk`, `@namada/sdk-multicore`, and `@namada/sdk-node` packages all share a common lib, with type docs available at:
1716

18-
### Notes
19-
20-
- This repo is in active development! Please use this as an example build and usage environment only.
21-
- In the future, we plan to update this so it may serve as a starter project!
17+
<https://github.com/namada-net/namada-sdkjs/blob/main/docs/modules.md>

node/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

node/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Namada SDK JS examples for NodeJS
2+
3+
## Usage
4+
5+
```bash
6+
npm install
7+
npm run dev
8+
```

node/eslint.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import tseslint from "typescript-eslint";
4+
import { defineConfig } from "eslint/config";
5+
6+
export default defineConfig([
7+
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], plugins: { js }, extends: ["js/recommended"], languageOptions: { globals: globals.browser } },
8+
tseslint.configs.recommended,
9+
]);

node/eslintrc.cjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
env: {
3+
es2021: true,
4+
node: true,
5+
},
6+
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
7+
parser: "@typescript-eslint/parser",
8+
parserOptions: {
9+
ecmaVersion: 13,
10+
sourceType: "module",
11+
},
12+
plugins: ["@typescript-eslint"],
13+
rules: {},
14+
};

0 commit comments

Comments
 (0)