diff --git a/package.json b/package.json index 2dd2acf7..91a40934 100644 --- a/package.json +++ b/package.json @@ -43,9 +43,9 @@ "!cosmos-sdk-*/**/*.md" ], "scripts": { - "format": "prettier --write --log-level warn \"./src/**/*.ts\" \"./scripts/**/*.js\"", + "format": "prettier --write --log-level warn \"./src/**/*.ts\" \"./scripts/**/*.cjs\"", "precodegen": "./scripts/exports_protos.sh", - "codegen": "rm -rf ./src && ./scripts/codegen.js && npm run format", + "codegen": "rm -rf ./src && ./scripts/codegen.cjs && npm run format", "prepare-publishing": "./scripts/prepare-publishing.sh", "build": "rm -rf ./build && tsc && npm run prepare-publishing" }, diff --git a/scripts/codegen.js b/scripts/codegen.cjs similarity index 97% rename from scripts/codegen.js rename to scripts/codegen.cjs index 4caa455e..d1535ca9 100755 --- a/scripts/codegen.js +++ b/scripts/codegen.cjs @@ -10,6 +10,7 @@ telescope({ protoDirs: ["protos/cosmos-sdk", "protos/wasmd", "protos/ibc-go"], outPath: outPath, options: { + restoreImportExtension: ".ts", logLevel: 0, useSDKTypes: false, tsDisable: { @@ -102,7 +103,7 @@ telescope({ // Exports we want to provide at the root of the "cosmjs-types" package - export type { DeepPartial, Exact } from "./helpers"; + export type { DeepPartial, Exact } from "./helpers.ts"; `; writeFileSync(`${outPath}/index.ts`, index_ts); diff --git a/src/index.ts b/src/index.ts index bfe8ca12..65252145 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,4 +2,4 @@ // Exports we want to provide at the root of the "cosmjs-types" package -export type { DeepPartial, Exact } from "./helpers"; +export type { DeepPartial, Exact } from "./helpers.ts"; diff --git a/tsconfig.json b/tsconfig.json index e7fa85e9..02a2eb15 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,7 @@ // So minifiers have to strip them off later on. "removeComments": false, "resolveJsonModule": true, + "rewriteRelativeImportExtensions": true, "rootDir": "src", "sourceMap": true, "strict": true