Skip to content

Commit f27660e

Browse files
committed
refactor: update repo
1 parent 4cfe2e9 commit f27660e

19 files changed

+591
-580
lines changed

.eslintrc

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"extends": [
3-
"@nuxtjs/eslint-config-typescript"
4-
]
3+
"eslint-config-unjs"
4+
],
5+
"rules": {
6+
"no-undef": 0,
7+
"unicorn/consistent-destructuring": 0,
8+
"unicorn/no-await-expression-member": 0,
9+
}
510
}

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 - UnJS
3+
Copyright (c) Pooya Parsa <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

build.config.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import { defineBuildConfig } from 'unbuild'
1+
import { defineBuildConfig } from "unbuild";
22

33
export default defineBuildConfig({
44
declaration: true,
5-
emitCJS: false,
5+
rollup: {
6+
emitCJS: true
7+
},
68
entries: [
7-
'src/index',
8-
'src/node',
9-
'src/undici'
9+
"src/index",
10+
"src/node",
11+
"src/undici"
1012
]
11-
})
13+
});

node.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './dist/node'
1+
export * from "./dist/node";

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,25 @@
4949
"test": "pnpm lint && vitest run --coverage"
5050
},
5151
"dependencies": {
52-
"destr": "^1.2.0",
53-
"node-fetch-native": "^0.1.8",
54-
"ufo": "^0.8.6",
52+
"destr": "^1.2.1",
53+
"node-fetch-native": "^1.0.1",
54+
"ufo": "^1.0.0",
5555
"undici": "^5.12.0"
5656
},
5757
"devDependencies": {
58-
"@nuxtjs/eslint-config-typescript": "^11.0.0",
5958
"@types/node": "^18.11.9",
60-
"@vitest/coverage-c8": "^0.25.1",
59+
"@vitest/coverage-c8": "^0.25.2",
6160
"eslint": "^8.27.0",
61+
"eslint-config-unjs": "^0.0.2",
6262
"fetch-blob": "^3.2.0",
6363
"formdata-polyfill": "^4.0.10",
64-
"h3": "^0.8.6",
64+
"h3": "^1.0.1",
6565
"jiti": "^1.16.0",
66-
"listhen": "^0.3.5",
66+
"listhen": "^1.0.0",
6767
"standard-version": "^9.5.0",
6868
"typescript": "^4.8.4",
6969
"unbuild": "^0.9.4",
70-
"vitest": "^0.25.1"
70+
"vitest": "^0.25.2"
7171
},
7272
"packageManager": "[email protected]"
7373
}

playground/index.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
import { $fetch } from '../src/node'
1+
import { $fetch } from "../src/node";
22

33
async function main () {
44
// const r = await $fetch<string>('http://google.com/404')
5-
const r = await $fetch<string>('http://httpstat.us/500')
5+
const r = await $fetch<string>("http://httpstat.us/500");
66
// const r = await $fetch<string>('http://httpstat/500')
77
// eslint-disable-next-line no-console
8-
console.log(r)
8+
console.log(r);
99
}
1010

11-
main().catch((err) => {
11+
// eslint-disable-next-line unicorn/prefer-top-level-await
12+
main().catch((error) => {
1213
// eslint-disable-next-line no-console
13-
console.error(err)
14-
process.exit(1)
15-
})
14+
console.error(error);
15+
// eslint-disable-next-line unicorn/no-process-exit
16+
process.exit(1);
17+
});

playground/undici.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import { $fetch } from '../src/undici'
1+
import { $fetch } from "../src/undici";
22

33
async function main () {
4-
const r = await $fetch<string>('http://google.com/404')
4+
const r = await $fetch<string>("http://google.com/404");
55
// eslint-disable-next-line no-console
6-
console.log(r)
6+
console.log(r);
77
}
88

9-
main().catch((err) => {
9+
// eslint-disable-next-line unicorn/prefer-top-level-await
10+
main().catch((error) => {
1011
// eslint-disable-next-line no-console
11-
console.error(err)
12-
process.exit(1)
13-
})
12+
console.error(error);
13+
// eslint-disable-next-line unicorn/no-process-exit
14+
process.exit(1);
15+
});

0 commit comments

Comments
 (0)