Skip to content

Commit

Permalink
refactor!: drop node 14
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Apr 16, 2023
1 parent 586c173 commit 12c5dca
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 181 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

### Node.js

Node.js >= v14.19.0
Node.js >= v16.14.0

```bash
npm i jike-sdk
Expand All @@ -93,11 +93,11 @@ npm i jike-sdk
```ts
// index.mjs

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

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

setApiConfig({
// ...
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,22 @@
"*.d.ts"
],
"module": "dist/index.js",
"types": "index.d.ts",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/node/index.cjs",
"import": "./dist/node/index.js"
},
"./index": {
"import": "./dist/index.js"
},
"./polyfill": {
"types": "./dist/index.d.ts",
"require": "./dist/node/index.cjs",
"import": "./dist/node/index.js"
},
"./*": "./*"
},
"typesVersions": {
"*": {
"<=4.9": {
"*": [
"./dist/*",
"./*"
Expand All @@ -45,13 +48,11 @@
"sideEffects": false,
"scripts": {
"dev": "tsx playground/main.ts",
"build": "pnpm run build:lib && pnpm run build:types",
"build:lib": "MODE=modern tsup && MODE=node tsup",
"build:types": "tsc --emitDeclarationOnly --declaration",
"build": "tsup",
"docs:build": "typedoc",
"docs:preview": "serve docs",
"lint": "eslint . --ext .js,.ts,.yml,.yaml,.md,.json,.json5",
"lint:fix": "npm run lint -- --fix",
"lint:fix": "pnpm run lint --fix",
"test": "vitest",
"test:deno": "cd tests/deno && deno run --allow-net --import-map=import_map.json --allow-env index.ts",
"release": "bumpp && npm publish",
Expand All @@ -60,24 +61,23 @@
"dependencies": {
"eventemitter3": "^5.0.0",
"ky": "^0.33.3",
"node-fetch": "^3.3.1"
"undici": "^5.21.2"
},
"devDependencies": {
"@faker-js/faker": "^7.6.0",
"@rollup/plugin-inject": "^5.0.3",
"@sxzz/eslint-config-prettier": "^2.4.6",
"@sxzz/eslint-config-ts": "^2.4.6",
"@types/md5": "^2.3.2",
"@types/node": "^18.15.11",
"@types/sharp": "^0.31.1",
"@vitest/ui": "^0.30.0",
"bumpp": "^9.1.0",
"compare-versions": "^5.0.3",
"esbuild": "^0.17.15",
"eslint": "^8.38.0",
"eslint-define-config": "^1.17.0",
"md5": "^2.3.0",
"rollup": "^3.20.2",
"rollup-plugin-esbuild": "^5.0.0",
"serve": "^14.2.0",
"sharp": "^0.32.0",
"tsup": "^6.7.0",
Expand All @@ -87,7 +87,7 @@
"vitest": "^0.30.0"
},
"engines": {
"node": ">=14.19.0"
"node": ">=16.14.0"
},
"pnpm": {
"peerDependencyRules": {
Expand Down
121 changes: 47 additions & 74 deletions pnpm-lock.yaml

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

7 changes: 0 additions & 7 deletions src/globals.d.ts

This file was deleted.

Loading

1 comment on commit 12c5dca

@vercel
Copy link

@vercel vercel bot commented on 12c5dca Apr 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.