Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/tough-rooms-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"create-eth": patch
---

Add drizzle-neon to curated extensions
Accept `postContent` args in `.gitignores` tempaltes
12 changes: 8 additions & 4 deletions contributors/TEMPLATE-FILES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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.
2 changes: 1 addition & 1 deletion src/dev/create-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 6 additions & 0 deletions src/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
11 changes: 8 additions & 3 deletions templates/base/.gitignore.template.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const contents = () =>
import { withDefaults } from "../utils.js";

const contents = ({ postContent }) =>
`# dependencies
node_modules

Expand All @@ -21,6 +23,9 @@ node_modules
.idea

# cli
dist`;
dist
${postContent[0] || ''}`;

export default contents
export default withDefaults(contents, {
postContent: ''
})
11 changes: 8 additions & 3 deletions templates/base/packages/nextjs/.gitignore.template.mjs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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: ''
})
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const contents = () =>
import { withDefaults } from "../../../../utils.js";

const contents = ({ postContent }) =>
`# Compiler files
cache/
out/
Expand All @@ -13,7 +15,9 @@ docs/
# Dotenv file
.env
localhost.json
`;
${postContent[0] || ''}`;

export default contents;
export default withDefaults(contents, {
postContent: ''
})

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const contents = () =>
import { withDefaults } from "../../../../utils.js";

const contents = ({postContent}) =>
`# dependencies
node_modules

Expand Down Expand Up @@ -28,6 +30,9 @@ deployments/localhost
*.tsbuildinfo

# other
temp`
temp
${postContent[0] || ''}`;

export default contents
export default withDefaults(contents, {
postContent: ''
})