@hyperweb/telescope 2.0.4 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/{main/bundle.js → bundle.js} +17 -7
- package/{types/commands → commands}/download.d.ts +2 -2
- package/{main/commands → commands}/download.js +17 -7
- package/{main/commands → commands}/generate.js +17 -7
- package/{main/commands → commands}/transpile.js +17 -7
- package/esm/build.d.ts +41 -0
- package/esm/builder.d.ts +50 -0
- package/esm/bundle.d.ts +30 -0
- package/esm/bundler.d.ts +31 -0
- package/esm/commands/download.d.ts +5 -0
- package/esm/commands/generate.d.ts +2 -0
- package/esm/commands/transpile.d.ts +4 -0
- package/{module → esm}/generators/create-sdk-module-stargate-clients.js +1 -1
- package/{module → esm}/generators/create-stargate-clients.js +1 -1
- package/{types → esm}/utils/index.d.ts +1 -1
- package/generators/create-aggregated-lcd-client.d.ts +2 -0
- package/generators/create-amino-converters.d.ts +3 -0
- package/generators/create-bundle.d.ts +3 -0
- package/generators/create-helpers.d.ts +2 -0
- package/generators/create-index.d.ts +2 -0
- package/{main/generators → generators}/create-index.js +17 -7
- package/generators/create-lcd-client-all.d.ts +3 -0
- package/{main/generators → generators}/create-lcd-client-all.js +17 -7
- package/generators/create-lcd-client-scoped.d.ts +3 -0
- package/{main/generators → generators}/create-lcd-client-scoped.js +17 -7
- package/generators/create-lcd-clients.d.ts +3 -0
- package/generators/create-mcp-server.d.ts +3 -0
- package/generators/create-mobx-bundle.d.ts +2 -0
- package/{main/generators → generators}/create-mobx-bundle.js +17 -7
- package/generators/create-msg-funcs.d.ts +3 -0
- package/generators/create-pinia-store-bundle.d.ts +2 -0
- package/{main/generators → generators}/create-pinia-store-bundle.js +17 -7
- package/generators/create-pinia-store.d.ts +3 -0
- package/generators/create-query-funcs.d.ts +3 -0
- package/generators/create-react-query-bundle.d.ts +2 -0
- package/{main/generators → generators}/create-react-query-bundle.js +17 -7
- package/generators/create-registries.d.ts +3 -0
- package/generators/create-root-readme.d.ts +2 -0
- package/generators/create-rpc-msg-client-all.d.ts +3 -0
- package/{main/generators → generators}/create-rpc-msg-client-all.js +17 -7
- package/generators/create-rpc-msg-client-scoped.d.ts +3 -0
- package/{main/generators → generators}/create-rpc-msg-client-scoped.js +17 -7
- package/generators/create-rpc-msg-clients.d.ts +3 -0
- package/generators/create-rpc-ops-bundle.d.ts +2 -0
- package/{main/generators → generators}/create-rpc-ops-bundle.js +17 -7
- package/generators/create-rpc-query-client-all.d.ts +3 -0
- package/{main/generators → generators}/create-rpc-query-client-all.js +17 -7
- package/generators/create-rpc-query-client-scoped.d.ts +3 -0
- package/{main/generators → generators}/create-rpc-query-client-scoped.js +17 -7
- package/generators/create-rpc-query-clients.d.ts +3 -0
- package/generators/create-sdk-module-stargate-clients.d.ts +3 -0
- package/{main/generators → generators}/create-sdk-module-stargate-clients.js +1 -1
- package/generators/create-stargate-clients.d.ts +3 -0
- package/{main/generators → generators}/create-stargate-clients.js +1 -1
- package/generators/create-types.d.ts +3 -0
- package/{main/generators → generators}/create-types.js +17 -7
- package/generators/customize-utils.d.ts +2 -0
- package/helpers/__test__/internalTimestamp.d.ts +21 -0
- package/{main/helpers → helpers}/__test__/internalTimestamp.js +4 -5
- package/helpers/__test__/internalTimestampBigint.d.ts +20 -0
- package/{main/helpers → helpers}/__test__/internalTimestampBigint.js +4 -5
- package/helpers/binary-coder.d.ts +2 -0
- package/helpers/decimals.d.ts +1 -0
- package/helpers/external-comet.d.ts +1 -0
- package/helpers/external-icjs.d.ts +1 -0
- package/helpers/external.d.ts +1 -0
- package/helpers/grpc-gateway.d.ts +1 -0
- package/helpers/grpc-web.d.ts +1 -0
- package/helpers/helper-func-types-interface.d.ts +2 -0
- package/helpers/helper-func-types.d.ts +2 -0
- package/helpers/internal-for-bigint.d.ts +2 -0
- package/helpers/internal.d.ts +2 -0
- package/helpers/json-safe.d.ts +1 -0
- package/helpers/mobx.d.ts +1 -0
- package/helpers/pinia-endpoint.d.ts +1 -0
- package/helpers/react-query-hooks-icjs.d.ts +2 -0
- package/helpers/react-query-hooks.d.ts +2 -0
- package/helpers/react-query.d.ts +2 -0
- package/{types/helpers/vue-query.d.ts → helpers/registry-helper.d.ts} +1 -1
- package/helpers/types-helper.d.ts +2 -0
- package/helpers/utf8-helper.d.ts +1 -0
- package/helpers/varint.d.ts +1 -0
- package/helpers/vue-query-hooks.d.ts +2 -0
- package/imports.d.ts +17 -0
- package/{main/imports.js → imports.js} +17 -7
- package/index.d.ts +6 -0
- package/package.json +31 -50
- package/parse.d.ts +15 -0
- package/prompt.d.ts +3 -0
- package/protod/bufbuild.d.ts +6 -0
- package/{main/protod → protod}/bufbuild.js +5 -6
- package/protod/config.d.ts +7 -0
- package/protod/git-repo.d.ts +11 -0
- package/protod/recursive.d.ts +4 -0
- package/{main/protod → protod}/recursive.js +3 -4
- package/protod/types.d.ts +49 -0
- package/protod/utils.d.ts +11 -0
- package/{main/protod → protod}/utils.js +8 -9
- package/types.d.ts +43 -0
- package/utils/common-create-bundle.d.ts +18 -0
- package/utils/files.d.ts +5 -0
- package/{main/utils → utils}/files.js +19 -9
- package/utils/index.d.ts +16 -0
- package/utils/unused.d.ts +5 -0
- package/{main/utils → utils}/unused.js +17 -7
- package/main/cli.js +0 -52
- package/main/cmds.js +0 -16
- package/main/contracts/generate.js +0 -31
- package/main/contracts/install.js +0 -107
- package/main/contracts/message-composer.js +0 -31
- package/main/contracts/react-query.js +0 -31
- package/main/contracts/recoil.js +0 -31
- package/main/file.js +0 -20
- package/main/generators/create-combined-stargate-clients.js +0 -99
- package/main/generators/create-cosmwasm-bundle.js +0 -15
- package/main/helpers/generated-type.js +0 -24
- package/main/helpers/internalForBigInt.js +0 -248
- package/main/helpers/types.js +0 -24
- package/main/helpers/vue-query.js +0 -91
- package/main/protod/proto-download.js +0 -57
- package/main/telescope.js +0 -10
- package/main/utils/contracts.js +0 -39
- package/module/cli.js +0 -25
- package/module/cmds.js +0 -10
- package/module/contracts/generate.js +0 -29
- package/module/contracts/install.js +0 -105
- package/module/contracts/message-composer.js +0 -29
- package/module/contracts/react-query.js +0 -29
- package/module/contracts/recoil.js +0 -29
- package/module/file.js +0 -18
- package/module/generators/create-combined-stargate-clients.js +0 -95
- package/module/generators/create-cosmwasm-bundle.js +0 -11
- package/module/helpers/generated-type.js +0 -21
- package/module/helpers/internalForBigInt.js +0 -245
- package/module/helpers/types.js +0 -21
- package/module/helpers/vue-query.js +0 -87
- package/module/protod/proto-download.js +0 -55
- package/module/telescope.js +0 -8
- package/module/utils/contracts.js +0 -33
- package/src/build.ts +0 -255
- package/src/builder.ts +0 -292
- package/src/bundle.ts +0 -160
- package/src/bundler.ts +0 -153
- package/src/cli.js +0 -31
- package/src/cmds.js +0 -11
- package/src/commands/download.ts +0 -120
- package/src/commands/generate.ts +0 -156
- package/src/commands/install.ts +0 -154
- package/src/commands/transpile.ts +0 -205
- package/src/file.js +0 -20
- package/src/generators/create-aggregated-lcd-client.ts +0 -133
- package/src/generators/create-all-stargate-clients.ts +0 -121
- package/src/generators/create-amino-converters.ts +0 -62
- package/src/generators/create-bundle.ts +0 -143
- package/src/generators/create-custom-stargate-clients.ts +0 -128
- package/src/generators/create-helpers.ts +0 -209
- package/src/generators/create-index.ts +0 -72
- package/src/generators/create-lcd-client-all.ts +0 -139
- package/src/generators/create-lcd-client-scoped.ts +0 -109
- package/src/generators/create-lcd-clients.ts +0 -108
- package/src/generators/create-mcp-server.ts +0 -1774
- package/src/generators/create-mobx-bundle.ts +0 -31
- package/src/generators/create-msg-funcs.ts +0 -219
- package/src/generators/create-pinia-store-bundle.ts +0 -35
- package/src/generators/create-pinia-store.ts +0 -121
- package/src/generators/create-query-funcs.ts +0 -224
- package/src/generators/create-react-query-bundle.ts +0 -111
- package/src/generators/create-registries.ts +0 -70
- package/src/generators/create-root-readme.ts +0 -403
- package/src/generators/create-rpc-msg-client-all.ts +0 -167
- package/src/generators/create-rpc-msg-client-scoped.ts +0 -147
- package/src/generators/create-rpc-msg-clients.ts +0 -165
- package/src/generators/create-rpc-ops-bundle.ts +0 -155
- package/src/generators/create-rpc-query-client-all.ts +0 -173
- package/src/generators/create-rpc-query-client-scoped.ts +0 -142
- package/src/generators/create-rpc-query-clients.ts +0 -304
- package/src/generators/create-sdk-module-stargate-clients.ts +0 -120
- package/src/generators/create-stargate-clients.ts +0 -123
- package/src/generators/create-types.ts +0 -236
- package/src/generators/customize-utils.ts +0 -52
- package/src/helpers/__test__/internalTimestamp.test.ts +0 -79
- package/src/helpers/__test__/internalTimestamp.ts +0 -58
- package/src/helpers/__test__/internalTimestampBigint.test.ts +0 -78
- package/src/helpers/__test__/internalTimestampBigint.ts +0 -58
- package/src/helpers/binary-coder.ts +0 -533
- package/src/helpers/decimals.ts +0 -108
- package/src/helpers/external-comet.ts +0 -49
- package/src/helpers/external-icjs.ts +0 -43
- package/src/helpers/external.ts +0 -28
- package/src/helpers/grpc-gateway.ts +0 -345
- package/src/helpers/grpc-web.ts +0 -11
- package/src/helpers/helper-func-types-interface.ts +0 -104
- package/src/helpers/helper-func-types.ts +0 -91
- package/src/helpers/internal-for-bigint.ts +0 -259
- package/src/helpers/internal.ts +0 -241
- package/src/helpers/json-safe.ts +0 -11
- package/src/helpers/mobx.ts +0 -77
- package/src/helpers/pinia-endpoint.ts +0 -17
- package/src/helpers/react-query-hooks-icjs.ts +0 -223
- package/src/helpers/react-query-hooks.ts +0 -266
- package/src/helpers/react-query.ts +0 -101
- package/src/helpers/registry-helper.ts +0 -227
- package/src/helpers/types-helper.ts +0 -169
- package/src/helpers/utf8-helper.ts +0 -143
- package/src/helpers/varint.ts +0 -483
- package/src/helpers/vue-query-hooks.ts +0 -224
- package/src/imports.ts +0 -499
- package/src/index.ts +0 -12
- package/src/parse.ts +0 -243
- package/src/prompt.js +0 -65
- package/src/protod/bufbuild.spec.ts +0 -80
- package/src/protod/bufbuild.ts +0 -95
- package/src/protod/config.ts +0 -30
- package/src/protod/git-repo.ts +0 -74
- package/src/protod/recursive.spec.ts +0 -164
- package/src/protod/recursive.ts +0 -190
- package/src/protod/test-data/.protod.config.json +0 -42
- package/src/protod/test-data/buf.lock +0 -23
- package/src/protod/test-data/buf.yaml +0 -25
- package/src/protod/test-data/buf2.yaml +0 -20
- package/src/protod/test-data/cosmos/buf.lock +0 -23
- package/src/protod/test-data/cosmos/crypto/secp256k1/keys.proto +0 -38
- package/src/protod/test-data/model.proto +0 -101
- package/src/protod/types.ts +0 -55
- package/src/protod/utils.spec.ts +0 -68
- package/src/protod/utils.ts +0 -90
- package/src/telescope.js +0 -9
- package/src/types.ts +0 -46
- package/src/utils/common-create-bundle.ts +0 -62
- package/src/utils/files.ts +0 -145
- package/src/utils/index.ts +0 -149
- package/src/utils/unused.ts +0 -52
- package/types/cli.d.ts +0 -1
- package/types/cmds.d.ts +0 -10
- package/types/codegen/cosmos/orm/module/v1alpha1/module.d.ts +0 -43
- package/types/contracts/generate.d.ts +0 -2
- package/types/contracts/message-composer.d.ts +0 -2
- package/types/contracts/react-query.d.ts +0 -2
- package/types/contracts/recoil.d.ts +0 -2
- package/types/file.d.ts +0 -2
- package/types/generators/create-cosmwasm-bundle.d.ts +0 -2
- package/types/generators/create-unified-stargate-clients.d.ts +0 -3
- package/types/helpers/generated-type.d.ts +0 -1
- package/types/helpers/internalForBigInt.d.ts +0 -1
- package/types/helpers/types.d.ts +0 -1
- package/types/protod/proto-download.d.ts +0 -2
- package/types/telescope.d.ts +0 -2
- package/types/utils/contracts.d.ts +0 -6
- /package/{types/build.d.ts → build.d.ts} +0 -0
- /package/{main/build.js → build.js} +0 -0
- /package/{types/builder.d.ts → builder.d.ts} +0 -0
- /package/{main/builder.js → builder.js} +0 -0
- /package/{types/bundle.d.ts → bundle.d.ts} +0 -0
- /package/{types/bundler.d.ts → bundler.d.ts} +0 -0
- /package/{main/bundler.js → bundler.js} +0 -0
- /package/{types/commands → commands}/generate.d.ts +0 -0
- /package/{types/commands → commands}/install.d.ts +0 -0
- /package/{main/commands → commands}/install.js +0 -0
- /package/{types/commands → commands}/transpile.d.ts +0 -0
- /package/{module → esm}/build.js +0 -0
- /package/{module → esm}/builder.js +0 -0
- /package/{module → esm}/bundle.js +0 -0
- /package/{module → esm}/bundler.js +0 -0
- /package/{module → esm}/commands/download.js +0 -0
- /package/{module → esm}/commands/generate.js +0 -0
- /package/{types/contracts → esm/commands}/install.d.ts +0 -0
- /package/{module → esm}/commands/install.js +0 -0
- /package/{module → esm}/commands/transpile.js +0 -0
- /package/{types → esm}/generators/create-aggregated-lcd-client.d.ts +0 -0
- /package/{module → esm}/generators/create-aggregated-lcd-client.js +0 -0
- /package/{types → esm}/generators/create-all-stargate-clients.d.ts +0 -0
- /package/{module → esm}/generators/create-all-stargate-clients.js +0 -0
- /package/{types → esm}/generators/create-amino-converters.d.ts +0 -0
- /package/{module → esm}/generators/create-amino-converters.js +0 -0
- /package/{types → esm}/generators/create-bundle.d.ts +0 -0
- /package/{module → esm}/generators/create-bundle.js +0 -0
- /package/{types → esm}/generators/create-custom-stargate-clients.d.ts +0 -0
- /package/{module → esm}/generators/create-custom-stargate-clients.js +0 -0
- /package/{types → esm}/generators/create-helpers.d.ts +0 -0
- /package/{module → esm}/generators/create-helpers.js +0 -0
- /package/{types → esm}/generators/create-index.d.ts +0 -0
- /package/{module → esm}/generators/create-index.js +0 -0
- /package/{types → esm}/generators/create-lcd-client-all.d.ts +0 -0
- /package/{module → esm}/generators/create-lcd-client-all.js +0 -0
- /package/{types → esm}/generators/create-lcd-client-scoped.d.ts +0 -0
- /package/{module → esm}/generators/create-lcd-client-scoped.js +0 -0
- /package/{types → esm}/generators/create-lcd-clients.d.ts +0 -0
- /package/{module → esm}/generators/create-lcd-clients.js +0 -0
- /package/{types → esm}/generators/create-mcp-server.d.ts +0 -0
- /package/{module → esm}/generators/create-mcp-server.js +0 -0
- /package/{types → esm}/generators/create-mobx-bundle.d.ts +0 -0
- /package/{module → esm}/generators/create-mobx-bundle.js +0 -0
- /package/{types → esm}/generators/create-msg-funcs.d.ts +0 -0
- /package/{module → esm}/generators/create-msg-funcs.js +0 -0
- /package/{types → esm}/generators/create-pinia-store-bundle.d.ts +0 -0
- /package/{module → esm}/generators/create-pinia-store-bundle.js +0 -0
- /package/{types → esm}/generators/create-pinia-store.d.ts +0 -0
- /package/{module → esm}/generators/create-pinia-store.js +0 -0
- /package/{types → esm}/generators/create-query-funcs.d.ts +0 -0
- /package/{module → esm}/generators/create-query-funcs.js +0 -0
- /package/{types → esm}/generators/create-react-query-bundle.d.ts +0 -0
- /package/{module → esm}/generators/create-react-query-bundle.js +0 -0
- /package/{types → esm}/generators/create-registries.d.ts +0 -0
- /package/{module → esm}/generators/create-registries.js +0 -0
- /package/{types → esm}/generators/create-root-readme.d.ts +0 -0
- /package/{module → esm}/generators/create-root-readme.js +0 -0
- /package/{types → esm}/generators/create-rpc-msg-client-all.d.ts +0 -0
- /package/{module → esm}/generators/create-rpc-msg-client-all.js +0 -0
- /package/{types → esm}/generators/create-rpc-msg-client-scoped.d.ts +0 -0
- /package/{module → esm}/generators/create-rpc-msg-client-scoped.js +0 -0
- /package/{types → esm}/generators/create-rpc-msg-clients.d.ts +0 -0
- /package/{module → esm}/generators/create-rpc-msg-clients.js +0 -0
- /package/{types → esm}/generators/create-rpc-ops-bundle.d.ts +0 -0
- /package/{module → esm}/generators/create-rpc-ops-bundle.js +0 -0
- /package/{types → esm}/generators/create-rpc-query-client-all.d.ts +0 -0
- /package/{module → esm}/generators/create-rpc-query-client-all.js +0 -0
- /package/{types → esm}/generators/create-rpc-query-client-scoped.d.ts +0 -0
- /package/{module → esm}/generators/create-rpc-query-client-scoped.js +0 -0
- /package/{types → esm}/generators/create-rpc-query-clients.d.ts +0 -0
- /package/{module → esm}/generators/create-rpc-query-clients.js +0 -0
- /package/{types → esm}/generators/create-sdk-module-stargate-clients.d.ts +0 -0
- /package/{types → esm}/generators/create-stargate-clients.d.ts +0 -0
- /package/{types → esm}/generators/create-types.d.ts +0 -0
- /package/{module → esm}/generators/create-types.js +0 -0
- /package/{types → esm}/generators/customize-utils.d.ts +0 -0
- /package/{module → esm}/generators/customize-utils.js +0 -0
- /package/{types → esm}/helpers/__test__/internalTimestamp.d.ts +0 -0
- /package/{module → esm}/helpers/__test__/internalTimestamp.js +0 -0
- /package/{types → esm}/helpers/__test__/internalTimestampBigint.d.ts +0 -0
- /package/{module → esm}/helpers/__test__/internalTimestampBigint.js +0 -0
- /package/{types → esm}/helpers/binary-coder.d.ts +0 -0
- /package/{module → esm}/helpers/binary-coder.js +0 -0
- /package/{types → esm}/helpers/decimals.d.ts +0 -0
- /package/{module → esm}/helpers/decimals.js +0 -0
- /package/{types → esm}/helpers/external-comet.d.ts +0 -0
- /package/{module → esm}/helpers/external-comet.js +0 -0
- /package/{types → esm}/helpers/external-icjs.d.ts +0 -0
- /package/{module → esm}/helpers/external-icjs.js +0 -0
- /package/{types → esm}/helpers/external.d.ts +0 -0
- /package/{module → esm}/helpers/external.js +0 -0
- /package/{types → esm}/helpers/grpc-gateway.d.ts +0 -0
- /package/{module → esm}/helpers/grpc-gateway.js +0 -0
- /package/{types → esm}/helpers/grpc-web.d.ts +0 -0
- /package/{module → esm}/helpers/grpc-web.js +0 -0
- /package/{types → esm}/helpers/helper-func-types-interface.d.ts +0 -0
- /package/{module → esm}/helpers/helper-func-types-interface.js +0 -0
- /package/{types → esm}/helpers/helper-func-types.d.ts +0 -0
- /package/{module → esm}/helpers/helper-func-types.js +0 -0
- /package/{types → esm}/helpers/index.d.ts +0 -0
- /package/{module → esm}/helpers/index.js +0 -0
- /package/{types → esm}/helpers/internal-for-bigint.d.ts +0 -0
- /package/{module → esm}/helpers/internal-for-bigint.js +0 -0
- /package/{types → esm}/helpers/internal.d.ts +0 -0
- /package/{module → esm}/helpers/internal.js +0 -0
- /package/{types → esm}/helpers/json-safe.d.ts +0 -0
- /package/{module → esm}/helpers/json-safe.js +0 -0
- /package/{types → esm}/helpers/mobx.d.ts +0 -0
- /package/{module → esm}/helpers/mobx.js +0 -0
- /package/{types → esm}/helpers/pinia-endpoint.d.ts +0 -0
- /package/{module → esm}/helpers/pinia-endpoint.js +0 -0
- /package/{types → esm}/helpers/react-query-hooks-icjs.d.ts +0 -0
- /package/{module → esm}/helpers/react-query-hooks-icjs.js +0 -0
- /package/{types → esm}/helpers/react-query-hooks.d.ts +0 -0
- /package/{module → esm}/helpers/react-query-hooks.js +0 -0
- /package/{types → esm}/helpers/react-query.d.ts +0 -0
- /package/{module → esm}/helpers/react-query.js +0 -0
- /package/{types → esm}/helpers/registry-helper.d.ts +0 -0
- /package/{module → esm}/helpers/registry-helper.js +0 -0
- /package/{types → esm}/helpers/types-helper.d.ts +0 -0
- /package/{module → esm}/helpers/types-helper.js +0 -0
- /package/{types → esm}/helpers/utf8-helper.d.ts +0 -0
- /package/{module → esm}/helpers/utf8-helper.js +0 -0
- /package/{types → esm}/helpers/varint.d.ts +0 -0
- /package/{module → esm}/helpers/varint.js +0 -0
- /package/{types → esm}/helpers/vue-query-hooks.d.ts +0 -0
- /package/{module → esm}/helpers/vue-query-hooks.js +0 -0
- /package/{types → esm}/imports.d.ts +0 -0
- /package/{module → esm}/imports.js +0 -0
- /package/{types → esm}/index.d.ts +0 -0
- /package/{module → esm}/index.js +0 -0
- /package/{types → esm}/parse.d.ts +0 -0
- /package/{module → esm}/parse.js +0 -0
- /package/{types → esm}/prompt.d.ts +0 -0
- /package/{module → esm}/prompt.js +0 -0
- /package/{types → esm}/protod/bufbuild.d.ts +0 -0
- /package/{module → esm}/protod/bufbuild.js +0 -0
- /package/{types → esm}/protod/config.d.ts +0 -0
- /package/{module → esm}/protod/config.js +0 -0
- /package/{types → esm}/protod/git-repo.d.ts +0 -0
- /package/{module → esm}/protod/git-repo.js +0 -0
- /package/{types → esm}/protod/index.d.ts +0 -0
- /package/{module → esm}/protod/index.js +0 -0
- /package/{types → esm}/protod/recursive.d.ts +0 -0
- /package/{module → esm}/protod/recursive.js +0 -0
- /package/{types → esm}/protod/types.d.ts +0 -0
- /package/{module → esm}/protod/types.js +0 -0
- /package/{types → esm}/protod/utils.d.ts +0 -0
- /package/{module → esm}/protod/utils.js +0 -0
- /package/{types → esm}/types.d.ts +0 -0
- /package/{module → esm}/types.js +0 -0
- /package/{types → esm}/utils/common-create-bundle.d.ts +0 -0
- /package/{module → esm}/utils/common-create-bundle.js +0 -0
- /package/{types → esm}/utils/files.d.ts +0 -0
- /package/{module → esm}/utils/files.js +0 -0
- /package/{module → esm}/utils/index.js +0 -0
- /package/{types → esm}/utils/unused.d.ts +0 -0
- /package/{module → esm}/utils/unused.js +0 -0
- /package/{main/generators → generators}/create-aggregated-lcd-client.js +0 -0
- /package/{types/generators/create-combined-stargate-clients.d.ts → generators/create-all-stargate-clients.d.ts} +0 -0
- /package/{main/generators → generators}/create-all-stargate-clients.js +0 -0
- /package/{main/generators → generators}/create-amino-converters.js +0 -0
- /package/{main/generators → generators}/create-bundle.js +0 -0
- /package/{types/generators/create-scoped-stargate-clients.d.ts → generators/create-custom-stargate-clients.d.ts} +0 -0
- /package/{main/generators → generators}/create-custom-stargate-clients.js +0 -0
- /package/{main/generators → generators}/create-helpers.js +0 -0
- /package/{main/generators → generators}/create-lcd-clients.js +0 -0
- /package/{main/generators → generators}/create-mcp-server.js +0 -0
- /package/{main/generators → generators}/create-msg-funcs.js +0 -0
- /package/{main/generators → generators}/create-pinia-store.js +0 -0
- /package/{main/generators → generators}/create-query-funcs.js +0 -0
- /package/{main/generators → generators}/create-registries.js +0 -0
- /package/{main/generators → generators}/create-root-readme.js +0 -0
- /package/{main/generators → generators}/create-rpc-msg-clients.js +0 -0
- /package/{main/generators → generators}/create-rpc-query-clients.js +0 -0
- /package/{main/generators → generators}/customize-utils.js +0 -0
- /package/{main/helpers → helpers}/binary-coder.js +0 -0
- /package/{main/helpers → helpers}/decimals.js +0 -0
- /package/{main/helpers → helpers}/external-comet.js +0 -0
- /package/{main/helpers → helpers}/external-icjs.js +0 -0
- /package/{main/helpers → helpers}/external.js +0 -0
- /package/{main/helpers → helpers}/grpc-gateway.js +0 -0
- /package/{main/helpers → helpers}/grpc-web.js +0 -0
- /package/{main/helpers → helpers}/helper-func-types-interface.js +0 -0
- /package/{main/helpers → helpers}/helper-func-types.js +0 -0
- /package/{src/helpers/index.ts → helpers/index.d.ts} +0 -0
- /package/{main/helpers → helpers}/index.js +0 -0
- /package/{main/helpers → helpers}/internal-for-bigint.js +0 -0
- /package/{main/helpers → helpers}/internal.js +0 -0
- /package/{main/helpers → helpers}/json-safe.js +0 -0
- /package/{main/helpers → helpers}/mobx.js +0 -0
- /package/{main/helpers → helpers}/pinia-endpoint.js +0 -0
- /package/{main/helpers → helpers}/react-query-hooks-icjs.js +0 -0
- /package/{main/helpers → helpers}/react-query-hooks.js +0 -0
- /package/{main/helpers → helpers}/react-query.js +0 -0
- /package/{main/helpers → helpers}/registry-helper.js +0 -0
- /package/{main/helpers → helpers}/types-helper.js +0 -0
- /package/{main/helpers → helpers}/utf8-helper.js +0 -0
- /package/{main/helpers → helpers}/varint.js +0 -0
- /package/{main/helpers → helpers}/vue-query-hooks.js +0 -0
- /package/{main/index.js → index.js} +0 -0
- /package/{main/parse.js → parse.js} +0 -0
- /package/{main/prompt.js → prompt.js} +0 -0
- /package/{main/protod → protod}/config.js +0 -0
- /package/{main/protod → protod}/git-repo.js +0 -0
- /package/{src/protod/index.ts → protod/index.d.ts} +0 -0
- /package/{main/protod → protod}/index.js +0 -0
- /package/{main/protod → protod}/types.js +0 -0
- /package/{main/types.js → types.js} +0 -0
- /package/{main/utils → utils}/common-create-bundle.js +0 -0
- /package/{main/utils → utils}/index.js +0 -0
package/src/protod/utils.spec.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
findAllProtoFiles,
|
|
3
|
-
getMainBranchName,
|
|
4
|
-
isPathExist,
|
|
5
|
-
parseProtoFile,
|
|
6
|
-
} from "./utils";
|
|
7
|
-
|
|
8
|
-
import { join } from "path";
|
|
9
|
-
|
|
10
|
-
const TEST_DATA_FOLDER = "test-data";
|
|
11
|
-
const TEST_DATA_NONE_FOLDER = "test-data-none";
|
|
12
|
-
let testData = join(__dirname, TEST_DATA_FOLDER);
|
|
13
|
-
let testDataNone = join(__dirname, TEST_DATA_NONE_FOLDER);
|
|
14
|
-
|
|
15
|
-
const testSwitch = false;
|
|
16
|
-
|
|
17
|
-
describe("Test `getMainBranchName`", () => {
|
|
18
|
-
(testSwitch ? it : it.skip)("`cosmos-proto` should return `main`", async () => {
|
|
19
|
-
const branch = await getMainBranchName(
|
|
20
|
-
"https://github.com/cosmos/cosmos-proto.git"
|
|
21
|
-
);
|
|
22
|
-
expect(branch).toBe("main");
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
(testSwitch ? it : it.skip)("`ics23` should return `master`", async () => {
|
|
26
|
-
const branch = await getMainBranchName(
|
|
27
|
-
"https://github.com/cosmos/ics23.git"
|
|
28
|
-
);
|
|
29
|
-
expect(branch).toBe("master");
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
describe("Test `parseProtoFile`", () => {
|
|
34
|
-
it("should successfully parse `./test-data/model.proto`", () => {
|
|
35
|
-
const [dep1, dep2] = parseProtoFile(join(testData, "/model.proto"));
|
|
36
|
-
expect(dep1).toBe("google/api/field_behavior.proto");
|
|
37
|
-
expect(dep2).toBe("google/api/resource.proto");
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
describe("Test `isPathExist`", () => {
|
|
42
|
-
it("`./test-data/buf.lock` should exist", () => {
|
|
43
|
-
const result = isPathExist(join(testData, "/buf.lock"));
|
|
44
|
-
expect(result).toBe(true);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("`./test-data/fake/buf.lock` should not exist", () => {
|
|
48
|
-
const result = isPathExist(join(testData, "/fake/buf.lock"));
|
|
49
|
-
expect(result).toBe(false);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it("`./test-data` should exist", () => {
|
|
53
|
-
const result = isPathExist(testData);
|
|
54
|
-
expect(result).toBe(true);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("`./test-data-none` should not exist", () => {
|
|
58
|
-
const result = isPathExist(testDataNone);
|
|
59
|
-
expect(result).toBe(false);
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
describe("Test `findAllProtoFiles`", () => {
|
|
64
|
-
it("`./test-data` should contain 2 proto files", () => {
|
|
65
|
-
const files = findAllProtoFiles(testData);
|
|
66
|
-
expect(files.length).toBe(2);
|
|
67
|
-
});
|
|
68
|
-
});
|
package/src/protod/utils.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { exec as _exec } from "shelljs";
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import { bufInfo } from "./config";
|
|
4
|
-
import { Repo } from "./types";
|
|
5
|
-
import { crossGlob as glob } from '@cosmology/utils';
|
|
6
|
-
|
|
7
|
-
export function exec(command: string, verbose = false) {
|
|
8
|
-
const { code, stdout, stderr } = _exec(command);
|
|
9
|
-
if (code === 0) {
|
|
10
|
-
if (verbose) {
|
|
11
|
-
console.log(stdout);
|
|
12
|
-
}
|
|
13
|
-
} else {
|
|
14
|
-
console.error(`Failed: ${command}`);
|
|
15
|
-
throw new Error(stderr);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return { stdout };
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export async function getMainBranchName(url: string) {
|
|
22
|
-
console.log(`Checking main branch for ${url}`)
|
|
23
|
-
|
|
24
|
-
const { stdout } = exec(`git ls-remote -h ${url} main`);
|
|
25
|
-
if (stdout) {
|
|
26
|
-
return "main";
|
|
27
|
-
}
|
|
28
|
-
const { stdout: stdout2 } = exec(`git ls-remote -h ${url} master`);
|
|
29
|
-
if (stdout2) {
|
|
30
|
-
return "master";
|
|
31
|
-
}
|
|
32
|
-
throw new Error("Can't find `main` or `master` branch");
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function getCorrespondingGit(bufRepo: Repo): Repo[] {
|
|
36
|
-
const bufItem = bufInfo.find(
|
|
37
|
-
(repo) => repo.owner === bufRepo.owner && repo.repo === bufRepo.repo
|
|
38
|
-
);
|
|
39
|
-
if (bufItem) {
|
|
40
|
-
return bufItem.git;
|
|
41
|
-
} else {
|
|
42
|
-
return [bufRepo];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function parseProtoFile(filePath: string): string[] {
|
|
47
|
-
if (!isPathExist(filePath)) {
|
|
48
|
-
console.warn(`No such file ${filePath}`);
|
|
49
|
-
return [];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
let proto;
|
|
53
|
-
|
|
54
|
-
try {
|
|
55
|
-
proto = fs.readFileSync(filePath, "utf8");
|
|
56
|
-
} catch (error) {
|
|
57
|
-
console.log(filePath);
|
|
58
|
-
throw new Error(error);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const deps: string[] = [];
|
|
62
|
-
proto?.split("\n").forEach((line) => {
|
|
63
|
-
if (line.trim().startsWith("import ")) {
|
|
64
|
-
const dep = /import\s"(.+)";?/.exec(line)?.[1];
|
|
65
|
-
if (!dep) {
|
|
66
|
-
throw Error(`Failed to parse line: ${line}`);
|
|
67
|
-
}
|
|
68
|
-
deps.push(dep);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
return deps;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function isPathExist(path: string): boolean {
|
|
75
|
-
return fs.existsSync(path);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function findAllProtoFiles(dir: string): string[] {
|
|
79
|
-
return glob(`${dir}/**/*.proto`, {
|
|
80
|
-
ignore: `${dir}/node_modules/**`,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function removeFolder(dir: string) {
|
|
85
|
-
fs.rmSync(dir, { recursive: true, force: true });
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export function makeDir(dir: string) {
|
|
89
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
90
|
-
}
|
package/src/telescope.js
DELETED
package/src/types.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ImportDeclaration } from '@babel/types';
|
|
2
|
-
import { ProtoServiceMethod, TelescopeOptions } from '@cosmology/types';
|
|
3
|
-
export interface ExportObj {
|
|
4
|
-
pkg: string;
|
|
5
|
-
localname: string;
|
|
6
|
-
relativePath: string;
|
|
7
|
-
exportedIdentifiers: string[];
|
|
8
|
-
isHelperFunc?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface Bundle {
|
|
11
|
-
bundleVariables: {};
|
|
12
|
-
bundleFile: string;
|
|
13
|
-
importPaths: ImportDeclaration[];
|
|
14
|
-
exportObjs?: ExportObj[];
|
|
15
|
-
base: string;
|
|
16
|
-
}
|
|
17
|
-
export interface BundlerFile {
|
|
18
|
-
proto?: string;
|
|
19
|
-
package?: string;
|
|
20
|
-
localname: string;
|
|
21
|
-
filename: string;
|
|
22
|
-
isMsg?: boolean;
|
|
23
|
-
instantExportedMethods?: ProtoServiceMethod[];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface ImportObj {
|
|
27
|
-
type: 'import' | 'default' | 'namespace' | string;
|
|
28
|
-
name: string;
|
|
29
|
-
path: string;
|
|
30
|
-
importAs?: string;
|
|
31
|
-
protoPath?: string;
|
|
32
|
-
}
|
|
33
|
-
export type UtilValue = ImportObj | string;
|
|
34
|
-
|
|
35
|
-
export interface DerivedImportObj extends ImportObj {
|
|
36
|
-
orig: string;
|
|
37
|
-
}
|
|
38
|
-
export interface ImportHash {
|
|
39
|
-
[key: string]: string[];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface TelescopeInput {
|
|
43
|
-
protoDirs: string[];
|
|
44
|
-
outPath: string;
|
|
45
|
-
options: TelescopeOptions;
|
|
46
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { aggregateImports, getImportStatements } from '../imports';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import { TelescopeBuilder } from '../builder';
|
|
4
|
-
import { GenericParseContext } from '@cosmology/ast';
|
|
5
|
-
import { ProtoRef } from '@cosmology/types';
|
|
6
|
-
import { TelescopeParseContext } from '../build';
|
|
7
|
-
import { writeAstToFile } from '../utils/files';
|
|
8
|
-
import { fixlocalpaths } from '../utils';
|
|
9
|
-
import * as t from '@babel/types';
|
|
10
|
-
import { createEmptyProtoRef } from '@cosmology/proto-parser';
|
|
11
|
-
|
|
12
|
-
export const commonBundlePlugin = (
|
|
13
|
-
builder: TelescopeBuilder,
|
|
14
|
-
bundleFilename: string,
|
|
15
|
-
packageMappings: object,
|
|
16
|
-
astFn: (
|
|
17
|
-
context: GenericParseContext,
|
|
18
|
-
obj: object
|
|
19
|
-
) => (
|
|
20
|
-
| t.ExportNamedDeclaration
|
|
21
|
-
| {
|
|
22
|
-
type: string;
|
|
23
|
-
importKind: string;
|
|
24
|
-
specifiers: {
|
|
25
|
-
type: string;
|
|
26
|
-
local: {
|
|
27
|
-
type: string;
|
|
28
|
-
name: string;
|
|
29
|
-
};
|
|
30
|
-
}[];
|
|
31
|
-
source: {
|
|
32
|
-
type: string;
|
|
33
|
-
value: string;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
)[]
|
|
37
|
-
) => {
|
|
38
|
-
const localname = bundleFilename;
|
|
39
|
-
|
|
40
|
-
// create proto ref for context
|
|
41
|
-
const pkg = '@root';
|
|
42
|
-
const ref: ProtoRef = createEmptyProtoRef(pkg, localname);
|
|
43
|
-
|
|
44
|
-
// create context
|
|
45
|
-
const pCtx = new TelescopeParseContext(ref, builder.store, builder.options);
|
|
46
|
-
|
|
47
|
-
// generate code for createRpcQueryHooks and imports of related packages.
|
|
48
|
-
const ast = astFn(pCtx.proto, packageMappings);
|
|
49
|
-
|
|
50
|
-
// generate imports added by context.addUtil
|
|
51
|
-
const imports = fixlocalpaths(aggregateImports(pCtx, {}, localname));
|
|
52
|
-
const importStmts = getImportStatements(localname, imports, builder.options);
|
|
53
|
-
|
|
54
|
-
// construct the AST
|
|
55
|
-
const prog = [].concat(importStmts).concat(ast);
|
|
56
|
-
|
|
57
|
-
// write the file.
|
|
58
|
-
const filename = join(builder.outPath, localname);
|
|
59
|
-
builder.files.push(localname);
|
|
60
|
-
|
|
61
|
-
writeAstToFile(builder.outPath, builder.options, prog, filename);
|
|
62
|
-
};
|
package/src/utils/files.ts
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import * as t from "@babel/types";
|
|
2
|
-
import { parse, ParserPlugin } from "@babel/parser";
|
|
3
|
-
import { TelescopeOptions } from "@cosmology/types";
|
|
4
|
-
import { mkdirp } from "mkdirp";
|
|
5
|
-
import { writeFileSync } from "fs";
|
|
6
|
-
import { dirname } from "path";
|
|
7
|
-
import minimatch from "minimatch";
|
|
8
|
-
import generate from "@babel/generator";
|
|
9
|
-
import { unused } from "./unused";
|
|
10
|
-
import traverse from "@babel/traverse";
|
|
11
|
-
import { toPosixPath } from "@cosmology/utils";
|
|
12
|
-
|
|
13
|
-
export function getExportedTypeNames(program: t.Statement[]): string[] {
|
|
14
|
-
const exportedNames: string[] = [];
|
|
15
|
-
const ast = t.program(program);
|
|
16
|
-
const content = generate(ast).code;
|
|
17
|
-
const plugins: ParserPlugin[] = ["typescript"];
|
|
18
|
-
const newAst = parse(content, {
|
|
19
|
-
sourceType: "module",
|
|
20
|
-
plugins,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
traverse(newAst, {
|
|
24
|
-
ExportNamedDeclaration(path) {
|
|
25
|
-
const node = path.node;
|
|
26
|
-
|
|
27
|
-
// Handle direct declarations (type aliases, interfaces, enums)
|
|
28
|
-
if (node.declaration) {
|
|
29
|
-
const decl = node.declaration;
|
|
30
|
-
const isTypeExport = node.exportKind === "type";
|
|
31
|
-
const isTypeDecl = [
|
|
32
|
-
"TSTypeAliasDeclaration",
|
|
33
|
-
"TSInterfaceDeclaration",
|
|
34
|
-
"TSEnumDeclaration",
|
|
35
|
-
].includes(decl.type);
|
|
36
|
-
|
|
37
|
-
if (isTypeExport || isTypeDecl) {
|
|
38
|
-
if ("id" in decl && decl.id?.type === "Identifier") {
|
|
39
|
-
exportedNames.push(decl.id.name);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Handle const declarations that might be types (e.g., const schemas)
|
|
44
|
-
if (decl.type === "VariableDeclaration" && decl.kind === "const") {
|
|
45
|
-
decl.declarations.forEach((declarator) => {
|
|
46
|
-
if (declarator.id?.type === "Identifier") {
|
|
47
|
-
exportedNames.push(declarator.id.name);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Handle export specifiers (e.g., export { SomeType })
|
|
54
|
-
if (node.specifiers && node.specifiers.length > 0) {
|
|
55
|
-
const isTypeExport = node.exportKind === "type";
|
|
56
|
-
if (isTypeExport) {
|
|
57
|
-
node.specifiers.forEach((spec) => {
|
|
58
|
-
if (spec.type === "ExportSpecifier" && spec.exported.type === "Identifier") {
|
|
59
|
-
exportedNames.push(spec.exported.name);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
return exportedNames;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export const writeAstToFile = (
|
|
71
|
-
outPath: string,
|
|
72
|
-
options: TelescopeOptions,
|
|
73
|
-
program: t.Statement[],
|
|
74
|
-
filename: string
|
|
75
|
-
) => {
|
|
76
|
-
const ast = t.program(program);
|
|
77
|
-
const content = generate(ast).code;
|
|
78
|
-
|
|
79
|
-
if (options.removeUnusedImports) {
|
|
80
|
-
const plugins: ParserPlugin[] = ["typescript"];
|
|
81
|
-
const newAst = parse(content, {
|
|
82
|
-
sourceType: "module",
|
|
83
|
-
plugins,
|
|
84
|
-
});
|
|
85
|
-
traverse(newAst, unused);
|
|
86
|
-
const content2 = generate(newAst).code;
|
|
87
|
-
writeContentToFile(
|
|
88
|
-
toPosixPath(outPath),
|
|
89
|
-
options,
|
|
90
|
-
content2,
|
|
91
|
-
toPosixPath(filename)
|
|
92
|
-
);
|
|
93
|
-
} else {
|
|
94
|
-
writeContentToFile(
|
|
95
|
-
toPosixPath(outPath),
|
|
96
|
-
options,
|
|
97
|
-
content,
|
|
98
|
-
toPosixPath(filename)
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export const writeContentToFile = (
|
|
104
|
-
outPath: string,
|
|
105
|
-
options: TelescopeOptions,
|
|
106
|
-
content: string,
|
|
107
|
-
filename: string
|
|
108
|
-
) => {
|
|
109
|
-
let esLintPrefix = "";
|
|
110
|
-
let tsLintPrefix = "";
|
|
111
|
-
|
|
112
|
-
let nameWithoutPath = filename.replace(outPath, "");
|
|
113
|
-
// strip off leading slash
|
|
114
|
-
if (nameWithoutPath.startsWith("/"))
|
|
115
|
-
nameWithoutPath = nameWithoutPath.replace(/^\//, "");
|
|
116
|
-
|
|
117
|
-
options.tsDisable.patterns.forEach((pattern) => {
|
|
118
|
-
if (minimatch(nameWithoutPath, pattern)) {
|
|
119
|
-
tsLintPrefix = `//@ts-nocheck\n`;
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
options.eslintDisable.patterns.forEach((pattern) => {
|
|
123
|
-
if (minimatch(nameWithoutPath, pattern)) {
|
|
124
|
-
esLintPrefix = `/* eslint-disable */\n`;
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
if (
|
|
129
|
-
options.tsDisable.files.includes(nameWithoutPath) ||
|
|
130
|
-
options.tsDisable.disableAll
|
|
131
|
-
) {
|
|
132
|
-
tsLintPrefix = `//@ts-nocheck\n`;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (
|
|
136
|
-
options.eslintDisable.files.includes(nameWithoutPath) ||
|
|
137
|
-
options.eslintDisable.disableAll
|
|
138
|
-
) {
|
|
139
|
-
esLintPrefix = `/* eslint-disable */\n`;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const text = tsLintPrefix + esLintPrefix + content;
|
|
143
|
-
mkdirp.sync(dirname(filename));
|
|
144
|
-
writeFileSync(filename, text);
|
|
145
|
-
};
|
package/src/utils/index.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { ProtoRoot, ProtoRef } from '@cosmology/types';
|
|
2
|
-
import { relative, dirname, extname } from 'path';
|
|
3
|
-
import { ImportObj, UtilValue } from '../types';
|
|
4
|
-
import { restoreExtension, toPosixPath } from '@cosmology/utils';
|
|
5
|
-
|
|
6
|
-
export const getRoot = (ref: ProtoRef): ProtoRoot => {
|
|
7
|
-
if (ref.traversed) return ref.traversed;
|
|
8
|
-
return ref.proto;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
// default example:
|
|
12
|
-
// Long: { type: 'default', path: 'long', name: 'Long ' },
|
|
13
|
-
// namespaced:
|
|
14
|
-
// _m0: { type: 'namespace', path: 'protobufjs/minimal', name: '_m0' },
|
|
15
|
-
export const UTILS: { [key: string]: UtilValue } = {
|
|
16
|
-
_m0: { type: 'namespace', path: 'protobufjs/minimal', name: '_m0' },
|
|
17
|
-
AminoHeight: '__helpers__',
|
|
18
|
-
AminoMsg: '@cosmjs/amino',
|
|
19
|
-
AminoTypes: '@cosmjs/stargate',
|
|
20
|
-
base64FromBytes: '__helpers__',
|
|
21
|
-
bytesFromBase64: '__helpers__',
|
|
22
|
-
BrowserHeaders: 'browser-headers',
|
|
23
|
-
connectComet: '@cosmjs/tendermint-rpc',
|
|
24
|
-
Decimal: '@cosmjs/math',
|
|
25
|
-
padDecimal: '__helpers__',
|
|
26
|
-
createProtobufRpcClient: '@cosmjs/stargate',
|
|
27
|
-
Pubkey: '@cosmjs/amino',
|
|
28
|
-
decodeBech32Pubkey: '@cosmjs/amino',
|
|
29
|
-
DeepPartial: '__helpers__',
|
|
30
|
-
defaultRegistryTypes: '@cosmjs/stargate',
|
|
31
|
-
encodeBech32Pubkey: '@cosmjs/amino',
|
|
32
|
-
Exact: '__helpers__',
|
|
33
|
-
fm: { type: 'namespace', path: '__grpc-gateway__', name: 'fm' },
|
|
34
|
-
encodePubkey: '@cosmjs/proto-signing',
|
|
35
|
-
decodePubkey: '@cosmjs/proto-signing',
|
|
36
|
-
fromBase64: '@cosmjs/encoding',
|
|
37
|
-
fromBech32: '@cosmjs/encoding',
|
|
38
|
-
fromDuration: '__helpers__',
|
|
39
|
-
fromHex: '@cosmjs/encoding',
|
|
40
|
-
fromJsonTimestamp: '__helpers__',
|
|
41
|
-
fromTimestamp: '__helpers__',
|
|
42
|
-
fromUtf8: '@cosmjs/encoding',
|
|
43
|
-
GeneratedType: '@cosmjs/proto-signing',
|
|
44
|
-
createTm34QueryClient: '__extern__',
|
|
45
|
-
createConnectCometQueryClient: '__extern__',
|
|
46
|
-
getRpcClient: '__extern__',
|
|
47
|
-
createRpcClient: '__extern__',
|
|
48
|
-
getRpcEndpointKey: '__extern__',
|
|
49
|
-
HttpEndpoint: '@cosmjs/tendermint-rpc',
|
|
50
|
-
isObject: '__helpers__',
|
|
51
|
-
isSet: '__helpers__',
|
|
52
|
-
LCDClient: '@cosmology/lcd',
|
|
53
|
-
Long: '__helpers__',
|
|
54
|
-
OfflineSigner: '@cosmjs/proto-signing',
|
|
55
|
-
omitDefault: '__helpers__',
|
|
56
|
-
ProtobufRpcClient: '@cosmjs/stargate',
|
|
57
|
-
QueryClient: '@cosmjs/stargate',
|
|
58
|
-
Registry: '@cosmjs/proto-signing',
|
|
59
|
-
Rpc: '__helpers__',
|
|
60
|
-
StdFee: '__types__',
|
|
61
|
-
TxRpc: '__types__',
|
|
62
|
-
BroadcastTxReq: '__types__',
|
|
63
|
-
BroadcastTxRes: '__types__',
|
|
64
|
-
EncodeObject: '__types__',
|
|
65
|
-
SigningClientParams: '__types__',
|
|
66
|
-
grpc: '@improbable-eng/grpc-web',
|
|
67
|
-
setPaginationParams: '__helpers__',
|
|
68
|
-
SigningStargateClient: '@cosmjs/stargate',
|
|
69
|
-
Tendermint34Client: '@cosmjs/tendermint-rpc',
|
|
70
|
-
toBase64: '@cosmjs/encoding',
|
|
71
|
-
toDuration: '__helpers__',
|
|
72
|
-
toTimestamp: '__helpers__',
|
|
73
|
-
toUtf8: '@cosmjs/encoding',
|
|
74
|
-
useQuery: '@tanstack/react-query',
|
|
75
|
-
ComputedRef: 'vue',
|
|
76
|
-
computed: 'vue',
|
|
77
|
-
Ref: 'vue',
|
|
78
|
-
useRpcEndpoint: '__react-query__',
|
|
79
|
-
useRpcClient: '__react-query__',
|
|
80
|
-
useTendermintClient: '__react-query__',
|
|
81
|
-
ReactQueryParams: '__react-query__',
|
|
82
|
-
buildUseMutation:'__react-query__',
|
|
83
|
-
UseQueryParams:'__react-query__',
|
|
84
|
-
buildUseQuery:'__react-query__',
|
|
85
|
-
UseQueryOptions: '@tanstack/react-query',
|
|
86
|
-
buildUseVueMutation:'__vue-query__',
|
|
87
|
-
buildUseVueQuery:'__vue-query__',
|
|
88
|
-
QueryStore: '__mobx__',
|
|
89
|
-
MobxResponse: '__mobx__',
|
|
90
|
-
useEndpoint: '__pinia-endpoint__',
|
|
91
|
-
JsonSafe: '__json-safe__',
|
|
92
|
-
override: 'mobx',
|
|
93
|
-
makeObservable: 'mobx',
|
|
94
|
-
NodeHttpTransport: '@improbable-eng/grpc-web-node-http-transport',
|
|
95
|
-
UnaryMethodDefinitionishR: '__grpc-web__',
|
|
96
|
-
UnaryMethodDefinitionish: '__grpc-web__',
|
|
97
|
-
BinaryReader: '__binary__',
|
|
98
|
-
BinaryWriter: '__binary__',
|
|
99
|
-
TelescopeGeneratedType: '__types__',
|
|
100
|
-
GlobalDecoderRegistry: '__registry__',
|
|
101
|
-
buildTx:'__helper-func-types__',
|
|
102
|
-
ISigningClient:'__helper-func-types__',
|
|
103
|
-
buildQuery:'__helper-func-types__',
|
|
104
|
-
EndpointOrRpc:'__helper-func-types__',
|
|
105
|
-
toConverters:'@interchainjs/cosmos/utils',
|
|
106
|
-
toEncoders:'@interchainjs/cosmos/utils'
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export const UTIL_HELPERS = [
|
|
110
|
-
'__helpers__',
|
|
111
|
-
'__extern__',
|
|
112
|
-
'__react-query__',
|
|
113
|
-
'__vue-query__',
|
|
114
|
-
'__mobx__',
|
|
115
|
-
'__binary__',
|
|
116
|
-
'__pinia-endpoint__',
|
|
117
|
-
'__json-safe__',
|
|
118
|
-
'__grpc-gateway__',
|
|
119
|
-
'__grpc-web__',
|
|
120
|
-
'__types__',
|
|
121
|
-
'__registry__',
|
|
122
|
-
'__decimals__',
|
|
123
|
-
'__helper-func-types__'
|
|
124
|
-
];
|
|
125
|
-
|
|
126
|
-
export const fixlocalpaths = (imports: ImportObj[]) => {
|
|
127
|
-
return imports.map((imp) => {
|
|
128
|
-
const fixedPath = toPosixPath(imp.path);
|
|
129
|
-
return {
|
|
130
|
-
...imp,
|
|
131
|
-
path:
|
|
132
|
-
UTIL_HELPERS.includes(imp.path) ||
|
|
133
|
-
imp.path.startsWith('.') ||
|
|
134
|
-
imp.path.startsWith('@')
|
|
135
|
-
? fixedPath
|
|
136
|
-
: `./${fixedPath}`,
|
|
137
|
-
};
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
export const getRelativePath = (f1: string, f2: string, ext?: string) => {
|
|
142
|
-
const rel = relative(dirname(f1), f2);
|
|
143
|
-
let importPath = rel.replace(extname(rel), '');
|
|
144
|
-
if (!/^\./.test(importPath)) importPath = `./${importPath}`;
|
|
145
|
-
importPath = toPosixPath(importPath);
|
|
146
|
-
return restoreExtension(importPath, ext);
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
export * from './common-create-bundle';
|
package/src/utils/unused.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//@ts-nocheck
|
|
2
|
-
|
|
3
|
-
import * as t from '@babel/types';
|
|
4
|
-
|
|
5
|
-
// https://github.com/chuyik/babel-plugin-danger-remove-unused-import
|
|
6
|
-
// https://github.com/chuyik/babel-plugin-danger-remove-unused-import/blob/c5454c21e94698a2464a12baa5590761932a71a8/License#L1
|
|
7
|
-
|
|
8
|
-
export const unused = {
|
|
9
|
-
Program: {
|
|
10
|
-
exit: (path) => {
|
|
11
|
-
const UnRefBindings = new Map()
|
|
12
|
-
for (const [name, binding] of Object.entries(path.scope.bindings)) {
|
|
13
|
-
if (!binding.path.parentPath || binding.kind !== 'module') continue
|
|
14
|
-
|
|
15
|
-
const source = binding.path.parentPath.get('source')
|
|
16
|
-
const importName = source.node.value
|
|
17
|
-
if (
|
|
18
|
-
!t.isStringLiteral(source)
|
|
19
|
-
)
|
|
20
|
-
continue
|
|
21
|
-
|
|
22
|
-
const key = `${importName}(${source.node.loc &&
|
|
23
|
-
source.node.loc.start.line})`
|
|
24
|
-
|
|
25
|
-
if (!UnRefBindings.has(key)) {
|
|
26
|
-
UnRefBindings.set(key, binding)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (binding.referenced) {
|
|
30
|
-
UnRefBindings.set(key, null)
|
|
31
|
-
} else {
|
|
32
|
-
const nodeType = binding.path.node.type
|
|
33
|
-
if (nodeType === 'ImportSpecifier') {
|
|
34
|
-
binding.path.remove()
|
|
35
|
-
} else if (nodeType === 'ImportDefaultSpecifier') {
|
|
36
|
-
binding.path.remove()
|
|
37
|
-
} else if (nodeType === 'ImportNamespaceSpecifier') {
|
|
38
|
-
binding.path.remove()
|
|
39
|
-
} else if (binding.path.parentPath) {
|
|
40
|
-
binding.path.parentPath.remove()
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
UnRefBindings.forEach((binding, key) => {
|
|
46
|
-
if (binding && binding.path.parentPath) {
|
|
47
|
-
binding.path.parentPath.remove()
|
|
48
|
-
}
|
|
49
|
-
})
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
};
|
package/types/cli.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function cli(argv: any): Promise<void>;
|
package/types/cmds.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export namespace Commands {
|
|
2
|
-
export { _commands_generate as generate };
|
|
3
|
-
export { _commands_install as install };
|
|
4
|
-
export { _commands_download as download };
|
|
5
|
-
export { _commands_transpile as transpile };
|
|
6
|
-
}
|
|
7
|
-
import _commands_generate from './commands/generate';
|
|
8
|
-
import _commands_install from './commands/install';
|
|
9
|
-
import _commands_download from './commands/download';
|
|
10
|
-
import _commands_transpile from './commands/transpile';
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { BinaryReader } from "../../../../binary";
|
|
2
|
-
/**
|
|
3
|
-
* Module defines the ORM module which adds providers to the app container for
|
|
4
|
-
* module-scoped DB's. In the future it may provide gRPC services for interacting
|
|
5
|
-
* with ORM data.
|
|
6
|
-
*/
|
|
7
|
-
export interface Module {
|
|
8
|
-
}
|
|
9
|
-
export interface ModuleProtoMsg {
|
|
10
|
-
typeUrl: "/cosmos.orm.module.v1alpha1.Module";
|
|
11
|
-
value: Uint8Array;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Module defines the ORM module which adds providers to the app container for
|
|
15
|
-
* module-scoped DB's. In the future it may provide gRPC services for interacting
|
|
16
|
-
* with ORM data.
|
|
17
|
-
*/
|
|
18
|
-
export interface ModuleAmino {
|
|
19
|
-
}
|
|
20
|
-
export interface ModuleAminoMsg {
|
|
21
|
-
type: "cosmos-sdk/Module";
|
|
22
|
-
value: ModuleAmino;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Module defines the ORM module which adds providers to the app container for
|
|
26
|
-
* module-scoped DB's. In the future it may provide gRPC services for interacting
|
|
27
|
-
* with ORM data.
|
|
28
|
-
*/
|
|
29
|
-
export interface ModuleSDKType {
|
|
30
|
-
}
|
|
31
|
-
export declare const Module: {
|
|
32
|
-
typeUrl: string;
|
|
33
|
-
encode(_: Module, writer?: BinaryWriter): BinaryWriter;
|
|
34
|
-
decode(input: BinaryReader | Uint8Array, length?: number): Module;
|
|
35
|
-
fromPartial(_: Partial<Module>): Module;
|
|
36
|
-
fromAmino(_: ModuleAmino): Module;
|
|
37
|
-
toAmino(_: Module): ModuleAmino;
|
|
38
|
-
fromAminoMsg(object: ModuleAminoMsg): Module;
|
|
39
|
-
toAminoMsg(message: Module): ModuleAminoMsg;
|
|
40
|
-
fromProtoMsg(message: ModuleProtoMsg): Module;
|
|
41
|
-
toProto(message: Module): Uint8Array;
|
|
42
|
-
toProtoMsg(message: Module): ModuleProtoMsg;
|
|
43
|
-
};
|