diff --git a/package.json b/package.json index e9644f76..d1cb0952 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,49 @@ { "name": "urllib", "version": "4.9.0", - "publishConfig": { - "tag": "latest" - }, "description": "Help in opening URLs (mostly HTTP) in a complex world — basic and digest authentication, redirections, timeout and more. Base undici API.", "keywords": [ - "urllib", - "http", - "urlopen", "curl", - "wget", - "request", + "fetch", + "http", "https", + "request", "undici", - "fetch" + "urllib", + "urlopen", + "wget" ], - "author": "fengmk2 (https://github.com/fengmk2)", "homepage": "https://github.com/node-modules/urllib", + "license": "MIT", + "author": "fengmk2 (https://github.com/fengmk2)", "repository": { "type": "git", "url": "git://github.com/node-modules/urllib.git" }, + "files": [ + "dist", + "src" + ], + "type": "module", + "main": "./dist/commonjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/commonjs/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "tag": "latest" + }, "scripts": { "lint": "oxlint src test --type-aware --type-check", "fmt": "oxfmt", @@ -64,8 +86,6 @@ "@codspeed/vitest-plugin": "^5.0.1", "@eggjs/oxlint-config": "^1.0.0", "@eggjs/tsconfig": "^2.0.0", - "@tsconfig/node18": "^18.2.6", - "@tsconfig/strictest": "^2.0.8", "@types/busboy": "^1.5.4", "@types/mime-types": "^2.1.4", "@types/node": "^22.19.3", @@ -81,7 +101,7 @@ "husky": "^9.1.7", "iconv-lite": "^0.6.3", "lint-staged": "^16.2.7", - "oxfmt": "^0.17.0", + "oxfmt": "^0.20.0", "oxlint": "^1.35.0", "oxlint-tsgolint": "^0.10.0", "proxy": "^1.0.2", @@ -93,42 +113,20 @@ "typescript": "^5.9.3", "vitest": "^3.2.4" }, - "engines": { - "node": ">= 18.19.0" + "lint-staged": { + "*": [ + "npm run lint -- --fix", + "oxfmt" + ] }, - "license": "MIT", - "type": "module", "tshy": { "exports": { ".": "./src/index.ts", "./package.json": "./package.json" } }, - "exports": { - ".": { - "import": { - "types": "./dist/esm/index.d.ts", - "default": "./dist/esm/index.js" - }, - "require": { - "types": "./dist/commonjs/index.d.ts", - "default": "./dist/commonjs/index.js" - } - }, - "./package.json": "./package.json" + "engines": { + "node": ">= 18.19.0" }, - "files": [ - "dist", - "src" - ], - "types": "./dist/commonjs/index.d.ts", - "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", - "packageManager": "pnpm@10.26.2", - "lint-staged": { - "*": [ - "npm run lint -- --fix", - "oxfmt" - ] - } + "packageManager": "pnpm@10.26.2" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f82e29b3..d105dd28 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,12 +42,6 @@ importers: '@eggjs/tsconfig': specifier: ^2.0.0 version: 2.0.0 - '@tsconfig/node18': - specifier: ^18.2.6 - version: 18.2.6 - '@tsconfig/strictest': - specifier: ^2.0.8 - version: 2.0.8 '@types/busboy': specifier: ^1.5.4 version: 1.5.4 @@ -94,8 +88,8 @@ importers: specifier: ^16.2.7 version: 16.2.7 oxfmt: - specifier: ^0.17.0 - version: 0.17.0 + specifier: ^0.20.0 + version: 0.20.0 oxlint: specifier: ^1.35.0 version: 1.35.0(oxlint-tsgolint@0.10.0) @@ -381,43 +375,47 @@ packages: '@loaderkit/resolve@1.0.4': resolution: {integrity: sha512-rJzYKVcV4dxJv+vW6jlvagF8zvGxHJ2+HTr1e2qOejfmGhAApgJHl8Aog4mMszxceTRiKTTbnpgmTO1bEZHV/A==} - '@oxfmt/darwin-arm64@0.17.0': - resolution: {integrity: sha512-OMv0tOb+xiwSZKjYbM6TwMSP5QwFJlBGQmEsk98QJ30sHhdyC//0UvGKuR0KZuzZW4E0+k0rHDmos1Z5DmBEkA==} + '@oxfmt/darwin-arm64@0.20.0': + resolution: {integrity: sha512-bjR5dqvrd9gxKYfYR0ljUu3/T3+TuDVWcwA7d+tsfmx9lqidlw3zhgBTblnjF1mrd1zkPMoc5zzq86GeSEt1cA==} cpu: [arm64] os: [darwin] - '@oxfmt/darwin-x64@0.17.0': - resolution: {integrity: sha512-trzidyzryKIdL/cLCYU9IwprgJegVBUrz1rqzOMe5is+qdgH/RxTCvhYUNFzxRHpil3g4QUYd2Ja831tc5Nehg==} + '@oxfmt/darwin-x64@0.20.0': + resolution: {integrity: sha512-esUDes8FlJX3IY4TVjFLgZrnZlIIyPDlhkCaHgGR3+z2eHFZOvQu68kTSpZLCEJmGXdSpU5rlveycQ6n8tk9ew==} cpu: [x64] os: [darwin] - '@oxfmt/linux-arm64-gnu@0.17.0': - resolution: {integrity: sha512-KlwzidgvHznbUaaglZT1goTS30osTV553pfbKve9B1PyTDkluNDfm/polOaf3SVLN7wL/NNLFZRMupvJ1eJXAw==} + '@oxfmt/linux-arm64-gnu@0.20.0': + resolution: {integrity: sha512-irE0RO9B0R6ziQE6kUVZtZ6IuTdRyuumn1cPWhDfpa0XUa5sE0ly8pjVsvJbj/J9qerVtidU05txeXBB5CirQg==} cpu: [arm64] os: [linux] + libc: [glibc] - '@oxfmt/linux-arm64-musl@0.17.0': - resolution: {integrity: sha512-+tbYJTocF4BNLaQQbc/xrBWTNgiU6zmYeF4NvRDxuuQjDOnmUZPn0EED3PZBRJyg4/YllhplHDo8x+gfcb9G3A==} + '@oxfmt/linux-arm64-musl@0.20.0': + resolution: {integrity: sha512-eXPBLwYJm26DCmwMwhelEwQMRwuGNaYhYZOhd+CYYsmVoF+h6L6dtjwj0Ovuu0Gqh18EL8vfsaoUvb+jr3vEBg==} cpu: [arm64] os: [linux] + libc: [musl] - '@oxfmt/linux-x64-gnu@0.17.0': - resolution: {integrity: sha512-pEmv7zJIw2HpnA4Tn1xrfJNGi2wOH2+usT14Pkvf/c5DdB+pOir6k/5jzfe70+V3nEtmtV9Lm+spndN/y6+X7A==} + '@oxfmt/linux-x64-gnu@0.20.0': + resolution: {integrity: sha512-dTPW38Hjgb7LoD2mNgyQGBaJ1hu5YgPrxImhl5Eb04eiws+ETCM0wrb2TWGduA+Nv3rHKn3vZEkMTEjklZXgRw==} cpu: [x64] os: [linux] + libc: [glibc] - '@oxfmt/linux-x64-musl@0.17.0': - resolution: {integrity: sha512-+DrFSCZWyFdtEAWR5xIBTV8GX0RA9iB+y7ZlJPRAXrNG8TdBY9vc7/MIGolIgrkMPK4mGMn07YG/qEyPY+iKaw==} + '@oxfmt/linux-x64-musl@0.20.0': + resolution: {integrity: sha512-b4duw9JGDK/kZoqrPNU9tBOOZQdUW8KJPZ7gW7z54X1eGSqCJ1PT0XLNmZ7SOA1BzQwQ0a3qmQWfFVOsH3a5bw==} cpu: [x64] os: [linux] + libc: [musl] - '@oxfmt/win32-arm64@0.17.0': - resolution: {integrity: sha512-FoUZRR7mVpTYIaY/qz2BYwzqMnL+HsUxmMWAIy6nl29UEkDgxNygULJ4rIGY4/Axne41fhtldLrSGBOpwNm3jA==} + '@oxfmt/win32-arm64@0.20.0': + resolution: {integrity: sha512-XAzvBhw4K+Fe16dBaFgYAdob9WaM8RYEXl0ibbm5NlNaQEq+5bH9xwc0oaYlHFnLfcgXWmn9ceTAYqNlONQRNA==} cpu: [arm64] os: [win32] - '@oxfmt/win32-x64@0.17.0': - resolution: {integrity: sha512-fBIcUpHmCwf3leWlo0cYwLb9Pd2mzxQlZYJX9dD9nylPvsxOnsy9fmsaflpj34O0JbQJN3Y0SRkoaCcHHlxFww==} + '@oxfmt/win32-x64@0.20.0': + resolution: {integrity: sha512-fkJqHbJaoOMRmrjHSljyb4/7BgXO3xPLBsJSFGtm3mpfW0HHFbAKvd4/6njhqJz9KY+b3RWP1WssjFshcqQQ4w==} cpu: [x64] os: [win32] @@ -465,21 +463,25 @@ packages: resolution: {integrity: sha512-T1lc0UaYbTxZyqVpLfC7eipbauNG8pBpkaZEW4JGz8Y68rxTH7d9s+CF0zxUxNr5RCtcmT669RLVjQT7VrKVLg==} cpu: [arm64] os: [linux] + libc: [glibc] '@oxlint/linux-arm64-musl@1.35.0': resolution: {integrity: sha512-7Wv5Pke9kwWKFycUziSHsmi3EM0389TLzraB0KE/MArrKxx30ycwfJ5PYoMj9ERoW+Ybs0txdaOF/xJy/XyYkg==} cpu: [arm64] os: [linux] + libc: [musl] '@oxlint/linux-x64-gnu@1.35.0': resolution: {integrity: sha512-HDMPOzyVVy+rQl3H7UOq8oGHt7m1yaiWCanlhAu4jciK8dvXeO9OG/OQd74lD/h05IcJh93pCLEJ3wWOG8hTiQ==} cpu: [x64] os: [linux] + libc: [glibc] '@oxlint/linux-x64-musl@1.35.0': resolution: {integrity: sha512-kAPBBsUOM3HQQ6n3nnZauvFR9EoXqCSoj4O3OSXXarzsRTiItNrHabVUwxeswZEc+xMzQNR0FHEWg/d4QAAWLw==} cpu: [x64] os: [linux] + libc: [musl] '@oxlint/win32-arm64@1.35.0': resolution: {integrity: sha512-qrpBkkOASS0WT8ra9xmBRXOEliN6D/MV9JhI/68lFHrtLhfFuRwg4AjzjxrCWrQCnQ0WkvAVpJzu73F4ICLYZw==} @@ -529,56 +531,67 @@ packages: resolution: {integrity: sha512-EHMUcDwhtdRGlXZsGSIuXSYwD5kOT9NVnx9sqzYiwAc91wfYOE1g1djOEDseZJKKqtHAHGwnGPQu3kytmfaXLQ==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.54.0': resolution: {integrity: sha512-+pBrqEjaakN2ySv5RVrj/qLytYhPKEUwk+e3SFU5jTLHIcAtqh2rLrd/OkbNuHJpsBgxsD8ccJt5ga/SeG0JmA==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.54.0': resolution: {integrity: sha512-NSqc7rE9wuUaRBsBp5ckQ5CVz5aIRKCwsoa6WMF7G01sX3/qHUw/z4pv+D+ahL1EIKy6Enpcnz1RY8pf7bjwng==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.54.0': resolution: {integrity: sha512-gr5vDbg3Bakga5kbdpqx81m2n9IX8M6gIMlQQIXiLTNeQW6CucvuInJ91EuCJ/JYvc+rcLLsDFcfAD1K7fMofg==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-loong64-gnu@4.54.0': resolution: {integrity: sha512-gsrtB1NA3ZYj2vq0Rzkylo9ylCtW/PhpLEivlgWe0bpgtX5+9j9EZa0wtZiCjgu6zmSeZWyI/e2YRX1URozpIw==} cpu: [loong64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-ppc64-gnu@4.54.0': resolution: {integrity: sha512-y3qNOfTBStmFNq+t4s7Tmc9hW2ENtPg8FeUD/VShI7rKxNW7O4fFeaYbMsd3tpFlIg1Q8IapFgy7Q9i2BqeBvA==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.54.0': resolution: {integrity: sha512-89sepv7h2lIVPsFma8iwmccN7Yjjtgz0Rj/Ou6fEqg3HDhpCa+Et+YSufy27i6b0Wav69Qv4WBNl3Rs6pwhebQ==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.54.0': resolution: {integrity: sha512-ZcU77ieh0M2Q8Ur7D5X7KvK+UxbXeDHwiOt/CPSBTI1fBmeDMivW0dPkdqkT4rOgDjrDDBUed9x4EgraIKoR2A==} cpu: [riscv64] os: [linux] + libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.54.0': resolution: {integrity: sha512-2AdWy5RdDF5+4YfG/YesGDDtbyJlC9LHmL6rZw6FurBJ5n4vFGupsOBGfwMRjBYH7qRQowT8D/U4LoSvVwOhSQ==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.54.0': resolution: {integrity: sha512-WGt5J8Ij/rvyqpFexxk3ffKqqbLf9AqrTBbWDk7ApGUzaIs6V+s2s84kAxklFwmMF/vBNGrVdYgbblCOFFezMQ==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.54.0': resolution: {integrity: sha512-JzQmb38ATzHjxlPHuTH6tE7ojnMKM2kYNzt44LO/jJi8BpceEC8QuXYA908n8r3CNuG/B3BV8VR3Hi1rYtmPiw==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-openharmony-arm64@4.54.0': resolution: {integrity: sha512-huT3fd0iC7jigGh7n3q/+lfPcXxBi+om/Rs3yiFxjvSxbSB6aohDFXbWvlspaqjeOh+hx7DDHS+5Es5qRkWkZg==} @@ -609,12 +622,6 @@ packages: resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} engines: {node: '>=10'} - '@tsconfig/node18@18.2.6': - resolution: {integrity: sha512-eAWQzAjPj18tKnDzmWstz4OyWewLUNBm9tdoN9LayzoboRktYx3Enk1ZXPmThj55L7c4VWYq/Bzq0A51znZfhw==} - - '@tsconfig/strictest@2.0.8': - resolution: {integrity: sha512-XnQ7vNz5HRN0r88GYf1J9JJjqtZPiHt2woGJOo2dYqyHGGcd6OLGqSlBB6p1j9mpzja6Oe5BoPqWmeDx6X9rLw==} - '@types/busboy@1.5.4': resolution: {integrity: sha512-kG7WrUuAKK0NoyxfQHsVE6j1m01s6kMma64E+OZenQABMQyTJop1DumUWcLwAQ2JzpefU7PDYoRDKl8uZosFjw==} @@ -1475,8 +1482,8 @@ packages: resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} engines: {node: '>= 0.4'} - oxfmt@0.17.0: - resolution: {integrity: sha512-12Rmq2ub61rUZ3Pqnsvmo99rRQ6hQJwQsjnFnbvXYLMrlIsWT6SFVsrjAkBBrkXXSHv8ePIpKQ0nZph5KDrOqw==} + oxfmt@0.20.0: + resolution: {integrity: sha512-+7f8eV8iaK3tENN/FUVxZM1g78HjPehybN8/+/dvEA1O893Dcvk6O7/Q1wTQOHMD7wvdwWdujKl+Uo8QMiKDrQ==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true @@ -1815,6 +1822,10 @@ packages: resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} engines: {node: ^18.0.0 || >=20.0.0} + tinypool@2.0.0: + resolution: {integrity: sha512-/RX9RzeH2xU5ADE7n2Ykvmi9ED3FBGPAjw9u3zucrNNaEBIO0HPSYgL0NT7+3p147ojeSdaVu08F6hjpv31HJg==} + engines: {node: ^20.0.0 || >=22.0.0} + tinyrainbow@2.0.0: resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} engines: {node: '>=14.0.0'} @@ -2218,28 +2229,28 @@ snapshots: dependencies: '@braidai/lang': 1.1.2 - '@oxfmt/darwin-arm64@0.17.0': + '@oxfmt/darwin-arm64@0.20.0': optional: true - '@oxfmt/darwin-x64@0.17.0': + '@oxfmt/darwin-x64@0.20.0': optional: true - '@oxfmt/linux-arm64-gnu@0.17.0': + '@oxfmt/linux-arm64-gnu@0.20.0': optional: true - '@oxfmt/linux-arm64-musl@0.17.0': + '@oxfmt/linux-arm64-musl@0.20.0': optional: true - '@oxfmt/linux-x64-gnu@0.17.0': + '@oxfmt/linux-x64-gnu@0.20.0': optional: true - '@oxfmt/linux-x64-musl@0.17.0': + '@oxfmt/linux-x64-musl@0.20.0': optional: true - '@oxfmt/win32-arm64@0.17.0': + '@oxfmt/win32-arm64@0.20.0': optional: true - '@oxfmt/win32-x64@0.17.0': + '@oxfmt/win32-x64@0.20.0': optional: true '@oxlint-tsgolint/darwin-arm64@0.10.0': @@ -2355,10 +2366,6 @@ snapshots: '@sindresorhus/is@4.6.0': {} - '@tsconfig/node18@18.2.6': {} - - '@tsconfig/strictest@2.0.8': {} - '@types/busboy@1.5.4': dependencies: '@types/node': 22.19.3 @@ -3322,16 +3329,18 @@ snapshots: object-keys: 1.1.1 safe-push-apply: 1.0.0 - oxfmt@0.17.0: + oxfmt@0.20.0: + dependencies: + tinypool: 2.0.0 optionalDependencies: - '@oxfmt/darwin-arm64': 0.17.0 - '@oxfmt/darwin-x64': 0.17.0 - '@oxfmt/linux-arm64-gnu': 0.17.0 - '@oxfmt/linux-arm64-musl': 0.17.0 - '@oxfmt/linux-x64-gnu': 0.17.0 - '@oxfmt/linux-x64-musl': 0.17.0 - '@oxfmt/win32-arm64': 0.17.0 - '@oxfmt/win32-x64': 0.17.0 + '@oxfmt/darwin-arm64': 0.20.0 + '@oxfmt/darwin-x64': 0.20.0 + '@oxfmt/linux-arm64-gnu': 0.20.0 + '@oxfmt/linux-arm64-musl': 0.20.0 + '@oxfmt/linux-x64-gnu': 0.20.0 + '@oxfmt/linux-x64-musl': 0.20.0 + '@oxfmt/win32-arm64': 0.20.0 + '@oxfmt/win32-x64': 0.20.0 oxlint-tsgolint@0.10.0: optionalDependencies: @@ -3739,6 +3748,8 @@ snapshots: tinypool@1.1.1: {} + tinypool@2.0.0: {} + tinyrainbow@2.0.0: {} tinyspy@4.0.4: {} diff --git a/test/fixtures/ts-cjs-es2021/tsconfig.json b/test/fixtures/ts-cjs-es2021/tsconfig.json index 715e34a5..2f2baadd 100644 --- a/test/fixtures/ts-cjs-es2021/tsconfig.json +++ b/test/fixtures/ts-cjs-es2021/tsconfig.json @@ -6,7 +6,7 @@ "moduleResolution": "Node", "baseUrl": "./", "paths": { - "urllib": ["../../.."], - }, - }, + "urllib": ["../../.."] + } + } } diff --git a/test/fixtures/ts-esm/tsconfig.json b/test/fixtures/ts-esm/tsconfig.json index 72cbcea6..c7a99cb1 100644 --- a/test/fixtures/ts-esm/tsconfig.json +++ b/test/fixtures/ts-esm/tsconfig.json @@ -6,7 +6,7 @@ "moduleResolution": "NodeNext", "baseUrl": "./", "paths": { - "urllib": ["../../.."], - }, - }, + "urllib": ["../../.."] + } + } } diff --git a/test/fixtures/ts/tsconfig.json b/test/fixtures/ts/tsconfig.json index d13f6161..5d8c56c9 100644 --- a/test/fixtures/ts/tsconfig.json +++ b/test/fixtures/ts/tsconfig.json @@ -6,7 +6,7 @@ "moduleResolution": "Node", "baseUrl": "./", "paths": { - "urllib": ["../../.."], - }, - }, + "urllib": ["../../.."] + } + } } diff --git a/test/mts/tsconfig.json b/test/mts/tsconfig.json index 30be5311..6f87f0b9 100644 --- a/test/mts/tsconfig.json +++ b/test/mts/tsconfig.json @@ -1,9 +1,10 @@ { - "extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node18/tsconfig"], "compilerOptions": { "allowSyntheticDefaultImports": true, "outDir": "dist", "skipLibCheck": false, + "module": "NodeNext", + "moduleResolution": "NodeNext" }, - "include": ["src/**/*"], + "include": ["src/**/*"] } diff --git a/tsconfig.json b/tsconfig.json index 148d5b50..cfa565a6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,9 +7,9 @@ "module": "NodeNext", "moduleResolution": "NodeNext", // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-5.html#isolated-declarations - "isolatedDeclarations": true, + "isolatedDeclarations": true // verbatimModuleSyntax is incompatible with multi-dialect builds // "verbatimModuleSyntax": true }, - "exclude": ["test/fixtures/ts*"], + "exclude": ["test/fixtures/ts*"] }