Skip to content

Commit 12c5dca

Browse files
committed
refactor!: drop node 14
1 parent 586c173 commit 12c5dca

12 files changed

+112
-181
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181
### Node.js
8282

83-
Node.js >= v14.19.0
83+
Node.js >= v16.14.0
8484

8585
```bash
8686
npm i jike-sdk
@@ -93,11 +93,11 @@ npm i jike-sdk
9393
```ts
9494
// index.mjs
9595

96-
// 自带 node-fetch。node < 18 使用此版本。
96+
// 不带 undici。需自行 ployfill 或 node >= 18 使用此版本。
9797
import { setApiConfig } from 'jike-sdk'
9898

99-
// 不带 node-fetch。自行 ployfill 或 node >= 18 使用此版本。
100-
// import { setApiConfig } from 'jike-sdk/index'
99+
// 自带 undici。node < 18 使用此版本。
100+
// import { setApiConfig } from 'jike-sdk/polyfill'
101101

102102
setApiConfig({
103103
// ...

package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,22 @@
2323
"*.d.ts"
2424
],
2525
"module": "dist/index.js",
26-
"types": "index.d.ts",
26+
"types": "dist/index.d.ts",
2727
"exports": {
2828
".": {
29+
"types": "./dist/index.d.ts",
2930
"require": "./dist/node/index.cjs",
30-
"import": "./dist/node/index.js"
31-
},
32-
"./index": {
3331
"import": "./dist/index.js"
3432
},
33+
"./polyfill": {
34+
"types": "./dist/index.d.ts",
35+
"require": "./dist/node/index.cjs",
36+
"import": "./dist/node/index.js"
37+
},
3538
"./*": "./*"
3639
},
3740
"typesVersions": {
38-
"*": {
41+
"<=4.9": {
3942
"*": [
4043
"./dist/*",
4144
"./*"
@@ -45,13 +48,11 @@
4548
"sideEffects": false,
4649
"scripts": {
4750
"dev": "tsx playground/main.ts",
48-
"build": "pnpm run build:lib && pnpm run build:types",
49-
"build:lib": "MODE=modern tsup && MODE=node tsup",
50-
"build:types": "tsc --emitDeclarationOnly --declaration",
51+
"build": "tsup",
5152
"docs:build": "typedoc",
5253
"docs:preview": "serve docs",
5354
"lint": "eslint . --ext .js,.ts,.yml,.yaml,.md,.json,.json5",
54-
"lint:fix": "npm run lint -- --fix",
55+
"lint:fix": "pnpm run lint --fix",
5556
"test": "vitest",
5657
"test:deno": "cd tests/deno && deno run --allow-net --import-map=import_map.json --allow-env index.ts",
5758
"release": "bumpp && npm publish",
@@ -60,24 +61,23 @@
6061
"dependencies": {
6162
"eventemitter3": "^5.0.0",
6263
"ky": "^0.33.3",
63-
"node-fetch": "^3.3.1"
64+
"undici": "^5.21.2"
6465
},
6566
"devDependencies": {
6667
"@faker-js/faker": "^7.6.0",
68+
"@rollup/plugin-inject": "^5.0.3",
6769
"@sxzz/eslint-config-prettier": "^2.4.6",
6870
"@sxzz/eslint-config-ts": "^2.4.6",
6971
"@types/md5": "^2.3.2",
7072
"@types/node": "^18.15.11",
7173
"@types/sharp": "^0.31.1",
7274
"@vitest/ui": "^0.30.0",
7375
"bumpp": "^9.1.0",
74-
"compare-versions": "^5.0.3",
7576
"esbuild": "^0.17.15",
7677
"eslint": "^8.38.0",
7778
"eslint-define-config": "^1.17.0",
7879
"md5": "^2.3.0",
7980
"rollup": "^3.20.2",
80-
"rollup-plugin-esbuild": "^5.0.0",
8181
"serve": "^14.2.0",
8282
"sharp": "^0.32.0",
8383
"tsup": "^6.7.0",
@@ -87,7 +87,7 @@
8787
"vitest": "^0.30.0"
8888
},
8989
"engines": {
90-
"node": ">=14.19.0"
90+
"node": ">=16.14.0"
9191
},
9292
"pnpm": {
9393
"peerDependencyRules": {

pnpm-lock.yaml

+47-74
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/globals.d.ts

-7
This file was deleted.

0 commit comments

Comments
 (0)