Skip to content

Commit 58e6394

Browse files
authored
Merge branch 't3dotgg:main' into main
2 parents a9c4f01 + 94289d3 commit 58e6394

File tree

6 files changed

+139
-10
lines changed

6 files changed

+139
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [main]
88

99
jobs:
10-
build:
10+
lint:
1111
runs-on: ubuntu-latest
1212

1313
steps:
@@ -39,14 +39,41 @@ jobs:
3939
- name: Install dependencies
4040
run: pnpm install --frozen-lockfile
4141

42-
- name: Lint and Format Check
42+
- name: Lint, format and typecheck
43+
run: |
44+
pnpm run check
45+
46+
build:
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- name: Setup Node.js
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: "20"
56+
57+
- name: Install pnpm
58+
uses: pnpm/action-setup@v2
59+
with:
60+
version: 9
61+
62+
- name: Get pnpm store directory
63+
shell: bash
4364
run: |
44-
pnpm run lint & \
45-
pnpm run format:check & \
46-
wait
65+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
66+
67+
- name: Setup pnpm cache
68+
uses: actions/cache@v3
69+
with:
70+
path: ${{ env.STORE_PATH }}
71+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
72+
restore-keys: |
73+
${{ runner.os }}-pnpm-store-
4774
48-
- name: Type check
49-
run: pnpm run typecheck
75+
- name: Install dependencies
76+
run: pnpm install --frozen-lockfile
5077

5178
- name: Build
5279
run: pnpm run build

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"build": "next build",
7-
"check": "next lint && tsc --noEmit",
7+
"check": "concurrently --names \"lint,typecheck,format\" --prefix-colors \"yellow,blue,green\" \"next lint\" \"tsc --noEmit\" \"pnpm run format:check\"",
88
"dev": "next dev --turbo",
99
"lint": "next lint",
1010
"lint:fix": "next lint --fix",
@@ -28,6 +28,7 @@
2828
"@types/react-dom": "npm:[email protected]",
2929
"@typescript-eslint/eslint-plugin": "^8.13.0",
3030
"@typescript-eslint/parser": "^8.13.0",
31+
"concurrently": "^9.1.0",
3132
"eslint": "^8",
3233
"eslint-config-next": "15.0.0-rc.1",
3334
"prettier": "^3.3.3",

pnpm-lock.yaml

Lines changed: 98 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pull_request_template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Please make sure you do the following before filing your PR:
2+
- [ ] Provide a video or screenshots of any visual changes made
3+
- [ ] Run `pnpm run check` and make sure everything passes

src/app/(tools)/rounded-border/rounded-tool.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export function RoundedTool() {
192192
const [radius, setRadius] = useLocalStorage<Radius>("roundedTool_radius", 2);
193193
const [background, setBackground] = useLocalStorage<BackgroundOption>(
194194
"roundedTool_background",
195-
"transparent"
195+
"transparent",
196196
);
197197

198198
if (!imageMetadata)

src/hooks/use-local-storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function useLocalStorage<T>(key: string, initialValue: T) {
66

77
try {
88
const item = window.localStorage.getItem(key);
9-
return item ? JSON.parse(item) : initialValue;
9+
return item ? (JSON.parse(item) as T) : initialValue;
1010
} catch (error) {
1111
console.warn(`Error reading localStorage key "${key}":`, error);
1212
return initialValue;

0 commit comments

Comments
 (0)