Skip to content

Commit

Permalink
refactor(cli-template-monorepo-ethers): update cli monorepo ethers te…
Browse files Browse the repository at this point in the history
…mplate
  • Loading branch information
vplasencia committed Feb 25, 2024
1 parent 6f1b279 commit f62b682
Show file tree
Hide file tree
Showing 68 changed files with 1,676 additions and 1,347 deletions.
2 changes: 1 addition & 1 deletion packages/cli-template-monorepo-ethers/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ max_line_length = 120
indent_size = 4

[*.md]
trim_trailing_whitespace = false
trim_trailing_whitespace = false
6 changes: 1 addition & 5 deletions packages/cli-template-monorepo-ethers/.env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
DEFAULT_NETWORK=localhost
INFURA_API_KEY=
ETHEREUM_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
FEEDBACK_CONTRACT_ADDRESS=0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9
SEMAPHORE_CONTRACT_ADDRESS=0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
OPENZEPPELIN_AUTOTASK_WEBHOOK=
GROUP_ID=42
REPORT_GAS=false
COINMARKETCAP_API_KEY=
ETHERSCAN_API_KEY=
ETHERSCAN_API_KEY=
74 changes: 2 additions & 72 deletions packages/cli-template-monorepo-ethers/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,12 @@ pids
.vscode
.idea

# Cargo
target

# Testing
coverage
coverage.json
*.lcov

# Dependency directories
node_modules/

# TypeScript cache
*.tsbuildinfo

# Output of 'npm pack'
*.tgz

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
Expand All @@ -49,35 +35,15 @@ node_modules/
# Yarn Integrity file
.yarn-integrity

# Generate output
dist
build

# Hardhat files
artifacts
cache
typechain-types

# Next.js
.next/
out/

# vercel
.vercel

# typescript
next-env.d.ts

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# Optional npm cache directory
.npm
*.DS_Store
.DS_Store

# yarn v3
.pnp.*
Expand All @@ -87,40 +53,4 @@ next-env.d.ts
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# The Graph
generated

# Auto Generated PWA files
**/public/sw.js
**/public/workbox-*.js
**/public/worker-*.js
**/public/sw.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map

#amplify-do-not-edit-begin
amplify/\#current-cloud-backend
amplify/.config/local-*
amplify/logs
amplify/mock-data
amplify/mock-api-resources
amplify/backend/amplify-meta.json
amplify/backend/.temp
build/
dist/
node_modules/
aws-exports.js
awsconfiguration.json
amplifyconfiguration.json
amplifyconfiguration.dart
amplify-build-config.json
amplify-gradle-config.json
amplifytools.xcconfig
.secret-*
**.sample
#amplify-do-not-edit-end

# Others
files.tgz
!.yarn/versions
8 changes: 6 additions & 2 deletions packages/cli-template-monorepo-ethers/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ docs
# production
dist
build
cache
contract-artifacts

# Hardhat files
artifacts
cache
typechain-types

# github
.github/ISSUE_TEMPLATE

Expand All @@ -42,4 +46,4 @@ generated
**/public/worker-*.js
**/public/sw.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map
**/public/worker-*.js.map

This file was deleted.

786 changes: 0 additions & 786 deletions packages/cli-template-monorepo-ethers/.yarn/releases/yarn-3.2.1.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions packages/cli-template-monorepo-ethers/.yarn/releases/yarn-4.1.0.cjs

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions packages/cli-template-monorepo-ethers/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
checksumBehavior: update
compressionLevel: mixed

nodeLinker: node-modules
enableGlobalCache: false

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.2.1.cjs
yarnPath: .yarn/releases/yarn-4.1.0.cjs
24 changes: 19 additions & 5 deletions packages/cli-template-monorepo-ethers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,27 @@ This project is a complete application that demonstrates a basic Semaphore use c

## 📜 Usage

Copy the `.env.example` file as `.env`:
### Add the environment variables

- Copy the `.env.example` file as `.env`:

```bash
cp .env.example .env
```

and add your environment variables or run the app in a local network.
- Copy the `.env.development.local.example` file as `.env.development.local`:

```bash
cp ./apps/web-app/.env.development.local.example ./apps/web-app/.env.development.local
```

- Copy the `.env.production.local.example` file as `.env.production.local`:

```bash
cp ./apps/web-app/.env.production.local.example ./apps/web-app/.env.production.local
```

Add your environment variables or run the app in a local network.

### Local server

Expand All @@ -30,7 +44,7 @@ yarn deploy --semaphore <semaphore-address> --group <group-id> --network arbitru

2. Update your `.env` file with your new contract address, the group id and the semaphore contract address.

3. Copy your contract artifacts from `apps/contracts/build/contracts/contracts` folder to `apps/web-app/contract-artifacts` folders manually. Or run `yarn copy:contract-artifacts` in the project root to do it automatically.
3. Copy your contract artifacts from `apps/contracts/artifacts/contracts/` folder to `apps/web-app/contract-artifacts` folder manually.

> **Note**
> Check the Semaphore contract addresses [here](https://docs.semaphore.pse.dev/deployed-contracts).
Expand All @@ -40,7 +54,7 @@ yarn deploy --semaphore <semaphore-address> --group <group-id> --network arbitru
### Code quality and formatting

Run [ESLint](https://eslint.org/) to analyze the code and catch bugs:
Run [ESLint](https://eslint.org/) and [solhint](https://github.com/protofire/solhint) to analyze the code and catch bugs:

```bash
yarn lint
Expand All @@ -52,7 +66,7 @@ Run [Prettier](https://prettier.io/) to check formatting rules:
yarn prettier
```

or to automatically format the code:
Or to automatically format the code:

```bash
yarn prettier:write
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
INFURA_API_KEY=
ETHEREUM_PRIVATE_KEY=
REPORT_GAS=false
ETHERSCAN_API_KEY=
COINMARKETCAP_API_KEY=
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,21 @@ yarn.lock
coverage
coverage.json

# docs
docs
# hardhat
artifacts
cache
typechain-types

# types
types

# circuits
circuits

# production
dist
build
cache
contract-artifacts
docs

# misc
.DS_Store
Expand All @@ -29,17 +33,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Next.js
.next/
out/

# The Graph
generated
# packages
cli-template-*

# Auto Generated PWA files
**/public/sw.js
**/public/workbox-*.js
**/public/worker-*.js
**/public/sw.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map
snark-artifacts
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,17 @@
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"project": ["./**/tsconfig.json"]
"project": ["./tsconfig.json", "./packages/**/tsconfig.json"]
},
"plugins": ["@typescript-eslint"],
"rules": {
"no-underscore-dangle": "off",
"no-alert": "off",
"no-nested-ternary": "off",
"import/no-extraneous-dependencies": "off",
"import/extensions": "off",
"import/no-relative-packages": "off",
"no-await-in-loop": "off",
"no-bitwise": "off",
"no-await-in-loop": "off",
"no-restricted-syntax": "off",
"no-console": ["warn", { "allow": ["info", "warn", "error"] }],
"no-console": ["warn", { "allow": ["info", "warn", "error", "log"] }],
"@typescript-eslint/lines-between-class-members": "off",
"no-param-reassign": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase", "PascalCase", "UPPER_CASE", "snake_case"],
"leadingUnderscore": "allow"
}
]
"no-param-reassign": "off"
}
}
71 changes: 71 additions & 0 deletions packages/cli-template-monorepo-ethers/apps/contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
node_modules
.env

# Hardhat files
/cache
/artifacts

# TypeChain files
/typechain
/typechain-types

# solidity-coverage files
/coverage
/coverage.json

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# IDE
.vscode
.idea

# Dependency directories
node_modules/

# Output of 'npm pack'
*.tgz

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Yarn Integrity file
.yarn-integrity

# vercel
.vercel

# dotenv environment variable files
.env

# Optional npm cache directory
.npm
.DS_Store

# yarn v3
.pnp.*
.pnp.js
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
Loading

0 comments on commit f62b682

Please sign in to comment.