Skip to content

Commit

Permalink
chore: setup turbo repo (#311)
Browse files Browse the repository at this point in the history
* add turbo

* create common check-types task

* typecheck globally

* fix type issues in example-app
  • Loading branch information
frontendphil authored Dec 11, 2024
1 parent 826ea57 commit 5e11725
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 10 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ on:
- main

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: latest
cache: "pnpm"
cache-dependency-path: "**/pnpm-lock.yaml"
- run: pnpm install --prefer-offline
- name: Typecheck
run: pnpm check-types

static_checks:
runs-on: ubuntu-latest
defaults:
Expand All @@ -23,6 +37,7 @@ jobs:
- run: pnpm install --prefer-offline
- name: Run static checks
run: pnpm check

unit_tests:
runs-on: ubuntu-latest
defaults:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules
build
dist
coverage
.turbo

.env
*.log
4 changes: 2 additions & 2 deletions example-app/app/Connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export const Connect = () => {
<Input
disabled
label="Wallet"
defaultValue={account.connector.name}
defaultValue={account.connector?.name}
/>

<Input disabled label="Chain" defaultValue={account.chain.name} />
<Input disabled label="Chain" defaultValue={account.chain?.name} />

<Input disabled defaultValue={account.address} label="Account" />

Expand Down
1 change: 1 addition & 0 deletions example-app/app/config/ConfigProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const useWagmiConfig = (): [config: Config, scopeKey: string] => {
return [
{
...config,
// @ts-expect-error Something around chain that hopefully isn't important
getClient: (options) => {
const chain = getChain(config.chains, options)

Expand Down
5 changes: 3 additions & 2 deletions example-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"private": true,
"type": "module",
"scripts": {
"dev": "node server.js"
"dev": "node server.js",
"check-types": "tsc --noEmit"
},
"dependencies": {
"@epic-web/invariant": "^1.0.0",
Expand Down Expand Up @@ -37,4 +38,4 @@
"vite": "^5.4.8",
"vite-tsconfig-paths": "^5.0.1"
}
}
}
5 changes: 4 additions & 1 deletion example-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
"strict": true,
"module": "ES2022",
"moduleResolution": "Bundler",
"skipLibCheck": true,
"jsx": "react-jsx",
"paths": {
"@/transfer": ["./app/transfer"],
"@/components": ["./app/components"],
"@/clients": ["./app/clients"],
"@/config": ["./app/config"]
}
}
},
"include": ["./app/**/*"],
"exclude": ["node_modules"]
}
4 changes: 2 additions & 2 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"test:unit": "vitest",
"test:e2e": "PW_CHROMIUM_ATTACH_TO_OTHER=1 playwright test --headed",
"test:e2e:ui": "pnpm test:e2e --ui",
"check": "pnpm check:ts && pnpm check:format && pnpm check:lint && pnpm check:spelling && pnpm check:cycles",
"check:ts": "pnpm tsc --noEmit",
"check": "pnpm check:format && pnpm check:lint && pnpm check:spelling && pnpm check:cycles",
"check-types": "tsc --noEmit",
"check:lint": "eslint . --max-warnings=0",
"check:format": "prettier \"src/**/*.(ts|tsx)\" --list-different",
"check:spelling": "cspell \"**\"",
Expand Down
3 changes: 2 additions & 1 deletion fork-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"scripts": {
"start": "env-cmd wrangler dev",
"deploy": "wrangler publish",
"format": "prettier --write '*.{json,js}' 'src/**/*.ts'"
"format": "prettier --write '*.{json,js}' 'src/**/*.ts'",
"check-types": "tsc --noEmit"
},
"packageManager": "[email protected]"
}
3 changes: 2 additions & 1 deletion landing-page/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
},
"scripts": {
"start": "vite",
"build": "vite build"
"build": "vite build",
"check-types": "tsc --noEmit"
},
"eslintConfig": {
"extends": [
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"vitest-chrome": "patches/vitest-chrome.patch"
}
},
"scripts": {
"check-types": "turbo check-types"
},
"devDependencies": {
"turbo": "^2.3.3",
"typescript": "5.7.2"
}
}
64 changes: 64 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"check-types": {},
"dev": {
"persistent": true,
"cache": false
}
}
}
3 changes: 2 additions & 1 deletion vnet-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"scripts": {
"start": "env-cmd wrangler dev",
"deploy": "wrangler publish",
"format": "prettier --write '*.{json,js}' 'src/**/*.ts'"
"format": "prettier --write '*.{json,js}' 'src/**/*.ts'",
"check-types": "tsc --noEmit"
},
"packageManager": "[email protected]"
}

0 comments on commit 5e11725

Please sign in to comment.