Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
#86/update packages react (#87)
Browse files Browse the repository at this point in the history
* #86 update to react 18 generally working

* #86 update to react 18 generally working

* #86 updated package names

* #86 updated package names and folders

* #86 updated package names and folders

* updated version

* #86 updated package names and folders

* #86 fixed scripts

* #86 updated all the packages for react 18

* updated packages
  • Loading branch information
ShravanSunder authored May 1, 2022
1 parent 53dd974 commit b41cf65
Show file tree
Hide file tree
Showing 49 changed files with 2,735 additions and 3,590 deletions.
32 changes: 16 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
packages/subgraph/subgraph.yaml
packages/subgraph/generated
packages/subgraph/abis/*
packages/hardhat/*.txt
**/aws.json

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
**/node_modules
Expand All @@ -16,15 +11,28 @@ tenderly.yaml
.yalc
yalc.lock
packages/vite-app-ts/dist
packages/hardhat-ts/mnemonic.secret
packages/**/data
build
dist

# ts
# hardhat ts
packages/hardhat-ts/cache
packages/hardhat-ts/generated
!packages/hardhat-ts/generated/.gitignore
cache
artifacts

# secrets
.secret
**/aws.json
packages/hardhat-ts/mnemonic.secret

#subgraph
packages/subgraph/subgraph.yaml
packages/subgraph/generated
packages/subgraph/abis/*

# dependencies
# dependencies, yarn, etc
/node_modules
/.pnp
.pnp.js
Expand All @@ -41,14 +49,6 @@ packages/hardhat-ts/cache
# testing
coverage

# production
build
dist

#Hardhat files
cache
artifacts

# misc
.DS_Store
.netlify
Expand Down
18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scaffold-eth/typescript",
"version": "0.3.0",
"version": "0.4.0",
"keywords": [
"ethereum",
"react",
Expand Down Expand Up @@ -32,10 +32,12 @@
"ship": "yarn workspace @scaffold-eth/vite-app ship",
"subgraph": "yarn workspace @scaffold-eth/subgraph",
"prepare": "husky install",
"postinstall": "husky install"
"postinstall": "husky install",
"lint": "yarn workspace @scaffold-eth/vite-app lint --fix && yarn workspace @scaffold-eth/common lint --fix && yarn workspace @scaffold-eth/hardhat lint --fix"
},
"workspaces": {
"packages": [
"packages/common",
"packages/hardhat-ts",
"packages/vite-app-ts",
"packages/services/*",
Expand All @@ -47,19 +49,23 @@
"packageManager": "[email protected]",
"devDependencies": {
"cross-env": "^7.0.3",
"eslint": "^8.9.0",
"eslint": "^8.14.0",
"husky": "^7.0.4",
"lint-staged": "^12.3.4",
"prettier": "^2.5.1",
"lint-staged": "^12.4.1",
"prettier": "^2.6.2",
"prettier-plugin-solidity": "^1.0.0-beta.19",
"shx": "^0.3.4",
"ts-node": "^10.5.0"
"ts-node": "^10.7.0"
},
"lint-staged": {
"packages/vite-app-ts/src/**/*.{ts,tsx}": [
"yarn workspace @scaffold-eth/vite-app lint --fix",
"yarn workspace @scaffold-eth/vite-app format"
],
"packages/common/src/**/*.{ts,tsx}": [
"yarn workspace @scaffold-eth/common lint --fix",
"yarn workspace @scaffold-eth/common format"
],
"packages/hardhat-ts/test/**/*.ts": [
"yarn workspace @scaffold-eth/hardhat lint --fix",
"yarn workspace @scaffold-eth/hardhat format"
Expand Down
File renamed without changes.
24 changes: 11 additions & 13 deletions packages/scaffold-common/.eslintrc → packages/common/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"parser": "@typescript-eslint/parser", // Specifies the ESLint parser
"ignorePatterns": ["**/*.pcss", "**/*.css", "**/*.less", "**/*.json"],
"parserOptions": {
"ecmaVersion": 2020, // Allows for the parsing of modern ECMAScript features
"sourceType": "module", // Allows for the use of imports,
"ecmaFeatures": {
"jsx": true // Allows for the parsing of JSX
"jsx": false // Allows for the parsing of JSX,
},
"project": "tsconfig.json",
"tsconfigRootDir": ".",
"projectFolderIgnoreList": [
"node_modules/*",
"node_modules",
"dist",
"lib",
"build",
".yarn",
"build-utils",
"docs",
"docusaurus"
"./src/styles"
]
},
"env": {
Expand All @@ -31,13 +31,13 @@
"plugin:import/typescript",
"plugin:react-hooks/recommended",
"plugin:react/recommended",
"plugin:tailwind/recommended",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:mocha/recommended"
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"plugins": ["prettier", "react", "react-hooks", "unused-imports", "testing-library", "mocha"],
"plugins": ["prettier", "react", "react-hooks", "unused-imports", "testing-library"],
"rules": {
"eqeqeq": ["error", "smart"],
"react/jsx-wrap-multilines": "warn",
Expand All @@ -52,6 +52,7 @@
"react/jsx-closing-bracket-location": "off",
"react/prop-types": "off",
"react-hooks/rules-of-hooks": "error",
"react/display-name": "off",
"react-hooks/exhaustive-deps": [
"warn",
{
Expand All @@ -78,7 +79,7 @@
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports-ts": "warn",
"unused-imports/no-unused-vars-ts": [
"error",
"warn",
{ "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" }
],
"@typescript-eslint/no-use-before-define": ["error"],
Expand All @@ -89,7 +90,7 @@
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/restrict-template-expressions": ["error", { "allowBoolean": true, "allowNumber": true }],
"@typescript-eslint/restrict-template-expressions": ["warn", { "allowBoolean": true, "allowNumber": true }],
"prefer-destructuring": "off",
"prefer-template": "off",
"react/destructuring-assignment": "off",
Expand Down Expand Up @@ -147,10 +148,7 @@
"eslint linebreak-style": "off",
"object-curly-newline": "off",
"no-shadow": "off",
"no-void": ["error", { "allowAsStatement": true }],
"mocha/no-mocha-arrows": "off",
"mocha/no-hooks-for-single-case": "off",
"mocha/max-top-level-suites": ["warn", { "limit": 3 }]
"no-void": ["error", { "allowAsStatement": true }]
},
"overrides": [
{
Expand All @@ -167,7 +165,7 @@
"pragma": "React", // Pragma to use, default to "React"
"fragment": "Fragment", // Fragment to use (may be a property of <pragma>), default to "Fragment"
"version": "detect" // React version. "detect" automatically picks the version you have installed.
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
// You can also use `16."off"`, `16.3`, etc, if you want to override the detected value.
// default to latest and warns if missing
// It will default to "detect" in the future
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
71 changes: 71 additions & 0 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"name": "@scaffold-eth/common",
"version": "1.0.0",
"author": "Shravan Sunder<[email protected]>",
"description": "Common package to be used by hardaht-ts and vite-app-ts in the scaffold-eth-typescript workspace",
"main": "index.ts",
"scripts": {
"watch": "tsc -w --noEmit",
"clean": "shx rm -rf ./lib",
"lint": "eslint --config ./.eslintrc --ignore-path ./.eslintignore ./src/**/*.(ts|tsx)",
"lint:report": "eslint --config ./.eslintrc --ignore-path ./.eslintignore --output-file eslint_report.json --format json ./src/**/*.(ts|tsx)",
"format": "yarn prettier -w ./src ",
"format:check": "yarn prettier -c ./src"
},
"dependencies": {
"eth-hooks": "^4.2.*",
"ethers": "^5.6.*"
},
"devDependencies": {
"@types/node": "^16.11.32",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"esbuild": "^0.14.38",
"esbuild-node-externals": "^1.4.1",
"eslint": "^8.14.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^16.2.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.1.5",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-mocha": "^10.0.4",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.5.0",
"eslint-plugin-tailwind": "^0.2.1",
"eslint-plugin-testing-library": "^5.3.1",
"eslint-plugin-unused-imports": "^2.0.0",
"husky": "^7.0.4",
"lint-staged": "^12.4.1",
"pinst": "^3.0.0",
"prettier": "^2.6.2",
"prettier-eslint": "^14.0.2",
"shx": "^0.3.4",
"ts-patch": "^2.0.1",
"tsconfig-paths": "^3.14.1",
"typescript": "^4.6.4",
"typescript-transform-paths": "^3.3.1"
},
"keywords": [
"blockchain",
"ethereum",
"react",
"create-eth-app",
"typescript"
],
"license": "MIT",
"packageManager": "[email protected]",
"volta": {
"node": "16.13.1"
},
"lint-staged": {
"**/*.{ts,tsx}": [
"yarn lint --fix",
"yarn format"
],
"**/*.{json}": [
"yarn format"
]
}
}
54 changes: 54 additions & 0 deletions packages/common/src/constants/hardhatNamedAccounts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { TNetworkNames } from "../models/TNetworkNames";

type TChain = TNetworkNames | number;
type TAccountName =
| "deployer"
| "user1"
| "user2"
| "user3"
| "user4"
| "user5"
| "governance";

/**
* The default account to use for hardhat. For example 0 will take by default take the first account of hardhat
*/
type TDefaultAccount = {
["default"]: number | string;
};

/**
* Named accounts to be used by hardaht. See docs: https://github.com/wighawag/hardhat-deploy#1-namedaccounts-ability-to-name-addresses
*
* the values are account addresses, or account number in hardhat
*/
export const hardhatNamedAccounts: {
[name in TAccountName]: Readonly<
Partial<{ [network in TChain]: number | string }> & TDefaultAccount
>;
} = {
deployer: {
default: 0, // here this will by default take the first account as deployer
1: 0, // similarly on mainnet it will take the first account as deployer. Note though that depending on how hardhat network are configured, the account 0 on one network can be different than on another
4: "0xA296a3d5F026953e17F472B497eC29a5631FB51B", // but for rinkeby it will be a specific address
goerli: "0x84b9514E013710b9dD0811c9Fe46b837a4A0d8E0", // it can also specify a specific netwotk name (specified in hardhat.config.js)
},
user1: {
default: 1,
},
user2: {
default: 2,
},
user3: {
default: 3,
},
user4: {
default: 4,
},
user5: {
default: 5,
},
governance: {
default: 10,
},
} as const;
2 changes: 2 additions & 0 deletions packages/common/src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./hardhatNamedAccounts";
export * from "./networks";
Loading

0 comments on commit b41cf65

Please sign in to comment.