-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrades to a newer turborepo approach
drops pnpm adds packages for eslint & ts config adds a sample app adds vscode configs contains workspaces in apps and packages Signed-off-by: Stefan <[email protected]>
- Loading branch information
1 parent
b33eef1
commit 261300f
Showing
26 changed files
with
4,078 additions
and
12,889 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
!.*.json | ||
tsconfig.json | ||
.yarn/ | ||
dist/ | ||
.next/ | ||
node_modules/ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
root: true, | ||
// This tells ESLint to load the config from the package `eslint-config-app` | ||
extends: ['app'], | ||
settings: { | ||
next: { | ||
rootDir: ['apps/*/'], | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
|
||
# dependencies | ||
node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
node_modules | ||
.turbo | ||
*.log | ||
.next | ||
dist | ||
dist-ssr | ||
*.local | ||
.env | ||
.cache | ||
server/dist | ||
public/dist | ||
.turbo | ||
storybook-static/ | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
apps/app-vite-js | ||
apps/app-vite-ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
dist/ | ||
coverage/ | ||
node_modules/ | ||
.next/ | ||
*.json | ||
.yarnrc.yml | ||
.yarn/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": false, | ||
"tabWidth": 2, | ||
"printWidth": 80 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"files.eol": "\n", | ||
"editor.formatOnSave": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
# an opinionated scaffold for web3 hackathon projects | ||
|
||
typescript | ||
pnpm monorepo with two packages | ||
pnpm monorepo with two packages | ||
hardhat | ||
typechain | ||
oz erc721 base impl | ||
oz erc721 base impl | ||
|
||
nextjs / react | ||
chakraui | ||
web3modal in context | ||
ethers.js | ||
ethers.js | ||
|
||
server based metadata (next) | ||
unrestricted minting | ||
fetching assets directly from chain | ||
|
||
## 2023 update | ||
|
||
inspired by https://github.com/bigstair-monorepo/monorepo / https://www.robinwieruch.de/javascript-monorepos/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "@app/demo", | ||
"version": "0.0.0", | ||
"private": true, | ||
"scripts": { | ||
"build": "tsc -p .", | ||
"clean": "rm -rf .turbo && rm -rf node_modules" | ||
}, | ||
"dependencies": { | ||
"@app/core": "*" | ||
}, | ||
"devDependencies": { | ||
"ts-config-app": "*", | ||
"eslint-config-app": "*", | ||
"serve": "^14.1.2", | ||
"typescript": "^4.9.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { sayHello } from "@app/core" | ||
|
||
const main = () => { | ||
const result = sayHello() | ||
console.log(result) | ||
} | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": "ts-config-app/base.json", | ||
"compilerOptions": { | ||
"outDir": "dist" | ||
}, | ||
"include": [ | ||
"." | ||
], | ||
"exclude": [ | ||
"dist", | ||
"build", | ||
"node_modules" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
{ | ||
"name": "", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"private": true, | ||
|
||
"workspaces": [ | ||
"packages/*", | ||
"apps/*" | ||
], | ||
"dependencies": {}, | ||
"scripts": { | ||
"preinstall": "npx only-allow pnpm", | ||
"build": "pnpm run -r build" | ||
"build": "turbo run build", | ||
"dev": "turbo run dev --no-cache --parallel --continue", | ||
"lint": "turbo run lint", | ||
"clean": "turbo run clean && rm -rf node_modules", | ||
"format": "prettier --ignore-path .gitignore --write \"**/*.{js,jsx,ts,tsx,md}\"", | ||
"changeset-create": "changeset", | ||
"changeset-apply": "changeset version", | ||
"release": "turbo run build && changeset publish" | ||
}, | ||
"devDependencies": { | ||
"@changesets/cli": "^2.26.0", | ||
"eslint": "^8.31.0", | ||
"eslint-config-app": "*", | ||
"prettier": "^2.8.2", | ||
"turbo": "^1.6.3" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['app'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "@app/core", | ||
"version": "0.0.1", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"sideEffects": false, | ||
"license": "MIT", | ||
"files": [ | ||
"dist/**" | ||
], | ||
"scripts": { | ||
"build": "tsup src/index.ts --format esm,cjs --dts ", | ||
"dev": "tsup src/index.ts --format esm,cjs --watch --dts ", | ||
"lint": "TIMING=1 eslint \"src/**/*.{ts,tsx,js,jsx}\" --fix", | ||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist" | ||
}, | ||
"devDependencies": { | ||
"ts-config-app": "*", | ||
"eslint-config-app": "*", | ||
"eslint": "^8.31.0", | ||
"tsup": "^6.5.0", | ||
"typescript": "^4.9.4" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const sayHello = (): string => { | ||
return "Hello" | ||
} | ||
|
||
const aVeryLongFunction = ( | ||
aLongVariableName: string, | ||
aLongVariableName2: string, | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
aLongVariableName3: string | ||
): string => { | ||
return "foo" | ||
} | ||
|
||
export { sayHello } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "ts-config-app/base.json", | ||
"include": [ | ||
"." | ||
], | ||
"exclude": [ | ||
"dist", | ||
"build", | ||
"node_modules" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module.exports = { | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: "module", | ||
}, | ||
extends: [ | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
//'next', | ||
"plugin:prettier/recommended", | ||
"prettier", | ||
], | ||
rules: { | ||
"@next/next/no-html-link-for-pages": "off", | ||
//'react/jsx-key': 'off', | ||
//"@typescript-eslint/no-unused-vars": "off", | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["*.ts", "*.tsx"], | ||
extends: [], | ||
rules: { | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-empty-function": "warn", | ||
"@typescript-eslint/ban-types": "warn", | ||
"@typescript-eslint/type-annotation-spacing": [ | ||
"off", | ||
{ | ||
before: true, | ||
after: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "eslint-config-app", | ||
"version": "0.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"private": true, | ||
"dependencies": { | ||
"@typescript-eslint/eslint-plugin": "^5.48.0", | ||
"@typescript-eslint/parser": "^5.48.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-config-next": "^13.1.1", | ||
"eslint-config-prettier": "^8.6.0", | ||
"eslint-plugin-react": "^7.31.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"display": "Default", | ||
"compilerOptions": { | ||
"composite": false, | ||
"declaration": true, | ||
"declarationMap": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"inlineSources": false, | ||
"isolatedModules": true, | ||
"moduleResolution": "node", | ||
"noUnusedLocals": false, | ||
"noUnusedParameters": false, | ||
"preserveWatchOutput": true, | ||
"skipLibCheck": true, | ||
"strict": true | ||
}, | ||
"exclude": ["node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "ts-config-app", | ||
"version": "0.0.0", | ||
"license": "MIT", | ||
"private": true, | ||
"main": "index.js", | ||
"files": [ | ||
"base.json", | ||
"react-library.json" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"display": "React Library", | ||
"extends": "./base.json", | ||
"compilerOptions": { | ||
"lib": ["dom", "ES2015"], | ||
"module": "ESNext", | ||
"target": "ES6", | ||
"jsx": "react-jsx" | ||
} | ||
} |
Oops, something went wrong.