diff --git a/.eslintrc.json b/.eslintrc.json index 85c0a0f6..ab26efb3 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,8 +12,8 @@ "plugin:@typescript-eslint/recommended" ], "parserOptions": { - "ecmaVersion": 12 - }, + "ecmaVersion": 2020 + }, "rules": { "no-mixed-spaces-and-tabs": "off" } diff --git a/package-lock.json b/package-lock.json index fbffab3e..2d79b6ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "lint-staged": "^12.1.4", "np": "*", "prettier": "^2.0.5", - "typescript": "^4.2.3" + "typescript": "^4.6.0-dev.20211227" } }, "node_modules/@babel/code-frame": { @@ -420,6 +420,41 @@ } } }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/typescript": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "node_modules/@typescript-eslint/experimental-utils": { "version": "5.8.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.1.tgz", @@ -528,6 +563,41 @@ } } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/typescript": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "node_modules/@typescript-eslint/visitor-keys": { "version": "5.8.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.1.tgz", @@ -5899,27 +5969,6 @@ "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", "dev": true }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -5954,9 +6003,9 @@ } }, "node_modules/typescript": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", - "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "version": "4.6.0-dev.20211227", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.0-dev.20211227.tgz", + "integrity": "sha512-ybFDDvIhNbxjJY/PFflxFtUWRveDyQAHFmzEr4YkNBbT0iGTJyLblIZiuAHlzxSWFjE0KgLeoSfGmsj1tZrldg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -6591,6 +6640,30 @@ "regexpp": "^3.2.0", "semver": "^7.3.5", "tsutils": "^3.21.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "typescript": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "dev": true, + "peer": true + } } }, "@typescript-eslint/experimental-utils": { @@ -6648,6 +6721,30 @@ "is-glob": "^4.0.3", "semver": "^7.3.5", "tsutils": "^3.21.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "typescript": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "dev": true, + "peer": true + } } }, "@typescript-eslint/visitor-keys": { @@ -10619,23 +10716,6 @@ "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", "dev": true }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - }, - "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - } - } - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -10661,9 +10741,9 @@ } }, "typescript": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", - "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "version": "4.6.0-dev.20211227", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.0-dev.20211227.tgz", + "integrity": "sha512-ybFDDvIhNbxjJY/PFflxFtUWRveDyQAHFmzEr4YkNBbT0iGTJyLblIZiuAHlzxSWFjE0KgLeoSfGmsj1tZrldg==", "dev": true }, "unique-string": { diff --git a/package.json b/package.json index f4d22f4e..9a2e7287 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "files": [ "dist/" ], + "type": "module", "repository": { "type": "git", "url": "git://github.com/mmgoodnow/cross-seed.git" @@ -45,7 +46,7 @@ "lint-staged": "^12.1.4", "np": "*", "prettier": "^2.0.5", - "typescript": "^4.2.3" + "typescript": "^4.6.0-dev.20211227" }, "prettier": { "tabWidth": 4, diff --git a/src/cmd.ts b/src/cmd.ts index b4423325..2523d1b0 100755 --- a/src/cmd.ts +++ b/src/cmd.ts @@ -1,6 +1,7 @@ #!/usr/bin/env node import chalk from "chalk"; import { Option, program } from "commander"; +// @ts-expect-error json imports are experimental import packageDotJson from "../package.json"; import { generateConfig, getFileConfig } from "./configuration"; import { Action } from "./constants"; diff --git a/src/config.template.docker.js b/src/config.template.docker.js index f339a0ac..5f0b5583 100644 --- a/src/config.template.docker.js +++ b/src/config.template.docker.js @@ -1,9 +1,8 @@ -// All of the configuration can be overridden with command-line flags, -// and some are more useful as flags than permanent config (offset). +// All of the configuration can be overridden with command-line flags. // If you find yourself always using the same command-line flag, you can set // it here as a default. -module.exports = { +export default { jackettServerUrl: "http://jackett:9117/jackett", jackettApiKey: "YOUR_JACKETT_API_KEY_HERE", diff --git a/src/config.template.js b/src/config.template.js index 3a12f990..6116b135 100644 --- a/src/config.template.js +++ b/src/config.template.js @@ -1,7 +1,7 @@ // If you find yourself always using the same command-line flag, you can set // it here as a default. -module.exports = { +export default { configVersion: 1, jackettServerUrl: "http://localhost:9117/jackett", diff --git a/src/configuration.ts b/src/configuration.ts index 050f88b9..99d902f3 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -1,6 +1,7 @@ import chalk from "chalk"; import fs from "fs"; import path from "path"; +// @ts-ignore import packageDotJson from "../package.json"; import configTemplate from "./config.template"; import { Action, CONFIG_TEMPLATE_URL } from "./constants"; diff --git a/tsconfig.json b/tsconfig.json index 586199d9..74afa442 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ "outDir": "./dist", "allowJs": true, "target": "es2019", - "module": "CommonJS", + "module": "node12", "esModuleInterop": true, "resolveJsonModule": true, "sourceMap": true