Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmurdoch committed Jun 29, 2023
1 parent fbd8fc8 commit 9c6765a
Show file tree
Hide file tree
Showing 42 changed files with 85 additions and 101 deletions.
26 changes: 4 additions & 22 deletions scripts/create.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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 <name> --location <location> [--folder <folder>]
return JSON.parse(npmConfigArgv).original.slice(1);
Expand All @@ -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} <name>`, "", yargs => {
Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -352,4 +334,4 @@ describe("${packageName}", () => {
chalk`{red fail} {magenta create} New package {bgBlack ${name} } not created. See error above.`
);
}
})();
})();
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions src/cli/cli/tsconfig.json → src/cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig-base.json",
"extends": "../tsconfig-base.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "typings",
Expand All @@ -18,17 +18,17 @@
"name": "@ganache/options",
"path": "../options"
},
{
"name": "@ganache/ethereum",
"path": "../../chains/ethereum/ethereum"
},
{
"name": "@ganache/colors",
"path": "../colors"
},
{
"name": "@ganache/flavor",
"path": "../flavor"
},
{
"name": "@ganache/ethereum",
"path": "../ethereum/ethereum"
}
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig-base.json",
"extends": "../tsconfig-base.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "typings",
Expand Down
10 changes: 5 additions & 5 deletions src/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig-base.json",
"extends": "../tsconfig-base.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "typings",
Expand All @@ -10,10 +10,6 @@
"src/**/*"
],
"references": [
{
"name": "@ganache/ethereum",
"path": "../../chains/ethereum/ethereum"
},
{
"name": "@ganache/options",
"path": "../options"
Expand All @@ -25,6 +21,10 @@
{
"name": "@ganache/flavor",
"path": "../flavor"
},
{
"name": "@ganache/ethereum",
"path": "../ethereum/ethereum"
}
]
}
4 changes: 2 additions & 2 deletions src/ethereum/address/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig-base.json",
"extends": "../../tsconfig-base.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "typings",
Expand All @@ -12,7 +12,7 @@
"references": [
{
"name": "@ganache/utils",
"path": "../../../packages/utils"
"path": "../../utils"
}
]
}
14 changes: 7 additions & 7 deletions src/ethereum/block/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig-base.json",
"extends": "../../tsconfig-base.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "typings",
Expand All @@ -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"
}
]
}
13 changes: 9 additions & 4 deletions src/ethereum/console.log/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
}
42 changes: 21 additions & 21 deletions src/ethereum/ethereum/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig-base.json",
"extends": "../../tsconfig-base.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "typings",
Expand All @@ -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"
Expand All @@ -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"
}
]
}
14 changes: 7 additions & 7 deletions src/ethereum/options/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig-base.json",
"extends": "../../tsconfig-base.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "typings",
Expand All @@ -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"
}
]
}
20 changes: 10 additions & 10 deletions src/ethereum/transaction/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig-base.json",
"extends": "../../tsconfig-base.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "typings",
Expand All @@ -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"
Expand All @@ -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"
}
]
}
12 changes: 6 additions & 6 deletions src/ethereum/utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig-base.json",
"extends": "../../tsconfig-base.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "typings",
Expand All @@ -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"
}
]
}
2 changes: 1 addition & 1 deletion src/flavor/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig-base.json",
"extends": "../tsconfig-base.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "typings",
Expand Down
2 changes: 1 addition & 1 deletion src/ganache/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig-base.json",
"extends": "../tsconfig-base.json",
"compilerOptions": {
"outDir": "lib"
},
Expand Down
2 changes: 1 addition & 1 deletion src/options/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig-base.json",
"extends": "../tsconfig-base.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "typings",
Expand Down
Loading

0 comments on commit 9c6765a

Please sign in to comment.