Skip to content

Commit 7b65562

Browse files
authored
Fix Node example (#15)
* 0.1.7 * update examples (fix #14) * Fix build * Add crypto to bloom tests
1 parent aea24b9 commit 7b65562

File tree

8 files changed

+17
-13
lines changed

8 files changed

+17
-13
lines changed

.github/workflows/build-js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Use Node.js
1818
uses: actions/setup-node@v3
1919
with:
20-
node-version: '19.x'
20+
node-version: 'lts/*'
2121

2222
- name: Install wasm-pack
2323
uses: jetli/wasm-pack-action@f98777369a49686b132a9e8f0fdd59837bf3c3fd

examples/node-local/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/node-local/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"dependencies": {
3-
"@blyss/sdk": "0.1.7-alpha.1"
3+
"@blyss/sdk": "latest"
44
},
55
"devDependencies": {
66
"ts-node": "^10.9.1",

examples/node/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ async function main() {
66
const client: Client = new blyss.Client('<YOUR API KEY HERE>');
77

88
// Create the bucket
9-
const bucketName = 'global.wc-v1';
9+
const bucketName = 'state-capitals';
1010
if (!(await client.exists(bucketName))) {
1111
console.log('creating...');
1212
await client.create(bucketName, true, {

examples/node/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/tests/bloom.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { bloomLookup, bloomWrite, bloomInit } from '../data/bloom';
22

3+
if (typeof crypto === 'undefined')
4+
// eslint-disable-next-line @typescript-eslint/no-var-requires
5+
(globalThis as any).crypto = (require('node:crypto') as any).webcrypto;
6+
37
describe('bloom filter write + lookup', () => {
48
it.each([
59
[10, 24, ['a', 'b', 'c']],

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "Samir Menon <[email protected]>",
33
"name": "@blyss/sdk",
4-
"version": "0.1.7-alpha.1",
4+
"version": "0.1.7",
55
"description": "Blyss SDK, enabling private retrievals from Blyss buckets",
66
"type": "module",
77
"main": "./dist/index.js",

0 commit comments

Comments
 (0)