Skip to content

Commit

Permalink
compile hardhat
Browse files Browse the repository at this point in the history
  • Loading branch information
aazhou1 committed Dec 20, 2024
1 parent d36fa1b commit d4d389a
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
22 changes: 22 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-foundry";
import "@nomicfoundation/hardhat-ethers";
import { task } from "hardhat/config";
import path from "path";
import glob from "glob";

task("compile", "Compiles the project, excluding specific files", async (_, { run }) => {
const excludedPaths = [
path.resolve(__dirname, "src/test/*.sol"),
];

const allFiles = glob.sync(path.resolve(__dirname, "src/*.sol"));
const filesToCompile = allFiles.filter(
(file) => !excludedPaths.some((excluded) => file.startsWith(excluded))
);

console.log("Files to compile:", filesToCompile);

await run("compile:solidity", { sources: filesToCompile, force: false, quiet: false });
});

const config: HardhatUserConfig = {
solidity: {
version: "0.8.23",
Expand All @@ -11,6 +30,9 @@ const config: HardhatUserConfig = {
},
},
},
paths: {
sources: "./src", // Specify the main directory for source files
},
networks: {
sepolia: {
url: process.env.SEPOLIA_RPC_URL || "",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"env-cmd": "^10.1.0",
"ethers": "^6.13.4",
"hardhat": "^2.22.17",
"path": "^0.12.7",
"prettier": "^2.5.1",
"prettier-plugin-solidity": "^1.0.0-beta.19",
"pretty-quick": "^3.1.3",
Expand Down
11 changes: 9 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"include": ["./src", "./scripts"],
"files": ["./hardhat.config.ts"]
"include": ["./src"],
"files": ["./hardhat.config.ts"],
"compilerOptions": {

"esModuleInterop": true,

// other options

}
}
25 changes: 25 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,11 @@ inherits@2, [email protected], inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4:
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==

[email protected]:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==

[email protected]:
version "1.10.4"
resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2"
Expand Down Expand Up @@ -2053,6 +2058,14 @@ path-type@^4.0.0:
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==

path@^0.12.7:
version "0.12.7"
resolved "https://registry.yarnpkg.com/path/-/path-0.12.7.tgz#d4dc2a506c4ce2197eb481ebfcd5b36c0140b10f"
integrity sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==
dependencies:
process "^0.11.1"
util "^0.10.3"

pbkdf2@^3.0.17:
version "3.1.2"
resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075"
Expand Down Expand Up @@ -2122,6 +2135,11 @@ pretty-quick@^3.1.3:
picomatch "^3.0.1"
tslib "^2.6.2"

process@^0.11.1:
version "0.11.10"
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==

pump@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.2.tgz#836f3edd6bc2ee599256c924ffe0d88573ddcbf8"
Expand Down Expand Up @@ -2589,6 +2607,13 @@ util-deprecate@^1.0.1:
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==

util@^0.10.3:
version "0.10.4"
resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901"
integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==
dependencies:
inherits "2.0.3"

uuid@^8.3.2:
version "8.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
Expand Down

0 comments on commit d4d389a

Please sign in to comment.