Skip to content

Commit

Permalink
fix: update lint-staged
Browse files Browse the repository at this point in the history
fix: remove formatting on precommit

weekly cli backmerge (#95)

Version Packages (#92)

List of templates and args example files (#97)

Co-authored-by: Shiv Bhonde <shivbhonde04@gmail.com>

update third party extension doc (#98)

cli: allow any case extension name (#101)

fix: remove --install

fix: &&

test without foundry

fix: enableImmutableInstalls false

fix: disable immutable installs

fix: change yarn release

update yarn

check hh/foundry

fix: solidity framework

try hh and foundry

update actions

hh

fix: balance

check ff only

add foundry to path

fix: yml

try without validation

feat: submodules

fix: with

move foundry

disable cache

try v3

disable validate foundry

update validation

fix: wrap git in try catch

testing errors

fix: change to error.message

return yarn 3.5.0

return options

remove redundant check

remove redundant release

remove redundant command

remove comments

revert
  • Loading branch information
rin-st committed Aug 28, 2024
1 parent e7618a2 commit 1822cec
Show file tree
Hide file tree
Showing 30 changed files with 233 additions and 188 deletions.
5 changes: 0 additions & 5 deletions .changeset/great-weeks-enjoy.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/sixty-grapes-push.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/spotty-rocks-notice.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/young-moose-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-eth": patch
---

cli: allow case-sensitive extension names
34 changes: 13 additions & 21 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,45 +27,37 @@ jobs:
- name: Install Dependencies
run: yarn

- name: Install Foundry
if: matrix.config == 'foundry'
uses: foundry-rs/foundry-toolchain@v1
with:
cache: false

- name: Start dev
run: yarn dev &

- name: Install application (Hardhat configuration)
if: matrix.config == 'hardhat'
run: yarn cli new_project --install -s hardhat

- name: Install Foundry
if: matrix.config == 'foundry'
uses: foundry-rs/foundry-toolchain@v1
run: yarn cli new_project_hardhat -s hardhat

- name: Install application (Foundry configuration)
if: matrix.config == 'foundry'
run: yarn cli new_project --install -s foundry
run: yarn cli new_project_foundry -s foundry

- name: Install application (No solidity framework configuration)
if: matrix.config == 'no_solidity_framework'
run: yarn cli new_project --install -s none
run: yarn cli new_project_no_solidity_framework -s none

- name: Run chain and deploy
working-directory: new_project
working-directory: new_project_${{ matrix.config }}
if: matrix.config == 'hardhat' || matrix.config == 'foundry'
run: yarn install & yarn chain & yarn deploy

- name: Run Cypress tests for apps with solidity frameworks
- name: Run Cypress tests
uses: cypress-io/github-action@v6
if: matrix.config == 'hardhat' || matrix.config == 'foundry'
with:
start: yarn start
wait-on: "http://localhost:3000"
working-directory: new_project/packages/nextjs
browser: chrome

- name: Run Cypress tests for apps without solidity frameworks
uses: cypress-io/github-action@v6
if: matrix.config == 'no_solidity_framework'
with:
start: yarn start
wait-on: "http://localhost:3000"
working-directory: new_project/packages/nextjs
spec: cypress/e2e/base/base.cy.ts
working-directory: new_project_${{ matrix.config }}/packages/nextjs
browser: chrome
spec: ${{ matrix.config == 'no_solidity_framework' && 'cypress/e2e/base/base.cy.ts' || '' }}
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarn lint-staged --verbose --cwd src
yarn lint-staged --verbose --config .lintstagedrc.js
3 changes: 0 additions & 3 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
const formatCommand = filenames => `yarn format ${filenames.join(" ")}`;
const lintCommand = filenames => `yarn lint ${filenames.filter(file => !file.includes("/templates/")).join(" ")}`;

export default {
"**/*": [formatCommand],

"**/*.{js,jsx,ts,tsx}": [lintCommand],
};
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
enableColors: true
enableImmutableInstalls: false

nodeLinker: node-modules

Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# create-eth

## 0.0.53

### Patch Changes

- fix: vscode eslint not working (https://github.com/scaffold-eth/scaffold-eth-2/pull/905)
- cli: display correct solidity framework options based on extension
- cli: Add curated ERC-20 extension
- cli: fix: copy only chosen solidity framework folder

## 0.0.52

### Patch Changes
Expand Down
32 changes: 32 additions & 0 deletions contributors/TEMPLATE-FILES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Template and Args File List

This document provides a comprehensive list of `.template.mjs` files and their corresponding `.args.mjs` example files used in the `create-eth` project.

Template files are the base files that can be extended by third-party extensions. Args files are used to inject additional content into these template files. Understanding the relationship between these files is crucial for developing extensions and customizing the base instance created by `create-eth`.

If you're interested in developing third-party extensions, the [THIRD-PARTY-EXTENSION.md](./THIRD-PARTY-EXTENSION.md) guide provides detailed instructions on the process. Additionally, we have a [YouTube tutorial](https://www.youtube.com/watch?v=XQCv533XGZk) that walks you through the process of creating an extension step-by-step.

#### Useful for third-party extensions

| Template | Example args file |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [(NextJS component) `Header.tsx.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/packages/nextjs/components/Header.tsx.template.mjs) | [(NextJS component) `Header.tsx.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/subgraph/extension/packages/nextjs/components/Header.tsx.args.mjs) |
| [(NextJS component) `ScaffoldEthAppWithProviders.tsx.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/packages/nextjs/components/ScaffoldEthAppWithProviders.tsx.template.mjs) | [(NextJS component) `ScaffoldEthAppWithProviders.tsx.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/subgraph/extension/packages/nextjs/components/ScaffoldEthAppWithProviders.tsx.args.mjs) |
| [(NextJS app) `layout.tsx.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/packages/nextjs/app/layout.tsx.template.mjs) | [(NextJS app) `layout.tsx.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/onchainkit/extension/packages/nextjs/app/layout.tsx.args.mjs) |
| [(NextJS config) `scaffold.config.ts.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/packages/nextjs/scaffold.config.ts.template.mjs) | [(NextJS config) `scaffold.config.ts.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/onchainkit/extension/packages/nextjs/scaffold.config.ts.args.mjs) |
| [(NextJS) `.env.example.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/packages/nextjs/.env.example.template.mjs) | [(NextJS) `.env.example.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/onchainkit/extension/packages/nextjs/.env.example.args.mjs) |
| [(Foundry 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) | [(Foundry script) `Deploy.s.sol.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/erc-20/extension/packages/foundry/script/Deploy.s.sol.args.mjs) |
| [(Root) `README.md.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/README.md.template.mjs) | [(Root) `README.md.args.mjs`](https://github.com/scaffold-eth/create-eth-extensions/blob/subgraph/extension/README.md.args.mjs) |

#### create-eth internal use

| Template | Example args file |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [(GitHub workflow) `lint.yaml.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/.github/workflows/lint.yaml.template.mjs) | [(GitHub workflow) `lint.yaml.args.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/hardhat/.github/workflows/lint.yaml.args.mjs) |
| [(Nextjs blockExplorer address) `page.tsx.template.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/base/packages/nextjs/app/blockexplorer/address/[address]/page.tsx.template.mjs) | [(BlockExplorer address) `page.tsx.args.mjs`](https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/hardhat/packages/nextjs/app/blockexplorer/address/[address]/page.tsx.args.mjs) |
| [(Foundry) `.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 |
| [(Foundry) `deployments/.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.

For more information on how templating works in this project, please refer to the [TEMPLATING.md](./TEMPLATING.md) document.
2 changes: 2 additions & 0 deletions contributors/TEMPLATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ To avoid issues when named arguments have typos, the `withDefaults` utility will

For each Template file, we search on the extensions the user selected for the existence of Args files in the exact same relative path. If there are multiple Args files, we combine them into an array

To see the list of template files and their matching args files, check [TEMPLATE-FILES.md](./TEMPLATE-FILES.md).

I've thought about how the strings should be joined, but an option is to use [tagged templates](4). We can go as crazy as we want with tagged templates.

# Extension folder anatomy
Expand Down
Loading

0 comments on commit 1822cec

Please sign in to comment.