Skip to content

Commit

Permalink
Merge pull request #2 from wydengyre/nodeless-ts-config
Browse files Browse the repository at this point in the history
nodeless-ts-config
  • Loading branch information
wydengyre authored Jan 26, 2024
2 parents c68964e + 6284b6e commit fe67f46
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 21 deletions.
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
},
"files": {
"include": ["cf/**/*.ts", "cf/**/*.json","lib/**/*.ts", "lib/**/*.json", "tools/*.ts"],
"include": ["cf/**/*.ts", "cf/**/*.json","lib/**/*.ts", "lib/**/*.json", "tools/**/*.ts"],
"ignore": ["cf/.wrangler"]
}
}
3 changes: 2 additions & 1 deletion cf/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"compilerOptions": {
"types": ["@cloudflare/workers-types"]
},
"include": ["*.ts", "../lib/declarations.d.ts"]
"include": ["*.ts", "../lib/declarations.d.ts"],
"exclude": ["*.test.ts"]
}
9 changes: 9 additions & 0 deletions cf/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.json",
"compilerOptions": {
"types": ["node"]
},
"include": ["*.test.ts", "../lib/declarations.d.ts"],
"exclude": []
}
2 changes: 1 addition & 1 deletion cf/worker.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { strict as assert } from "node:assert";
import { readFile } from "node:fs/promises";
import { Server, createServer } from "node:http";
import path from "node:path";
import * as path from "node:path";
import test, { after, before } from "node:test";
import { fileURLToPath } from "node:url";
import { getPodcastFromFeed } from "@podverse/podcast-feed-parser";
Expand Down
2 changes: 1 addition & 1 deletion lib/feed.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { strict as assert } from "assert";
import { strict as assert } from "node:assert";
import test from "node:test";
import { error, json } from "itty-router";
import {
Expand Down
3 changes: 1 addition & 2 deletions lib/handler.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { strict as assert } from "node:assert";
import { readFileSync } from "node:fs";
import { readFile } from "node:fs/promises";
import path from "node:path";
import * as path from "node:path";
import test, { after, before } from "node:test";
import { fileURLToPath } from "node:url";
import { getPodcastFromFeed } from "@podverse/podcast-feed-parser";
import { error, json } from "itty-router";
import { mkFetchHandler } from "./handler.js";
import feedJson from "./test/lastoriaingiallo.json" with { type: "json" };
Expand Down
2 changes: 1 addition & 1 deletion lib/media.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { strict as assert } from "assert";
import { strict as assert } from "node:assert";
import test from "node:test";
import { Fetcher } from "./media.js";

Expand Down
13 changes: 10 additions & 3 deletions lib/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@tsconfig/node21/tsconfig.json",
"compilerOptions": {
"lib": ["ES2022", "dom"],
"module": "nodenext",
"target": "es2022",

"strict": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"noEmit": true
"noEmit": true,
"types": []
},
"include": ["*.ts"]
"include": ["*.ts"],
"exclude": ["*.test.ts"]
}
9 changes: 9 additions & 0 deletions lib/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.json",
"compilerOptions": {
"types": ["node"]
},
"include": ["*.test.ts", "declarations.d.ts"],
"exclude": []
}
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
"test-cf": "tsx --tsconfig ./cf/tsconfig.json --env-file=cf/.dev.vars --test 'cf/**/*.test.ts'",
"test-lib": "tsx --tsconfig ./lib/tsconfig.json --test 'lib/**/*.test.ts'",
"typecheck": "npm run typecheck-lib && npm run typecheck-cf && npm run typecheck-tools",
"typecheck-cf": "tsc --project cf/tsconfig.json",
"typecheck-lib": "tsc --project lib/tsconfig.json",
"typecheck-tools": "tsc --project tools/tsconfig.json"
"typecheck-cf": "npm run typecheck-cf-prod && npm run typecheck-cf-test",
"typecheck-cf-prod": "tsc --project cf/tsconfig.json",
"typecheck-cf-test": "tsc --project cf/tsconfig.test.json",
"typecheck-lib": "npm run typecheck-lib-prod && npm run typecheck-lib-test",
"typecheck-lib-prod": "tsc --project lib/tsconfig.json",
"typecheck-lib-test": "tsc --project lib/tsconfig.test.json",
"typecheck-tools": "tsc --project tools/tsconfig.json"
},
"author": "",
"license": "ISC",
Expand All @@ -29,6 +33,7 @@
"@cloudflare/workers-types": "^4.20240117.0",
"@podverse/podcast-feed-parser": "^1.1.1",
"@tsconfig/node21": "^21.0.1",
"@types/node": "^20.11.6",
"@whatwg-node/server": "^0.9.23",
"esbuild": "0.19.12",
"esbuild-plugin-polyfill-node": "0.3.0",
Expand Down
6 changes: 1 addition & 5 deletions tools/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@tsconfig/node21/tsconfig.json",
"compilerOptions": {
"module": "nodenext",
"resolveJsonModule": true,
"noEmit": true
},
"compilerOptions": { "noEmit": true },
"include": ["*.ts"]
}

0 comments on commit fe67f46

Please sign in to comment.