chore: add TS build + oxlint scaffolding

This commit is contained in:
Vignesh Natarajan
2026-01-21 21:03:47 -08:00
parent 0020655a8c
commit d748672293
4 changed files with 66 additions and 7 deletions
+12
View File
@@ -0,0 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/oxc-project/oxlint/main/npm/oxlint/schema.json",
"env": {
"node": true,
"es2022": true
},
"rules": {
"eslint/no-unused-vars": "error",
"eslint/no-undef": "error",
"typescript/no-explicit-any": "off"
}
}
+21 -2
View File
@@ -1,4 +1,23 @@
#!/usr/bin/env node
import { runCli } from '../src/cli.js';
await runCli(process.argv.slice(2));
import { existsSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
async function load() {
const distEntry = join(__dirname, "../dist/src/cli.js");
if (existsSync(distEntry)) {
return import(distEntry);
}
return import(join(__dirname, "../src/cli.js"));
}
const mod = await load();
if (typeof mod.runCli !== "function") {
throw new Error("lobster CLI entrypoint missing runCli()");
}
await mod.runCli(process.argv.slice(2));
+15 -5
View File
@@ -7,13 +7,23 @@
"lobster": "./bin/lobster.js"
},
"exports": {
".": "./src/sdk/index.js",
"./sdk": "./src/sdk/index.js",
"./recipes/github": "./src/recipes/github/index.js"
".": "./dist/src/sdk/index.js",
"./sdk": "./dist/src/sdk/index.js",
"./recipes/github": "./dist/src/recipes/github/index.js"
},
"main": "./src/sdk/index.js",
"main": "./dist/src/sdk/index.js",
"scripts": {
"test": "node --test"
"clean": "rm -rf dist",
"build": "pnpm clean && tsc -p tsconfig.json",
"typecheck": "tsc -p tsconfig.json --noEmit",
"lint": "oxlint --tsconfig tsconfig.json src test",
"fmt": "oxlint --tsconfig tsconfig.json --fix src test",
"test": "pnpm build && node --test dist/test"
},
"devDependencies": {
"@types/node": "^22.0.0",
"oxlint": "^0.15.0",
"typescript": "^5.7.0"
},
"engines": {
"node": ">=20"
+18
View File
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"lib": ["ES2022"],
"types": ["node"],
"rootDir": ".",
"outDir": "dist",
"declaration": false,
"sourceMap": true,
"strict": false,
"skipLibCheck": true,
"noEmitOnError": true
},
"include": ["src/**/*.ts", "test/**/*.ts"],
"exclude": ["dist", "node_modules"]
}