Skip to content

Commit 974c7f2

Browse files
authored
Merge pull request #465 from sadmann7/update-primitive
feat: add file-upload pritmive
2 parents 6a37d13 + d5c891f commit 974c7f2

Some content is hidden

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

66 files changed

+4717
-5510
lines changed

.env.example

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
# When adding additional environment variables, the schema in "/src/env.js"
1010
# should be updated accordingly.
1111

12-
# App
13-
# Use the production URL when deploying to production
14-
NEXT_PUBLIC_APP_URL="http://localhost:3000"
15-
1612
# uploadthing
1713
UPLOADTHING_TOKEN=""
1814

.eslintrc.cjs

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

.github/setup/action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Setup Workflow
2+
description: Composite action that sets up pnpm and installs dependencies
3+
runs:
4+
using: "composite"
5+
steps:
6+
- uses: actions/setup-node@v4
7+
with:
8+
node-version: 20.x
9+
10+
- name: Setup pnpm
11+
uses: pnpm/action-setup@v4
12+
with:
13+
version: 10.8.0
14+
15+
- run: pnpm install
16+
shell: bash

.github/workflows/code-check.yml

Lines changed: 32 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -6,119 +6,52 @@ on:
66
push:
77
branches: ["main"]
88

9-
jobs:
10-
lint:
11-
runs-on: ubuntu-latest
12-
name: Lint
13-
steps:
14-
- uses: actions/checkout@v4
15-
with:
16-
fetch-depth: 0
17-
18-
- name: Install Node.js
19-
uses: actions/setup-node@v4
20-
with:
21-
node-version: 20
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
2212

23-
- uses: pnpm/[email protected]
24-
name: Install pnpm
25-
id: pnpm-install
26-
with:
27-
version: 8.6.1
28-
run_install: false
29-
30-
- name: Get pnpm store directory
31-
id: pnpm-cache
32-
run: |
33-
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
34-
- uses: actions/cache@v4
35-
name: Setup pnpm cache
36-
with:
37-
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
38-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
39-
restore-keys: |
40-
${{ runner.os }}-pnpm-store-
41-
- name: Install dependencies
42-
run: pnpm install
43-
44-
- run: cp .env.example .env.local
45-
46-
- run: pnpm lint
13+
env:
14+
FORCE_COLOR: 3
4715

16+
jobs:
4817
format:
4918
runs-on: ubuntu-latest
50-
name: Format
5119
steps:
52-
- uses: actions/checkout@v4
20+
- name: Checkout repo
21+
uses: actions/checkout@v4
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
5324
with:
54-
fetch-depth: 0
25+
version: 10.8.0
26+
- uses: ./.github/setup
5527

56-
- name: Install Node.js
57-
uses: actions/setup-node@v4
58-
with:
59-
node-version: 20
28+
- name: Check formatting
29+
run: pnpm lint:fix
6030

61-
- uses: pnpm/[email protected]
62-
name: Install pnpm
63-
id: pnpm-install
64-
with:
65-
version: 8.6.1
66-
run_install: false
67-
68-
- name: Get pnpm store directory
69-
id: pnpm-cache
70-
run: |
71-
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
72-
73-
- uses: actions/cache@v4
74-
name: Setup pnpm cache
31+
lint:
32+
runs-on: ubuntu-latest
33+
name: Lint
34+
steps:
35+
- name: Checkout repo
36+
uses: actions/checkout@v4
37+
- name: Setup pnpm
38+
uses: pnpm/action-setup@v4
7539
with:
76-
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
77-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
78-
restore-keys: |
79-
${{ runner.os }}-pnpm-store-
80-
81-
- name: Install dependencies
82-
run: pnpm install
83-
84-
- run: cp .env.example .env.local
40+
version: 10.8.0
41+
- uses: ./.github/setup
8542

86-
- run: pnpm format:check
43+
- run: pnpm lint
8744

88-
tsc:
45+
typecheck:
8946
runs-on: ubuntu-latest
9047
name: Typecheck
9148
steps:
92-
- uses: actions/checkout@v4
93-
with:
94-
fetch-depth: 0
95-
96-
- name: Install Node.js
97-
uses: actions/setup-node@v4
98-
with:
99-
node-version: 20
100-
101-
- uses: pnpm/[email protected]
102-
name: Install pnpm
103-
id: pnpm-install
104-
with:
105-
version: 8.6.1
106-
run_install: false
107-
108-
- name: Get pnpm store directory
109-
id: pnpm-cache
110-
run: |
111-
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
112-
- uses: actions/cache@v4
113-
name: Setup pnpm cache
49+
- name: Checkout repo
50+
uses: actions/checkout@v4
51+
- name: Setup pnpm
52+
uses: pnpm/action-setup@v4
11453
with:
115-
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
116-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
117-
restore-keys: |
118-
${{ runner.os }}-pnpm-store-
119-
- name: Install dependencies
120-
run: pnpm install
121-
122-
- run: cp .env.example .env.local
54+
version: 10.8.0
55+
- uses: ./.github/setup
12356

12457
- run: pnpm typecheck

biome.json

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"formatter": {
7+
"enabled": true,
8+
"indentWidth": 2,
9+
"indentStyle": "space",
10+
"ignore": [
11+
"**/node_modules",
12+
"**/dist",
13+
"**/build",
14+
"**/public",
15+
"**/.turbo",
16+
"**/.next"
17+
]
18+
},
19+
"linter": {
20+
"enabled": true,
21+
"rules": {
22+
"recommended": true,
23+
"a11y": {
24+
"noSvgWithoutTitle": "off",
25+
"useButtonType": "off",
26+
"useAltText": "off",
27+
"useKeyWithClickEvents": "off",
28+
"useSemanticElements": "off",
29+
"noLabelWithoutControl": "off"
30+
},
31+
"correctness": {
32+
"noUnusedVariables": "warn",
33+
"useExhaustiveDependencies": "warn"
34+
},
35+
"complexity": {
36+
"noBannedTypes": "off"
37+
},
38+
"style": {
39+
"useImportType": "warn"
40+
},
41+
"security": {
42+
"noDangerouslySetInnerHtml": "off"
43+
},
44+
"suspicious": {
45+
"noAssignInExpressions": "off",
46+
"noArrayIndexKey": "off"
47+
},
48+
"nursery": {
49+
"useSortedClasses": {
50+
"level": "warn",
51+
"options": {
52+
"attributes": ["classList"],
53+
"functions": ["clsx", "cva", "tw"]
54+
}
55+
}
56+
}
57+
},
58+
"ignore": [
59+
"**/node_modules",
60+
"**/dist",
61+
"**/build",
62+
"**/public",
63+
"**/.turbo",
64+
"**/.next"
65+
]
66+
},
67+
"overrides": [
68+
{
69+
"include": ["**/*.test.ts"]
70+
}
71+
],
72+
"vcs": {
73+
"enabled": true,
74+
"clientKind": "git",
75+
"useIgnoreFile": true
76+
},
77+
"files": {
78+
"ignore": [
79+
"**/node_modules",
80+
"**/dist",
81+
"**/build",
82+
"**/public",
83+
"**/.turbo",
84+
"**/.next"
85+
]
86+
}
87+
}

next.config.js renamed to next.config.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
import type { NextConfig } from "next";
2+
13
/**
24
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
35
* for Docker builds.
46
*/
7+
// Import environment validation synchronously
8+
import "./src/env.js";
59

6-
/** @type {import("next").NextConfig} */
7-
const config = {
10+
const nextConfig: NextConfig = {
811
images: {
912
remotePatterns: [
1013
{
@@ -17,6 +20,6 @@ const config = {
1720
// Already doing linting and typechecking as separate tasks in CI
1821
eslint: { ignoreDuringBuilds: true },
1922
typescript: { ignoreBuildErrors: true },
20-
}
23+
};
2124

22-
export default config
25+
export default nextConfig;

0 commit comments

Comments
 (0)