Skip to content

Commit 49bbfcf

Browse files
committed
Publish wasm to npm
1 parent 93f2478 commit 49bbfcf

File tree

10 files changed

+23
-29
lines changed

10 files changed

+23
-29
lines changed

.cargo/config.toml

-2
This file was deleted.

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ Cargo.lock
1515

1616
# Node
1717
node_modules/
18-
legion-wasm32-wasi.wasm
19-
package-lock.json
18+
github-wasm32-wasi.wasm
19+
package-lock.json

.run/build-wasi.sh

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
cargo build --release --target wasm32-wasip2
2-
cp target/wasm32-wasip2/release/legion.wasm projects/legion-wasm32-wasi/legion-wasm32-wasi.wasm
3-
jco transpile projects/legion-wasm32-wasi/legion-wasm32-wasi.wasm -o projects/legion-wasm32-wasi/src --name index --no-namespaced-exports --multi-memory --valid-lifting-optimization --optimize
4-
5-
cp target/wasm32-wasip2/release/v.wasm projects/v-wasm32-wasi/v-wasm32-wasi.wasm
6-
jco transpile projects/v-wasm32-wasi/v-wasm32-wasi.wasm -o projects/v-wasm32-wasi/src --name index --no-namespaced-exports --multi-memory --valid-lifting-optimization --optimize
2+
cp target/wasm32-wasip2/release/github.wasm projects/publish-wasm32-wasi/github-wasm32-wasi.wasm
3+
jco transpile projects/publish-wasm32-wasi/github-wasm32-wasi.wasm -o projects/publish-wasm32-wasi/src --name index --no-namespaced-exports --multi-memory --valid-lifting-optimization --optimize

index.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env node
2+
3+
import {run} from "@valkyrie-language/rust-publish";
4+
5+
run.run()

projects/publish-rs/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ impl GithubCLI {
1717
pub async fn run(self) -> Result<(), GithubError> {
1818
let args: Vec<String> = std::env::args().collect();
1919
println!("Args:\n{:#?}", args);
20-
let Self { commands, arguments } = self;
21-
match commands {
22-
Some(s) => s.run(&arguments).await?,
23-
None => {}
24-
}
20+
// let Self { commands, arguments } = self;
21+
// match commands {
22+
// Some(s) => s.run(&arguments).await?,
23+
// None => {}
24+
// }
2525
Ok(())
2626
}
2727
}

projects/publish-rs/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use clap::Parser;
2-
use legion::{GithubCLI, GithubError};
2+
use github::{GithubCLI, GithubError};
33

44
#[tokio::main(flavor = "current_thread")]
55
async fn main() -> Result<(), GithubError> {
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
node_modules/
2-
legion-wasm32-wasi.wasm
3-
legion.wasm
2+
github-wasm32-wasi.wasm
3+
github.wasm

projects/publish-wasm32-wasi/legion.js

-5
This file was deleted.

projects/publish-wasm32-wasi/package.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
"license": "UNLICENSED",
66
"repository": {
77
"type": "git",
8-
"url": "https://github.com/valkyrie-language/legion.rs",
8+
"url": "git+https://github.com/valkyrie-language/legion.rs.git",
99
"directory": "projects/legion-wasm32-wasi"
1010
},
11+
"bin": {
12+
"rust-publish": "rust-publish.js"
13+
},
1114
"type": "module",
15+
"main": "src/index.js",
1216
"types": "src/index.d.js",
1317
"typings": "src/index.d.js",
14-
"bin": {
15-
"legion": "legion.js",
16-
"legion-new": "legion-new.js"
17-
},
1818
"publishConfig": {
1919
"access": "public",
2020
"registry": "https://registry.npmjs.org/"
@@ -23,8 +23,7 @@
2323

2424
},
2525
"dependencies": {
26-
"@bytecodealliance/preview2-shim": "^0.17.1",
27-
"create-legion": "0.0.2"
26+
"@bytecodealliance/preview2-shim": "^0.17.1"
2827
},
2928
"devDependencies": {
3029

0 commit comments

Comments
 (0)