Skip to content

Commit

Permalink
Cleanup Build Helper
Browse files Browse the repository at this point in the history
  • Loading branch information
joelsmith-2019 committed Sep 24, 2024
1 parent e8189c0 commit 341dc34
Showing 1 changed file with 11 additions and 51 deletions.
62 changes: 11 additions & 51 deletions wormchain/ts-sdk/src/buildHelper.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ const { execSync } = require("child_process");
const fs = require("fs");
const path = require("path");

// const CERTUS_DIRECTORY =
// "../vue/src/store/generated/wormhole-foundation/wormchain/";
// const COSMOS_DIRECTORY = "../vue/src/store/generated/cosmos/cosmos-sdk/";
// const WASMD_DIRECTORY = "../vue/src/store/generated/CosmWasm/wasmd/";

const VUE_DIRECTORY = "../ts-client/"; //"../vue/src/store/generated/";

const VUE_DIRECTORY = "../ts-client/";
const MODULE_DIRECTORY = "../ts-sdk/src/modules/";

function execWrapper(command) {
Expand All @@ -31,52 +25,18 @@ function execWrapper(command) {
});
}

// const certusFiles = fs.readdirSync(CERTUS_DIRECTORY, { withFileTypes: true }); //should only contain directories for the modules
// const cosmosFiles = fs.readdirSync(COSMOS_DIRECTORY, { withFileTypes: true });
// const wasmdFiles = fs.readdirSync(WASMD_DIRECTORY, { withFileTypes: true });
const vueFiles = fs.readdirSync(VUE_DIRECTORY, { withFileTypes: true });

// certusFiles.forEach((directory) => {
// execWrapper(`mkdir -p ${MODULE_DIRECTORY + directory.name}/`);
// execWrapper(
// `cp -R ${CERTUS_DIRECTORY + directory.name}/module/* ${
// MODULE_DIRECTORY + directory.name
// }/`
// ); //move all the files from the vue module into the sdk
// });

// cosmosFiles.forEach((directory) => {
// execWrapper(`mkdir -p ${MODULE_DIRECTORY + directory.name}/`);
// execWrapper(
// `cp -R ${COSMOS_DIRECTORY + directory.name}/module/* ${
// MODULE_DIRECTORY + directory.name
// }/`
// ); //move all the files from the vue module into the sdk
// });

// wasmdFiles.forEach((directory) => {
// execWrapper(`mkdir -p ${MODULE_DIRECTORY + directory.name}/`);
// execWrapper(
// `cp -R ${WASMD_DIRECTORY + directory.name}/module/* ${
// MODULE_DIRECTORY + directory.name
// }/`
// ); //move all the files from the vue module into the sdk
// });

vueFiles.forEach((directory) => {

// check if directory is a folder
if (!directory.isDirectory()) {
return;
}

execWrapper(`mkdir -p ${MODULE_DIRECTORY + directory.name}/`);
execWrapper(
`cp -R ${VUE_DIRECTORY + directory.name}/* ${
MODULE_DIRECTORY + directory.name
}/`
); //move all the files from the vue module into the sdk
});
// Move all module directories from Ignite's ts-client to the ts-sdk
vueFiles
.filter(directory => directory.isDirectory())
.forEach((directory) => {
execWrapper(`mkdir -p ${MODULE_DIRECTORY + directory.name}/`);
execWrapper(
`cp -R ${VUE_DIRECTORY + directory.name}/* ${MODULE_DIRECTORY + directory.name
}/`
);
});

//As of 19.5 javascript isn't emitted
//execWrapper(`find ${MODULE_DIRECTORY} -name "*.js" | xargs rm `); //delete all javascript files, so they can be cleanly created based on our tsconfig
Expand Down

0 comments on commit 341dc34

Please sign in to comment.