Skip to content
Snippets Groups Projects
Verified Commit ffc3db90 authored by Mateusz Tyszczak's avatar Mateusz Tyszczak :scroll:
Browse files

Move package scope from hive to hiveio

parent 17fc7c33
No related branches found
No related tags found
1 merge request!9Move to hiveio
......@@ -41,6 +41,3 @@ config/.env*
# But include debug configuration universal for other users using vscode
!.vscode/launch.json
# Publish tokens and registries
.npmrc
\ No newline at end of file
......@@ -42,13 +42,11 @@ lint:
build:
stage: build
image: ${EMSCRIPTEN_IMAGE}
before_script:
- pnpm install
script:
- npm run build
after_script:
- npm pack --pack-destination "$CI_PROJECT_DIR/dist"
extends: .npm_build_template
variables:
DIST_DIR: "$CI_PROJECT_DIR/dist"
NPM_PACKAGE_SCOPE: "@hiveio"
NPM_PACKAGE_NAME: "workerbee"
artifacts:
paths:
- "$CI_PROJECT_DIR/dist/*.tgz"
......@@ -87,7 +85,7 @@ deploy_dev_package:
image: ${EMSCRIPTEN_IMAGE}
variables:
PUBLISH_TOKEN: "$NPM_TOKEN"
NPM_SCOPE: "@hive"
NPM_SCOPE: "@hiveio"
NPM_REGISTRY: "gitlab.syncad.com/api/v4/projects/${CI_PROJECT_ID}/packages/npm/"
script:
......@@ -104,13 +102,9 @@ deploy_production_public_npm:
# emscripten image can be used as it contains all needed tools.
image: ${EMSCRIPTEN_IMAGE}
variables:
PUBLISH_TOKEN: "$INTERNAL_HIDDEN_PUBLISH_TOKEN" # Add token variable here
NPM_SCOPE: "@hiveio"
NPM_REGISTRY: "registry.npmjs.org/"
script:
- tar -xf "$CI_PROJECT_DIR"/dist/hive-workerbee-*.tgz --strip-components=1
- scripts/bump_npm_version.sh "$PUBLISH_TOKEN" "$NPM_SCOPE" "$NPM_REGISTRY"
- scripts/npm_publish.sh
NPM_PUBLISH_TOKEN: "$INTERNAL_HIDDEN_PUBLISH_TOKEN"
NPM_PACKAGE_NAME: "workerbee"
PACKAGE_TGZ_PATH: "${BUILT_PACKAGE_PATH}"
needs:
- job: lint
- job: test
......
.npmrc 0 → 100644
# https://gitlab.syncad.com/hive group specification, offering aggregated package view: https://gitlab.syncad.com/groups/hive/-/packages
@hiveio:registry=https://gitlab.syncad.com/api/v4/groups/136/-/packages/npm/
......@@ -14,15 +14,32 @@ Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```bash
npm install @hive/workerbee
npm install @hiveio/workerbee
```
If you want to use development versions of our packages, set `@hiveio` scope to use our GitLab registry:
```bash
echo @hiveio:registry=https://gitlab.syncad.com/api/v4/packages/npm/ >> .npmrc
npm install @hiveio/workerbee
```
## Usage
Wax is designed to work in web environment by default, so remember to use:
```ts
import '@hiveio/workerbee/node';
```
import when you intend to work in the Node.js environment.
You may need to set `moduleResolution` to `Bundler` in your `tsconfig.json` in order to respect the `exports` fields in our `package.json` file
### Iterating indefinitely over new blocks
```js
import WorkerBee from "@hive/workerbee";
import WorkerBee from "@hiveio/workerbee";
const bot = new WorkerBee();
bot.on("error", console.error);
......@@ -36,7 +53,7 @@ for await(const { block, number } of bot)
### Wait for the next block using observer
```js
import WorkerBee from "@hive/workerbee";
import WorkerBee from "@hiveio/workerbee";
const bot = new WorkerBee();
bot.on("error", console.error);
......@@ -60,7 +77,7 @@ observer.subscribe({
### Observe given account for operations in blockchain
```js
import WorkerBee from "@hive/workerbee";
import WorkerBee from "@hiveio/workerbee";
const bot = new WorkerBee();
bot.on("error", console.error);
......@@ -79,7 +96,7 @@ observer.subscribe({
### Observe given account for full manabar regeneration
```js
import WorkerBee from "@hive/workerbee";
import WorkerBee from "@hiveio/workerbee";
const bot = new WorkerBee();
bot.on("error", console.error);
......@@ -98,8 +115,8 @@ observer.subscribe({
### Broadcast and observe transaction in blockchain
```js
import WorkerBee from "@hive/workerbee";
import beekeeperFactory from "@hive/beekeeper";
import WorkerBee from "@hiveio/workerbee";
import beekeeperFactory from "@hiveio/beekeeper";
const beekeeper = await beekeeperFactory();
const session = await beekeeper.createSession("my.salt");
......
......@@ -9,12 +9,12 @@
<script type="importmap">
{
"imports": {
"@hive/workerbee": "/dist/bundle/web-full.js"
"@hiveio/workerbee": "/dist/bundle/web-full.js"
}
}
</script>
<script type="module">
import WorkerBee from '@hive/workerbee';
import WorkerBee from '@hiveio/workerbee';
Object.defineProperties(window, {
WorkerBee: {
......
<a name="_modulesmd"></a>
# @hive/workerbee
# @hiveio/workerbee
## Interfaces
......
......@@ -42,8 +42,8 @@
<div id="log"></div>
<script type="module">
import WorkerBee from "../../dist/bundle/index.js";
import { OperationVisitor } from "@hive/wax";
import beekeeperFactory from "@hive/beekeeper";
import { OperationVisitor } from "@hiveio/wax";
import beekeeperFactory from "@hiveio/beekeeper";
const startBtn = document.getElementById("start");
const logger = document.getElementById("log");
......
......@@ -54,7 +54,7 @@
<h2>Log</h2>
<div id="log"></div>
<script type="module">
import beekeeperFactory from "@hive/beekeeper";
import beekeeperFactory from "@hiveio/beekeeper";
const startBtn = document.getElementById("start");
const logger = document.getElementById("log");
......
{
"name": "@hive/workerbee",
"name": "@hiveio/workerbee",
"version": "0.0.1-LastGitTagPlaceholder.GitHashPlaceholder",
"description": "Hive automation library based on the wax and beekeeper",
"main": "dist/bundle/web.js",
"types": "dist/bundle/web.d.ts",
"packageManager": "pnpm@9.0.6+sha256.0624e30eff866cdeb363b15061bdb7fd9425b17bc1bb42c22f5f4efdea21f6b3",
"exports": {
".": {
"node": {
"import": {
"types": "./dist/bundle/node.d.ts",
"default": "./dist/bundle/node.js"
}
},
"default": {
"import": {
"types": "./dist/bundle/web.d.ts",
......@@ -79,8 +74,8 @@
"typescript": "5.2.2"
},
"dependencies": {
"@hive/beekeeper": "1.27.2-stable.240111223939",
"@hive/wax": "0.3.8-stable.240111142158",
"@hiveio/beekeeper": "1.27.5-rc7-stable.240510204534",
"@hiveio/wax": "0.3.8-240514120640",
"events": "^3.3.0",
"rxjs": "^7.8.1"
},
......
This diff is collapsed.
......@@ -14,8 +14,8 @@ const commonConfiguration = (env, packEntire = false) => ([
plugins: [
alias({
entries: [
{ find: '@hive/beekeeper', replacement: `@hive/beekeeper/${env}` },
{ find: '@hive/wax', replacement: `@hive/wax/${env}` }
{ find: '@hiveio/beekeeper', replacement: `@hiveio/beekeeper/${env}` },
{ find: '@hiveio/wax', replacement: `@hiveio/wax/${env}` }
]
}),
nodeResolve({
......
......@@ -4,7 +4,7 @@ SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
PROJECT_DIR="${SCRIPTPATH}/.."
PUBLISH_TOKEN="${1}"
# @hive
# @hiveio
SCOPE="${2:-@hiveio}"
# gitlab.syncad.com/api/v4/projects/419/packages/npm/
REGISTRY_URL="${3:-registry.npmjs.org/}"
......
......@@ -7,7 +7,7 @@ import {
limit_order_create, limit_order_create2, operation, pow, pow2, recover_account, recurrent_transfer, remove_proposal,
request_account_recovery, set_withdraw_vesting_route, transfer, transfer_from_savings, transfer_to_savings,
transfer_to_vesting, update_proposal, update_proposal_votes, vote, withdraw_vesting, witness_block_approve,
witness_set_properties, witness_update } from "@hive/wax";
witness_set_properties, witness_update } from "@hiveio/wax";
export class AccountOperationVisitor extends OperationVisitor<operation | void> {
public constructor(
......
import EventEmitter from "events";
import type { IBeekeeperOptions, IBeekeeperUnlockedWallet } from "@hive/beekeeper";
import { BroadcastTransactionRequest, calculateExpiration, IWaxOptionsChain, transaction, TWaxExtended } from "@hive/wax";
import type { IBeekeeperOptions, IBeekeeperUnlockedWallet } from "@hiveio/beekeeper";
import { BroadcastTransactionRequest, calculateExpiration, IWaxOptionsChain, transaction, TWaxExtended } from "@hiveio/wax";
import type { Subscribable } from "rxjs";
import { WorkerBeeError } from "./errors";
......
import type EventEmitter from "events";
import type { IBeekeeperUnlockedWallet } from "@hive/beekeeper";
import type { ApiAccount, ApiBlock, ApiTransaction, IHiveChainInterface, operation, transaction } from "@hive/wax";
import type { IBeekeeperUnlockedWallet } from "@hiveio/beekeeper";
import type { ApiAccount, ApiBlock, ApiTransaction, IHiveChainInterface, operation, transaction } from "@hiveio/wax";
import type { Subscribable } from "rxjs";
import type { IStartConfiguration } from "./bot";
......
import type { ApiAccount, operation } from "@hive/wax";
import type { ApiAccount, operation } from "@hiveio/wax";
import type { Subscribable, Observer, Unsubscribable } from "rxjs";
import { AccountOperationVisitor } from "./account_observer";
......
import { createHiveChain, IWaxOptionsChain, TWaxExtended } from "@hive/wax";
import { createHiveChain, IWaxOptionsChain, TWaxExtended } from "@hiveio/wax";
export const WaxExtendTypes = {};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment