Skip to content

Commit

Permalink
Add public README file
Browse files Browse the repository at this point in the history
  • Loading branch information
mtyszczak committed Oct 18, 2023
1 parent 265ed25 commit ac487d9
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 16 deletions.
52 changes: 36 additions & 16 deletions programs/beekeeper/beekeeper_wasm/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,59 @@
# beekeeper

## TypeScript
call hived functions from JavaScript

### Configure
## Install

**It is strongly advised to use our development image: `registry.gitlab.syncad.com/hive/common-ci-configuration/emsdk:3.1.43`**
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/).

If you want to test our package locally follow those steps:
Before installing, [download and install Node.js](https://nodejs.org/en/download/).
Node.js 12 or higher is required.

First install the package manager:
Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```bash
sudo npm i -g pnpm
npm install @hiveio/beekeeper
```

And all of the required dependencies:
## Usage

```bash
pnpm install
```js
import beekeeperFactory from '@hiveio/beekeeper';

const beekeeper = await beekeeperFactory();

const sessionData = await beekeeper.create_session('pear');

console.log(beekeeper.get_info(sessionData.token));
```

### Build
## API

**(WIP)**

## Support and tests

Tested on the latest Chromium (v117)

[Automated CI test](https://gitlab.syncad.com/hive/hive/-/pipelines) runs are available.

To run the tests on your own, clone the Hive repo and install the dependencies:

```bash
npm run build
git clone https://gitlab.syncad.com/hive/hive.git --depth 1
cd hive/programs/beekeeper/beekeeper_wasm
sudo npm install -g pnpm
pnpm install
```

### Test

We use playwright in our tests to emulate WASM behaviour in the browser environment:
Then run tests:

```bash
npm run test
```

### License
## License

See license in the [LICENSE.md](../../../LICENSE.md) file
See license in the [LICENSE.md](LICENSE.md) file
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ test.describe('WASM Base tests', () => {
// Base browser type test
test('Should test on chromium', async () => {
const browserType = browser.browserType();
const version = browser.version();

console.info(`Using browser ${browserType} v${version}`);;

expect(browserType.name()).toBe('chromium');
});
Expand Down
37 changes: 37 additions & 0 deletions programs/beekeeper/beekeeper_wasm/building.ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# TypeScript beekeeper

## Configure

**It is strongly advised to use our development image: `registry.gitlab.syncad.com/hive/common-ci-configuration/emsdk:3.1.43`**

If you want to test our package locally follow those steps:

First install the package manager:

```bash
sudo npm i -g pnpm
```

And all of the required dependencies:

```bash
pnpm install
```

## Build

```bash
npm run build
```

## Test

We use playwright in our tests to emulate WASM behaviour in the browser environment:

```bash
npm run test
```

## License

See license in the [LICENSE.md](../../../LICENSE.md) file
1 change: 1 addition & 0 deletions programs/beekeeper/beekeeper_wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"license": "SEE LICENSE IN LICENSE.md",
"files": [
"LICENSE.md",
"README.md",
"build/beekeeper_wasm.js",
"build/beekeeper_wasm.d.ts",
"dist/*.d.ts",
Expand Down

0 comments on commit ac487d9

Please sign in to comment.