Skip to content

Commit

Permalink
backmerge latest changes to CLI (#523)
Browse files Browse the repository at this point in the history
* Fix RainbowKitCustomConnectButton dropdown styles (#500)

* chore: footer missalignment & home page on small screens  (#502)

Co-authored-by: CJ <53488449+0xChijoke@users.noreply.github.com>

* Update and typescript version (#499)

* update typescript and viem version

* update next config

* fix: header links wrapping icons and text (#510)

* Fix typos in useScaffoldContractWrite logs (#512)

* fix: spelling in test file name (#522)

* add suport for verify in foundry similar to hardhat

* update git task title when using foundry

* add changeset

* update changeset

---------

Co-authored-by: Rinat <rinat@hey.com>
Co-authored-by: CJ <53488449+0xChijoke@users.noreply.github.com>
Co-authored-by: Zak G <zakgriffith@gmail.com>
  • Loading branch information
4 people committed Sep 7, 2023
1 parent d059aa7 commit 32caee5
Show file tree
Hide file tree
Showing 16 changed files with 245 additions and 30 deletions.
19 changes: 19 additions & 0 deletions .changeset/curly-garlics-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
"create-eth": patch
---

1. Fix RainbowKitCustomConnectButton dropdown styles #500

2. chore: footer missalignment on mobile screens #502

3. Update and typescript version #499

4. add grid and grid-flow class to li manually #510

5. Fix typos in getScaffoldContractWrite lines 57 & 65 #512

6. fix: test file name #522

7. add support for `yarn verify --network networkName` in foundry similar to hardhat #489

8. updated the Git task title from "Initializing Git repository" => "Initializing Git repository and submodules" when the user selects foundry as an extension
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ export async function createProject(options: Options) {
},
},
{
title: `📡 Initializing Git repository`,
title: `📡 Initializing Git repository ${
options.extensions.includes("foundry") ? "and submodules" : ""
}`,
task: () => createFirstGitCommit(targetDirectory, options),
},
]);
Expand Down
12 changes: 12 additions & 0 deletions src/tasks/create-first-git-commit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ export async function createFirstGitCommit(
cwd: foundryWorkSpacePath,
}
);
await execa(
"git",
[
"submodule",
"add",
"https://github.com/gnsps/solidity-bytes-utils",
"lib/solidity-bytes-utils",
],
{
cwd: foundryWorkSpacePath,
}
);
await execa("git", ["submodule", "update", "--init", "--recursive"], {
cwd: foundryWorkSpacePath,
});
Expand Down
26 changes: 14 additions & 12 deletions templates/base/packages/nextjs/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const Footer = () => {
const nativeCurrencyPrice = useGlobalState(state => state.nativeCurrencyPrice);

return (
<div className="min-h-0 p-5 mb-11 lg:mb-0">
<div className="min-h-0 py-5 px-1 mb-11 lg:mb-0">
<div>
<div className="fixed flex justify-between items-center w-full z-10 p-4 bottom-0 left-0 pointer-events-none">
<div className="flex space-x-2 pointer-events-auto">
Expand All @@ -31,7 +31,7 @@ export const Footer = () => {
<div className="w-full">
<ul className="menu menu-horizontal w-full">
<div className="flex justify-center items-center gap-2 text-sm w-full">
<div>
<div className="text-center">
<a
href="https://github.com/scaffold-eth/se-2"
target="_blank"
Expand All @@ -43,18 +43,20 @@ export const Footer = () => {
</div>
<span>·</span>
<div>
Built with <HeartIcon className="inline-block h-4 w-4" /> at 🏰{" "}
<a
href="https://buidlguidl.com/"
target="_blank"
rel="noreferrer"
className="underline underline-offset-2"
>
BuidlGuidl
</a>
<p className="m-0 text-center">
Built with <HeartIcon className="inline-block h-4 w-4" /> at 🏰{" "}
<a
href="https://buidlguidl.com/"
target="_blank"
rel="noreferrer"
className="underline underline-offset-2"
>
BuidlGuidl
</a>
</p>
</div>
<span>·</span>
<div>
<div className="text-center">
<a
href="https://t.me/joinchat/KByvmRe5wkR-8F_zz6AjpA"
target="_blank"
Expand Down
6 changes: 3 additions & 3 deletions templates/base/packages/nextjs/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const NavLink = ({ href, children }: { href: string; children: React.ReactNode }
passHref
className={`${
isActive ? "bg-secondary shadow-md" : ""
} hover:bg-secondary hover:shadow-md focus:!bg-secondary py-1.5 px-3 text-sm rounded-full gap-2`}
} hover:bg-secondary hover:shadow-md focus:!bg-secondary active:!text-neutral py-1.5 px-3 text-sm rounded-full gap-2 grid grid-flow-col`}
>
{children}
</Link>
Expand Down Expand Up @@ -85,12 +85,12 @@ export const Header = () => {
</ul>
)}
</div>
<Link href="/" passHref className="hidden lg:flex items-center gap-2 ml-4 mr-6">
<Link href="/" passHref className="hidden lg:flex items-center gap-2 ml-4 mr-6 shrink-0">
<div className="flex relative w-10 h-10">
<Image alt="SE2 logo" className="cursor-pointer" fill src="/logo.svg" />
</div>
<div className="flex flex-col">
<span className="font-bold leading-tight">Scaffold-eth</span>
<span className="font-bold leading-tight">Scaffold-ETH</span>
<span className="text-xs">Ethereum dev stack</span>
</div>
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,24 @@ export const RainbowKitCustomConnectButton = () => {
{chain.name}
</span>
</div>
<div className="dropdown dropdown-end">
<label tabIndex={0} className="btn btn-secondary btn-sm pl-0 pr-2 shadow-md dropdown-toggle gap-0">
<div className="dropdown dropdown-end leading-3">
<label
tabIndex={0}
className="btn btn-secondary btn-sm pl-0 pr-2 shadow-md dropdown-toggle gap-0 !h-auto"
>
<BlockieAvatar address={account.address} size={24} ensImage={account.ensAvatar} />
<span className="ml-2 mr-1">{account.displayName}</span>
<ChevronDownIcon className="h-6 w-4 ml-2 sm:ml-0" />
</label>
<ul
tabIndex={0}
className="dropdown-content menu p-2 mt-1 shadow-center shadow-accent bg-base-200 rounded-box gap-1"
className="dropdown-content menu z-[2] p-2 mt-2 shadow-center shadow-accent bg-base-200 rounded-box gap-1"
>
<li>
{addressCopied ? (
<div className="btn-sm !rounded-xl flex gap-3 py-3">
<CheckCircleIcon
className=" text-xl font-normal h-6 w-4 cursor-pointer"
className="text-xl font-normal h-6 w-4 cursor-pointer ml-2 sm:ml-0"
aria-hidden="true"
/>
<span className=" whitespace-nowrap">Copy address</span>
Expand All @@ -122,7 +125,7 @@ export const RainbowKitCustomConnectButton = () => {
>
<div className="btn-sm !rounded-xl flex gap-3 py-3">
<DocumentDuplicateIcon
className=" text-xl font-normal h-6 w-4 cursor-pointer"
className="text-xl font-normal h-6 w-4 cursor-pointer ml-2 sm:ml-0"
aria-hidden="true"
/>
<span className=" whitespace-nowrap">Copy address</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ export const useScaffoldContractWrite = <
value?: UseScaffoldWriteConfig<TContractName, TFunctionName>["value"];
} & UpdatedArgs = {}) => {
if (!deployedContractData) {
notification.error("Target Contract is not deployed, did you forgot to run `yarn deploy`?");
notification.error("Target Contract is not deployed, did you forget to run `yarn deploy`?");
return;
}
if (!chain?.id) {
notification.error("Please connect your wallet");
return;
}
if (chain?.id !== configuredNetwork.id) {
notification.error("You on the wrong network");
notification.error("You are on the wrong network");
return;
}

Expand Down
4 changes: 4 additions & 0 deletions templates/base/packages/nextjs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const nextConfig = {
eslint: {
ignoreDuringBuilds: process.env.NEXT_PUBLIC_IGNORE_BUILD_ERROR === "true",
},
webpack: config => {
config.resolve.fallback = { fs: false, net: false, tls: false };
return config;
},
};

module.exports = nextConfig;
4 changes: 2 additions & 2 deletions templates/base/packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"react-hot-toast": "~2.4.0",
"use-debounce": "~8.0.4",
"usehooks-ts": "~2.9.1",
"viem": "1.2.1",
"viem": "~1.6.7",
"wagmi": "1.3.10",
"zustand": "~4.1.2"
},
Expand All @@ -50,7 +50,7 @@
"postcss": "~8.4.16",
"prettier": "~2.8.4",
"tailwindcss": "~3.3.3",
"typescript": "~4.9.5",
"typescript": "~5.1.6",
"vercel": "~28.15.1"
}
}
14 changes: 11 additions & 3 deletions templates/base/packages/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@ const Home: NextPage = () => {
</h1>
<p className="text-center text-lg">
Get started by editing{" "}
<code className="italic bg-base-300 text-base font-bold">packages/nextjs/pages/index.tsx</code>
<code className="italic bg-base-300 text-base font-bold max-w-full break-words break-all inline-block">
packages/nextjs/pages/index.tsx
</code>
</p>
<p className="text-center text-lg">
Edit your smart contract <code className="italic bg-base-300 text-base font-bold">YourContract.sol</code> in{" "}
<code className="italic bg-base-300 text-base font-bold">packages/hardhat/contracts</code>
Edit your smart contract{" "}
<code className="italic bg-base-300 text-base font-bold max-w-full break-words break-all inline-block">
YourContract.sol
</code>{" "}
in{" "}
<code className="italic bg-base-300 text-base font-bold max-w-full break-words break-all inline-block">
packages/hardhat/contracts
</code>
</p>
</div>

Expand Down
6 changes: 6 additions & 0 deletions templates/base/packages/nextjs/types/abitype/abi.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import "abitype";

declare module "viem/node_modules/abitype" {
export interface Config {
AddressType: string;
}
}

declare module "abitype" {
export interface Config {
AddressType: string;
Expand Down
1 change: 1 addition & 0 deletions templates/extensions/foundry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"foundry:lint": "yarn workspace @se-2/foundry lint",
"foundry:test": "yarn workspace @se-2/foundry test",
"test": "yarn foundry:test",
"verify": "yarn workspace @se-2/foundry verify",
"generate": "yarn workspace @se-2/foundry generate"
}
}
3 changes: 2 additions & 1 deletion templates/extensions/foundry/packages/foundry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"compile": "forge compile",
"generate": "node script/generateAccount.js",
"deploy": "forge build --build-info --build-info-path out/build-info/ && forge script script/Deploy.s.sol --rpc-url ${1:-default_network} --broadcast --legacy && node script/generateTsAbis.js",
"deploy:verify": "forge build --build-info --build-info-path out/build-info/ && forge script script/Deploy.s.sol --rpc-url ${1:-default_network} --broadcast --legacy --verify && node script/generateTsAbis.js",
"deploy:verify": "forge build --build-info --build-info-path out/build-info/ && forge script script/Deploy.s.sol --rpc-url ${1:-default_network} --broadcast --legacy --verify ; node script/generateTsAbis.js",
"verify": "forge build --build-info --build-info-path out/build-info/ && forge script script/VerifyAll.s.sol --ffi --rpc-url ${1:-default_network}",
"lint": "forge fmt",
"test": "forge test"
},
Expand Down
Loading

0 comments on commit 32caee5

Please sign in to comment.