From d0dccc7a910a579d8c172c3d5a5a02ea3abd964d Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Thu, 22 Jan 2026 13:27:36 -0500 Subject: Simple web server for viewing trees --- cgithub/tsconfig.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 cgithub/tsconfig.json (limited to 'cgithub/tsconfig.json') diff --git a/cgithub/tsconfig.json b/cgithub/tsconfig.json new file mode 100644 index 0000000..c2f75c1 --- /dev/null +++ b/cgithub/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES2024", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2024"], + "outDir": "./build", + "rootDir": "./src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "types": ["node"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "build"] +} -- cgit v1.3.1 From fee5c6f6438316a8d407699370729ac2d0abd9d1 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Mon, 26 Jan 2026 15:55:52 -0500 Subject: Use Node native TypeScript elision See https://nodejs.org/api/typescript.html#type-stripping --- cgithub/.gitignore | 1 - cgithub/package.json | 3 +-- cgithub/src/index.ts | 6 +++--- cgithub/tsconfig.json | 21 +++++++-------------- 4 files changed, 11 insertions(+), 20 deletions(-) (limited to 'cgithub/tsconfig.json') 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 + } } -- cgit v1.3.1