Skip to content

Commit f1b264a

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

22 files changed

+3563
-2
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,26 @@ jobs:
132132
with:
133133
repo-token: ${{ secrets.GITHUB_TOKEN }}
134134
- run: scripts/rust_fmt.sh --check
135+
136+
js-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: 10
154+
- name: Install dependencies
155+
run: pnpm install
156+
- name: Build packages
157+
run: pnpm run build

.github/workflows/release.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@v3
3030

31+
- name: Extract tag version
32+
id: get_version
33+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
34+
35+
- name: Update package versions
36+
run: |
37+
cd packages/torii-wasm && npm version $VERSION --no-git-tag-version
38+
cd ../torii-client && npm version $VERSION --no-git-tag-version
39+
3140
- uses: dtolnay/rust-toolchain@master
3241
name: Rust Toolchain Setup
3342
with:
@@ -41,16 +50,31 @@ jobs:
4150
- uses: arduino/setup-protoc@v3
4251
with:
4352
repo-token: ${{ secrets.GITHUB_TOKEN }}
44-
53+
4554
- name: Install wasm-pack
4655
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
4756

57+
- uses: actions/setup-node@v3
58+
with:
59+
node-version: "20"
60+
registry-url: "https://registry.npmjs.org"
61+
62+
- uses: pnpm/action-setup@v2
63+
with:
64+
version: 10
65+
66+
- name: Install dependencies
67+
run: pnpm install
68+
4869
- name: Build WASM (no-modules)
4970
run: wasm-pack build crates/wasm --out-dir ../../pkg-no-modules --release --target no-modules
5071

5172
- name: Build WASM (web)
5273
run: wasm-pack build crates/wasm --out-dir ../../pkg-web --release --target web
5374

75+
- name: Build packages
76+
run: pnpm run build
77+
5478
- name: Package WASM builds
5579
id: wasm_artifacts
5680
shell: bash
@@ -67,6 +91,20 @@ jobs:
6791
torii-wasm-no-modules.tar.gz
6892
torii-wasm-web.tar.gz
6993
94+
- name: Publish torii-wasm
95+
working-directory: packages/torii-wasm
96+
run: pnpm publish --access public
97+
if: startsWith(github.ref, 'refs/tags/')
98+
env:
99+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
100+
101+
- name: Publish torii-client
102+
working-directory: packages/torii-client
103+
run: pnpm publish --access public
104+
if: startsWith(github.ref, 'refs/tags/')
105+
env:
106+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
107+
70108
build-uniffi:
71109
name: Build UniFFI bindings
72110
needs: prepare
@@ -290,3 +328,4 @@ jobs:
290328
with:
291329
files: |
292330
${{ steps.artifacts.outputs.file_name }}
331+

.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)