Skip to content

Commit c738811

Browse files
committed
chore: add torii-wasm and torii-client
1 parent 276c37e commit c738811

22 files changed

+3601
-2
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,29 @@ jobs:
132132
with:
133133
repo-token: ${{ secrets.GITHUB_TOKEN }}
134134
- run: scripts/rust_fmt.sh --check
135+
136+
npm-packages:
137+
name: Build npm packages
138+
runs-on: ubuntu-latest
139+
steps:
140+
- uses: actions/checkout@v3
141+
- uses: dtolnay/rust-toolchain@master
142+
with:
143+
toolchain: ${{ env.RUST_VERSION }}
144+
targets: wasm32-unknown-unknown
145+
- uses: Swatinem/rust-cache@v2
146+
- uses: arduino/setup-protoc@v1
147+
with:
148+
repo-token: ${{ secrets.GITHUB_TOKEN }}
149+
- name: Install wasm-pack
150+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
151+
- uses: pnpm/action-setup@v2
152+
with:
153+
version: 8
154+
- uses: actions/setup-node@v3
155+
with:
156+
node-version: "20"
157+
- name: Install dependencies
158+
run: pnpm install
159+
- name: Build packages
160+
run: pnpm run build

.github/workflows/release.yml

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,17 @@ jobs:
4141
- uses: arduino/setup-protoc@v3
4242
with:
4343
repo-token: ${{ secrets.GITHUB_TOKEN }}
44-
44+
4545
- name: Install wasm-pack
4646
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
4747

48+
- uses: pnpm/action-setup@v2
49+
with:
50+
version: 10
51+
52+
- name: Install dependencies
53+
run: pnpm install
54+
4855
- name: Build WASM (no-modules)
4956
run: wasm-pack build crates/wasm --out-dir ../../pkg-no-modules --release --target no-modules
5057

@@ -67,6 +74,21 @@ jobs:
6774
torii-wasm-no-modules.tar.gz
6875
torii-wasm-web.tar.gz
6976
77+
- name: Build packages
78+
run: pnpm run build
79+
80+
- name: Publish torii-wasm
81+
working-directory: packages/torii-wasm
82+
run: npm publish --access public
83+
env:
84+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
85+
86+
- name: Publish torii-client
87+
working-directory: packages/torii-client
88+
run: npm publish --access public
89+
env:
90+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
91+
7092
build-uniffi:
7193
name: Build UniFFI bindings
7294
needs: prepare
@@ -290,3 +312,55 @@ jobs:
290312
with:
291313
files: |
292314
${{ steps.artifacts.outputs.file_name }}
315+
316+
publish-npm:
317+
name: Publish npm packages
318+
needs: prepare
319+
runs-on: ubuntu-latest
320+
321+
steps:
322+
- uses: actions/checkout@v3
323+
324+
- uses: dtolnay/rust-toolchain@master
325+
name: Rust Toolchain Setup
326+
with:
327+
targets: wasm32-unknown-unknown
328+
toolchain: ${{ env.RUST_VERSION }}
329+
330+
- uses: Swatinem/rust-cache@v1
331+
with:
332+
cache-on-failure: true
333+
334+
- uses: arduino/setup-protoc@v3
335+
with:
336+
repo-token: ${{ secrets.GITHUB_TOKEN }}
337+
338+
- name: Install wasm-pack
339+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
340+
341+
- uses: pnpm/action-setup@v2
342+
with:
343+
version: 8
344+
345+
- uses: actions/setup-node@v3
346+
with:
347+
node-version: "20"
348+
registry-url: "https://registry.npmjs.org"
349+
350+
- name: Install dependencies
351+
run: pnpm install
352+
353+
- name: Build packages
354+
run: pnpm run build
355+
356+
- name: Publish torii-wasm
357+
working-directory: packages/torii-wasm
358+
run: npm publish --access public
359+
env:
360+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
361+
362+
- name: Publish torii-client
363+
working-directory: packages/torii-client
364+
run: npm publish --access public
365+
env:
366+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
target
22
*.out
3-
.DS_Store
3+
.DS_Store
4+
5+
# Node/npm
6+
node_modules/
7+
dist/
8+
*.log
9+
.turbo/
10+
pkg/

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org/

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "dojo-c",
3+
"version": "1.6.0",
4+
"private": true,
5+
"scripts": {
6+
"build": "pnpm build:wasm && pnpm build:client",
7+
"build:wasm": "pnpm --filter @dojoengine/torii-wasm build:wasm",
8+
"build:client": "pnpm --filter @dojoengine/torii-client build"
9+
}
10+
}

packages/torii-client/.gitignore

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

packages/torii-client/.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*
2+
3+
!dist/**
4+
!package.json
5+
!readme.md
6+
!changelog.md
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
**/*/target
2+
**/*/dist
3+
packages/torii-client/wasm
4+
packages/torii-client/pkg
5+
packages/torii-wasm/pkg/
6+
packages/utils-wasm/pkg/
7+
8+
packages/create-burner/coverage
9+
packages/core/coverage
10+
11+
worlds/dojo-starter
12+
worlds/onchain-dash
13+
14+
# ignore lock files
15+
**/*-lock.yaml
16+
package-lock.json
17+
dev-dist
18+
19+
**/CHANGELOG.md

0 commit comments

Comments
 (0)