Skip to content

Commit c20e818

Browse files
ci: run prettier autofix action (#565)
* ci: run prettier autofix action * ci: apply automated fixes * Update branches --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 0cce78b commit c20e818

37 files changed

+368
-277
lines changed

.github/workflows/autofix.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: autofix.ci # needed to securely identify the workflow
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
autofix:
17+
name: autofix
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/[email protected]
22+
with:
23+
fetch-depth: 0
24+
- name: Setup Tools
25+
uses: tanstack/config/.github/setup@main
26+
- name: Fix formatting
27+
run: pnpm format
28+
- name: Apply fixes
29+
uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
30+
with:
31+
commit-message: 'ci: apply automated fixes'

.github/workflows/pr.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,12 @@ jobs:
88
name: PR
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Git Checkout
12-
uses: actions/checkout@v4
13-
- name: Setup pnpm
14-
uses: pnpm/action-setup@v4
15-
- name: Setup Node
16-
uses: actions/setup-node@v4
11+
- name: Checkout
12+
uses: actions/[email protected]
1713
with:
18-
node-version-file: .nvmrc
19-
cache: pnpm
20-
- name: Install Packages
21-
run: pnpm install --frozen-lockfile
14+
fetch-depth: 0
15+
- name: Setup Tools
16+
uses: tanstack/config/.github/setup@main
2217
- name: Run Lint
2318
run: pnpm lint
2419
- name: Run Build

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.15.0
1+
v20.19.6

netlify/functions/scheduled/refresh-stats-cache.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ export const handler: Handler = async (
2929
// Invoke the background function
3030
const functionUrl = `${process.env.URL}/.netlify/functions/refresh-stats-cache-background`
3131

32-
console.log('[refresh-stats-cache] Invoking background function:', functionUrl)
32+
console.log(
33+
'[refresh-stats-cache] Invoking background function:',
34+
functionUrl
35+
)
3336

3437
// Fire and forget - background function will run independently
3538
const response = await fetch(functionUrl, {
3639
method: 'POST',
3740
headers: {
3841
'Content-Type': 'application/json',
39-
'Authorization': `Bearer ${cronSecret}`,
42+
Authorization: `Bearer ${cronSecret}`,
4043
},
4144
body: JSON.stringify({
4245
source: 'scheduled-function',
@@ -46,10 +49,14 @@ export const handler: Handler = async (
4649

4750
if (!response.ok) {
4851
const errorText = await response.text()
49-
throw new Error(`Background function invocation failed: ${response.status} - ${errorText}`)
52+
throw new Error(
53+
`Background function invocation failed: ${response.status} - ${errorText}`
54+
)
5055
}
5156

52-
console.log('[refresh-stats-cache] Background function invoked successfully')
57+
console.log(
58+
'[refresh-stats-cache] Background function invoked successfully'
59+
)
5360

5461
return {
5562
statusCode: 202, // Accepted - processing in background

netlify/functions/scheduled/sync-github-releases.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export const handler: Handler = async (
1818
event: HandlerEvent,
1919
context: HandlerContext
2020
) => {
21-
console.log('[sync-github-releases] Triggering background GitHub release sync...')
21+
console.log(
22+
'[sync-github-releases] Triggering background GitHub release sync...'
23+
)
2224

2325
try {
2426
const cronSecret = process.env.CRON_SECRET
@@ -29,14 +31,17 @@ export const handler: Handler = async (
2931
// Invoke the background function
3032
const functionUrl = `${process.env.URL}/.netlify/functions/sync-github-releases-background`
3133

32-
console.log('[sync-github-releases] Invoking background function:', functionUrl)
34+
console.log(
35+
'[sync-github-releases] Invoking background function:',
36+
functionUrl
37+
)
3338

3439
// Fire and forget - background function will run independently
3540
const response = await fetch(functionUrl, {
3641
method: 'POST',
3742
headers: {
3843
'Content-Type': 'application/json',
39-
'Authorization': `Bearer ${cronSecret}`,
44+
Authorization: `Bearer ${cronSecret}`,
4045
},
4146
body: JSON.stringify({
4247
source: 'scheduled-function',
@@ -46,10 +51,14 @@ export const handler: Handler = async (
4651

4752
if (!response.ok) {
4853
const errorText = await response.text()
49-
throw new Error(`Background function invocation failed: ${response.status} - ${errorText}`)
54+
throw new Error(
55+
`Background function invocation failed: ${response.status} - ${errorText}`
56+
)
5057
}
5158

52-
console.log('[sync-github-releases] Background function invoked successfully')
59+
console.log(
60+
'[sync-github-releases] Background function invoked successfully'
61+
)
5362

5463
return {
5564
statusCode: 202, // Accepted - processing in background

netlify/functions/sync-github-releases-background.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ export const handler: Handler = async (
2424
event: HandlerEvent,
2525
context: HandlerContext
2626
) => {
27-
console.log('[sync-github-releases-background] Starting GitHub release sync...')
27+
console.log(
28+
'[sync-github-releases-background] Starting GitHub release sync...'
29+
)
2830

2931
// Check authentication
3032
const cronSecret = process.env.CRON_SECRET
3133
const authHeader = event.headers.authorization || event.headers.Authorization
3234

3335
if (!cronSecret) {
34-
console.error('[sync-github-releases-background] CRON_SECRET not configured')
36+
console.error(
37+
'[sync-github-releases-background] CRON_SECRET not configured'
38+
)
3539
return {
3640
statusCode: 500,
3741
body: JSON.stringify({

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dev:frontend": "pnpm run with-env vite dev",
1212
"build": "vite build",
1313
"start": "vite start",
14-
"lint": "prettier --check '**/*' --ignore-unknown && eslint --ext .ts,.tsx ./src",
14+
"lint": "eslint --ext .ts,.tsx ./src",
1515
"format": "prettier --write '**/*' --ignore-unknown",
1616
"linkAll": "node scripts/link.js",
1717
"db:generate": "drizzle-kit generate",

scripts/migrate-data.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This guide covers migrating data from Convex to PostgreSQL (Neon DB).
77
## Prerequisites
88

99
1. **Export Convex Data**
10+
1011
- Use Convex dashboard or CLI to export all tables
1112
- Export format: JSON or CSV
1213
- Tables to export:
@@ -31,15 +32,18 @@ This guide covers migrating data from Convex to PostgreSQL (Neon DB).
3132
Create a transformation script that:
3233

3334
1. **Convert Convex IDs to UUIDs**
35+
3436
- Generate new UUIDs for each record
3537
- Maintain mapping for foreign key relationships
3638

3739
2. **Transform Timestamps**
40+
3841
- Convex: milliseconds (number)
3942
- PostgreSQL: `timestamp with time zone` (Date object)
4043
- Convert: `new Date(timestamp)` for milliseconds
4144

4245
3. **Transform Arrays**
46+
4347
- Convex: stored as arrays
4448
- PostgreSQL: array columns (already compatible)
4549
- Ensure proper formatting
@@ -101,17 +105,19 @@ WHERE u.id IS NULL;
101105
### Step 4: Post-Migration Tasks
102106

103107
1. **Set up indexes** (if not created by Drizzle):
108+
104109
```sql
105110
-- GIN indexes for array columns
106-
CREATE INDEX IF NOT EXISTS feed_entries_library_ids_gin_idx
111+
CREATE INDEX IF NOT EXISTS feed_entries_library_ids_gin_idx
107112
ON feed_entries USING GIN (library_ids);
108-
CREATE INDEX IF NOT EXISTS feed_entries_tags_gin_idx
113+
CREATE INDEX IF NOT EXISTS feed_entries_tags_gin_idx
109114
ON feed_entries USING GIN (tags);
110-
115+
111116
-- Full-text search (see drizzle/migrations/README.md)
112117
```
113118

114119
2. **Verify functionality**:
120+
115121
- Test authentication flow
116122
- Test feed queries
117123
- Test admin interfaces
@@ -138,4 +144,3 @@ If migration fails:
138144
- **entryId field**: The `feed_entries` table uses `entryId` (string) as the unique identifier, not `id` (UUID). Make sure to map Convex feed entry IDs to `entryId` field.
139145
- **Metadata**: JSONB fields should be preserved as-is from Convex
140146
- **Capabilities**: Array fields should be preserved as arrays
141-

scripts/test-db-connection.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@ async function testConnection() {
3333

3434
// Test 3: Count records
3535
console.log('3. Counting records...')
36-
const userCount = await db.select({ count: sql<number>`count(*)` }).from(users)
37-
const roleCount = await db.select({ count: sql<number>`count(*)` }).from(roles)
38-
const feedCount = await db.select({ count: sql<number>`count(*)` }).from(feedEntries)
36+
const userCount = await db
37+
.select({ count: sql<number>`count(*)` })
38+
.from(users)
39+
const roleCount = await db
40+
.select({ count: sql<number>`count(*)` })
41+
.from(roles)
42+
const feedCount = await db
43+
.select({ count: sql<number>`count(*)` })
44+
.from(feedEntries)
3945

4046
console.log(`✓ Users: ${userCount[0]?.count ?? 0}`)
4147
console.log(`✓ Roles: ${roleCount[0]?.count ?? 0}`)
@@ -57,4 +63,3 @@ async function testConnection() {
5763
}
5864

5965
testConnection()
60-

src/components/FeedEntry.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export function FeedEntry({
253253
className="text-xs font-semibold text-gray-900 dark:text-gray-100 truncate hover:text-blue-600 dark:hover:text-blue-400 transition-colors"
254254
>
255255
{entry.title}
256-
</Link>
256+
</Link>
257257
</TableCell>
258258

259259
{/* Excerpt */}

0 commit comments

Comments
 (0)