Skip to content

Commit 85ba44b

Browse files
committed
feat: migrate project to TypeScript
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
1 parent f044975 commit 85ba44b

15 files changed

Lines changed: 693 additions & 285 deletions

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ jobs:
4949
name=$(node -p "require('./package.json').name")
5050
version=$(node -p "require('./package.json').version")
5151
pnpm add --global pkg
52-
pkg --out-path build .
52+
pnpm build
53+
pkg --out-path build dist/index.js
54+
5355
gh release create "v$version" \
5456
--title "Release v$version" \
5557
--notes "Release v$version" \

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ coverage
77
.nyc_output
88

99
# Build
10-
build
10+
build
11+
dist
12+
*.tsbuildinfo
13+
14+
# Test-generated certificate directories
15+
test/custom-folder/
16+
test/custom\ folder/

.oxfmtrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"$schema": "./node_modules/oxfmt/configuration_schema.json",
33
"semi": false,
44
"arrowParens": "avoid",
5-
"singleQuote": false
5+
"singleQuote": false,
6+
"sortImports": true
67
}

index.js

Lines changed: 0 additions & 126 deletions
This file was deleted.

oxlint.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"rules": {
4+
"eslint/no-unused-vars": [
5+
"error",
6+
{
7+
"args": "none",
8+
"caughtErrors": "none",
9+
"fix": {
10+
"imports": "fix"
11+
}
12+
}
13+
]
14+
},
15+
"plugins": ["eslint"]
16+
}

package.json

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,26 @@
2020
"url": "git+https://github.com/daquinoaldo/https-localhost.git"
2121
},
2222
"bin": {
23-
"serve": "index.js"
23+
"serve": "src/index.ts"
24+
},
25+
"files": [
26+
"dist"
27+
],
28+
"type": "module",
29+
"main": "src/index.ts",
30+
"types": "src/index.ts",
31+
"publishConfig": {
32+
"main": "dist/cjs/index.js",
33+
"module": "dist/esm/index.js",
34+
"types": "dist/esm/index.d.ts"
2435
},
25-
"main": "index.js",
2636
"scripts": {
27-
"lint": "oxfmt && oxlint --fix",
28-
"test": "node --test",
29-
"preuninstall": "node certs.js -u",
30-
"start": "node index.js"
37+
"build": "rm -rf dist && tsc --project tsconfig.build.esm.json && tsc --project tsconfig.build.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
38+
"lint": "oxfmt && oxlint --fix && tsc --noEmit",
39+
"test": "node --test test/*.ts",
40+
"prepack": "pnpm build",
41+
"preuninstall": "node dist/esm/certs.js -u",
42+
"start": "node src/index.ts"
3143
},
3244
"dependencies": {
3345
"appdata-path": "^1.0.0",
@@ -37,8 +49,14 @@
3749
"uglify-js": "^3.19.3"
3850
},
3951
"devDependencies": {
52+
"@types/compression": "^1.8.1",
53+
"@types/cors": "^2.8.19",
54+
"@types/express": "^5.0.6",
55+
"@types/node": "^26.4.1",
56+
"@types/uglify-js": "^3.17.5",
4057
"oxfmt": "^0.66.0",
41-
"oxlint": "^1.81.0"
58+
"oxlint": "^1.81.0",
59+
"typescript": "^7.0.2"
4260
},
4361
"devEngines": {
4462
"packageManager": {

0 commit comments

Comments
 (0)