Skip to content

Commit

Permalink
Merge pull request #9 from denorg/wasmbuild
Browse files Browse the repository at this point in the history
feat: move to wasmbuild
  • Loading branch information
oplik0 authored Jul 5, 2022
2 parents 1ec4449 + b8f179c commit 47ce498
Show file tree
Hide file tree
Showing 13 changed files with 993 additions and 191 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/deno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: 14
- name: Setup Deno
uses: denolib/setup-deno@master
with:
deno-version: 1.x
- name: build wasm
run: deno task wasmbuild
- name: Setup package.json
run: echo '{"name":"@denorg/scrypt","version":"0.0.0","publishConfig":{"access":"public"},"scripts":{"semantic-release":"semantic-release"},"repository":{"type":"git","url":"https://github.com/denorg/scrypt.git"},"author":"Denorg<hello@den.org.in>","license":"MIT","bugs":{"url":"https://github.com/denorg/scrypt/issues"},"homepage":"https://denorg.github.io/scrypt/","devDependencies":{"semantic-release":"^17.0.4","semantic-release-gitmoji":"^1.3.3"}}' > package.json
- name: Install dependencies
Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[workspace]
members = ["lib/_wasm"]
default-members = ["lib/_wasm"]
[profile.release]
opt-level = 3
3 changes: 3 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"files": {
"exclude": ["lib/_wasm/wasm.js", "lib/_wasm/out/"]
}
},
"tasks": {
"wasmbuild": "deno run --allow-env --allow-run --allow-read --allow-write --allow-net https://deno.land/x/wasmbuild@0.8.3/main.ts --out ./lib/_wasm --project scrypt-wasm --sync"
}
}
3 changes: 2 additions & 1 deletion dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
],
"excludes": [
"**/node_modules",
"**/*-lock.json"
"**/*-lock.json",
"**/*.generated.js"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.69.1.wasm",
Expand Down
2 changes: 1 addition & 1 deletion lib/_wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "scrypt-wasm"
version = "0.1.1"
authors = ["Kosala Hemachandra <kvhnuke@aol.com>", "oplik0"]
authors = ["oplik0"]
edition = "2021"

[lib]
Expand Down
3 changes: 1 addition & 2 deletions lib/_wasm/LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
MIT License

Copyright (c) 2018 MyEtherWallet
Copyright (c) 2018 oplik0
Copyright (c) 2022 oplik0

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 4 additions & 10 deletions lib/_wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ Scrypt crypto library in Web Assembly

# Prerequisities

- This project requires Rust 1.30.0 or later.
- `wasm-pack` is required.
```sh
cargo install wasm-pack
```
- Rust toolchain needs to be installed (see https://rustup.rs/)

### Build

from the main package folder run

```sh
deno run --allow-read --allow-write --allow-run ./build.ts
deno task wasmbuild
```

### acknowledgement

This implementation is a modified version of [this repository](https://github.com/MyEtherWallet/scrypt-wasm/)
47 changes: 0 additions & 47 deletions lib/_wasm/build.ts

This file was deleted.

Loading

0 comments on commit 47ce498

Please sign in to comment.