Skip to content

Commit f8db5d7

Browse files
authored
feat: convert project to esm, use got v12 (#61)
BREAKING CHANGE: upgrade got to v12 BREAKING CHANGE: This package is now pure ESM. https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c BREAKING CHANGE: requires node > 14.16 - adds @ctrl/magnet-link as a dependency - adds support for adding torrent magnet links to normalizedAddTorrent - new function `addTorrentFromUrl`
1 parent fd7efff commit f8db5d7

File tree

8 files changed

+5362
-11273
lines changed

8 files changed

+5362
-11273
lines changed

package-lock.json

Lines changed: 4670 additions & 10626 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,56 @@
66
"license": "MIT",
77
"repository": "scttcper/utorrent",
88
"homepage": "https://utorrent.vercel.app",
9-
"main": "dist/index.js",
10-
"typings": "dist/index.d.ts",
9+
"type": "module",
10+
"main": "./dist/src/index.js",
11+
"typings": "./dist/src/index.d.ts",
1112
"files": [
12-
"dist"
13+
"dist/src"
1314
],
1415
"sideEffects": false,
1516
"keywords": [
1617
"utorrent",
1718
"typescript"
1819
],
1920
"scripts": {
20-
"lint": "eslint --ext .js,.ts .",
21-
"lint:fix": "eslint --fix --ext .js,.ts .",
21+
"lint": "eslint --ext .ts .",
22+
"lint:fix": "eslint --fix --ext .ts .",
2223
"prepare": "npm run build",
23-
"build": "tsc -p tsconfig.build.json",
24+
"build": "tsc",
2425
"build:docs": "typedoc",
25-
"test": "jest",
26-
"test:watch": "npm run test -- --watch",
27-
"test:ci": "npm run test -- --ci --reporters=default --reporters=jest-junit --coverage",
28-
"semantic-release": "semantic-release"
26+
"test": "ava",
27+
"test:watch": "ava --watch",
28+
"test:ci": "c8 --reporter=text --reporter=lcov ava"
2929
},
3030
"dependencies": {
31-
"@ctrl/shared-torrent": "^3.0.5",
32-
"@ctrl/torrent-file": "^1.3.3",
33-
"form-data": "^4.0.0",
34-
"got": "^11.8.2",
35-
"tough-cookie": "^4.0.0",
36-
"@ctrl/url-join": "^1.0.4"
31+
"@ctrl/magnet-link": "^3.1.0",
32+
"@ctrl/shared-torrent": "^4.1.0",
33+
"@ctrl/torrent-file": "^2.0.1",
34+
"@ctrl/url-join": "^2.0.0",
35+
"formdata-node": "^4.3.2",
36+
"got": "^12.0.1",
37+
"tough-cookie": "^4.0.0"
3738
},
3839
"devDependencies": {
39-
"@babel/plugin-transform-modules-commonjs": "7.16.0",
40-
"@babel/preset-typescript": "7.16.0",
41-
"@ctrl/eslint-config": "3.1.1",
42-
"@jest/globals": "27.3.1",
43-
"@types/node": "16.11.6",
40+
"@ctrl/eslint-config": "3.3.1",
41+
"@types/node": "17.0.21",
4442
"@types/tough-cookie": "4.0.1",
45-
"jest": "27.3.1",
46-
"jest-junit": "13.0.0",
47-
"typedoc": "0.22.8",
48-
"typescript": "4.4.4"
43+
"@sindresorhus/tsconfig": "2.0.0",
44+
"ava": "4.0.1",
45+
"c8": "7.11.0",
46+
"ts-node": "10.5.0",
47+
"typedoc": "0.22.12",
48+
"typescript": "4.5.5"
4949
},
50-
"jest": {
51-
"testEnvironment": "node",
52-
"coverageProvider": "v8"
53-
},
54-
"babel": {
55-
"presets": [
56-
"@babel/preset-typescript"
50+
"ava": {
51+
"files": [
52+
"test/**/*.spec.ts"
5753
],
58-
"plugins": [
59-
"@babel/plugin-transform-modules-commonjs"
54+
"extensions": {
55+
"ts": "module"
56+
},
57+
"nodeArguments": [
58+
"--loader=ts-node/esm"
6059
]
6160
},
6261
"publishConfig": {
@@ -66,6 +65,6 @@
6665
"branch": "master"
6766
},
6867
"engines": {
69-
"node": ">=10.19.0"
68+
"node": ">=14.16"
7069
}
7170
}

0 commit comments

Comments
 (0)