diff --git a/.changeset/tough-rooms-mate.md b/.changeset/tough-rooms-mate.md new file mode 100644 index 0000000000..4231f25228 --- /dev/null +++ b/.changeset/tough-rooms-mate.md @@ -0,0 +1,6 @@ +--- +"create-eth": patch +--- + +Add drizzle-neon to curated extensions +Accept `postContent` args in `.gitignores` tempaltes diff --git a/contributors/TEMPLATE-FILES.md b/contributors/TEMPLATE-FILES.md index f3a444011c..e7492aad45 100644 --- a/contributors/TEMPLATE-FILES.md +++ b/contributors/TEMPLATE-FILES.md @@ -15,12 +15,14 @@ If you're interested in developing third-party extensions, the [THIRD-PARTY-EXTE | [(script) `Deploy.s.sol.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/foundry/packages/foundry/script/Deploy.s.sol.template.mjs) | [`Deploy.s.sol.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/example/extension/packages/foundry/script/Deploy.s.sol.args.mjs) | | [(config) `foundry.toml.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/foundry/packages/foundry/foundry.toml.template.mjs) | [`foundry.toml.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/example/extension/packages/foundry/foundry.toml.args.mjs) | | [(config) `Makefile.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/foundry/packages/foundry/Makefile.template.mjs) | [`Makefile.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/example/extension/packages/foundry/Makefile.args.mjs) | +| [(gitignore) `.gitignore.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/foundry/packages/foundry/.gitignore.template.mjs) | [`.gitignore.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/example/extension/packages/foundry/.gitignore.args.mjs) | #### Hardhat | Template | Example args file | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | [(config) `hardhat.config.ts.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/hardhat/packages/hardhat/hardhat.config.ts.template.mjs) | [`hardhat.config.ts.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/example/extension/packages/hardhat/hardhat.config.ts.args.mjs) | +| [(gitignore) `.gitignore.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/hardhat/packages/hardhat/.gitignore.template.mjs) | [`.gitignore.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/example/extension/packages/hardhat/.gitignore.args.mjs) | #### NextJS @@ -40,12 +42,14 @@ If you're interested in developing third-party extensions, the [THIRD-PARTY-EXTE | [(config) `getMetadata.ts.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/packages/nextjs/utils/scaffold-eth/getMetadata.ts.args.mjs) | [`getMetadata.ts.teamplte.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/tree/example/extension/packages/nextjs/utils/scaffold-eth/getMetadata.ts.args.mjs) | | [(types) `abi.d.ts.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/packages/nextjs/types/abitype/abi.d.ts.template.mjs) | [`abi.d.ts.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/example/extension/packages/nextjs/types/abitype/abi.d.ts.args.mjs) | | [(env) `.env.example.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/packages/nextjs/.env.example.template.mjs) | [`.env.example.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/example/extension/packages/nextjs/.env.example.args.mjs) | +| [(gitignore) `.gitignore.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/packages/nextjs/.gitignore.template.mjs) | [`.gitignore.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/example/extension/packages/nextjs/.gitignore.args.mjs) | #### Root -| Template | Example args file | -| ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| [(doc) `README.md.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/README.md.template.mjs) | [`README.md.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/example/extension/README.md.args.mjs) | +| Template | Example args file | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- | +| [(doc) `README.md.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/README.md.template.mjs) | [`README.md.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/example/extension/README.md.args.mjs) | +| [(gitignore) `.gitignore.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/.gitignore.template.mjs) | [`.gitignore.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/example/extension/.gitignore.args.mjs) | ### create-eth internal use @@ -69,6 +73,6 @@ If you're interested in developing third-party extensions, the [THIRD-PARTY-EXTE | [(env) `.env.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/foundry/packages/foundry/.env.template.mjs) | we need to create a `.env` file for the foundry to work properly out of box | | [(gitignore) `.gitignore.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/foundry/packages/foundry/deployments/.gitignore.template.mjs) | this makes sure we have empty `deployments` out of box | -We also have `.gitignore.template.mjs` files in [root](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/.gitignore.template.mjs), [nextjs](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/packages/nextjs/.gitignore.template.mjs), [hardhat](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/hardhat/packages/hardhat/.gitignore.template.mjs), [foundry](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/foundry/packages/foundry/.env.template.mjs) that are used to prevent npm from ignoring the `.gitignore` files in the generated project. +We have `.gitignore.template.mjs` files in [root](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/.gitignore.template.mjs), [nextjs](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/packages/nextjs/.gitignore.template.mjs), [hardhat](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/hardhat/packages/hardhat/.gitignore.template.mjs), [foundry](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/foundry/packages/foundry/.env.template.mjs) that are used to prevent npm from ignoring the `.gitignore` files in the generated project. For more information on how templating works in this project, please refer to the [TEMPLATING.md](./TEMPLATING.md) document. diff --git a/src/dev/create-extension.ts b/src/dev/create-extension.ts index cbcf9a1243..23326c6262 100644 --- a/src/dev/create-extension.ts +++ b/src/dev/create-extension.ts @@ -165,7 +165,7 @@ const copyChanges = async ( const defaultArgs = extractWithDefaultsArg(templateContent); if (!defaultArgs) { - prettyLog.info(`.gitignore and .env files could not be changed`, 3); + prettyLog.info(`${file} could not be changed (does not accept arguments)`, 3); console.log("\n"); continue; } diff --git a/src/extensions.json b/src/extensions.json index 3a406698f4..41326ed38a 100644 --- a/src/extensions.json +++ b/src/extensions.json @@ -53,6 +53,12 @@ "repository": "https://github.com/scaffold-eth/create-eth-extensions", "branch": "envio" }, + { + "extensionFlagValue": "drizzle-neon", + "description": "This extension sets up a local database with Drizzle ORM. Optimized to work using Neon as the database provider.", + "repository": "https://github.com/scaffold-eth/create-eth-extensions", + "branch": "drizzle-neon" + }, { "extensionFlagValue": "challenge-tokenization", "description": "SpeedRunEthereum Challenge: Tokenization.", diff --git a/templates/base/.gitignore.template.mjs b/templates/base/.gitignore.template.mjs index 349f345f09..91a164f0f0 100644 --- a/templates/base/.gitignore.template.mjs +++ b/templates/base/.gitignore.template.mjs @@ -1,4 +1,6 @@ -const contents = () => +import { withDefaults } from "../utils.js"; + +const contents = ({ postContent }) => `# dependencies node_modules @@ -21,6 +23,9 @@ node_modules .idea # cli -dist`; +dist +${postContent[0] || ''}`; -export default contents +export default withDefaults(contents, { + postContent: '' +}) diff --git a/templates/base/packages/nextjs/.gitignore.template.mjs b/templates/base/packages/nextjs/.gitignore.template.mjs index 07cae40186..3503c81526 100644 --- a/templates/base/packages/nextjs/.gitignore.template.mjs +++ b/templates/base/packages/nextjs/.gitignore.template.mjs @@ -1,4 +1,6 @@ -const contents = () => +import { withDefaults } from "../../../utils.js"; + +const contents = ({ postContent }) => `# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies @@ -36,6 +38,9 @@ yarn-error.log* # typescript *.tsbuildinfo -ipfs-upload.config.json` +ipfs-upload.config.json +${postContent[0] || ''}`; -export default contents +export default withDefaults(contents, { + postContent: '' +}) diff --git a/templates/solidity-frameworks/foundry/packages/foundry/.gitignore.template.mjs b/templates/solidity-frameworks/foundry/packages/foundry/.gitignore.template.mjs index 9cfc0c1fb6..a75b1f3ca9 100644 --- a/templates/solidity-frameworks/foundry/packages/foundry/.gitignore.template.mjs +++ b/templates/solidity-frameworks/foundry/packages/foundry/.gitignore.template.mjs @@ -1,4 +1,6 @@ -const contents = () => +import { withDefaults } from "../../../../utils.js"; + +const contents = ({ postContent }) => `# Compiler files cache/ out/ @@ -13,7 +15,9 @@ docs/ # Dotenv file .env localhost.json -`; +${postContent[0] || ''}`; -export default contents; +export default withDefaults(contents, { + postContent: '' +}) diff --git a/templates/solidity-frameworks/hardhat/packages/hardhat/.gitignore.template.mjs b/templates/solidity-frameworks/hardhat/packages/hardhat/.gitignore.template.mjs index 99f0e02510..42e8da425a 100644 --- a/templates/solidity-frameworks/hardhat/packages/hardhat/.gitignore.template.mjs +++ b/templates/solidity-frameworks/hardhat/packages/hardhat/.gitignore.template.mjs @@ -1,4 +1,6 @@ -const contents = () => +import { withDefaults } from "../../../../utils.js"; + +const contents = ({postContent}) => `# dependencies node_modules @@ -28,6 +30,9 @@ deployments/localhost *.tsbuildinfo # other -temp` +temp +${postContent[0] || ''}`; -export default contents \ No newline at end of file +export default withDefaults(contents, { + postContent: '' +}) \ No newline at end of file