Skip to content

Commit

Permalink
conversion to vite/rollup bundling
Browse files Browse the repository at this point in the history
  • Loading branch information
karnthis committed May 16, 2023
1 parent a322d11 commit 540478b
Show file tree
Hide file tree
Showing 115 changed files with 3,279 additions and 1,361 deletions.
3,563 changes: 2,710 additions & 853 deletions package-lock.json

Large diffs are not rendered by default.

35 changes: 23 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
{
"name": "jackal.js-protos",
"version": "1.3.4",
"version": "1.3.5",
"description": "Package of all protos used by Jackal.js",
"keywords": [
"jackal",
"canine",
"protos"
],
"type": "module",
"files": ["dist"],
"main": "dist/index.js",
"module": "dist/index.js",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.js"
"require": "./dist/index.cjs"
}
},
"types": "dist/index.d.ts",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"typings": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsc && tscpaths -p tsconfig.json -s ./src -o ./dist",
"build": "tsc && vite build",
"compile": "./scripts/protocgen.sh",
"packit": "npm run build && npm pack --pack-destination packs",
"push": "npm run build && npm publish",
"test": "echo \"Error: no tests included\" && exit 1"
"dev": "vite",

"preview": "vite preview",
"packit": "npm run build && npm pack --pack-destination packs"
},
"contributors": [
{
Expand Down Expand Up @@ -59,6 +62,9 @@
},
"devDependencies": {
"@modii/tscpaths": "^0.2.3",
"@rollup/plugin-commonjs": "^25.0.0",
"@rollup/plugin-typescript": "^11.1.1",
"@types/node": "^17.0.35",
"@typescript-eslint/eslint-plugin": "^4.18.0",
"@typescript-eslint/parser": "^4.18.0",
"eslint": "^6.7.2",
Expand All @@ -67,6 +73,11 @@
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"prettier": "^2.8.8",
"typescript": "~4.1.5"
"rollup-plugin-typescript-paths": "^1.4.0",
"tslib": "^2.4.0",
"typescript": "~4.1.5",
"vite": "^4.3.2",
"vite-plugin-dts": "^2.3.0",
"vite-tsconfig-paths": "^4.2.0"
}
}
38 changes: 16 additions & 22 deletions src/builders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,46 +17,40 @@ import {
TGrpc
} from '@/interfaces/IGrpcWebImpl'
import { genBroadcaster, IGenBroadcaster } from '@/customBroadcast'
import IAllQuery from '@/interfaces/IAllQuery'
import IAllTx from '@/interfaces/IAllTx'
import IQueryFileTree from '@/interfaces/classes/IQueryFileTree'
import { IAllQuery } from '@/interfaces/IAllQuery'
import { IAllTx } from '@/interfaces/IAllTx'
import { IQueryFileTree } from '@/interfaces/classes/IQueryFileTree'
import QueryFileTree from '@/snackages/query/custom/fileTree'
import { ITxFileTree, TxFileTree } from '@/snackages/tx/custom/fileTree'
import IQueryJklMint from '@/interfaces/classes/IQueryJklMint'
import { IQueryJklMint } from '@/interfaces/classes/IQueryJklMint'
import QueryJklMint from '@/snackages/query/custom/jklMint'
import IQueryNotifications from '@/interfaces/classes/IQueryNotifications'
import { IQueryNotifications } from '@/interfaces/classes/IQueryNotifications'
import QueryNotifications from '@/snackages/query/custom/notifications'
import {
ITxNotifications,
TxNotifications
} from '@/snackages/tx/custom/notifications'
import IQueryOracle from '@/interfaces/classes/IQueryOracle'
import { ITxNotifications, TxNotifications } from '@/snackages/tx/custom/notifications'
import { IQueryOracle } from '@/interfaces/classes/IQueryOracle'
import QueryOracle from '@/snackages/query/custom/oracle'
import { ITxOracle, TxOracle } from '@/snackages/tx/custom/oracle'
import IQueryRns from '@/interfaces/classes/IQueryRns'
import { IQueryRns } from '@/interfaces/classes/IQueryRns'
import QueryRns from '@/snackages/query/custom/rns'
import { ITxRns, TxRns } from '@/snackages/tx/custom/rns'
import IQueryStorage from '@/interfaces/classes/IQueryStorage'
import { IQueryStorage } from '@/interfaces/classes/IQueryStorage'
import QueryStorage from '@/snackages/query/custom/storage'
import { ITxStorage, TxStorage } from '@/snackages/tx/custom/storage'
import IQueryABCI from '@/interfaces/classes/IQueryABCI'
import { IQueryABCI } from '@/interfaces/classes/IQueryABCI'
import QueryABCI from '@/snackages/query/static/abci'
import IQueryBank from '@/interfaces/classes/IQueryBank'
import { IQueryBank } from '@/interfaces/classes/IQueryBank'
import QueryBank from '@/snackages/query/static/bank'
import { ITxBank, TxBank } from '@/snackages/tx/static/bank'
import IQueryDistribution from '@/interfaces/classes/IQueryDistribution'
import { IQueryDistribution } from '@/interfaces/classes/IQueryDistribution'
import QueryDistribution from '@/snackages/query/static/distribution'
import {
ITxDistribution,
TxDistribution
} from '@/snackages/tx/static/distribution'
import IQueryGov from '@/interfaces/classes/IQueryGov'
import { ITxDistribution, TxDistribution } from '@/snackages/tx/static/distribution'
import { IQueryGov } from '@/interfaces/classes/IQueryGov'
import QueryGov from '@/snackages/query/static/gov'
import { ITxGov, TxGov } from '@/snackages/tx/static/gov'
import IQuerySlashing from '@/interfaces/classes/IQuerySlashing'
import { IQuerySlashing } from '@/interfaces/classes/IQuerySlashing'
import QuerySlashing from '@/snackages/query/static/slashing'
import { ITxSlashing, TxSlashing } from '@/snackages/tx/static/slashing'
import IQueryStaking from '@/interfaces/classes/IQueryStaking'
import { IQueryStaking } from '@/interfaces/classes/IQueryStaking'
import QueryStaking from '@/snackages/query/static/staking'
import { ITxStaking, TxStaking } from '@/snackages/tx/static/staking'
import IQueryBuilder from '@/interfaces/classes/IQueryBuilder'
Expand Down
74 changes: 41 additions & 33 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
export { ProtoBuilder, QueryBuilder } from '@/builders'
export { default as IProtoBuilder } from '@/interfaces/classes/IProtoBuilder'
export { default as IQueryBuilder } from '@/interfaces/classes/IQueryBuilder'

export { IGenBroadcaster, TMasterBroadcaster } from '@/customBroadcast'

export { default as IQueryABCI } from '@/interfaces/classes/IQueryABCI'
export { default as IQueryFileTree } from '@/interfaces/classes/IQueryFileTree'
export { default as IQueryJklMint } from '@/interfaces/classes/IQueryJklMint'
export { default as IQueryNotifications } from '@/interfaces/classes/IQueryNotifications'
export { default as IQueryOracle } from '@/interfaces/classes/IQueryOracle'
export { default as IQueryRns } from '@/interfaces/classes/IQueryRns'
export { default as IQueryStorage } from '@/interfaces/classes/IQueryStorage'
export { default as IQueryBank } from '@/interfaces/classes/IQueryBank'
export { default as IQueryDistribution } from '@/interfaces/classes/IQueryDistribution'
export { default as IQueryGov } from '@/interfaces/classes/IQueryGov'
export { default as IQuerySlashing } from '@/interfaces/classes/IQuerySlashing'
export { default as IQueryStaking } from '@/interfaces/classes/IQueryStaking'

export { ITxFileTree } from '@/snackages/tx/custom/fileTree'
export { ITxNotifications } from '@/snackages/tx/custom/notifications'
export { ITxOracle } from '@/snackages/tx/custom/oracle'
export { ITxRns } from '@/snackages/tx/custom/rns'
export { ITxStorage } from '@/snackages/tx/custom/storage'
export { ITxBank } from '@/snackages/tx/static/bank'
export { ITxDistribution } from '@/snackages/tx/static/distribution'
export { ITxGov } from '@/snackages/tx/static/gov'
export { ITxSlashing } from '@/snackages/tx/static/slashing'
export { ITxStaking } from '@/snackages/tx/static/staking'
export { default as IAllQuery } from '@/interfaces/IAllQuery'
export { default as IAllTx } from '@/interfaces/IAllTx'
export * from '@/builders'
import * as IProtoBuilder from '@/interfaces/classes/IProtoBuilder'
import * as IQueryBuilder from '@/interfaces/classes/IQueryBuilder'
export * from '@/customBroadcast'
export * from '@/interfaces/classes/IQueryABCI'
export * from '@/interfaces/classes/IQueryFileTree'
export * from '@/interfaces/classes/IQueryJklMint'
export * from '@/interfaces/classes/IQueryNotifications'
export * from '@/interfaces/classes/IQueryOracle'
export * from '@/interfaces/classes/IQueryRns'
export * from '@/interfaces/classes/IQueryStorage'
export * from '@/interfaces/classes/IQueryBank'
export * from '@/interfaces/classes/IQueryDistribution'
export * from '@/interfaces/classes/IQueryGov'
export * from '@/interfaces/classes/IQuerySlashing'
export * from '@/interfaces/classes/IQueryStaking'
export * from '@/snackages/tx/custom/fileTree'
export * from '@/snackages/tx/custom/notifications'
export * from '@/snackages/tx/custom/oracle'
export * from '@/snackages/tx/custom/rns'
export * from '@/snackages/tx/custom/storage'
export * from '@/snackages/tx/static/bank'
export * from '@/snackages/tx/static/distribution'
export * from '@/snackages/tx/static/gov'
export * from '@/snackages/tx/static/slashing'
export * from '@/snackages/tx/static/staking'
export * from '@/interfaces/IAllQuery'
export * from '@/interfaces/IAllTx'

/** Misc */
export { default as SuccessIncluded } from '@/types/TSuccessIncluded'
export { default as SuccessNoUndefined } from '@/types/TSuccessNoUndefined'
export { Contracts } from '@/postgen/canine_chain/storage/contracts'
export { FidCid } from '@/postgen/canine_chain/storage/fid_cid'
export { QueryFindFileResponse } from '@/postgen/canine_chain/storage/query'
Expand All @@ -45,3 +40,16 @@ export { Notifications } from '@/postgen/canine_chain/notifications/notification
export { ProposalStatus } from '@/postgen/cosmos/gov/v1beta1/gov'
export { PageResponse } from '@/postgen/cosmos/base/query/v1beta1/pagination'

export * from '@/postgen/tendermint/abci/types'
export {
QueryAllNotiCounterResponse,
QueryAllNotificationsByAddressResponse,
QueryAllNotificationsResponse,
QueryGetNotiCounterResponse,
QueryGetNotificationsResponse
} from '@/postgen/canine_chain/notifications/query'

export {
IProtoBuilder,
IQueryBuilder
}
26 changes: 13 additions & 13 deletions src/interfaces/IAllQuery.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import IQueryFileTree from '@/interfaces/classes/IQueryFileTree'
import IQueryJklMint from '@/interfaces/classes/IQueryJklMint'
import IQueryNotifications from '@/interfaces/classes/IQueryNotifications'
import IQueryOracle from '@/interfaces/classes/IQueryOracle'
import IQueryRns from '@/interfaces/classes/IQueryRns'
import IQueryStorage from '@/interfaces/classes/IQueryStorage'
import IQueryABCI from '@/interfaces/classes/IQueryABCI'
import IQueryBank from '@/interfaces/classes/IQueryBank'
import IQueryDistribution from '@/interfaces/classes/IQueryDistribution'
import IQueryGov from '@/interfaces/classes/IQueryGov'
import IQuerySlashing from '@/interfaces/classes/IQuerySlashing'
import IQueryStaking from '@/interfaces/classes/IQueryStaking'
import { IQueryFileTree } from '@/interfaces/classes/IQueryFileTree'
import { IQueryJklMint } from '@/interfaces/classes/IQueryJklMint'
import { IQueryNotifications } from '@/interfaces/classes/IQueryNotifications'
import { IQueryOracle } from '@/interfaces/classes/IQueryOracle'
import { IQueryRns } from '@/interfaces/classes/IQueryRns'
import { IQueryStorage } from '@/interfaces/classes/IQueryStorage'
import { IQueryABCI } from '@/interfaces/classes/IQueryABCI'
import { IQueryBank } from '@/interfaces/classes/IQueryBank'
import { IQueryDistribution } from '@/interfaces/classes/IQueryDistribution'
import { IQueryGov } from '@/interfaces/classes/IQueryGov'
import { IQuerySlashing } from '@/interfaces/classes/IQuerySlashing'
import { IQueryStaking } from '@/interfaces/classes/IQueryStaking'

export default interface IAllQuery {
export interface IAllQuery {
/** Custom */
fileTree: IQueryFileTree
jklMint: IQueryJklMint
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IAllTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ITxGov } from '@/snackages/tx/static/gov'
import { ITxSlashing } from '@/snackages/tx/static/slashing'
import { ITxStaking } from '@/snackages/tx/static/staking'

export default interface IAllTx {
export interface IAllTx {
/** Custom */
fileTree: ITxFileTree
jklMint: null
Expand Down
5 changes: 1 addition & 4 deletions src/interfaces/IGrpcWebImpl.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { GrpcWebImpl as IFileTreeGrpc } from '@/postgen/canine_chain/filetree/query'
import {
GrpcWebImpl,
GrpcWebImpl as IJklMintGrpc
} from '@/postgen/canine_chain/jklmint/query'
import { GrpcWebImpl, GrpcWebImpl as IJklMintGrpc } from '@/postgen/canine_chain/jklmint/query'
import { GrpcWebImpl as INotificationsGrpc } from '@/postgen/canine_chain/notifications/query'
import { GrpcWebImpl as IOracleGrpc } from '@/postgen/canine_chain/oracle/query'
import { GrpcWebImpl as IRnsGrpc } from '@/postgen/canine_chain/rns/query'
Expand Down
14 changes: 1 addition & 13 deletions src/interfaces/classes/IProtoBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
import IQueryFileTree from '@/interfaces/classes/IQueryFileTree'
import IQueryJklMint from '@/interfaces/classes/IQueryJklMint'
import IQueryOracle from '@/interfaces/classes/IQueryOracle'
import IQueryRns from '@/interfaces/classes/IQueryRns'
import IQueryStorage from '@/interfaces/classes/IQueryStorage'
import IQueryABCI from '@/interfaces/classes/IQueryABCI'
import IQueryBank from '@/interfaces/classes/IQueryBank'
import IQueryDistribution from '@/interfaces/classes/IQueryDistribution'
import IQueryGov from '@/interfaces/classes/IQueryGov'
import IQuerySlashing from '@/interfaces/classes/IQuerySlashing'
import IQueryStaking from '@/interfaces/classes/IQueryStaking'
import { ITxFileTree } from '@/snackages/tx/custom/fileTree'
import { ITxOracle } from '@/snackages/tx/custom/oracle'
import { ITxRns } from '@/snackages/tx/custom/rns'
Expand All @@ -18,8 +7,7 @@ import { ITxDistribution } from '@/snackages/tx/static/distribution'
import { ITxGov } from '@/snackages/tx/static/gov'
import { ITxSlashing } from '@/snackages/tx/static/slashing'
import { ITxStaking } from '@/snackages/tx/static/staking'
import IAllQuery from '@/interfaces/IAllQuery'
import IAllTx from '@/interfaces/IAllTx'
import { IAllTx } from '@/interfaces/IAllTx'
import { IGenBroadcaster } from '@/customBroadcast'
import IQueryBuilder from '@/interfaces/classes/IQueryBuilder'
import { ITxNotifications } from '@/snackages/tx/custom/notifications'
Expand Down
44 changes: 22 additions & 22 deletions src/interfaces/classes/IQueryABCI.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
import { grpc } from '@improbable-eng/grpc-web'
import {
DeepPartial,
RequestApplySnapshotChunk,
RequestBeginBlock,
RequestCheckTx,
RequestCommit,
RequestDeliverTx,
RequestEcho,
ResponseEcho,
RequestEndBlock,
RequestFlush,
ResponseFlush,
RequestInfo,
ResponseInfo,
RequestInitChain,
RequestListSnapshots,
RequestLoadSnapshotChunk,
RequestOfferSnapshot,
RequestQuery,
RequestSetOption,
ResponseSetOption,
RequestDeliverTx,
ResponseDeliverTx,
RequestCheckTx,
ResponseApplySnapshotChunk,
ResponseBeginBlock,
ResponseCheckTx,
RequestQuery,
ResponseQuery,
RequestCommit,
ResponseCommit,
RequestInitChain,
ResponseInitChain,
RequestBeginBlock,
ResponseBeginBlock,
RequestEndBlock,
ResponseDeliverTx,
ResponseEcho,
ResponseEndBlock,
RequestListSnapshots,
ResponseFlush,
ResponseInfo,
ResponseInitChain,
ResponseListSnapshots,
RequestOfferSnapshot,
ResponseOfferSnapshot,
RequestLoadSnapshotChunk,
ResponseLoadSnapshotChunk,
RequestApplySnapshotChunk,
ResponseApplySnapshotChunk
ResponseOfferSnapshot,
ResponseQuery,
ResponseSetOption
} from '@/postgen/tendermint/abci/types'
import SuccessNoUndefined from '@/types/TSuccessNoUndefined'

export default interface IQueryABCI {
export interface IQueryABCI {
/** Returns a message (or echo) */
echo(
request: DeepPartial<RequestEcho>,
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/classes/IQueryBank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
} from '@/postgen/cosmos/bank/v1beta1/query'
import SuccessNoUndefined from '@/types/TSuccessNoUndefined'

export default interface IQueryBank {
export interface IQueryBank {
/** Balance queries the balance of a single coin for a single account. */
queryBalance(
request: DeepPartial<QueryBalanceRequest>,
Expand Down
24 changes: 12 additions & 12 deletions src/interfaces/classes/IQueryBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import IQueryFileTree from '@/interfaces/classes/IQueryFileTree'
import IQueryJklMint from '@/interfaces/classes/IQueryJklMint'
import IQueryOracle from '@/interfaces/classes/IQueryOracle'
import IQueryRns from '@/interfaces/classes/IQueryRns'
import IQueryStorage from '@/interfaces/classes/IQueryStorage'
import IQueryABCI from '@/interfaces/classes/IQueryABCI'
import IQueryBank from '@/interfaces/classes/IQueryBank'
import IQueryDistribution from '@/interfaces/classes/IQueryDistribution'
import IQueryGov from '@/interfaces/classes/IQueryGov'
import IQuerySlashing from '@/interfaces/classes/IQuerySlashing'
import IQueryStaking from '@/interfaces/classes/IQueryStaking'
import IAllQuery from '@/interfaces/IAllQuery'
import { IQueryFileTree } from '@/interfaces/classes/IQueryFileTree'
import { IQueryJklMint } from '@/interfaces/classes/IQueryJklMint'
import { IQueryOracle } from '@/interfaces/classes/IQueryOracle'
import { IQueryRns } from '@/interfaces/classes/IQueryRns'
import { IQueryStorage } from '@/interfaces/classes/IQueryStorage'
import { IQueryABCI } from '@/interfaces/classes/IQueryABCI'
import { IQueryBank } from '@/interfaces/classes/IQueryBank'
import { IQueryDistribution } from '@/interfaces/classes/IQueryDistribution'
import { IQueryGov } from '@/interfaces/classes/IQueryGov'
import { IQuerySlashing } from '@/interfaces/classes/IQuerySlashing'
import { IQueryStaking } from '@/interfaces/classes/IQueryStaking'
import { IAllQuery } from '@/interfaces/IAllQuery'

export default interface IQueryBuilder {
/** Custom */
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/classes/IQueryDistribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from '@/postgen/cosmos/distribution/v1beta1/query'
import SuccessNoUndefined from '@/types/TSuccessNoUndefined'

export default interface IQueryDistribution {
export interface IQueryDistribution {
/** Params queries params of the distribution module. */
queryParams(
request: DeepPartial<QueryParamsRequest>,
Expand Down
Loading

0 comments on commit 540478b

Please sign in to comment.