Skip to content

Commit

Permalink
feat: Add Better Typescript Api
Browse files Browse the repository at this point in the history
  • Loading branch information
28Smiles committed Jun 18, 2022
1 parent b6c4618 commit c0e073c
Show file tree
Hide file tree
Showing 55 changed files with 1,628 additions and 332 deletions.
73 changes: 62 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
CARGO_TERM_COLOR: always

jobs:
rust-test:
rs-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -27,12 +27,57 @@ jobs:
with:
command: test
args: --verbose --features std
wasmpack:
- name: Cache Cargo Registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ubuntu-latest-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
js-test:
runs-on: ubuntu-latest
needs:
- rs-test
strategy:
matrix:
node-version: [ 10.x, 12.x, v14.18.3, 14.x, 16.x, 18.x, '*' ]
steps:
- uses: actions/checkout@v2
name: Clone
- uses: actions-rs/toolchain@v1
name: Setup Rust
with:
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
name: Install WasmPack
with:
command: install
args: wasm-pack
- uses: actions/setup-node@v1
name: Setup Node ${{ matrix.node-version }}
with:
node-version: ${{ matrix.node-version }}
- uses: borales/[email protected]
name: Install npm dependencies
with:
cmd: install
- uses: borales/[email protected]
name: Run Jest Tests
with:
cmd: run test
- name: Cache Cargo Registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ubuntu-latest-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
assemble:
runs-on: ubuntu-latest
needs:
- js-test
steps:
- uses: actions/checkout@v2
name: Clone
- uses: actions/setup-node@v1
name: Setup Node
with:
node-version: 18.x
- uses: actions-rs/toolchain@v1
Expand All @@ -46,30 +91,34 @@ jobs:
command: install
args: wasm-pack
- uses: borales/[email protected]
name: Install npm dependencies
with:
cmd: install
- name: Build Wasm
run: ./build.sh
- uses: borales/[email protected]
name: Build
with:
cmd: run test
cmd: run build
- uses: actions/upload-artifact@v2
name: Upload Artifacts
with:
name: pkg
path: |
pkg.bundler/
pkg.dist/
pkg.node/
pkg.web/
package.json
index.browser.js
LICENCE
README.md
js-test:
- name: Cache Cargo Registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ubuntu-latest-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
js-test-integration:
runs-on: ubuntu-latest
needs:
- wasmpack
- rust-test
- assemble
strategy:
matrix:
node-version: [ 10.x, 12.x, v14.18.3, 14.x, 16.x, 18.x, '*' ]
Expand All @@ -80,12 +129,14 @@ jobs:
with:
name: pkg
- uses: actions/setup-node@v1
name: Setup Node ${{ matrix.node-version }}
with:
node-version: ${{ matrix.node-version }}
- uses: borales/[email protected]
name: Install npm dependencies
with:
cmd: install
- uses: borales/[email protected]
name: Run Jest Tests
with:
cmd: run test

cmd: run test:integration
92 changes: 64 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
tags:

jobs:
rust-test:
rs-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -24,24 +24,26 @@ jobs:
with:
command: build
args: --verbose --features std
- name: Cache Cargo Registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ubuntu-latest-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/cargo@v1
name: Cargo Test
with:
command: test
args: --verbose --features std
wasmpack:
- name: Cache Cargo Registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ubuntu-latest-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
js-test:
runs-on: ubuntu-latest
needs:
- rs-test
strategy:
matrix:
node-version: [ 10.x, 12.x, v14.18.3, 14.x, 16.x, 18.x, '*' ]
steps:
- uses: actions/checkout@v2
name: Clone
- uses: actions/setup-node@v1
with:
node-version: 18.x
- uses: actions-rs/toolchain@v1
name: Setup Rust
with:
Expand All @@ -52,36 +54,73 @@ jobs:
with:
command: install
args: wasm-pack
- uses: actions/setup-node@v1
name: Setup Node ${{ matrix.node-version }}
with:
node-version: ${{ matrix.node-version }}
- uses: borales/[email protected]
name: Install npm dependencies
with:
cmd: install
- name: Build Wasm
run: ./build.sh
- uses: borales/[email protected]
name: Run Jest Tests
with:
cmd: run test
- name: Cache Cargo Registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ubuntu-latest-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
assemble:
runs-on: ubuntu-latest
needs:
- js-test
steps:
- uses: actions/checkout@v2
name: Clone
- uses: actions/setup-node@v1
name: Setup Node
with:
node-version: 18.x
- uses: actions-rs/toolchain@v1
name: Setup Rust
with:
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
name: Install WasmPack
with:
command: install
args: wasm-pack
- uses: borales/[email protected]
name: Install npm dependencies
with:
cmd: install
- uses: borales/[email protected]
name: Build
with:
cmd: run build
- uses: actions/upload-artifact@v2
name: Upload Artifacts
with:
name: pkg
path: |
pkg.bundler/
pkg.dist/
pkg.node/
pkg.web/
package.json
index.browser.js
LICENCE
README.md
js-test:
- name: Cache Cargo Registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ubuntu-latest-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
js-test-integration:
runs-on: ubuntu-latest
needs:
- wasmpack
- rust-test
- assemble
strategy:
matrix:
node-version: [ 10.x, 12.x, v14.18.3, 14.x, 16.x, 18.x, '*' ]
Expand All @@ -92,20 +131,21 @@ jobs:
with:
name: pkg
- uses: actions/setup-node@v1
name: Setup Node ${{ matrix.node-version }}
with:
node-version: ${{ matrix.node-version }}
- uses: borales/[email protected]
name: Install npm dependencies
with:
cmd: install
- uses: borales/[email protected]
name: Run Jest Tests
with:
cmd: run test
cmd: run test:integration
cratesio:
runs-on: ubuntu-latest
needs:
- wasmpack
- rust-test
- js-test
- js-test-integration
steps:
- uses: actions/checkout@v2
name: Clone
Expand All @@ -127,9 +167,7 @@ jobs:
npm:
runs-on: ubuntu-latest
needs:
- wasmpack
- rust-test
- js-test
- js-test-integration
steps:
- uses: actions/checkout@v2
name: Clone
Expand All @@ -146,9 +184,7 @@ jobs:
github:
runs-on: ubuntu-latest
needs:
- wasmpack
- rust-test
- js-test
- js-test-integration
steps:
- uses: actions/checkout@v2
name: Clone
Expand All @@ -157,8 +193,8 @@ jobs:
name: pkg
- name: Pack Artifacts
run: |
zip -r qukit.zip pkg.node/ pkg.bundler/ pkg.web/ pkg.dist/ index.browser.js package.json README.md LICENCE
tar -cvzf qukit.tar.gz pkg.node/ pkg.bundler/ pkg.web/ pkg.dist/ index.browser.js package.json README.md LICENCE
zip -r qukit.zip pkg.node pkg.bundler pkg.web index.browser.js package.json README.md LICENCE
tar -cvzf qukit.tar.gz pkg.node pkg.bundler pkg.web index.browser.js package.json README.md LICENCE
- name: Extract Tag Last
id: prerelease
uses: actions/[email protected]
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
/pkg.node
/pkg.dist
/pkg.web
/dist
/package
8 changes: 3 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "qukit"
version = "0.0.0-pre1"
version = "0.0.0-pre2"
description = "a quantum simulator for rust and wasm"
repository = "https://github.com/28Smiles/qukit"
authors = ["Leon Camus <[email protected]>"]
Expand All @@ -21,7 +21,8 @@ libm = "0.2"
rand = { version = "0.8", default-features = false, features = ["small_rng"] }
serde = { version = "1.0", features = ["derive"], optional = true }
wasm-bindgen = { version = "0.2", features = ["serde-serialize"], optional = true }
tsify = { version = "0.2", optional = true }
#tsify = { version = "0.2", optional = true }
tsify = { git = "https://github.com/28Smiles/tsify", rev = "ea87fda", optional = true }
console_error_panic_hook = { version = "0.1", optional = true }
wee_alloc = { version = "0.4", optional = true }
js-sys = { version = "0.3", optional = true }
Expand Down
26 changes: 0 additions & 26 deletions build.sh

This file was deleted.

Loading

0 comments on commit c0e073c

Please sign in to comment.