Skip to content

Commit b2e07d1

Browse files
committed
Updated download-protos and fixed codegen related bugs
1 parent 5cd5850 commit b2e07d1

File tree

8 files changed

+62
-7
lines changed

8 files changed

+62
-7
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"repos": [
3+
{ "owner": "cosmos", "repo": "cosmos-sdk", "branch": "release/v0.50.x" },
4+
{ "owner": "cosmos", "repo": "ibc-go" },
5+
{ "owner": "injectivelabs", "repo": "sdk-go" }
6+
],
7+
"protoDirMapping": {
8+
"gogo/protobuf/master": ".",
9+
"googleapis/googleapis/master": ".",
10+
"protocolbuffers/protobuf/main": "src"
11+
},
12+
"outDir": "protos/interchainjs",
13+
"ssh": false,
14+
"tempRepoDir": "git-modules",
15+
"targets": [
16+
"cosmos/**/*.proto",
17+
"cosmwasm/**/*.proto",
18+
"ibc/**/*.proto",
19+
"injective/types/v1beta1/account.proto"
20+
]
21+
}

boilerplates/telescope/packages/__MODULENAME__/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
2424
"clean": "rimraf dist/**",
2525
"prepare": "npm run build",
26+
"download-protos": "ts-node scripts/download-protos.ts --config ./.protod.config.json",
2627
"codegen": "ts-node scripts/codegen.ts",
2728
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
2829
"build:dev": "npm run clean; npm run codegen; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
@@ -31,7 +32,10 @@
3132
"test:watch": "jest --watch"
3233
},
3334
"devDependencies": {
34-
"@cosmology/telescope": "^1.10.0"
35+
"@cosmology/telescope": "^1.12.4",
36+
"@types/node": "^22.14.1",
37+
"ts-node": "^10.9.2",
38+
"typescript": "^5.8.3"
3539
},
3640
"dependencies": {
3741
"@cosmjs/encoding": "0.32.3",

boilerplates/telescope/packages/__MODULENAME__/scripts/codegen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { rimrafSync as rimraf } from 'rimraf';
55

66
import { AMINO_MAP } from './aminos';
77

8-
const protoDirs: string[] = [join(__dirname, '/../proto')];
8+
const protoDirs: string[] = [join(__dirname, '/../protos')];
99
const outPath: string = join(__dirname, '../src');
1010
rimraf(outPath);
1111

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// @ts-ignore
2+
import downloadProtos from '@cosmology/telescope/main/commands/download'
3+
4+
const argv = require('minimist')(process.argv.slice(2), {
5+
alias: {
6+
b: 'fromBranch',
7+
e: 'example',
8+
t: 'template',
9+
n: 'name'
10+
}
11+
});
12+
13+
14+
downloadProtos(argv)
15+
.then(() => console.log('✅ Proto download completed'))
16+
// @ts-ignore
17+
.catch((error) => {
18+
console.error('❌ Proto download failed:', error);
19+
process.exit(1);
20+
});

boilerplates/telescope/packages/__MODULENAME__/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "dist",
5-
"rootDir": "src/"
5+
"rootDir": "src/",
66
},
77
"include": ["src/**/*.ts"],
88
"exclude": ["dist", "node_modules", "**/*.spec.*", "**/*.test.*"]

packages/create-interchain-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"typescript": "^5.1.6"
6363
},
6464
"dependencies": {
65+
"@cosmology/telescope": "^1.12.4",
6566
"ansi-colors": "4.1.3",
6667
"dargs": "7.0.0",
6768
"fuzzy": "0.1.3",
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import { CIA_URL } from "./constants";
22
import { createGitApp } from "./git-cia-template";
3+
import protodCommand from '@cosmology/telescope/main/commands/download'
34
export const cli = async (argv, version) => {
4-
const repo = argv.repo ?? CIA_URL;
5-
const createCosmosApp = createGitApp(repo, version);
6-
await createCosmosApp(argv);
5+
switch (argv._[0]) {
6+
case 'protod':
7+
await protodCommand(argv);
8+
break;
9+
default: {
10+
const repo = argv.repo ?? CIA_URL;
11+
const createCosmosApp = createGitApp(repo, version);
12+
await createCosmosApp(argv);
13+
break;
14+
}
15+
}
716
};

packages/create-interchain-app/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"baseUrl": ".",
4-
"rootDir": "src",
4+
"rootDir": ".",
55
"skipLibCheck": true,
66
"emitDeclarationOnly": false,
77
"declaration": true,

0 commit comments

Comments
 (0)