Skip to content

Commit

Permalink
export urllib
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Dec 29, 2024
1 parent f13e910 commit e119bc8
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
21 changes: 16 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "egg",
"version": "4.0.0-beta.8",
"version": "4.0.0-beta.11",
"engines": {
"node": ">= 18.19.0"
},
Expand All @@ -19,9 +19,9 @@
"egg"
],
"dependencies": {
"@eggjs/cluster": "beta",
"@eggjs/cluster": "^3.0.0",
"@eggjs/cookies": "^3.0.0",
"@eggjs/core": "beta",
"@eggjs/core": "^6.2.5",
"@eggjs/schedule": "^5.0.2",
"@eggjs/utils": "^4.1.5",
"@eggjs/watcher": "^4.0.1",
Expand Down Expand Up @@ -49,7 +49,7 @@
"onelogger": "^1.0.0",
"performance-ms": "^1.1.0",
"sendmessage": "^3.0.1",
"urllib": "^4.0.0",
"urllib": "^4.6.11",
"utility": "^2.1.0",
"ylru": "^1.3.2"
},
Expand Down Expand Up @@ -98,7 +98,7 @@
"preci": "npm run clean && npm run lint",
"ci": "egg-bin cov",
"postci": "npm run prepublishOnly && npm run clean",
"prepublishOnly": "tshy && tshy-after && attw --pack",
"prepublishOnly": "tshy && tshy-after && attw --pack --profile node16",
"site:dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider APP_ROOT=./site dumi dev",
"site:devWithNode14-16": "cross-env APP_ROOT=./site dumi dev",
"site:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider APP_ROOT=./site dumi build",
Expand Down Expand Up @@ -131,6 +131,7 @@
"tshy": {
"exports": {
".": "./src/index.ts",
"./urllib": "./src/urllib.ts",
"./package.json": "./package.json"
}
},
Expand All @@ -145,6 +146,16 @@
"default": "./dist/commonjs/index.js"
}
},
"./urllib": {
"import": {
"types": "./dist/esm/urllib.d.ts",
"default": "./dist/esm/urllib.js"
},
"require": {
"types": "./dist/commonjs/urllib.d.ts",
"default": "./dist/commonjs/urllib.js"
}
},
"./package.json": "./package.json"
},
"types": "./dist/commonjs/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/urllib.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from 'urllib';
33 changes: 33 additions & 0 deletions test/urllib.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { strict as assert } from 'node:assert';
import * as urllib from '../src/urllib.js';

describe('test/urllib.test.ts', () => {
it('should expose properties', () => {
assert.deepEqual(Object.keys(urllib).sort(), [
'Agent',
'Dispatcher',
'FetchFactory',
'FormData',
'Headers',
'HttpClient',
'HttpClient2',
'HttpClientConnectTimeoutError',
'HttpClientRequestError',
'HttpClientRequestTimeoutError',
'MockAgent',
'ProxyAgent',
'Request',
'Response',
'USER_AGENT',
'WebFormData',
'curl',
'fetch',
'getDefaultHttpClient',
'getGlobalDispatcher',
'request',
'setGlobalDispatcher',
]);

assert.equal(typeof urllib.MockAgent, 'function');
});
});

0 comments on commit e119bc8

Please sign in to comment.