Skip to content

Commit ba9c293

Browse files
committed
Add tsc to build pipe
1 parent de710c3 commit ba9c293

9 files changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ jobs:
7575
with:
7676
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
7777

78+
- name: Install and typecheck
79+
run: |
80+
npm ci
81+
npm run typecheck
82+
7883
- name: Build and push
7984
uses: docker/build-push-action@v6
8085
with:

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"dev:server": "astro dev --host 0.0.0.0 & tsx --watch src/api/server.ts & wait",
99
"dev:api": "tsx --watch src/api/server.ts",
1010
"build": "astro build",
11+
"typecheck": "tsc --noEmit",
1112
"preview": "astro preview",
1213
"start": "node ./dist/server/entry.mjs",
1314
"db:generate": "drizzle-kit generate",

src/api/plugins/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async function authPlugin(app: FastifyInstance) {
9292

9393
// All writes (POST/PATCH/PUT/DELETE) require auth, except public paths
9494
if (!request.accountId) {
95-
const path = request.url.split("?")[0];
95+
const path = request.url.split("?")[0] ?? "";
9696
if (publicPaths.has(path)) return;
9797
return reply.status(401).send({ error: "Authentication required", statusCode: 401 });
9898
}

src/api/routes/files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export async function fileRoutes(app: FastifyInstance) {
168168

169169
// Redirect to CDN
170170
const cdnUrl = `https://assets.underlay.org/files/${cleanHash.slice(0, 2)}/${cleanHash.slice(2, 4)}/${cleanHash}`;
171-
return reply.redirect(301, cdnUrl);
171+
return reply.redirect(cdnUrl);
172172
});
173173

174174
// Upload file

src/components/CollectionExplorer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function CollectionExplorer() {
1111
const [query, setQuery] = useState("");
1212
const [collections, setCollections] = useState<Collection[]>([]);
1313
const [loading, setLoading] = useState(true);
14-
const timerRef = useRef<ReturnType<typeof setTimeout>>();
14+
const timerRef = useRef<ReturnType<typeof setTimeout>>(undefined);
1515

1616
async function load(q = "") {
1717
const params = new URLSearchParams();

src/components/SchemaBrowser.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function SchemaBrowser() {
1313
const [filterType, setFilterType] = useState<"q" | "label" | "slug">("q");
1414
const [schemas, setSchemas] = useState<SchemaResult[]>([]);
1515
const [loading, setLoading] = useState(true);
16-
const timerRef = useRef<ReturnType<typeof setTimeout>>();
16+
const timerRef = useRef<ReturnType<typeof setTimeout>>(undefined);
1717

1818
async function load(q = "", type = filterType) {
1919
setLoading(true);

src/components/UserMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface UserMenuProps {
1313
export default function UserMenu({ slug, orgs = [] }: UserMenuProps) {
1414
const [open, setOpen] = useState(false);
1515
const rootRef = useRef<HTMLDivElement>(null);
16-
const hideTimeout = useRef<ReturnType<typeof setTimeout>>();
16+
const hideTimeout = useRef<ReturnType<typeof setTimeout>>(undefined);
1717

1818
function show() {
1919
clearTimeout(hideTimeout.current);

src/lib/s3.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type { Readable } from "node:stream";
1313
// For MinIO (dev): S3_ENDPOINT=http://minio:9000
1414
const s3 = new S3Client({
1515
region: process.env.S3_REGION ?? "auto",
16-
endpoint: process.env.S3_ENDPOINT,
16+
...(process.env.S3_ENDPOINT && { endpoint: process.env.S3_ENDPOINT }),
1717
forcePathStyle: true,
1818
credentials: {
1919
accessKeyId: process.env.S3_ACCESS_KEY ?? "",

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"compilerOptions": {
3+
"ignoreDeprecations": "6.0",
34
"target": "ES2022",
45
"module": "ES2022",
56
"moduleResolution": "bundler",

0 commit comments

Comments
 (0)