From bcbb770dd2a13520c06c676de53ce7d3ce6f9622 Mon Sep 17 00:00:00 2001 From: "fryorcraken.eth" Date: Tue, 27 Sep 2022 13:52:03 +1000 Subject: [PATCH 1/3] chore: update lock file --- example/package-lock.json | 6 ++++-- package-lock.json | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/example/package-lock.json b/example/package-lock.json index 64d447e..bcf26ca 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -1,11 +1,11 @@ { - "name": "rln-wasm-example", + "name": "@waku/rln-example", "version": "0.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "rln-wasm-example", + "name": "@waku/rln-example", "version": "0.1.0", "dependencies": { "@waku/rln": "file:../" @@ -54,6 +54,7 @@ "husky": "^7.0.4", "ignore-loader": "^0.1.2", "isomorphic-fetch": "^3.0.0", + "js-waku": "^0.29.0-7714812", "jsdom": "^19.0.0", "jsdom-global": "^3.0.2", "karma": "^6.3.12", @@ -3971,6 +3972,7 @@ "husky": "^7.0.4", "ignore-loader": "^0.1.2", "isomorphic-fetch": "^3.0.0", + "js-waku": "^0.29.0-7714812", "jsdom": "^19.0.0", "jsdom-global": "^3.0.2", "karma": "^6.3.12", diff --git a/package-lock.json b/package-lock.json index e0c63dc..2ea0e1d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10421,6 +10421,16 @@ "through": "^2.3.8" } }, + "node_modules/undici": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.10.0.tgz", + "integrity": "sha512-c8HsD3IbwmjjbLvoZuRI26TZic+TSEe8FPMLLOkN1AfYRhdjnKBU6yL+IwcSCbdZiX4e5t0lfMDLDCqj4Sq70g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12.18" + } + }, "node_modules/unique-string": { "version": "2.0.0", "dev": true, @@ -16505,7 +16515,8 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/native-fetch/-/native-fetch-4.0.2.tgz", "integrity": "sha512-4QcVlKFtv2EYVS5MBgsGX5+NWKtbDbIECdUXDBGDMAZXq3Jkv9zf+y8iS7Ub8fEdga3GpYeazp9gauNqXHJOCg==", - "dev": true + "dev": true, + "requires": {} }, "natural-compare": { "version": "1.4.0", @@ -18252,6 +18263,13 @@ "through": "^2.3.8" } }, + "undici": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.10.0.tgz", + "integrity": "sha512-c8HsD3IbwmjjbLvoZuRI26TZic+TSEe8FPMLLOkN1AfYRhdjnKBU6yL+IwcSCbdZiX4e5t0lfMDLDCqj4Sq70g==", + "dev": true, + "peer": true + }, "unique-string": { "version": "2.0.0", "dev": true, From c1fb1f52ca920b987c1c66c469a82a562c5a09bf Mon Sep 17 00:00:00 2001 From: "fryorcraken.eth" Date: Tue, 27 Sep 2022 13:54:44 +1000 Subject: [PATCH 2/3] chore: fix format --- src/encoder.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/encoder.ts b/src/encoder.ts index 66f8742..535be68 100644 --- a/src/encoder.ts +++ b/src/encoder.ts @@ -1,5 +1,5 @@ import debug from "debug"; -import {proto_message, utils} from "js-waku"; +import { proto_message, utils } from "js-waku"; import { Decoder, Encoder, @@ -76,6 +76,6 @@ export class RLNDecoder implements Decoder { } function toRLNSignal(msg: Message): Uint8Array { - const contentTopicBytes = utils.utf8ToBytes(msg.contentTopic ?? "") + const contentTopicBytes = utils.utf8ToBytes(msg.contentTopic ?? ""); return new Uint8Array([...(msg.payload ?? []), ...contentTopicBytes]); } From ae9b3c1f9efada691f2a1421b6c89adaf9cba938 Mon Sep 17 00:00:00 2001 From: "fryorcraken.eth" Date: Tue, 27 Sep 2022 13:49:24 +1000 Subject: [PATCH 3/3] chore: add ci --- .github/workflows/ci.yml | 70 ++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cff8c52 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,70 @@ +name: CI + +on: + push: + branches: + - "master" + - "staging" + - "trying" + pull_request: + +env: + NODE_JS: "16" + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_JS }} + - uses: bahmutov/npm-install@v1 + - run: npm run test:lint + - run: npm run test:prettier + - run: npm run test:spelling + - run: npm run test:tsc + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_JS }} + - uses: bahmutov/npm-install@v1 + - run: npm run build + + browser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_JS }} + - uses: bahmutov/npm-install@v1 + - run: npm run test:browser + + release_next: + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + needs: [check, build, browser] + steps: + - uses: actions/checkout@v2.3.3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_JS }} + - uses: bahmutov/npm-install@v1 + + - name: Append git hash to version + shell: bash + run: | + CURR_VERSION=$(cat package.json | jq .version | tr -d '"') + GIT_HASH=$(git rev-parse --short HEAD) + cat package.json| jq --arg version "$CURR_VERSION-$GIT_HASH" '.version |= $version' > _package.json + mv -f _package.json package.json + + - name: Authenticate with registry + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ./.npmrc + + - run: npm publish --tag next --access public diff --git a/package.json b/package.json index 51789c7..5f2cd3c 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "test:lint": "eslint src --ext .ts", "test:prettier": "prettier \"src/**/*.ts\" \"./*.json\" \"*.*js\" \".github/**/*.yml\" --list-different", "test:spelling": "cspell \"{*.md,.github/*.md,src/**/*.ts}\"", - "test:tsc": "tsc", + "test:tsc": "tsc -p tsconfig.dev.json", "test:browser": "karma start karma.conf.cjs", "watch:build": "tsc -p tsconfig.json -w", "watch:test": "mocha --watch",