Skip to content

Commit

Permalink
fix: fix build.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ALPAC-4 committed Apr 2, 2024
1 parent 9d4fca6 commit 81a0fc6
Show file tree
Hide file tree
Showing 17 changed files with 324 additions and 397 deletions.
12 changes: 6 additions & 6 deletions _packages/initia-registry/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions _packages/initia-registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"clean:main": "rimraf main",
"clean:esm": "rimraf esm",
"clean": "npm run clean:main && npm run clean:esm",
"build": "npm run clean && npm run build:mjs && npm run build:cjs"
"build": "npm run clean && npm run build:mjs && npm run build:cjs",
"build:pkg": "node ./scripts/build.js"
},
"repository": {
"type": "git",
Expand All @@ -38,6 +39,6 @@
"rimraf": "^5.0.5"
},
"dependencies": {
"@initia/initia-registry-types": "^0.0.11"
"@initia/initia-registry-types": "^0.0.12"
}
}
13 changes: 9 additions & 4 deletions _packages/initia-registry/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,15 +402,20 @@ const initIBC = (obj, ibcFieldName) => {

const NON_INFO_DIRS = ["_packages", "_scripts", "_template", ".github"];

const chainPaths = glob(`${__dirname}/../../../**/chain.json`).filter((a) => {
const splitedDirs = a.split("chain-registry/chain-registry");
const chainPaths = glob(`${__dirname}/../../../*/*/chain.json`).filter((a) => {
const spliter = "initia-registry";
const index = a.indexOf(spliter);
const splitedDirs = [a.slice(0, index), a.slice(index + spliter.length)];
let dir = splitedDirs.pop();
dir = path.basename(path.dirname(dir));
return !NON_INFO_DIRS.includes(dir);
});

const paths = glob(`${__dirname}/../../../**/*.json`).filter((a) => {
const splitedDirs = a.split("chain-registry/chain-registry");
const paths = glob(`${__dirname}/../../../*/*/*.json`).filter((a) => {
const spliter = "initia-registry";
const index = a.indexOf(spliter);
const splitedDirs = [a.slice(0, index), a.slice(index + spliter.length)];
console.log(splitedDirs);
const filePath = splitedDirs.pop();
const dir = path.basename(path.dirname(filePath));
return (
Expand Down
2 changes: 1 addition & 1 deletion _packages/initia-registry/src/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
ibc
};

export { assets, chains, ibc };
export { assets, chains, ibc };
17 changes: 11 additions & 6 deletions _packages/initia-registry/src/devnet/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ import assets from './assets';
import chains from './chains';
import ibc from './ibc';

export default {
assets,
chains,
ibc
};

export { assets, chains, ibc };
export default {
assets,
chains,
ibc,
};

export {
assets,
chains,
ibc,
};
4 changes: 2 additions & 2 deletions _packages/initia-registry/src/devnet/ibc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IBCData } from '@initia/initia-registry-types';
import { IBCInfo } from '@initia/initia-registry-types';

import * as _initia from './initia'

const ibc: IBCData[] = [..._initia.ibc_chain1];
const ibc: IBCInfo[] = [..._initia.ibc_chain1];

export default ibc;
2 changes: 1 addition & 1 deletion _packages/initia-registry/src/devnet/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * as miniwasm from './miniwasm';
export * as minimove from './minimove';
export * as initia from './initia';
export * as initia from './initia'
4 changes: 2 additions & 2 deletions _packages/initia-registry/src/devnet/initia/ibc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IBCData } from '@initia/initia-registry-types';
const info: IBCData[] = [
import { IBCInfo } from '@initia/initia-registry-types';
const info: IBCInfo[] = [
{
"$schema": "../../ibc_data.schema.json",
"chain_1": {
Expand Down
4 changes: 2 additions & 2 deletions _packages/initia-registry/src/devnet/initia/ibc_chain1.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IBCData } from '@initia/initia-registry-types';
const info: IBCData[] = [
import { IBCInfo } from '@initia/initia-registry-types';
const info: IBCInfo[] = [
{
"$schema": "../../ibc_data.schema.json",
"chain_1": {
Expand Down
4 changes: 2 additions & 2 deletions _packages/initia-registry/src/devnet/minimove/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ const info: AssetList = {
"description": "The native token of Initia",
"denom_units": [
{
"denom": "l2/771d639f30fbe45e3fbca954ffbe2fcc26f915f5513c67a4a2d0bc1d635bdefd",
"denom": "l2/2588fd87a8e081f6a557f43ff14f05dddf5e34cb27afcefd6eaf81f1daea30d0",
"exponent": 0
},
{
"denom": "INIT",
"exponent": 6
}
],
"base": "l2/771d639f30fbe45e3fbca954ffbe2fcc26f915f5513c67a4a2d0bc1d635bdefd",
"base": "l2/2588fd87a8e081f6a557f43ff14f05dddf5e34cb27afcefd6eaf81f1daea30d0",
"display": "INIT",
"name": "Initia Native Token",
"symbol": "INIT",
Expand Down
4 changes: 2 additions & 2 deletions _packages/initia-registry/src/devnet/minimove/ibc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IBCData } from '@initia/initia-registry-types';
const info: IBCData[] = [
import { IBCInfo } from '@initia/initia-registry-types';
const info: IBCInfo[] = [
{
"$schema": "../../ibc_data.schema.json",
"chain_1": {
Expand Down
4 changes: 2 additions & 2 deletions _packages/initia-registry/src/devnet/miniwasm/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ const info: AssetList = {
"description": "The native token of Initia",
"denom_units": [
{
"denom": "l2/2588fd87a8e081f6a557f43ff14f05dddf5e34cb27afcefd6eaf81f1daea30d0",
"denom": "l2/771d639f30fbe45e3fbca954ffbe2fcc26f915f5513c67a4a2d0bc1d635bdefd",
"exponent": 0
},
{
"denom": "INIT",
"exponent": 6
}
],
"base": "l2/2588fd87a8e081f6a557f43ff14f05dddf5e34cb27afcefd6eaf81f1daea30d0",
"base": "l2/771d639f30fbe45e3fbca954ffbe2fcc26f915f5513c67a4a2d0bc1d635bdefd",
"display": "INIT",
"name": "Initia Native Token",
"symbol": "INIT",
Expand Down
48 changes: 24 additions & 24 deletions _packages/initia-registry/src/devnet/miniwasm/ibc.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import { IBCData } from '@initia/initia-registry-types';
const info = [
import { IBCInfo } from '@initia/initia-registry-types';
const info: IBCInfo[] = [
{
$schema: '../../ibc_data.schema.json',
chain_1: {
chain_name: 'initia',
client_id: '07-tendermint-1',
connection_id: 'connection-1'
"$schema": "../../ibc_data.schema.json",
"chain_1": {
"chain_name": "initia",
"client_id": "07-tendermint-1",
"connection_id": "connection-1"
},
chain_2: {
chain_name: 'miniwasm',
client_id: '07-tendermint-0',
connection_id: 'connection-0'
"chain_2": {
"chain_name": "miniwasm",
"client_id": "07-tendermint-0",
"connection_id": "connection-0"
},
channels: [
"channels": [
{
chain_1: {
channel_id: 'channel-1',
port_id: 'transfer'
"chain_1": {
"channel_id": "channel-1",
"port_id": "transfer"
},
chain_2: {
channel_id: 'channel-0',
port_id: 'transfer'
"chain_2": {
"channel_id": "channel-0",
"port_id": "transfer"
},
ordering: 'unordered',
version: 'ics20-1',
tags: {
status: 'live',
preferred: true
"ordering": "unordered",
"version": "ics20-1",
"tags": {
"status": "live",
"preferred": true
}
}
]
}
];
export default info;
export default info;
6 changes: 3 additions & 3 deletions _packages/initia-registry/src/ibc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IBCData } from "@initia/initia-registry-types";
import { IBCInfo } from '@initia/initia-registry-types';

import * as _devnet from "./devnet/all";
import * as _devnet from './devnet/all'

const ibc: IBCData[] = [..._devnet.ibc];
const ibc: IBCInfo[] = [..._devnet.ibc];

export default ibc;
10 changes: 5 additions & 5 deletions _packages/initia-registry/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export * from './devnet';
import all from './all';
export * from './devnet'; import all from './all';

export default all;
export default all;

const { assets, chains, ibc } = all;
const { assets, chains, ibc }= all;

export { assets, chains, ibc };
export { assets, chains, ibc };

4 changes: 2 additions & 2 deletions _packages/initia-registry/types/ibc.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { IBCData } from "@initia/initia-registry-types";
declare const ibc: IBCData[];
import { IBCInfo } from "@initia/initia-registry-types";
declare const ibc: IBCInfo[];
export default ibc;
Loading

0 comments on commit 81a0fc6

Please sign in to comment.