mirror of
https://github.com/hexboy/maven-mirror-tool.git
synced 2025-04-09 00:09:09 +00:00
remove minimist
This commit is contained in:
parent
e39804b032
commit
cf8bf9876d
4 changed files with 7 additions and 41 deletions
|
@ -2,9 +2,9 @@ module.exports = {
|
|||
apps: [
|
||||
{
|
||||
name: 'mmt-server',
|
||||
script: 'tsx src/index.ts --port=${PORT}',
|
||||
script: 'tsx src/index.ts',
|
||||
max_memory_restart: '300M',
|
||||
env_production: {
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
},
|
||||
env_development: {
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
"express": "^4.19.2",
|
||||
"got": "^14.4.2",
|
||||
"js-yaml": "^4.1.0",
|
||||
"minimist": "^1.2.8",
|
||||
"morgan": "^1.10.0",
|
||||
"pm2": "^5.4.2",
|
||||
"proxy-agent": "^6.4.0",
|
||||
|
@ -33,7 +32,6 @@
|
|||
"@types/express": "^4.17.21",
|
||||
"@types/got": "^9.6.12",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/minimist": "^1.2.5",
|
||||
"@types/morgan": "^1.9.9",
|
||||
"eslint": "^9.9.1",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import yaml from 'js-yaml';
|
||||
import minimist from 'minimist';
|
||||
import { IConfig } from '../types';
|
||||
|
||||
const config = yaml.load(
|
||||
|
@ -9,15 +8,6 @@ const config = yaml.load(
|
|||
? fs.readFileSync('config.local.yml', 'utf8')
|
||||
: fs.readFileSync('config.yml', 'utf8')
|
||||
) as IConfig;
|
||||
const args = minimist(process.argv, {
|
||||
string: ['cache-dir', 'port', 'path'],
|
||||
boolean: ['verbose'],
|
||||
}) as {
|
||||
path?: string;
|
||||
port?: number;
|
||||
verbose?: boolean;
|
||||
'cache-dir'?: string;
|
||||
};
|
||||
|
||||
const {
|
||||
REPOSITORIES,
|
||||
|
@ -26,17 +16,11 @@ const {
|
|||
VALID_FILE_TYPES = [],
|
||||
} = config;
|
||||
|
||||
const PORT = args.port ?? config.PORT ?? 8008;
|
||||
const CACHE_DIR = path.resolve(
|
||||
args['cache-dir'] ?? config.CACHE_DIR,
|
||||
'__MMT_CACHE__'
|
||||
);
|
||||
const TMP_DIR = path.resolve(
|
||||
args['cache-dir'] ?? config.CACHE_DIR,
|
||||
'__MMT_TMP__'
|
||||
);
|
||||
const DEFAULT_PATH = args.path ?? config.DEFAULT_PATH ?? 'v1';
|
||||
const VERBOSE = args.verbose ?? config.LOG_REQUESTS ?? false;
|
||||
const PORT = config.PORT ?? 8008;
|
||||
const CACHE_DIR = path.resolve(config.CACHE_DIR, '__MMT_CACHE__');
|
||||
const TMP_DIR = path.resolve(config.CACHE_DIR, '__MMT_TMP__');
|
||||
const DEFAULT_PATH = config.DEFAULT_PATH ?? 'v1';
|
||||
const VERBOSE = config.LOG_REQUESTS ?? false;
|
||||
|
||||
export {
|
||||
PORT,
|
||||
|
|
16
yarn.lock
16
yarn.lock
|
@ -528,13 +528,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/minimist@npm:^1.2.5":
|
||||
version: 1.2.5
|
||||
resolution: "@types/minimist@npm:1.2.5"
|
||||
checksum: 10c0/3f791258d8e99a1d7d0ca2bda1ca6ea5a94e5e7b8fc6cde84dd79b0552da6fb68ade750f0e17718f6587783c24254bbca0357648dd59dc3812c150305cabdc46
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/morgan@npm:^1.9.9":
|
||||
version: 1.9.9
|
||||
resolution: "@types/morgan@npm:1.9.9"
|
||||
|
@ -2727,7 +2720,6 @@ __metadata:
|
|||
"@types/express": "npm:^4.17.21"
|
||||
"@types/got": "npm:^9.6.12"
|
||||
"@types/js-yaml": "npm:^4.0.9"
|
||||
"@types/minimist": "npm:^1.2.5"
|
||||
"@types/morgan": "npm:^1.9.9"
|
||||
chalk: "npm:^5.3.0"
|
||||
eslint: "npm:^9.9.1"
|
||||
|
@ -2738,7 +2730,6 @@ __metadata:
|
|||
got: "npm:^14.4.2"
|
||||
js-yaml: "npm:^4.1.0"
|
||||
lefthook: "npm:^1.7.14"
|
||||
minimist: "npm:^1.2.8"
|
||||
morgan: "npm:^1.10.0"
|
||||
pm2: "npm:^5.4.2"
|
||||
prettier: "npm:^3.3.3"
|
||||
|
@ -2844,13 +2835,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"minimist@npm:^1.2.8":
|
||||
version: 1.2.8
|
||||
resolution: "minimist@npm:1.2.8"
|
||||
checksum: 10c0/19d3fcdca050087b84c2029841a093691a91259a47def2f18222f41e7645a0b7c44ef4b40e88a1e58a40c84d2ef0ee6047c55594d298146d0eb3f6b737c20ce6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"minipass-collect@npm:^2.0.1":
|
||||
version: 2.0.1
|
||||
resolution: "minipass-collect@npm:2.0.1"
|
||||
|
|
Loading…
Add table
Reference in a new issue