Skip to content

Commit

Permalink
cli: templatise tailwind and hardhat config (#106)
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Sánchez <[email protected]>
  • Loading branch information
technophile-04 and carletex authored Aug 30, 2024
1 parent 63e0fea commit 7d5626f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 36 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-bananas-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-eth": patch
---

cli: templatise tailwind and hardhat config
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/** @type {import('tailwindcss').Config} */
import { withDefaults } from "../../../utils.js";

const contents = ({ lightTheme, darkTheme }) => `/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./app/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}", "./utils/**/*.{js,ts,jsx,tsx}"],
plugins: [require("daisyui")],
Expand All @@ -8,7 +10,27 @@ module.exports = {
daisyui: {
themes: [
{
light: {
light: ${lightTheme},
},
{
dark: ${darkTheme},
},
],
},
theme: {
extend: {
boxShadow: {
center: "0 0 12px -2px rgb(0 0 0 / 0.05)",
},
animation: {
"pulse-fast": "pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite",
},
},
},
};`;

export default withDefaults(contents, {
lightTheme: `{
primary: "#93BBFB",
"primary-content": "#212638",
secondary: "#DAE8FF",
Expand Down Expand Up @@ -37,10 +59,8 @@ module.exports = {
".link:hover": {
opacity: "80%",
},
},
},
{
dark: {
}`,
darkTheme: `{
primary: "#212638",
"primary-content": "#F9FBFF",
secondary: "#323f61",
Expand Down Expand Up @@ -70,18 +90,5 @@ module.exports = {
".link:hover": {
opacity: "80%",
},
},
},
],
},
theme: {
extend: {
boxShadow: {
center: "0 0 12px -2px rgb(0 0 0 / 0.05)",
},
animation: {
"pulse-fast": "pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite",
},
},
},
};
}`,
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import * as dotenv from "dotenv";
import { withDefaults } from "../../../../utils.js";

const contents = ({ imports }) => `import * as dotenv from "dotenv";
dotenv.config();
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-ethers";
Expand All @@ -9,6 +11,7 @@ import "solidity-coverage";
import "@nomicfoundation/hardhat-verify";
import "hardhat-deploy";
import "hardhat-deploy-ethers";
${imports.filter(Boolean).join("\n")}
// If not set, it uses ours Alchemy's default API key.
// You can get your own at https://dashboard.alchemyapi.io
Expand Down Expand Up @@ -42,48 +45,48 @@ const config: HardhatUserConfig = {
// If the network you are looking for is not here you can add new network settings
hardhat: {
forking: {
url: `https://eth-mainnet.alchemyapi.io/v2/${providerApiKey}`,
url: \`https://eth-mainnet.alchemyapi.io/v2/\${providerApiKey}\`,
enabled: process.env.MAINNET_FORKING_ENABLED === "true",
},
},
mainnet: {
url: `https://eth-mainnet.alchemyapi.io/v2/${providerApiKey}`,
url: \`https://eth-mainnet.alchemyapi.io/v2/\${providerApiKey}\`,
accounts: [deployerPrivateKey],
},
sepolia: {
url: `https://eth-sepolia.g.alchemy.com/v2/${providerApiKey}`,
url: \`https://eth-sepolia.g.alchemy.com/v2/\${providerApiKey}\`,
accounts: [deployerPrivateKey],
},
arbitrum: {
url: `https://arb-mainnet.g.alchemy.com/v2/${providerApiKey}`,
url: \`https://arb-mainnet.g.alchemy.com/v2/\${providerApiKey}\`,
accounts: [deployerPrivateKey],
},
arbitrumSepolia: {
url: `https://arb-sepolia.g.alchemy.com/v2/${providerApiKey}`,
url: \`https://arb-sepolia.g.alchemy.com/v2/\${providerApiKey}\`,
accounts: [deployerPrivateKey],
},
optimism: {
url: `https://opt-mainnet.g.alchemy.com/v2/${providerApiKey}`,
url: \`https://opt-mainnet.g.alchemy.com/v2/\${providerApiKey}\`,
accounts: [deployerPrivateKey],
},
optimismSepolia: {
url: `https://opt-sepolia.g.alchemy.com/v2/${providerApiKey}`,
url: \`https://opt-sepolia.g.alchemy.com/v2/\${providerApiKey}\`,
accounts: [deployerPrivateKey],
},
polygon: {
url: `https://polygon-mainnet.g.alchemy.com/v2/${providerApiKey}`,
url: \`https://polygon-mainnet.g.alchemy.com/v2/\${providerApiKey}\`,
accounts: [deployerPrivateKey],
},
polygonMumbai: {
url: `https://polygon-mumbai.g.alchemy.com/v2/${providerApiKey}`,
url: \`https://polygon-mumbai.g.alchemy.com/v2/\${providerApiKey}\`,
accounts: [deployerPrivateKey],
},
polygonZkEvm: {
url: `https://polygonzkevm-mainnet.g.alchemy.com/v2/${providerApiKey}`,
url: \`https://polygonzkevm-mainnet.g.alchemy.com/v2/\${providerApiKey}\`,
accounts: [deployerPrivateKey],
},
polygonZkEvmTestnet: {
url: `https://polygonzkevm-testnet.g.alchemy.com/v2/${providerApiKey}`,
url: \`https://polygonzkevm-testnet.g.alchemy.com/v2/\${providerApiKey}\`,
accounts: [deployerPrivateKey],
},
gnosis: {
Expand Down Expand Up @@ -121,17 +124,21 @@ const config: HardhatUserConfig = {
},
// configuration for harhdat-verify plugin
etherscan: {
apiKey: `${etherscanApiKey}`,
apiKey: \`\${etherscanApiKey}\`,
},
// configuration for etherscan-verify from hardhat-deploy plugin
verify: {
etherscan: {
apiKey: `${etherscanApiKey}`,
apiKey: \`\${etherscanApiKey}\`,
},
},
sourcify: {
enabled: false,
},
};
export default config;
export default config;`;

export default withDefaults(contents, {
imports: "",
});

0 comments on commit 7d5626f

Please sign in to comment.