Skip to content

Commit

Permalink
chore: [skip ci] migrate to @joystream npm repo (#422)
Browse files Browse the repository at this point in the history
* chore: rename @dzlzv -> @Joystream

affects: @joystream/bn-typeorm, @joystream/hydra-cli, @joystream/hydra-common,
@joystream/hydra-db-utils, hydra-e2e-tests, @joystream/hydra-indexer-gateway,
@joystream/hydra-indexer, @joystream/hydra-processor, @joystream/hydra-typegen, sample,
sample-mappings

* chore: add explicit public config

affects: @joystream/bn-typeorm, @joystream/hydra-cli, @joystream/hydra-common,
@joystream/hydra-db-utils, @joystream/hydra-processor, @joystream/hydra-typegen

* style: lint fix

affects: @joystream/hydra-processor
  • Loading branch information
dzhelezov authored Jun 16, 2021
1 parent 50bd134 commit 401fdec
Show file tree
Hide file tree
Showing 152 changed files with 270 additions and 12,359 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
echo "Branch name: ${{ steps.extract_branch.outputs.branch }}"
yarn logout
echo "always-auth=true" > .npmrc
echo "@dzlzv:registry=https://registry.npmjs.org/" >> .npmrc
echo "@joystream:registry=https://registry.npmjs.org/" >> .npmrc
echo "registry=https://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> .npmrc
npm whoami
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
(cd ./packages/hydra-indexer-gateway && yarn docker:publish)
env:
RELEASE_TAG: ${{ github.event.inputs.graduate == 'true' && 'latest' || 'next' }}


2 changes: 1 addition & 1 deletion .github/workflows/hydra-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
run: |
yarn
yarn e2e-test
14 changes: 7 additions & 7 deletions .github/workflows/hydra-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
- name: run unit tests
run: |
yarn
yarn workspace @dzlzv/hydra-cli test
yarn workspace @dzlzv/hydra-typegen test
yarn workspace @dzlzv/hydra-common build
yarn workspace @dzlzv/hydra-db-utils build
yarn workspace @dzlzv/hydra-processor install
yarn workspace @dzlzv/hydra-processor test
yarn workspace @joystream/hydra-cli test
yarn workspace @joystream/hydra-typegen test
yarn workspace @joystream/hydra-common build
yarn workspace @joystream/hydra-db-utils build
yarn workspace @joystream/hydra-processor install
yarn workspace @joystream/hydra-processor test
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
yarn logout
echo "always-auth=true" > .npmrc
echo "@dzlzv:registry=https://registry.npmjs.org/" >> .npmrc
echo "@joystream:registry=https://registry.npmjs.org/" >> .npmrc
echo "registry=https://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> .npmrc
npm whoami
Expand All @@ -48,4 +48,4 @@ jobs:
- name: Lerna publish current package
if: github.event.inputs.graduate == 'false'
run: |
yarn lerna publish from-package --dist-tag next --yes --conventional-commits --conventional-prerelease '${{ github.event.inputs.packages }}'
yarn lerna publish from-package --dist-tag next --yes --conventional-commits --conventional-prerelease '${{ github.event.inputs.packages }}'
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
}

]
}
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Hydra is an open-source project and contributions in the form of a PR are welcom

## Testing

A pull request adding a new feature or fixing an existing bug should include a test covering the changes. The contribution can be covered either by an e2e test or by a unit test. End-to-end tests are located in `packages/hydra-e2e-tests` and can be run from the root with `yarn e2e-test`. Unit tests are package-specific. For example, unit tests for `hydra-cli` can ber run using `yarn workspace @dzlzv/hydra-cli test`. Both e2e and unit tests are run by CI once a PR is opened.
A pull request adding a new feature or fixing an existing bug should include a test covering the changes. The contribution can be covered either by an e2e test or by a unit test. End-to-end tests are located in `packages/hydra-e2e-tests` and can be run from the root with `yarn e2e-test`. Unit tests are package-specific. For example, unit tests for `hydra-cli` can ber run using `yarn workspace @joystream/hydra-cli test`. Both e2e and unit tests are run by CI once a PR is opened.

## Versioning and Releases

Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ ADD --chown=node:node ./packages/hydra-typegen ./packages/hydra-typegen

RUN yarn --frozen-lockfile

RUN yarn workspace @dzlzv/bn-typeorm build
RUN yarn workspace @dzlzv/hydra-common build
RUN yarn workspace @dzlzv/hydra-db-utils build
RUN yarn workspace @dzlzv/hydra-processor build
RUN yarn workspace @dzlzv/hydra-cli build
RUN yarn workspace @dzlzv/hydra-typegen build
RUN yarn workspace @joystream/bn-typeorm build
RUN yarn workspace @joystream/hydra-common build
RUN yarn workspace @joystream/hydra-db-utils build
RUN yarn workspace @joystream/hydra-processor build
RUN yarn workspace @joystream/hydra-cli build
RUN yarn workspace @joystream/hydra-typegen build

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For popular chains, one can use an already in-sync publicly available Indexer en
Run

```text
$ npx @dzlzv/hydra-cli@next scaffold
$ npx @joystream/hydra-cli@next scaffold
```

and answer the prompts. It will generate a sample project and README with setup instructions.
Expand Down
4 changes: 2 additions & 2 deletions docs/mappings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mappings:
handler: timestampCall
```
Handers receive a signle argument of type defined in `@dzlzv/hydra-common`
Handers receive a signle argument of type defined in `@joystream/hydra-common`

* `eventHanlder` receives a single argument of type `EventContext & StoreContext`
* `extrinsicHandler`receives a single argument of type `ExtrinsicContext & StoreContext`
Expand All @@ -42,7 +42,7 @@ import {
EventContext,
BlockContext,
StoreContext,
} from '@dzlzv/hydra-common'
} from '@joystream/hydra-common'
export async function balancesTransfer({
store,
Expand Down
2 changes: 1 addition & 1 deletion examples/indexers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ A Hydra Indexer (and a gateway) is an independent piece of the Hydra stack. It e

To run an indexer, one typically needs to prepare a json file with the runtime types. Otherwise, the indexer will likely fail due to deserialization errors. Here we keep some popular setups for running a self-hosted indexer.

To run a Hydra processor against the indexer, update `INDEXER_ENDPOINT_URL` environment property, e.g. to `http://localhost:4001/graphql`. For production use, it is recommended to use `https` reverse proxy for the indexer endpoint.
To run a Hydra processor against the indexer, update `INDEXER_ENDPOINT_URL` environment property, e.g. to `http://localhost:4001/graphql`. For production use, it is recommended to use `https` reverse proxy for the indexer endpoint.
2 changes: 1 addition & 1 deletion examples/indexers/joystream/docker-compose-rome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ services:
- "5432"
environment:
POSTGRES_PASSWORD: postgres


2 changes: 1 addition & 1 deletion examples/indexers/node-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Simply run
docker-compose up -d
```

The indexer gateway will be available at `http://localhost:4001/graphql`
The indexer gateway will be available at `http://localhost:4001/graphql`
2 changes: 1 addition & 1 deletion examples/indexers/node-template/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ services:
- "5432"
environment:
POSTGRES_PASSWORD: postgres


2 changes: 1 addition & 1 deletion examples/indexers/subsocial/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ services:
- "5432"
environment:
POSTGRES_PASSWORD: postgres


2 changes: 1 addition & 1 deletion examples/indexers/subsocial/typedefs.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,4 @@
},
"Address": "AccountId",
"LookupSource": "AccountId"
}
}
2 changes: 1 addition & 1 deletion examples/v1/joystream-query-node/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ services:
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_DB: ${DB_NAME}
POSTGRES_DB: ${DB_NAME}
4 changes: 2 additions & 2 deletions examples/v1/joystream-query-node/mappings/members.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BN from 'bn.js'
import { Member } from '../generated/graphql-server/src/modules/member/member.model'
import { SubstrateEvent, AnyJsonField, ExtrinsicArg } from '@dzlzv/hydra-common'
import { DatabaseManager } from '@dzlzv/hydra-db-utils'
import { SubstrateEvent, AnyJsonField, ExtrinsicArg } from '@joystream/hydra-common'
import { DatabaseManager } from '@joystream/hydra-db-utils'

interface CheckedUserInfo {
handle: string
Expand Down
8 changes: 4 additions & 4 deletions examples/v1/joystream-query-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
"tslib": "^2.0.0"
},
"devDependencies": {
"@dzlzv/hydra-cli": "0.1.8",
"@dzlzv/hydra-common": "^0.0.3",
"@dzlzv/hydra-db-utils": "^0.0.2",
"@dzlzv/hydra-processor": "^0.0.7"
"@joystream/hydra-cli": "0.1.8",
"@joystream/hydra-common": "^0.0.3",
"@joystream/hydra-db-utils": "^0.0.2",
"@joystream/hydra-processor": "^0.0.7"
}
}
2 changes: 1 addition & 1 deletion examples/v1/subsocial-query-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ Make sure the model classes and the database schema are rebuilt after a model or

```sh
yarn rebuild
```
```
10 changes: 5 additions & 5 deletions examples/v1/subsocial-query-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
"bn.js": "^5.1.2"
},
"devDependencies": {
"@dzlzv/hydra-cli": "0.1.4",
"@dzlzv/hydra-common": "^0.0.3",
"@dzlzv/hydra-db-utils": "^0.0.2",
"@dzlzv/hydra-processor": "^0.0.7"
"@joystream/hydra-cli": "0.1.4",
"@joystream/hydra-common": "^0.0.3",
"@joystream/hydra-db-utils": "^0.0.2",
"@joystream/hydra-processor": "^0.0.7"
}
}
}
2 changes: 1 addition & 1 deletion examples/v2/subsocial-query-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ Now everything is ready:

```bash
$ docker-compose up
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ services:
image: redis:6.0-alpine
restart: always
ports:
- "6379"
- "6379"
2 changes: 1 addition & 1 deletion examples/v2/subsocial-query-node/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ mappings:
eventHandlers:
- event: posts.PostCreated
handler: postCreated(DatabaseManager, Posts.PostCreatedEvent)


2 changes: 1 addition & 1 deletion examples/v2/subsocial-query-node/mappings/mappings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DatabaseManager } from '@dzlzv/hydra-db-utils'
import { DatabaseManager } from '@joystream/hydra-db-utils'
import { Post } from '../generated/graphql-server/src/modules/post/post.model'

import { Posts } from './generated/types'
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/subsocial-query-node/mappings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"clean": "rm -rf lib"
},
"dependencies": {
"@dzlzv/hydra-common": "2.0.1-beta.9",
"@joystream/hydra-common": "2.0.1-beta.9",
"@polkadot/types": "~2.10.2-7",
"@subsocial/types": "^0.4.35",
"warthog": "https://github.com/metmirr/warthog/releases/download/v2.23.0/warthog-v2.23.0.tgz"
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/subsocial-query-node/mappings/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"skipLibCheck": true,
},
"include": ["./**/*"]
}
}
8 changes: 4 additions & 4 deletions examples/v2/subsocial-query-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"bn.js": "^5.1.2"
},
"devDependencies": {
"@dzlzv/hydra-cli": "2.0.1-beta.9",
"@dzlzv/hydra-processor": "2.0.1-beta.9",
"@dzlzv/hydra-typegen": "2.0.1-beta.9"
"@joystream/hydra-cli": "2.0.1-beta.9",
"@joystream/hydra-processor": "2.0.1-beta.9",
"@joystream/hydra-typegen": "2.0.1-beta.9"
}
}
}
2 changes: 1 addition & 1 deletion examples/v2/subsocial-query-node/typedefs.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,4 @@
},
"Address": "AccountId",
"LookupSource": "AccountId"
}
}
4 changes: 2 additions & 2 deletions hydra-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ A cli tool for running a [Hydra](https://joystream.org/hydra) query node
Using `npx`:

```bash
$ alias hydra-cli='npx @dzlzv/hydra-cli'
$ alias hydra-cli='npx @joystream/hydra-cli'
```

or install via npm:

```bash
npm install -g @dzlzv/hydra-cli
npm install -g @joystream/hydra-cli
```

and then
Expand Down
12 changes: 6 additions & 6 deletions install-hydra.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
## Installation

{% hint style="warning" %}
Use `@dzlzv/hydra-cli@next` for the most recent development version
Use `@joystream/hydra-cli@next` for the most recent development version
{% endhint %}

_Global installation:_

```bash
npm install -g @dzlzv/hydra-cli
npm install -g @joystream/hydra-cli
```

The path to `hydra-cli` binaries will be added to the system-wide `$PATH`.

_Local installation:_

```bash
npm install @dzlzv/hydra-cli
npm install @joystream/hydra-cli
```

The binaries will be installed to the local `.bin` folder. You can execute `hydra-cli` commands by adding the`.bin`folder within your local `node_modules` to `$PATH`.
Expand All @@ -36,7 +36,7 @@ _Isolated set-up:_
Execute `hydra-cli` commands directly by typing

```bash
npx @dzlzv/hydra-cli <command>
npx @joystream/hydra-cli <command>
```

This provides an isolated way to execute `hydra-cli` commands.
Expand All @@ -49,13 +49,13 @@ Run `hydra-cli --version` to check your installation
It may be convenient to create an alias for quick access to `hydra-cli` e.g.

```text
alias hydra-cli='npx @dzlzv/hydra-cli'
alias hydra-cli='npx @joystream/hydra-cli'
```

Or on Windows you can use:

```text
doskey hydra-cli=npx @dzlzv/hydra-cli
doskey hydra-cli=npx @joystream/hydra-cli
```
{% endhint %}

3 changes: 3 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"conventionalCommits": true,
"changelogPreset": "conventionalcommits",
"message": "chore: [ci skip] %s"
},
"publish": {
"registry": "https://registry.npmjs.org/"
}
}
}
4 changes: 2 additions & 2 deletions migration-to-hydra-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ Run `yarn typegen`

### Mapping files

Change mappings arguments: `DB` should be converted to `DatabaseManager` imported from `@dzlzv/hydra-db-utils`
Change mappings arguments: `DB` should be converted to `DatabaseManager` imported from `@joystream/hydra-db-utils`

Replace `event: SubstrateEvent` with a typed class generated by typegen in the previous step. The event data is now available at `event.data`

Whenever the corresponding extrinsic data is needed, use `event.ctx.extrinsic` and create a type-safe `Call` class out of it. Here is an example:

```typescript
import { DatabaseManager } from '@dzlzv/hydra-db-utils'
import { DatabaseManager } from '@joystream/hydra-db-utils'
import { Post } from '../generated/graphql-server/src/modules/post/post.model'

import { Posts } from './generated/types'
Expand Down
Loading

0 comments on commit 401fdec

Please sign in to comment.