Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚙️ tsconfig 用の workspace 作る #6

Merged
merged 7 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,22 @@ jobs:
run: pnpm install --frozen-lockfile
- name: Run biome
run: pnpm run check

typecheck:
runs-on: ubuntu-22.04
needs: install
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run typecheck
run: pnpm run typecheck
1 change: 1 addition & 0 deletions apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@repo/typescript-config": "workspace:*",
"@remix-run/dev": "^2.9.2",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.3.0",
Expand Down
19 changes: 2 additions & 17 deletions apps/client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "@repo/typescript-config/remix.json",
"include": [
"**/*.ts",
"**/*.tsx",
Expand All @@ -8,27 +9,11 @@
"**/.client/**/*.tsx"
],
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"types": ["@remix-run/node", "vite/client"],
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"module": "ESNext",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"target": "ES2022",
"strict": true,
"allowJs": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"@/*": ["./app/*"]
},

"jsxImportSource": "@emotion/react",

// Vite takes care of building everything, not tsc.
"noEmit": true
"jsxImportSource": "@emotion/react"
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"check": "biome check apps ./*.json",
"check:fix": "pnpm run check --apply",
"typecheck": "turbo typecheck",
"build": "turbo build",
"dev": "turbo dev"
},
Expand Down
File renamed without changes.
20 changes: 20 additions & 0 deletions packages/typescript-config/base.json
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,
"module": "ESNext",
"moduleResolution": "Bundler",
"noUnusedLocals": false,
"noUnusedParameters": false,
"preserveWatchOutput": true,
"skipLibCheck": true,
"strict": true
}
}
8 changes: 8 additions & 0 deletions packages/typescript-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "@repo/typescript-config",
"version": "1.0.0",
"license": "ISC",
"publishConfig": {
"access": "public"
}
}
17 changes: 17 additions & 0 deletions packages/typescript-config/remix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "./base.json",
"compilerOptions": {
"types": ["@remix-run/node", "vite/client"],
"target": "ES2022",
"jsx": "react-jsx",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"sourceMap": true,
"resolveJsonModule": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noEmit": true
}
}
13 changes: 9 additions & 4 deletions pnpm-lock.yaml

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

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
packages:
- 'apps/*'
- 'packages/*'
1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"build": {
"outputs": ["build"]
},
"typecheck": {},
"dev": {
"cache": false,
"persistent": true
Expand Down