Skip to content

Commit

Permalink
cli: allow more template files (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
rin-st authored Jul 25, 2024
1 parent 0b28a10 commit 6d21542
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/rotten-timers-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-eth": patch
---

add onchainkit to curated extension
5 changes: 5 additions & 0 deletions .changeset/shy-horses-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-eth": patch
---

feat: template files update
4 changes: 4 additions & 0 deletions src/curated-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const CURATED_EXTENSIONS: { [key: string]: ExternalExtension } = {
repository: "https://github.com/scaffold-eth/create-eth-extensions",
branch: "ponder",
},
onchainkit: {
repository: "https://github.com/scaffold-eth/create-eth-extensions",
branch: "onchainkit",
},
};

export { CURATED_EXTENSIONS };
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# Template for NextJS environment variables.
import { withDefaults } from "../../../utils.js";

const contents = ({ additionalVars }) => {
return `# Template for NextJS environment variables.
# For local development, copy this file, rename it to .env.local, and fill in the values.
# When deploying live, you'll need to store the vars in Vercel/System config.
# If not set, we provide default values (check `scaffold.config.ts`) so developers can start prototyping out of the box,
# If not set, we provide default values (check \`scaffold.config.ts\`) so developers can start prototyping out of the box,
# but we recommend getting your own API Keys for Production Apps.
# To access the values stored in this env file you can use: process.env.VARIABLENAME
# You'll need to prefix the variables names with NEXT_PUBLIC_ if you want to access them on the client side.
# More info: https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables
NEXT_PUBLIC_ALCHEMY_API_KEY=
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
${additionalVars.join("\n")}
`
};

export default withDefaults(contents, {
additionalVars: ""
});
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import { withDefaults } from "../../../../utils.js";

const contents = ({ imports }) => {
return `
${imports.filter(Boolean).join("\n")}
import "@rainbow-me/rainbowkit/styles.css";
import { ScaffoldEthAppWithProviders } from "~~/components/ScaffoldEthAppWithProviders";
import { ThemeProvider } from "~~/components/ThemeProvider";
Expand All @@ -21,4 +26,9 @@ const ScaffoldEthApp = ({ children }: { children: React.ReactNode }) => {
);
};
export default ScaffoldEthApp;
export default ScaffoldEthApp;`;
};

export default withDefaults(contents, {
imports: ""
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const contents = ({ providerNames, providerSetups, providerImports, providerProp
// filter out empty strings
const providerOpeningTags = providerNames.filter(Boolean).map((name, index) => `<${name} ${providerProps[index]}>`);

const providerClosingTags = providerNames.filter(Boolean).map(name => `</${name}>`);
const providerClosingTags = providerNames.filter(Boolean).map(name => `</${name}>`).reverse();

return `"use client";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type ScaffoldConfig = {
const scaffoldConfig = {
// The networks on which your DApp is live
targetNetworks: [chains.${chainName[0]}],
targetNetworks: [${chainName.map(chain => `chains.${chain}`).join(', ')}],
// The interval at which your front-end polls the RPC servers for new data
// it has no effect if you only target the local network (default is 4000)
Expand Down

0 comments on commit 6d21542

Please sign in to comment.