Skip to content

Commit

Permalink
Add template support for solidityVersion, networks and tailwind extend (
Browse files Browse the repository at this point in the history
  • Loading branch information
carletex authored Sep 4, 2024
1 parent faa6dab commit 2064f18
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-papayas-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-eth": patch
---

Allow solidity versions and networks + tailwind extend theme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { withDefaults } from "../../../utils.js";

const contents = ({ lightTheme, darkTheme }) => `/** @type {import('tailwindcss').Config} */
const contents = ({ lightTheme, darkTheme, extendTheme }) => `/** @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 @@ -19,6 +19,7 @@ module.exports = {
},
theme: {
extend: {
${extendTheme[0] && `${extendTheme[0]},`}
boxShadow: {
center: "0 0 12px -2px rgb(0 0 0 / 0.05)",
},
Expand Down Expand Up @@ -91,4 +92,5 @@ export default withDefaults(contents, {
opacity: "80%",
},
}`,
extendTheme: "",
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { withDefaults } from "../../../../utils.js";

const contents = ({ imports }) => `import * as dotenv from "dotenv";
const contents = ({ imports, solidityVersion, networks }) => `import * as dotenv from "dotenv";
dotenv.config();
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-ethers";
Expand All @@ -24,7 +24,7 @@ const etherscanApiKey = process.env.ETHERSCAN_API_KEY || "DNXJA8RX2Q3VZ4URQIWP7Z
const config: HardhatUserConfig = {
solidity: {
version: "0.8.17",
version: "${solidityVersion[0]}",
settings: {
optimizer: {
enabled: true,
Expand All @@ -41,6 +41,7 @@ const config: HardhatUserConfig = {
},
},
networks: {
${networks[0] && `${networks[0]},`}
// View the networks that are pre-configured.
// If the network you are looking for is not here you can add new network settings
hardhat: {
Expand Down Expand Up @@ -141,4 +142,6 @@ export default config;`;

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

0 comments on commit 2064f18

Please sign in to comment.