diff --git a/scripts/create.ts b/scripts/create.ts index 486f2a68b2..0443966029 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -1,4 +1,4 @@ -import { TruffleColors } from "../src/packages/colors"; +import { TruffleColors } from "../src/colors"; import { sep, join, resolve } from "path"; import { highlight } from "cli-highlight"; import { mkdir, mkdirSync, writeFile } from "fs-extra"; @@ -22,7 +22,7 @@ const COMMAND_NAME = "create"; const getArgv = () => { const npmConfigArgv = process.env["npm_config_argv"]; if (npmConfigArgv) { - // handle `npm run create name --location chains` + // handle `npm run create name --location ethereum` // convert original npm args into a command // create --location [--folder ] return JSON.parse(npmConfigArgv).original.slice(1); @@ -45,11 +45,7 @@ const COLORS = { FgRed: "\x1b[31m" }; -let locations = getDirectories(join(__dirname, "../src")); -const chainLocations = getDirectories(join(__dirname, "../src/chains")).map( - d => `chains/${d}` -); -locations = locations.concat(chainLocations); +const locations = ["/", "ethereum"]; const argv = yargs(getArgv()) .command(`${COMMAND_NAME} `, "", yargs => { @@ -118,24 +114,10 @@ process.stdout.write(`${COLORS.Reset}`); // determines how many `../` are needed for package contents const numDirectoriesAwayFromSrc = 1 + location.split(sep).length; const relativePathToSrc = "../".repeat(numDirectoriesAwayFromSrc); - const isNewChain = location === "chains"; const workspaceDir = join(__dirname, "../"); const dir = join(workspaceDir, "src", location, folderName); - if (isNewChain) { - mkdirSync(dir); - - const fullLocation = join(location, folderName); - console.log( - chalk`{green success} {magenta create} New chain folder {bgBlack ${name} } created at ./src/${fullLocation}.` - ); - console.log(""); - console.log( - chalk` Add packages to this chain by running: {bgBlack {bold npm run create {dim <}name{dim >} {dim --}location ${fullLocation}}}` - ); - return; - } try { const LICENSE = readFile(join(workspaceDir, "LICENSE"), "utf-8"); @@ -352,4 +334,4 @@ describe("${packageName}", () => { chalk`{red fail} {magenta create} New package {bgBlack ${name} } not created. See error above.` ); } -})(); +})(); \ No newline at end of file diff --git a/src/cli/cli/.npmignore b/src/cli/.npmignore similarity index 100% rename from src/cli/cli/.npmignore rename to src/cli/.npmignore diff --git a/src/cli/cli/LICENSE b/src/cli/LICENSE similarity index 100% rename from src/cli/cli/LICENSE rename to src/cli/LICENSE diff --git a/src/cli/cli/README.md b/src/cli/README.md similarity index 100% rename from src/cli/cli/README.md rename to src/cli/README.md diff --git a/src/cli/cli/index.ts b/src/cli/index.ts similarity index 100% rename from src/cli/cli/index.ts rename to src/cli/index.ts diff --git a/src/cli/cli/package-lock.json b/src/cli/package-lock.json similarity index 100% rename from src/cli/cli/package-lock.json rename to src/cli/package-lock.json diff --git a/src/cli/cli/package.json b/src/cli/package.json similarity index 100% rename from src/cli/cli/package.json rename to src/cli/package.json diff --git a/src/cli/cli/src/args.ts b/src/cli/src/args.ts similarity index 100% rename from src/cli/cli/src/args.ts rename to src/cli/src/args.ts diff --git a/src/cli/cli/src/cli.ts b/src/cli/src/cli.ts similarity index 100% rename from src/cli/cli/src/cli.ts rename to src/cli/src/cli.ts diff --git a/src/cli/cli/src/detach.ts b/src/cli/src/detach.ts similarity index 100% rename from src/cli/cli/src/detach.ts rename to src/cli/src/detach.ts diff --git a/src/cli/cli/src/flavors.ts b/src/cli/src/flavors.ts similarity index 100% rename from src/cli/cli/src/flavors.ts rename to src/cli/src/flavors.ts diff --git a/src/cli/cli/src/helpers.ts b/src/cli/src/helpers.ts similarity index 100% rename from src/cli/cli/src/helpers.ts rename to src/cli/src/helpers.ts diff --git a/src/cli/cli/src/process-name.ts b/src/cli/src/process-name.ts similarity index 100% rename from src/cli/cli/src/process-name.ts rename to src/cli/src/process-name.ts diff --git a/src/cli/cli/src/types.ts b/src/cli/src/types.ts similarity index 100% rename from src/cli/cli/src/types.ts rename to src/cli/src/types.ts diff --git a/src/cli/cli/tests/args.test.ts b/src/cli/tests/args.test.ts similarity index 100% rename from src/cli/cli/tests/args.test.ts rename to src/cli/tests/args.test.ts diff --git a/src/cli/cli/tests/detach.test.ts b/src/cli/tests/detach.test.ts similarity index 100% rename from src/cli/cli/tests/detach.test.ts rename to src/cli/tests/detach.test.ts diff --git a/src/cli/cli/tsconfig.json b/src/cli/tsconfig.json similarity index 85% rename from src/cli/cli/tsconfig.json rename to src/cli/tsconfig.json index b38907acd2..830414fc04 100644 --- a/src/cli/cli/tsconfig.json +++ b/src/cli/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig-base.json", + "extends": "../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", @@ -18,10 +18,6 @@ "name": "@ganache/options", "path": "../options" }, - { - "name": "@ganache/ethereum", - "path": "../../chains/ethereum/ethereum" - }, { "name": "@ganache/colors", "path": "../colors" @@ -29,6 +25,10 @@ { "name": "@ganache/flavor", "path": "../flavor" + }, + { + "name": "@ganache/ethereum", + "path": "../ethereum/ethereum" } ] } \ No newline at end of file diff --git a/src/colors/colors/.npmignore b/src/colors/.npmignore similarity index 100% rename from src/colors/colors/.npmignore rename to src/colors/.npmignore diff --git a/src/colors/colors/LICENSE b/src/colors/LICENSE similarity index 100% rename from src/colors/colors/LICENSE rename to src/colors/LICENSE diff --git a/src/colors/colors/README.md b/src/colors/README.md similarity index 100% rename from src/colors/colors/README.md rename to src/colors/README.md diff --git a/src/colors/colors/index.ts b/src/colors/index.ts similarity index 100% rename from src/colors/colors/index.ts rename to src/colors/index.ts diff --git a/src/colors/colors/package-lock.json b/src/colors/package-lock.json similarity index 100% rename from src/colors/colors/package-lock.json rename to src/colors/package-lock.json diff --git a/src/colors/colors/package.json b/src/colors/package.json similarity index 100% rename from src/colors/colors/package.json rename to src/colors/package.json diff --git a/src/colors/colors/src/index.ts b/src/colors/src/index.ts similarity index 100% rename from src/colors/colors/src/index.ts rename to src/colors/src/index.ts diff --git a/src/colors/colors/tests/index.test.ts b/src/colors/tests/index.test.ts similarity index 100% rename from src/colors/colors/tests/index.test.ts rename to src/colors/tests/index.test.ts diff --git a/src/colors/colors/tsconfig.json b/src/colors/tsconfig.json similarity index 78% rename from src/colors/colors/tsconfig.json rename to src/colors/tsconfig.json index 48bbbee655..8ef5bece1c 100644 --- a/src/colors/colors/tsconfig.json +++ b/src/colors/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig-base.json", + "extends": "../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", diff --git a/src/core/tsconfig.json b/src/core/tsconfig.json index 2af9b81b00..08713b5539 100644 --- a/src/core/tsconfig.json +++ b/src/core/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig-base.json", + "extends": "../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", @@ -10,10 +10,6 @@ "src/**/*" ], "references": [ - { - "name": "@ganache/ethereum", - "path": "../../chains/ethereum/ethereum" - }, { "name": "@ganache/options", "path": "../options" @@ -25,6 +21,10 @@ { "name": "@ganache/flavor", "path": "../flavor" + }, + { + "name": "@ganache/ethereum", + "path": "../ethereum/ethereum" } ] } \ No newline at end of file diff --git a/src/ethereum/address/tsconfig.json b/src/ethereum/address/tsconfig.json index dd5cc8d93f..c3a158e47d 100644 --- a/src/ethereum/address/tsconfig.json +++ b/src/ethereum/address/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig-base.json", + "extends": "../../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", @@ -12,7 +12,7 @@ "references": [ { "name": "@ganache/utils", - "path": "../../../packages/utils" + "path": "../../utils" } ] } \ No newline at end of file diff --git a/src/ethereum/block/tsconfig.json b/src/ethereum/block/tsconfig.json index fa4e62f98d..180655d040 100644 --- a/src/ethereum/block/tsconfig.json +++ b/src/ethereum/block/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig-base.json", + "extends": "../../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", @@ -19,16 +19,16 @@ "path": "../transaction" }, { - "name": "@ganache/rlp", - "path": "../../../packages/rlp" + "name": "@ganache/ethereum-utils", + "path": "../utils" }, { - "name": "@ganache/utils", - "path": "../../../packages/utils" + "name": "@ganache/rlp", + "path": "../../rlp" }, { - "name": "@ganache/ethereum-utils", - "path": "../utils" + "name": "@ganache/utils", + "path": "../../utils" } ] } \ No newline at end of file diff --git a/src/ethereum/console.log/tsconfig.json b/src/ethereum/console.log/tsconfig.json index df62d392b4..6414313a35 100644 --- a/src/ethereum/console.log/tsconfig.json +++ b/src/ethereum/console.log/tsconfig.json @@ -1,15 +1,20 @@ { - "extends": "../../../tsconfig-base.json", + "extends": "../../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", "composite": true }, - "include": ["src", "index.ts", "scripts/generate.ts", "scripts/helpers.ts"], + "include": [ + "src", + "index.ts", + "scripts/generate.ts", + "scripts/helpers.ts" + ], "references": [ { "name": "@ganache/utils", - "path": "../../../packages/utils" + "path": "../../utils" } ] -} +} \ No newline at end of file diff --git a/src/ethereum/ethereum/tsconfig.json b/src/ethereum/ethereum/tsconfig.json index cca2ef4bbd..52b5d9623f 100644 --- a/src/ethereum/ethereum/tsconfig.json +++ b/src/ethereum/ethereum/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig-base.json", + "extends": "../../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", @@ -14,22 +14,10 @@ "name": "@ganache/ethereum-utils", "path": "../utils" }, - { - "name": "@ganache/promise-queue", - "path": "../../../packages/promise-queue" - }, { "name": "@ganache/ethereum-options", "path": "../options" }, - { - "name": "@ganache/utils", - "path": "../../../packages/utils" - }, - { - "name": "@ganache/rlp", - "path": "../../../packages/rlp" - }, { "name": "@ganache/ethereum-transaction", "path": "../transaction" @@ -42,21 +30,33 @@ "name": "@ganache/ethereum-block", "path": "../block" }, - { - "name": "@ganache/secp256k1", - "path": "../../../packages/secp256k1" - }, { "name": "@ganache/console.log", "path": "../console.log" }, { - "name": "@ganache/flavor", - "path": "../../../packages/flavor" + "name": "@ganache/colors", + "path": "../../colors" }, { - "name": "@ganache/colors", - "path": "../../../packages/colors" + "name": "@ganache/promise-queue", + "path": "../../promise-queue" + }, + { + "name": "@ganache/rlp", + "path": "../../rlp" + }, + { + "name": "@ganache/secp256k1", + "path": "../../secp256k1" + }, + { + "name": "@ganache/utils", + "path": "../../utils" + }, + { + "name": "@ganache/flavor", + "path": "../../flavor" } ] } \ No newline at end of file diff --git a/src/ethereum/options/tsconfig.json b/src/ethereum/options/tsconfig.json index 019ea15cc9..75b0508606 100644 --- a/src/ethereum/options/tsconfig.json +++ b/src/ethereum/options/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig-base.json", + "extends": "../../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", @@ -15,16 +15,16 @@ "path": "../utils" }, { - "name": "@ganache/options", - "path": "../../../packages/options" + "name": "@ganache/ethereum-address", + "path": "../address" }, { - "name": "@ganache/utils", - "path": "../../../packages/utils" + "name": "@ganache/options", + "path": "../../options" }, { - "name": "@ganache/ethereum-address", - "path": "../address" + "name": "@ganache/utils", + "path": "../../utils" } ] } \ No newline at end of file diff --git a/src/ethereum/transaction/tsconfig.json b/src/ethereum/transaction/tsconfig.json index e2566a4cc4..d107296034 100644 --- a/src/ethereum/transaction/tsconfig.json +++ b/src/ethereum/transaction/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig-base.json", + "extends": "../../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", @@ -10,14 +10,6 @@ "index.ts" ], "references": [ - { - "name": "@ganache/utils", - "path": "../../../packages/utils" - }, - { - "name": "@ganache/rlp", - "path": "../../../packages/rlp" - }, { "name": "@ganache/ethereum-address", "path": "../address" @@ -26,9 +18,17 @@ "name": "@ganache/ethereum-utils", "path": "../utils" }, + { + "name": "@ganache/rlp", + "path": "../../rlp" + }, { "name": "@ganache/secp256k1", - "path": "../../../packages/secp256k1" + "path": "../../secp256k1" + }, + { + "name": "@ganache/utils", + "path": "../../utils" } ] } \ No newline at end of file diff --git a/src/ethereum/utils/tsconfig.json b/src/ethereum/utils/tsconfig.json index 09c4627719..74d5a79ee5 100644 --- a/src/ethereum/utils/tsconfig.json +++ b/src/ethereum/utils/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig-base.json", + "extends": "../../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", @@ -11,16 +11,16 @@ ], "references": [ { - "name": "@ganache/utils", - "path": "../../../packages/utils" + "name": "@ganache/ethereum-address", + "path": "../address" }, { "name": "@ganache/rlp", - "path": "../../../packages/rlp" + "path": "../../rlp" }, { - "name": "@ganache/ethereum-address", - "path": "../address" + "name": "@ganache/utils", + "path": "../../utils" } ] } \ No newline at end of file diff --git a/src/flavor/tsconfig.json b/src/flavor/tsconfig.json index fe8d55211d..b626810826 100644 --- a/src/flavor/tsconfig.json +++ b/src/flavor/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig-base.json", + "extends": "../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", diff --git a/src/ganache/tsconfig.json b/src/ganache/tsconfig.json index 0d5ba07b5b..9dfb9d6ecc 100644 --- a/src/ganache/tsconfig.json +++ b/src/ganache/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig-base.json", + "extends": "../tsconfig-base.json", "compilerOptions": { "outDir": "lib" }, diff --git a/src/options/tsconfig.json b/src/options/tsconfig.json index 44bb79e28a..7922267673 100644 --- a/src/options/tsconfig.json +++ b/src/options/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig-base.json", + "extends": "../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", diff --git a/src/promise-queue/tsconfig.json b/src/promise-queue/tsconfig.json index c2419ae70b..2280003847 100644 --- a/src/promise-queue/tsconfig.json +++ b/src/promise-queue/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig-base.json", + "extends": "../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", diff --git a/src/rlp/tsconfig.json b/src/rlp/tsconfig.json index 38976a7828..a1287268e2 100644 --- a/src/rlp/tsconfig.json +++ b/src/rlp/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig-base.json", + "extends": "../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", diff --git a/src/secp256k1/tsconfig.json b/src/secp256k1/tsconfig.json index 48bbbee655..8ef5bece1c 100644 --- a/src/secp256k1/tsconfig.json +++ b/src/secp256k1/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig-base.json", + "extends": "../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings", diff --git a/src/tsconfig.json b/src/tsconfig.json index afefae6da2..72e67dc8b0 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -2,10 +2,7 @@ "files": [], "references": [ { - "path": "packages/ganache" - }, - { - "path": "chains/filecoin/filecoin" + "path": "ganache" } ] } \ No newline at end of file diff --git a/src/utils/tsconfig.json b/src/utils/tsconfig.json index 08c2f312ac..918348ad54 100644 --- a/src/utils/tsconfig.json +++ b/src/utils/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig-base.json", + "extends": "../tsconfig-base.json", "compilerOptions": { "outDir": "lib", "declarationDir": "typings",