Skip to content

Commit

Permalink
Moving packages
Browse files Browse the repository at this point in the history
  • Loading branch information
troelsfr committed Nov 4, 2022
1 parent 14d4939 commit 33964f9
Show file tree
Hide file tree
Showing 119 changed files with 94 additions and 90 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ want to use it for.

| Package | Version | Description | Dependencies |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [`@zilliqa-js/core`](./packages/zilliqa-js-core) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/core.svg)](https://www.npmjs.com/package/@zilliqa-js/core) | Core abstractions and base classes, such as `HTTPProvider` and network logic for interfacing with the Zilliqa JSON-RPC. | |
| [`@zilliqa-js/util`](./packages/zilliqa-js-util) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/util.svg)](https://www.npmjs.com/package/@zilliqa-js/util) | Miscellaneous functions that take care of serialisation/deserialisation and validation. | |
| [`@zilliqa-js/crypto`](./packages/zilliqa-js-crypto) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/crypto.svg)](https://www.npmjs.com/package/@zilliqa-js/crypto) | Exposes several loosely-coupled cryptographic convenience functions for working with the Zilliqa blockchain and its cryptographic primitives, such as Schnorr signatures. | `@zilliqa-js/util` |
| [`@zilliqa-js/proto`](./packages/zilliqa-js-proto) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/proto.svg)](https://www.npmjs.com/package/@zilliqa-js/proto) | Protobuf source files and corresponding generated JS modules. | |
| [`@zilliqa-js/account`](./packages/zilliqa-js-account) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/account.svg)](https://www.npmjs.com/package/@zilliqa-js/account) | `Wallet`, `Account` and `Transaction` abstractions. | `@zilliqa-js/core`, `@zilliqa-js/crypto`, `@zilliqa-js/proto` |
| [`@zilliqa-js/blockchain`](./packages/zilliqa-js-blockchain) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/blockchain.svg)](https://www.npmjs.com/package/@zilliqa-js/blockchain) | Main interface to the Zilliqa `JSON-RPC`. | `@zilliqa-js/account` |
| [`@zilliqa-js/contract`](./packages/zilliqa-js-contract) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/contract.svg)](https://www.npmjs.com/package/@zilliqa-js/contract) | Exposes a `Contracts` module that takes care of smart contract deployment and interaction. | `@zilliqa-js/blockchain` |
| [`@zilliqa-js/subscriptions`](./packages/zilliqa-js-util) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/subscriptions.svg)](https://www.npmjs.com/package/@zilliqa-js/subscriptions) | Classes to interact with the websocket API of Zilliqa node. | |
| [`@zilliqa-js/core`](./zilliqa/typescript/zilliqa-js-core) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/core.svg)](https://www.npmjs.com/package/@zilliqa-js/core) | Core abstractions and base classes, such as `HTTPProvider` and network logic for interfacing with the Zilliqa JSON-RPC. | |
| [`@zilliqa-js/util`](./zilliqa/typescript/zilliqa-js-util) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/util.svg)](https://www.npmjs.com/package/@zilliqa-js/util) | Miscellaneous functions that take care of serialisation/deserialisation and validation. | |
| [`@zilliqa-js/crypto`](./zilliqa/typescript/zilliqa-js-crypto) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/crypto.svg)](https://www.npmjs.com/package/@zilliqa-js/crypto) | Exposes several loosely-coupled cryptographic convenience functions for working with the Zilliqa blockchain and its cryptographic primitives, such as Schnorr signatures. | `@zilliqa-js/util` |
| [`@zilliqa-js/proto`](./zilliqa/typescript/zilliqa-js-proto) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/proto.svg)](https://www.npmjs.com/package/@zilliqa-js/proto) | Protobuf source files and corresponding generated JS modules. | |
| [`@zilliqa-js/account`](./zilliqa/typescript/zilliqa-js-account) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/account.svg)](https://www.npmjs.com/package/@zilliqa-js/account) | `Wallet`, `Account` and `Transaction` abstractions. | `@zilliqa-js/core`, `@zilliqa-js/crypto`, `@zilliqa-js/proto` |
| [`@zilliqa-js/blockchain`](./zilliqa/typescript/zilliqa-js-blockchain) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/blockchain.svg)](https://www.npmjs.com/package/@zilliqa-js/blockchain) | Main interface to the Zilliqa `JSON-RPC`. | `@zilliqa-js/account` |
| [`@zilliqa-js/contract`](./zilliqa/typescript/zilliqa-js-contract) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/contract.svg)](https://www.npmjs.com/package/@zilliqa-js/contract) | Exposes a `Contracts` module that takes care of smart contract deployment and interaction. | `@zilliqa-js/blockchain` |
| [`@zilliqa-js/subscriptions`](./zilliqa/typescript/zilliqa-js-util) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/subscriptions.svg)](https://www.npmjs.com/package/@zilliqa-js/subscriptions) | Classes to interact with the websocket API of Zilliqa node. | |
| [`@zilliqa-js/scilla-json-utils`](https://github.com/Zilliqa/scilla-json-utils) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/scilla-json-utils.svg)](https://www.npmjs.com/package/@zilliqa-js/scilla-json-utils) | Simplifies the way you construct the Scilla JSON data. | |
| [`@zilliqa-js/viewblock`](https://github.com/Ashlar/zilliqa-js-viewblock) | [![npm](https://img.shields.io/npm/v/@zilliqa-js/viewblock.svg)](https://www.npmjs.com/package/@zilliqa-js/viewblock) | Library interfacing with ViewBlock's APIs. This package is maintained by [Ashlar](https://github.com/Ashlar) | `@zilliqa-js/crypto` |

Expand Down Expand Up @@ -335,13 +335,13 @@ For more examples, visit this [repository](https://github.com/Zilliqa/zilliqa-js

Each package contains API documentation. For convenience, these are links to the respective `README` documents.

- [`account`](./packages/zilliqa-js-account/README.md)
- [`blockchain`](./packages/zilliqa-js-blockchain/README.md)
- [`contract`](./packages/zilliqa-js-contract/README.md)
- [`core`](./packages/zilliqa-js-core/README.md)
- [`crypto`](./packages/zilliqa-js-crypto/README.md)
- [`proto`](./packages/zilliqa-js-proto/README.md)
- [`util`](./packages/zilliqa-js-util/README.md)
- [`account`](./zilliqa/typescript/zilliqa-js-account/README.md)
- [`blockchain`](./zilliqa/typescript/zilliqa-js-blockchain/README.md)
- [`contract`](./zilliqa/typescript/zilliqa-js-contract/README.md)
- [`core`](./zilliqa/typescript/zilliqa-js-core/README.md)
- [`crypto`](./zilliqa/typescript/zilliqa-js-crypto/README.md)
- [`proto`](./zilliqa/typescript/zilliqa-js-proto/README.md)
- [`util`](./zilliqa/typescript/zilliqa-js-util/README.md)

Also, you can use [viewblock library](https://github.com/Ashlar/zilliqa-js-viewblock) to interface with ViewBlock's APIs.

Expand Down Expand Up @@ -369,7 +369,7 @@ yarn build:ts -w

### Unit Tests

Tests for each package reside in `packages/src/*/tests`, and are run using
Tests for each package reside in `zilliqa/typescript/src/*/tests`, and are run using
`jest`.

### E2E Tests
Expand All @@ -381,7 +381,7 @@ We can easily simulate a publish using [Verdaccio](https://verdaccio.org/) which
#### rollup

`zilliqa-js` is bundled using `rollup`. To build the distributable bundles, simple run `yarn bundle`.
This will output two bundles, `*.umd.js` and `*.esm.js`, to `packages/*/dist`. Node.js clients
This will output two bundles, `*.umd.js` and `*.esm.js`, to `zilliqa/typescript/*/dist`. Node.js clients
are pointed to the `umd` bundle, and bundlers are pointed to `esm`.

_NOTE: these bundles are *not* minified._
Expand Down
14 changes: 8 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@ const config = {
transform: {
'^.+\\.ts$': 'ts-jest',
},
testMatch: ['<rootDir>/packages/**/test/?(*.)+(spec|test).ts'],
testMatch: ['<rootDir>/zilliqa/typescript/**/test/?(*.)+(spec|test).ts'],
moduleDirectories: [
'packages/*/src',
'zilliqa/typescript/*/src',
'<rootDir>/includes',
'<rootDir>/node_modules',
'<rootDir>/*/node_modules',
],
moduleFileExtensions: ['js', 'ts', 'node', 'json'],
moduleNameMapper: {
'^@zilliqa-js/zilliqa': '<rootDir>/packages/zilliqa/src/index.ts',
'^@zilliqa-js/proto$': '<rootDir>/packages/zilliqa-js-proto/dist/index.js',
'^@zilliqa-js/(.*)$': '<rootDir>/packages/zilliqa-js-$1/src/index.ts',
'^@zilliqa-js/zilliqa': '<rootDir>/zilliqa/typescript/zilliqa/src/index.ts',
'^@zilliqa-js/proto$':
'<rootDir>/zilliqa/typescript/zilliqa-js-proto/dist/index.js',
'^@zilliqa-js/(.*)$':
'<rootDir>/zilliqa/typescript/zilliqa-js-$1/src/index.ts',
},
globals: {
'ts-jest': {
Expand All @@ -39,7 +41,7 @@ const config = {
testURL: 'http://localhost',
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/packages/*/src/**/*.{ts,js}',
'<rootDir>/zilliqa/typescript/*/src/**/*.{ts,js}',
'!**/node_modules/**',
],
testEnvironment: 'jsdom',
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": [
"packages/*"
"zilliqa/typescript/*"
],
"version": "3.3.4",
"npmClient": "yarn",
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
"lint": "eslint . --ext .ts -c .eslintrc.js",
"validate": "yarn lint && yarn prettier -- --list-different && yarn bootstrap && yarn test"
},
"workspaces": ["packages/*"],
"workspaces": [
"zilliqa/typescript/*"
],
"devDependencies": {
"@types/bn.js": "^4.11.3",
"@types/camelcase": "^4.1.0",
Expand Down
8 changes: 0 additions & 8 deletions packages/zilliqa-js-core/tsconfig.json

This file was deleted.

8 changes: 0 additions & 8 deletions packages/zilliqa-js-subscriptions/tsconfig.json

This file was deleted.

8 changes: 0 additions & 8 deletions packages/zilliqa-js-util/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { c, createLogger } from './logger';
const logBundle = createLogger('bundle');

function getKeys(p) {
const packageJsonFile = `${process.cwd()}/packages/${p}/package.json`;
const packageJsonFile = `${process.cwd()}/zilliqa/typescript/${p}/package.json`;
const data = fs.readFileSync(packageJsonFile, 'utf-8');
const { dependencies } = JSON.parse(data);
return dependencies ? Object.keys(dependencies) : [];
Expand Down
16 changes: 8 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"files": [],
"references": [
{ "path": "packages/zilliqa" },
{ "path": "packages/zilliqa-js-account" },
{ "path": "packages/zilliqa-js-blockchain" },
{ "path": "packages/zilliqa-js-contract" },
{ "path": "packages/zilliqa-js-core" },
{ "path": "packages/zilliqa-js-crypto" },
{ "path": "packages/zilliqa-js-util" },
{ "path": "packages/zilliqa-js-subscriptions" }
{ "path": "zilliqa/typescript/zilliqa" },
{ "path": "zilliqa/typescript/zilliqa-js-account" },
{ "path": "zilliqa/typescript/zilliqa-js-blockchain" },
{ "path": "zilliqa/typescript/zilliqa-js-contract" },
{ "path": "zilliqa/typescript/zilliqa-js-core" },
{ "path": "zilliqa/typescript/zilliqa-js-crypto" },
{ "path": "zilliqa/typescript/zilliqa-js-util" },
{ "path": "zilliqa/typescript/zilliqa-js-subscriptions" }
]
}
14 changes: 7 additions & 7 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"files": [],
"include": ["./typings/**/*.d.ts"],
"references": [
{ "path": "packages/zilliqa-js" },
{ "path": "packages/zilliqa-js-account" },
{ "path": "packages/zilliqa-js-blockchain" },
{ "path": "packages/zilliqa-js-contract" },
{ "path": "packages/zilliqa-js-core" },
{ "path": "packages/zilliqa-js-crypto" },
{ "path": "packages/zilliqa-js-util" }
{ "path": "zilliqa/typescript/zilliqa-js" },
{ "path": "zilliqa/typescript/zilliqa-js-account" },
{ "path": "zilliqa/typescript/zilliqa-js-blockchain" },
{ "path": "zilliqa/typescript/zilliqa-js-contract" },
{ "path": "zilliqa/typescript/zilliqa-js-core" },
{ "path": "zilliqa/typescript/zilliqa-js-crypto" },
{ "path": "zilliqa/typescript/zilliqa-js-util" }
]
}
14 changes: 7 additions & 7 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {

// entry files
entry: {
zilliqa: path.resolve(__dirname, 'packages/zilliqa/src/index.ts'),
zilliqa: path.resolve(__dirname, 'zilliqa/typescript/zilliqa/src/index.ts'),
},

// output bundles (location)
Expand All @@ -33,27 +33,27 @@ module.exports = {
alias: {
'@zilliqa-js/core': path.resolve(
__dirname,
'packages/zilliqa-js-core/src/index.ts',
'zilliqa/typescript/zilliqa-js-core/src/index.ts',
),
'@zilliqa-js/account': path.resolve(
__dirname,
'packages/zilliqa-js-account/src/index.ts',
'zilliqa/typescript/zilliqa-js-account/src/index.ts',
),
'@zilliqa-js/blockchain': path.resolve(
__dirname,
'packages/zilliqa-js-blockchain/src/index.ts',
'zilliqa/typescript/zilliqa-js-blockchain/src/index.ts',
),
'@zilliqa-js/contract': path.resolve(
__dirname,
'packages/zilliqa-js-contract/src/index.ts',
'zilliqa/typescript/zilliqa-js-contract/src/index.ts',
),
'@zilliqa-js/subscriptions': path.resolve(
__dirname,
'packages/zilliqa-js-subscriptions/src/index.ts',
'zilliqa/typescript/zilliqa-js-subscriptions/src/index.ts',
),
'@zilliqa-js/crypto': path.resolve(
__dirname,
'packages/zilliqa-js-crypto/src/index.ts',
'zilliqa/typescript/zilliqa-js-crypto/src/index.ts',
),
},
modules: ['node_modules'],
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@

"@lerna/[email protected]":
version "4.0.0"
resolved "https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-4.0.0.tgz#b1f70d70e1de9cdd36a4e50caa0ac501f8d012f2"
resolved "https://registry.npmjs.org/@lerna/filter-zilliqa/typescript/-/filter-packages-4.0.0.tgz#b1f70d70e1de9cdd36a4e50caa0ac501f8d012f2"
integrity sha512-+4AJIkK7iIiOaqCiVTYJxh/I9qikk4XjNQLhE3kixaqgMuHl1NQ99qXRR0OZqAWB9mh8Z1HA9bM5K1HZLBTOqA==
dependencies:
"@lerna/validation-error" "4.0.0"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": ["src", "../../typings/**/*.d.ts"],
"include": ["src", "../../../typings/**/*.d.ts"],
"references": [
{ "path": "../zilliqa-js-core" },
{ "path": "../zilliqa-js-crypto" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../../tsconfig.test.json",
"include": ["src", "test", "../../typings/**/*.d.ts"],
"include": ["src", "test", "../../../typings/**/*.d.ts"],
"references": [
{ "path": "../zilliqa-js-core" },
{ "path": "../zilliqa-js-crypto" },
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": ["src", "../../typings/**/*.d.ts"],
"include": ["src", "../../../typings/**/*.d.ts"],
"references": [
{ "path": "../zilliqa-js-account" },
{ "path": "../zilliqa-js-crypto" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../../tsconfig.test.json",
"include": ["src", "test", "../../typings/**/*.d.ts"],
"include": ["src", "test", "../../../typings/**/*.d.ts"],
"references": [
{ "path": "../zilliqa-js-account" },
{ "path": "../zilliqa-js-contract" },
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": ["src", "../../typings/**/*.d.ts"],
"include": ["src", "../../../typings/**/*.d.ts"],
"references": [
{ "path": "../zilliqa-js-account" },
{ "path": "../zilliqa-js-core" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../../tsconfig.test.json",
"include": ["src", "test", "../../typings/**/*.d.ts"],
"include": ["src", "test", "../../../typings/**/*.d.ts"],
"references": [
{ "path": "../zilliqa-js-account" },
{ "path": "../zilliqa-js-core" },
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions zilliqa/typescript/zilliqa-js-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": ["src", "../../../typings/**/*.d.ts"]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.test.json",
"include": ["src", "test", "../../typings/**/*.d.ts"],
"include": ["src", "test", "../../../typings/**/*.d.ts"],
"references": []
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": ["src", "../../typings/**/*.d.ts"],
"include": ["src", "../../../typings/**/*.d.ts"],
"references": [{ "path": "../zilliqa-js-util" }]
}
Loading

0 comments on commit 33964f9

Please sign in to comment.