summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2026-01-26 15:55:52 -0500
committerJoe Mou <dev@mou.fo>2026-01-26 17:23:43 -0500
commitfee5c6f6438316a8d407699370729ac2d0abd9d1 (patch)
treeb1f7eccd44beae5939d452bcdb741f081c5a67e2
parentd91b89f89bd7dcf3258dc5802d6a97c5e341e272 (diff)
Use Node native TypeScript elision
See https://nodejs.org/api/typescript.html#type-stripping
-rw-r--r--cgithub/.gitignore1
-rw-r--r--cgithub/package.json3
-rw-r--r--cgithub/src/index.ts6
-rw-r--r--cgithub/tsconfig.json21
4 files changed, 11 insertions, 20 deletions
diff --git a/cgithub/.gitignore b/cgithub/.gitignore
index b2636c7..3d2bc62 100644
--- a/cgithub/.gitignore
+++ b/cgithub/.gitignore
@@ -1,3 +1,2 @@
-/build/
/dist/
/node_modules/
diff --git a/cgithub/package.json b/cgithub/package.json
index 461a9bd..b3d778b 100644
--- a/cgithub/package.json
+++ b/cgithub/package.json
@@ -4,7 +4,7 @@
"description": "Lightweight GitHub alternative frontend",
"type": "module",
"scripts": {
- "dev": "concurrently 'tsc --watch --preserveWatchOutput' 'node --watch --watch-preserve-output build/index.js'",
+ "dev": "node --watch --watch-preserve-output src/index.ts",
"build": "rm -rf dist/* && esbuild --bundle --format=esm --platform=node --outdir=dist/build --sourcemap src/index.ts && cp -R static views dist/"
},
"dependencies": {
@@ -14,7 +14,6 @@
},
"devDependencies": {
"@types/node": "^22.10.2",
- "concurrently": "^9.1.2",
"esbuild": "^0.27.2",
"prettier": "^3.8.1",
"typescript": "^5.7.2"
diff --git a/cgithub/src/index.ts b/cgithub/src/index.ts
index 38d6d13..388b1e0 100644
--- a/cgithub/src/index.ts
+++ b/cgithub/src/index.ts
@@ -2,9 +2,9 @@ import { createAdaptorServer, serve } from "@hono/node-server";
import { serveStatic } from "@hono/node-server/serve-static";
import { Eta } from "eta";
import { Hono } from "hono";
-import * as path from "node:path";
-import * as url from "node:url";
-import { getGitHubBlob, getGitHubRepo, getGitHubTree } from "./scraper.js";
+import path from "node:path";
+import url from "node:url";
+import { getGitHubBlob, getGitHubRepo, getGitHubTree } from "./scraper.ts";
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
diff --git a/cgithub/tsconfig.json b/cgithub/tsconfig.json
index c2f75c1..2e9fe6a 100644
--- a/cgithub/tsconfig.json
+++ b/cgithub/tsconfig.json
@@ -1,19 +1,12 @@
{
"compilerOptions": {
- "target": "ES2024",
+ "target": "ESNext",
"module": "NodeNext",
- "moduleResolution": "NodeNext",
- "lib": ["ES2024"],
- "outDir": "./build",
- "rootDir": "./src",
+ "lib": ["ESNext"],
+ "noEmit": true,
"strict": true,
- "esModuleInterop": true,
- "skipLibCheck": true,
- "forceConsistentCasingInFileNames": true,
- "resolveJsonModule": true,
- "allowSyntheticDefaultImports": true,
- "types": ["node"]
- },
- "include": ["src/**/*"],
- "exclude": ["node_modules", "build"]
+ "erasableSyntaxOnly": true,
+ "rewriteRelativeImportExtensions": true,
+ "verbatimModuleSyntax": true
+ }
}