Skip to content

Commit b4f4d47

Browse files
authored
Fix and improve CI checks (#46)
* Move checks to workflows * Improve github actions and checks * Move source maps up * Fix linting * Add test to make it work * Fix web eslint config * Fix linting and build * No not watch by default * Add test for timer * Clean up * Make lint depend on build * Fix eslint config for real? * Remove flag * IDK * Upgrade typescript * Ok * Fix update counter * Change order * Remove absolute versioning from actions * Upgrade pnpm and regenerate lockfile * Upgrade all deps * Adopt eslint config from gemini * Simplify turbo setup * Ok go * Yep * format * Remove parallel * Is dit het dan * Format
1 parent c899085 commit b4f4d47

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4715
-3672
lines changed

.github/checks.yml

Lines changed: 0 additions & 83 deletions
This file was deleted.

.github/workflows/checks.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Checks
2+
3+
on:
4+
pull_request: # push is handled in the deploy workflows
5+
branches: ["**"]
6+
workflow_call:
7+
8+
concurrency:
9+
# Skip concurrency restriction when called from another workflow
10+
# This prevents deadlocks between parent workflow and this one
11+
group:
12+
${{ github.workflow_ref != '' && format('{0}-{1}', github.workflow,
13+
github.run_id) || format('{0}-{1}', github.workflow, github.ref) }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
verify:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
command: [check-types, check-format, check-circular, lint, test]
23+
24+
name: ${{ matrix.command }}
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 22
32+
33+
- name: Enable corepack
34+
run: corepack enable pnpm
35+
36+
- name: Get pnpm store directory
37+
id: pnpm-cache
38+
shell: bash
39+
run: |
40+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
41+
42+
- name: Setup pnpm cache
43+
uses: actions/cache@v4
44+
with:
45+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
46+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
47+
# First tries exact match with lock file hash. If not found,
48+
# falls back to any cache starting with 'pnpm-store-'.
49+
# This way we get exact cache on repeated runs, but can still
50+
# use older cache as starting point when dependencies change.
51+
restore-keys: |
52+
${{ runner.os }}-pnpm-store-
53+
54+
- name: Install dependencies
55+
run: pnpm install --frozen-lockfile
56+
57+
- name: Run ${{ matrix.command }}
58+
run: pnpm ${{ matrix.command }}

apps/web/eslint.config.js

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,4 @@
1-
// @ts-check
2-
/* eslint-disable */
3-
import { FlatCompat } from "@eslint/eslintrc";
4-
import baseConfig from "@repo/eslint-config/base";
5-
import tseslint from "typescript-eslint";
1+
import config from "@repo/eslint-config/next-js";
62

7-
const compat = new FlatCompat({
8-
baseDirectory: import.meta.dirname,
9-
});
10-
11-
export default tseslint.config(
12-
...baseConfig,
13-
...compat.config({
14-
extends: ["next"],
15-
settings: {
16-
next: {
17-
rootDir: "apps/web/", // required for monorepos
18-
},
19-
},
20-
}),
21-
tseslint.configs.strictTypeChecked,
22-
tseslint.configs.stylisticTypeChecked,
23-
{
24-
languageOptions: {
25-
parserOptions: {
26-
projectService: true,
27-
tsconfigRootDir: import.meta.dirname,
28-
},
29-
},
30-
rules: {
31-
"@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
32-
},
33-
}
34-
);
3+
/** @type {import("eslint").Linter.Config} */
4+
export default config;

apps/web/package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"check-types": "tsc --noEmit",
8+
"check-circular": "madge --circular --extensions ts ./src --ts-config ./tsconfig.json",
89
"dev": "next dev",
910
"build": "next build",
1011
"clean": "del-cli .next tsconfig.tsbuildinfo",
@@ -15,27 +16,28 @@
1516
"@radix-ui/react-icons": "^1.3.2",
1617
"@radix-ui/react-slot": "^1.1.1",
1718
"@repo/common": "workspace:*",
18-
"@typed-firestore/react": "1.0.0",
19+
"@typed-firestore/react": "1.1.0",
1920
"class-variance-authority": "^0.7.1",
2021
"clsx": "^2.1.1",
21-
"firebase": "^11.2.0",
22-
"lucide-react": "^0.474.0",
22+
"firebase": "^12.1.0",
23+
"lucide-react": "^0.539.0",
2324
"next": "^15.1.6",
2425
"react": "^19.0.0",
2526
"react-dom": "^19.0.0",
26-
"tailwind-merge": "^2.6.0",
27+
"tailwind-merge": "^3.3.1",
2728
"tailwindcss-animate": "^1.0.7",
28-
"typescript": "^5.7.3"
29+
"typescript": "^5.9.2"
2930
},
3031
"devDependencies": {
3132
"@codecompose/typescript-config": "^1.2.0",
3233
"@repo/eslint-config": "workspace:*",
33-
"@types/node": "^22.10.10",
34+
"@types/node": "^24.2.1",
3435
"@types/react": "^19.0.8",
3536
"@types/react-dom": "^19.0.3",
3637
"autoprefixer": "^10.4.20",
3738
"del-cli": "^6.0.0",
3839
"eslint-config-next": "^15.1.6",
40+
"madge": "^8.0.0",
3941
"postcss": "^8.5.1",
4042
"tailwindcss": "^3.4.17"
4143
}

apps/web/src/components/ui/table.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import * as React from "react";
22

33
import { cn } from "~/lib/utils";
44

5+
/* eslint-disable react/prop-types */
6+
57
const Table = React.forwardRef<
68
HTMLTableElement,
79
React.HTMLAttributes<HTMLTableElement>

apps/web/src/lib/firebase.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ let db: Firestore | undefined;
2020
let auth: Auth | undefined;
2121

2222
export function getFirebaseApp(): FirebaseApp {
23-
if (!app) {
24-
app = initializeApp(firebaseConfig);
25-
}
23+
app ??= initializeApp(firebaseConfig);
2624
return app;
2725
}
2826

@@ -37,8 +35,6 @@ export function getFirestoreDb(): Firestore {
3735
}
3836

3937
export function getFirebaseAuth(): Auth {
40-
if (!auth) {
41-
auth = getAuth(getFirebaseApp());
42-
}
38+
auth ??= getAuth(getFirebaseApp());
4339
return auth;
4440
}

apps/web/turbo.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,6 @@
1717
],
1818
"dependsOn": ["^build"],
1919
"outputs": [".next/**", "!.next/cache/**"]
20-
},
21-
"lint": {
22-
"dependsOn": ["^lint"]
23-
},
24-
"test": {
25-
"dependsOn": ["^build"],
26-
"outputs": ["coverage/**"],
27-
"inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts", "test/**/*.tsx"]
28-
},
29-
"check-types": {
30-
"dependsOn": ["^check-types"]
31-
},
32-
"clean": {
33-
"dependsOn": ["^clean"]
34-
},
35-
"dev": {
36-
"cache": false,
37-
"persistent": true
3820
}
3921
}
4022
}

package.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dist"
1818
],
1919
"main": "dist/index.js",
20-
"packageManager": "pnpm@9.0.4+sha256.caa915eaae9d9aefccf50ee8aeda25a2f8684d8f9d5c6e367eaf176d97c1f89e",
20+
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748",
2121
"author": "Thijs Koerselman",
2222
"license": "MIT",
2323
"publishConfig": {
@@ -28,27 +28,29 @@
2828
"url": "https://github.com/0x80/mono-ts"
2929
},
3030
"scripts": {
31-
"check-types": "turbo run check-types",
32-
"build": "turbo run build",
33-
"build:fns": "turbo run build --filter=@repo/fns",
34-
"build:api": "turbo run build --filter=@repo/api",
35-
"clean": "turbo run clean",
36-
"dev": "turbo run dev",
31+
"check-types": "turbo check-types --continue",
32+
"check-circular": "turbo check-circular --continue",
33+
"build": "turbo build",
34+
"build:fns": "turbo build --filter=@repo/fns",
35+
"build:api": "turbo build --filter=@repo/api",
36+
"clean": "turbo clean",
37+
"dev": "turbo dev",
3738
"deploy": "firebase deploy",
3839
"watch": "turbo watch build --filter=@repo/core --filter=@repo/fns --filter=@repo/api",
39-
"lint": "turbo run lint --parallel",
40-
"test": "turbo run test -- --watch false",
40+
"lint": "turbo lint",
41+
"test": "turbo test -- --watch false",
4142
"format": "prettier --write .",
43+
"check-format": "prettier --check .",
4244
"emulate": "firebase emulators:start --project demo-mono-ts",
4345
"db:get-indexes": "firebase firestore:indexes > firestore.indexes.json"
4446
},
4547
"devDependencies": {
46-
"firebase-tools-with-isolate": "13.29.1-2",
48+
"firebase-tools-with-isolate": "14.10.1",
4749
"prettier": "^3.4.2",
4850
"prettier-plugin-jsdoc": "^1.3.2",
4951
"turbo": "^2.3.4",
50-
"typescript": "^5.7.3",
51-
"vercel": "^39.3.0",
52+
"typescript": "^5.9.2",
53+
"vercel": "^44.7.3",
5254
"vitest": "^3.0.4"
5355
}
5456
}

packages/common/eslint.config.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
1-
// @ts-check
2-
import base from "@repo/eslint-config/base";
3-
import tseslint from "typescript-eslint";
1+
import config from "@repo/eslint-config/library";
42

5-
export default tseslint.config([
6-
...base,
7-
{
8-
languageOptions: {
9-
parserOptions: {
10-
tsconfigRootDir: import.meta.dirname,
11-
allowDefaultProject: true,
12-
},
13-
},
14-
},
15-
]);
3+
/** @type {import("eslint").Linter.Config} */
4+
export default config;

packages/common/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@
1414
],
1515
"scripts": {
1616
"check-types": "tsc --noEmit",
17+
"check-circular": "madge --circular --extensions ts ./src --ts-config ./tsconfig.json",
1718
"test": "vitest",
1819
"build": "bunchee --sourcemap --target es2022",
1920
"clean": "del-cli dist tsconfig.tsbuildinfo",
20-
"lint": "eslint src --flag unstable_config_lookup_from_file --max-warnings 0",
21+
"lint": "eslint src --max-warnings 0",
2122
"coverage": "vitest run --coverage"
2223
},
2324
"license": "MIT",
2425
"dependencies": {
25-
"firebase": "^11.2.0",
26+
"firebase": "^12.1.0",
2627
"remeda": "^2.20.0"
2728
},
2829
"devDependencies": {
@@ -32,9 +33,9 @@
3233
"bunchee": "^6.6.0",
3334
"del-cli": "^6.0.0",
3435
"eslint": "^9.19.0",
36+
"madge": "^8.0.0",
3537
"prettier": "^3.4.2",
36-
"typescript": "^5.7.3",
37-
"typescript-eslint": "^8.21.0",
38+
"typescript": "^5.9.2",
3839
"vitest": "^3.0.4"
3940
}
4041
}

0 commit comments

Comments
 (0)