Skip to content

Commit

Permalink
build: install deps using Node.js
Browse files Browse the repository at this point in the history
chore: remove git submodules
refactor: update import paths
  • Loading branch information
PaulRBerg committed Dec 18, 2023
1 parent df6e78a commit ff7c914
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 20 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"
Expand Down Expand Up @@ -50,12 +48,24 @@ jobs:
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Install Pnpm"
uses: "pnpm/action-setup@v2"
with:
version: "8"

- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
cache: "pnpm"
node-version: "lts/*"

- name: "Install the Node.js dependencies"
run: "pnpm install"

- name: "Build the contracts and print their size"
run: "forge build --sizes"

Expand All @@ -70,12 +80,24 @@ jobs:
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Install Pnpm"
uses: "pnpm/action-setup@v2"
with:
version: "8"

- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
cache: "pnpm"
node-version: "lts/*"

- name: "Install the Node.js dependencies"
run: "pnpm install"

- name: "Show the Foundry config"
run: "forge config"

Expand Down
8 changes: 0 additions & 8 deletions .gitmodules

This file was deleted.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"url": "https://github.com/PaulRBerg"
},
"devDependencies": {
"@prb/test": "^0.6.4",
"forge-std": "github:foundry-rs/forge-std#v1",
"prettier": "^3.0.0"
},
"keywords": [
Expand Down
16 changes: 16 additions & 0 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@prb/test/=lib/prb-test/src/
forge-std/=lib/forge-std/src/
@prb/test/=node_modules/@prb/test/
forge-std/=node_modules/forge-std/

This comment has been minimized.

Copy link
@adamazad

adamazad Dec 18, 2023

Why not keep /src and avoid the change in test/Foo.t.sol and script/Base.s.sol?

2 changes: 1 addition & 1 deletion script/Base.s.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.21 <0.9.0;

import { Script } from "forge-std/Script.sol";
import { Script } from "forge-std/src/Script.sol";

abstract contract BaseScript is Script {
/// @dev Included to enable compilation of the script without a $MNEMONIC environment variable.
Expand Down
6 changes: 3 additions & 3 deletions test/Foo.t.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.21 <0.9.0;

import { PRBTest } from "@prb/test/PRBTest.sol";
import { console2 } from "forge-std/console2.sol";
import { StdCheats } from "forge-std/StdCheats.sol";
import { PRBTest } from "@prb/test/src/PRBTest.sol";
import { console2 } from "forge-std/src/console2.sol";
import { StdCheats } from "forge-std/src/StdCheats.sol";

import { Foo } from "../src/Foo.sol";

Expand Down

0 comments on commit ff7c914

Please sign in to comment.