Skip to content

Commit c450856

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

24 files changed

+3630
-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: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ 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

@@ -290,3 +290,55 @@ jobs:
290290
with:
291291
files: |
292292
${{ steps.artifacts.outputs.file_name }}
293+
294+
publish-npm:
295+
name: Publish npm packages
296+
needs: prepare
297+
runs-on: ubuntu-latest
298+
299+
steps:
300+
- uses: actions/checkout@v3
301+
302+
- uses: dtolnay/rust-toolchain@master
303+
name: Rust Toolchain Setup
304+
with:
305+
targets: wasm32-unknown-unknown
306+
toolchain: ${{ env.RUST_VERSION }}
307+
308+
- uses: Swatinem/rust-cache@v1
309+
with:
310+
cache-on-failure: true
311+
312+
- uses: arduino/setup-protoc@v3
313+
with:
314+
repo-token: ${{ secrets.GITHUB_TOKEN }}
315+
316+
- name: Install wasm-pack
317+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
318+
319+
- uses: pnpm/action-setup@v2
320+
with:
321+
version: 8
322+
323+
- uses: actions/setup-node@v3
324+
with:
325+
node-version: "20"
326+
registry-url: "https://registry.npmjs.org"
327+
328+
- name: Install dependencies
329+
run: pnpm install
330+
331+
- name: Build packages
332+
run: pnpm run build
333+
334+
- name: Publish torii-wasm
335+
working-directory: packages/torii-wasm
336+
run: npm publish --access public
337+
env:
338+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
339+
340+
- name: Publish torii-client
341+
working-directory: packages/torii-client
342+
run: npm publish --access public
343+
env:
344+
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 --filter './packages/**' build",
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)