diff --git a/templates/base/README.md b/templates/base/README.md.template.mjs similarity index 54% rename from templates/base/README.md rename to templates/base/README.md.template.mjs index 9c5c0c761..8e5eb60c3 100644 --- a/templates/base/README.md +++ b/templates/base/README.md.template.mjs @@ -1,4 +1,7 @@ -# ๐Ÿ— Scaffold-ETH 2 +import { withDefaults } from "../utils.js"; + +const contents = ({ solidityFrameWork, quickStart }) => + `# ๐Ÿ— Scaffold-ETH 2

Documentation | @@ -7,9 +10,14 @@ ๐Ÿงช An open-source, up-to-date toolkit for building decentralized applications (dapps) on the Ethereum blockchain. It's designed to make it easier for developers to create and deploy smart contracts and build user interfaces that interact with those contracts. -โš™๏ธ Built using NextJS, RainbowKit, Hardhat, Wagmi, Viem, and Typescript. - -- โœ… **Contract Hot Reload**: Your frontend auto-adapts to your smart contract as you edit it. +โš™๏ธ Built using NextJS, RainbowKit, ${ + Boolean(solidityFrameWork[0]) ? solidityFrameWork[0] + ", " : "" + }Wagmi, Viem, and Typescript. +${ + Boolean(solidityFrameWork[0]) + ? "\n- โœ… **Contract Hot Reload**: Your frontend auto-adapts to your smart contract as you edit it." + : "" +} - ๐Ÿช **[Custom hooks](https://docs.scaffoldeth.io/hooks/)**: Collection of React hooks wrapper around [wagmi](https://wagmi.sh/) to simplify interactions with smart contracts with typescript autocompletion. - ๐Ÿงฑ [**Components**](https://docs.scaffoldeth.io/components/): Collection of common web3 components to quickly build your frontend. - ๐Ÿ”ฅ **Burner Wallet & Local Faucet**: Quickly test your application with a burner wallet and local faucet. @@ -25,56 +33,38 @@ Before you begin, you need to install the following tools: - Yarn ([v1](https://classic.yarnpkg.com/en/docs/install/) or [v2+](https://yarnpkg.com/getting-started/install)) - [Git](https://git-scm.com/downloads) -## Quickstart - -To get started with Scaffold-ETH 2, follow the steps below: - -1. Clone this repo & install dependencies - -``` -git clone https://github.com/scaffold-eth/scaffold-eth-2.git -cd scaffold-eth-2 -yarn install -``` +${quickStart[0]} -2. Run a local network in the first terminal: - -``` -yarn chain -``` - -This command starts a local Ethereum network using Hardhat. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in `hardhat.config.ts`. - -3. On a second terminal, deploy the test contract: - -``` -yarn deploy -``` +## Documentation -This command deploys a test smart contract to the local network. The contract is located in `packages/hardhat/contracts` and can be modified to suit your needs. The `yarn deploy` command uses the deploy script located in `packages/hardhat/deploy` to deploy the contract to the network. You can also customize the deploy script. +Visit our [docs](https://docs.scaffoldeth.io) to learn how to start building with Scaffold-ETH 2. -4. On a third terminal, start your NextJS app: +To know more about its features, check out our [website](https://scaffoldeth.io). -``` -yarn start -``` +## Contributing to Scaffold-ETH 2 -Visit your app on: `http://localhost:3000`. You can interact with your smart contract using the `Debug Contracts` page. You can tweak the app config in `packages/nextjs/scaffold.config.ts`. +We welcome contributions to Scaffold-ETH 2! -Run smart contract test with `yarn hardhat:test` +Please see [CONTRIBUTING.MD](https://github.com/scaffold-eth/scaffold-eth-2/blob/main/CONTRIBUTING.md) for more information and guidelines for contributing to Scaffold-ETH 2.`; -- Edit your smart contract `YourContract.sol` in `packages/hardhat/contracts` -- Edit your frontend in `packages/nextjs/pages` -- Edit your deployment scripts in `packages/hardhat/deploy` +export default withDefaults(contents, { + solidityFrameWork: "", + quickStart: `## Quickstart -## Documentation +To get started with Scaffold-ETH 2, follow the steps below: -Visit our [docs](https://docs.scaffoldeth.io) to learn how to start building with Scaffold-ETH 2. +1. Install dependencies if it was skipped in CLI: -To know more about its features, check out our [website](https://scaffoldeth.io). +\`\`\` +cd my-dapp-example +yarn install +\`\`\` -## Contributing to Scaffold-ETH 2 +2. Start your NextJS app: -We welcome contributions to Scaffold-ETH 2! +\`\`\` +yarn start +\`\`\` -Please see [CONTRIBUTING.MD](https://github.com/scaffold-eth/scaffold-eth-2/blob/main/CONTRIBUTING.md) for more information and guidelines for contributing to Scaffold-ETH 2. +Visit your app on: \`http://localhost:3000\`. You can interact with your smart contract using the \`Debug Contracts\` page. You can tweak the app config in \`packages/nextjs/scaffold.config.ts\`.`, +}); diff --git a/templates/extensions/foundry/README.md.args.mjs b/templates/extensions/foundry/README.md.args.mjs new file mode 100644 index 000000000..4379af638 --- /dev/null +++ b/templates/extensions/foundry/README.md.args.mjs @@ -0,0 +1,42 @@ +export const quickStart = `## Quickstart + +To get started with Scaffold-ETH 2, follow the steps below: + +1. Install dependencies if it was skipped in CLI: + +\`\`\` +cd my-dapp-example +yarn install +\`\`\` + +2. Run a local network in the first terminal: + +\`\`\` +yarn chain +\`\`\` + +This command starts a local Ethereum network using Foundry. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in \`packages/foundry/foundry.toml\`. + +3. On a second terminal, deploy the test contract: + +\`\`\` +yarn deploy +\`\`\` + +This command deploys a test smart contract to the local network. The contract is located in \`packages/foundry/contracts\` and can be modified to suit your needs. The \`yarn deploy\` command uses the deploy script located in \`packages/foundry/script\` to deploy the contract to the network. You can also customize the deploy script. + +4. On a third terminal, start your NextJS app: + +\`\`\` +yarn start +\`\`\` + +Visit your app on: \`http://localhost:3000\`. You can interact with your smart contract using the \`Debug Contracts\` page. You can tweak the app config in \`packages/nextjs/scaffold.config.ts\`. + +Run smart contract test with \`yarn foundry:test\` + +- Edit your smart contract \`YourContract.sol\` in \`packages/foundry/contracts\` +- Edit your frontend homepage at \`packages/nextjs/app/page.tsx\`. For guidance on [routing](https://nextjs.org/docs/app/building-your-application/routing/defining-routes) and configuring [pages/layouts](https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts) checkout the Next.js documentation. +- Edit your deployment scripts in \`packages/foundry/script\``; + +export const solidityFrameWork = "Foundry"; diff --git a/templates/extensions/hardhat/README.md.args.mjs b/templates/extensions/hardhat/README.md.args.mjs new file mode 100644 index 000000000..06da83b51 --- /dev/null +++ b/templates/extensions/hardhat/README.md.args.mjs @@ -0,0 +1,42 @@ +export const quickStart = `## Quickstart + +To get started with Scaffold-ETH 2, follow the steps below: + +1. Install dependencies if it was skipped in CLI: + +\`\`\` +cd my-dapp-example +yarn install +\`\`\` + +2. Run a local network in the first terminal: + +\`\`\` +yarn chain +\`\`\` + +This command starts a local Ethereum network using Hardhat. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in \`packages/hardhat/hardhat.config.ts\`. + +3. On a second terminal, deploy the test contract: + +\`\`\` +yarn deploy +\`\`\` + +This command deploys a test smart contract to the local network. The contract is located in \`packages/hardhat/contracts\` and can be modified to suit your needs. The \`yarn deploy\` command uses the deploy script located in \`packages/hardhat/deploy\` to deploy the contract to the network. You can also customize the deploy script. + +4. On a third terminal, start your NextJS app: + +\`\`\` +yarn start +\`\`\` + +Visit your app on: \`http://localhost:3000\`. You can interact with your smart contract using the \`Debug Contracts\` page. You can tweak the app config in \`packages/nextjs/scaffold.config.ts\`. + +Run smart contract test with \`yarn hardhat:test\` + +- Edit your smart contract \`YourContract.sol\` in \`packages/hardhat/contracts\` +- Edit your frontend homepage at \`packages/nextjs/app/page.tsx\`. For guidance on [routing](https://nextjs.org/docs/app/building-your-application/routing/defining-routes) and configuring [pages/layouts](https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts) checkout the Next.js documentation. +- Edit your deployment scripts in \`packages/hardhat/deploy\``; + +export const solidityFrameWork = "Hardhat";