-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f63e0d7
commit e639ac8
Showing
19 changed files
with
6,569 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: npm publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- base | ||
release: | ||
types: [published] | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
concurrency: | ||
# SHA is added to the end if on `main` to let all main workflows run | ||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main') && github.sha || '' }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_npm: | ||
name: Npm | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set Env | ||
uses: Chia-Network/actions/setjobenv@main | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up rusts | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: rustfmt, clippy | ||
|
||
- name: install wasm-pack | ||
run: cargo install --version 0.11.1 wasm-pack | ||
|
||
- name: wasm-pack build and pack | ||
run: wasm-pack build --release --target=nodejs wasm && wasm-pack pack wasm | ||
|
||
- name: Setup Node 16.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
run: cd wasm/tests && yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))] | ||
#[ctor::ctor] | ||
fn init() { | ||
env_logger::init(); | ||
} | ||
|
||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))] | ||
pub fn wasm_init() { | ||
env_logger::init(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[package] | ||
name = "chia_gaming_wasm" | ||
version = "0.1.0" | ||
edition = "2018" | ||
authors = ["Art Yerkes <[email protected]>"] | ||
description = "tools for working with chialisp language; compiler, repl, python and wasm bindings" | ||
homepage = "https://prozacchiwawa.github.io/clvm_tools_rs/" | ||
readme = "README.md" | ||
repository = "https://github.com/Chia-Network/clvm_tools_rs" | ||
license = "MIT" | ||
keywords = ["chia", "chialisp", "clvm"] | ||
categories = ["command-line-utilities"] | ||
|
||
[lib] | ||
name = "chia_gaming_wasm" | ||
crate-type = ["cdylib"] | ||
path = "src/mod.rs" | ||
|
||
[dependencies] | ||
chia_gaming = { path= "..", features = [] } | ||
clvmr = { version = "0.3.0", features = ["pre-eval"] } | ||
wasm-bindgen = "=0.2.83" | ||
wasm-bindgen-test = "=0.3.25" | ||
js-sys = "0.3.60" | ||
num-bigint = "0.4.0" | ||
num-traits = "0.2.15" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use wasm_bindgen::prelude::*; | ||
|
||
use chia_gaming::log::wasm_init; | ||
|
||
#[wasm_bindgen] | ||
pub fn init() { | ||
wasm_init(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build/* | ||
/**/*.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"modules": true, | ||
"experimentalObjectRestSpread": true | ||
} | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], | ||
"rules": { | ||
"comma-dangle": 0, | ||
"no-unused-vars": "warn", | ||
"no-unexpected-multiline": "warn", | ||
"prefer-const": "warn", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-var-requires": "off" | ||
}, | ||
"settings": {}, | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"jasmine": true, | ||
"jest": true, | ||
"es6": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.vscode | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# dependencies | ||
/node_modules | ||
|
||
# testing | ||
/tests | ||
/coverage | ||
|
||
# docs | ||
/docs | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
/.github | ||
/demo | ||
.esdoc.json | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Development folders and files | ||
public | ||
src | ||
scripts | ||
config | ||
.travis.yml | ||
CHANGELOG.md | ||
README.md | ||
.eslintignore | ||
.eslintrc.json | ||
webpack.config.js | ||
babel.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
presets: [["@babel/env"]], | ||
plugins: [ | ||
["@babel/plugin-proposal-class-properties"], | ||
["@babel/plugin-transform-typescript"], | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
"name": "clvm-tools-interface", | ||
"version": "0.1.35", | ||
"description": "Tests and extras for the clvm_tools_rs javascript interface", | ||
"main": "build/index.js", | ||
"types": "build/types/index.d.ts", | ||
"scripts": { | ||
"start": "webpack serve --config webpack.config.demo.js", | ||
"build": "webpack && tsc", | ||
"build:demo": "webpack --config webpack.config.demo.js", | ||
"test": "tsc -p tstestconfig.json --noEmit && jest", | ||
"coverage": "npm run test -- --coverage", | ||
"prepare": "npm run build", | ||
"trypublish": "npm publish || true" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/hodgef/ts-library-boilerplate-basic" | ||
}, | ||
"author": "Francisco Hodge <[email protected]> (https://github.com/hodgef)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/hodgef/ts-library-boilerplate-basic/issues" | ||
}, | ||
"homepage": "https://github.com/hodgef/ts-library-boilerplate-basic", | ||
"keywords": [ | ||
"library", | ||
"starter", | ||
"es6" | ||
], | ||
"devDependencies": { | ||
"@babel/cli": "^7.22.9", | ||
"@babel/core": "^7.22.10", | ||
"@babel/plugin-proposal-class-properties": "^7.16.0", | ||
"@babel/plugin-transform-typescript": "^7.22.10", | ||
"@babel/polyfill": "^7.12.1", | ||
"@babel/preset-env": "^7.22.10", | ||
"@types/jest": "^29.5.3", | ||
"@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"@typescript-eslint/parser": "^4.33.0", | ||
"babel-eslint": "^10.1.0", | ||
"babel-loader": "^9.1.3", | ||
"babel-preset-minify": "^0.5.2", | ||
"css-loader": "^6.8.1", | ||
"css-minimizer-webpack-plugin": "^5.0.1", | ||
"eslint": "^7.32.0", | ||
"file-loader": "^6.2.0", | ||
"html-webpack-plugin": "^5.5.3", | ||
"jest": "^29.6.2", | ||
"mini-css-extract-plugin": "^2.7.6", | ||
"style-loader": "^3.3.2", | ||
"terser-webpack-plugin": "^5.3.9", | ||
"typescript": "^4.9.5", | ||
"url-loader": "^4.1.1", | ||
"webpack": "^5.88.2", | ||
"webpack-cli": "^5.1.4", | ||
"webpack-dev-server": "4.13.3" | ||
}, | ||
"jest": { | ||
"moduleNameMapper": { | ||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/scripts/testMock.js", | ||
"\\.(css|less)$": "<rootDir>/scripts/testMock.js" | ||
}, | ||
"moduleFileExtensions": [ | ||
"web.js", | ||
"js", | ||
"web.ts", | ||
"ts", | ||
"web.tsx", | ||
"tsx", | ||
"json", | ||
"web.jsx", | ||
"jsx", | ||
"node" | ||
] | ||
}, | ||
"dependencies": { | ||
"bls-signatures": "^2.0.2" | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { init } from '../../../../pkg/chia_gaming_wasm.js'; | ||
|
||
import * as fs from 'fs'; | ||
import { resolve } from 'path'; | ||
import * as assert from 'assert'; | ||
import * as bls_loader from 'bls-signatures'; | ||
|
||
it('loads', async () => { | ||
init(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"compilerOptions": { | ||
"noImplicitAny": true, | ||
"outDir": "build/types", | ||
"module": "esnext", | ||
"target": "es5", | ||
"allowJs": true, | ||
"checkJs": false, | ||
"sourceMap": true, | ||
"declaration": true, | ||
"emitDeclarationOnly": true, | ||
"suppressImplicitAnyIndexErrors": true, | ||
"lib": ["es2018", "dom"], | ||
"moduleResolution": "node", | ||
"target": "es2020" | ||
}, | ||
"include": ["src/lib"], | ||
"exclude": ["src/lib/**/tests"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"emitDeclarationOnly": false, | ||
"noEmitOnError": true, | ||
"strict": true, | ||
}, | ||
"include": ["src/lib/**/tests"], | ||
"exclude": [] | ||
} |
Oops, something went wrong.