mirror of
https://github.com/hexboy/maven-mirror-tool.git
synced 2025-04-21 05:59: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: [
|
apps: [
|
||||||
{
|
{
|
||||||
name: 'mmt-server',
|
name: 'mmt-server',
|
||||||
script: 'tsx src/index.ts --port=${PORT}',
|
script: 'tsx src/index.ts',
|
||||||
max_memory_restart: '300M',
|
max_memory_restart: '300M',
|
||||||
env_production: {
|
env: {
|
||||||
NODE_ENV: 'production',
|
NODE_ENV: 'production',
|
||||||
},
|
},
|
||||||
env_development: {
|
env_development: {
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"got": "^14.4.2",
|
"got": "^14.4.2",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"minimist": "^1.2.8",
|
|
||||||
"morgan": "^1.10.0",
|
"morgan": "^1.10.0",
|
||||||
"pm2": "^5.4.2",
|
"pm2": "^5.4.2",
|
||||||
"proxy-agent": "^6.4.0",
|
"proxy-agent": "^6.4.0",
|
||||||
|
@ -33,7 +32,6 @@
|
||||||
"@types/express": "^4.17.21",
|
"@types/express": "^4.17.21",
|
||||||
"@types/got": "^9.6.12",
|
"@types/got": "^9.6.12",
|
||||||
"@types/js-yaml": "^4.0.9",
|
"@types/js-yaml": "^4.0.9",
|
||||||
"@types/minimist": "^1.2.5",
|
|
||||||
"@types/morgan": "^1.9.9",
|
"@types/morgan": "^1.9.9",
|
||||||
"eslint": "^9.9.1",
|
"eslint": "^9.9.1",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import yaml from 'js-yaml';
|
import yaml from 'js-yaml';
|
||||||
import minimist from 'minimist';
|
|
||||||
import { IConfig } from '../types';
|
import { IConfig } from '../types';
|
||||||
|
|
||||||
const config = yaml.load(
|
const config = yaml.load(
|
||||||
|
@ -9,15 +8,6 @@ const config = yaml.load(
|
||||||
? fs.readFileSync('config.local.yml', 'utf8')
|
? fs.readFileSync('config.local.yml', 'utf8')
|
||||||
: fs.readFileSync('config.yml', 'utf8')
|
: fs.readFileSync('config.yml', 'utf8')
|
||||||
) as IConfig;
|
) 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 {
|
const {
|
||||||
REPOSITORIES,
|
REPOSITORIES,
|
||||||
|
@ -26,17 +16,11 @@ const {
|
||||||
VALID_FILE_TYPES = [],
|
VALID_FILE_TYPES = [],
|
||||||
} = config;
|
} = config;
|
||||||
|
|
||||||
const PORT = args.port ?? config.PORT ?? 8008;
|
const PORT = config.PORT ?? 8008;
|
||||||
const CACHE_DIR = path.resolve(
|
const CACHE_DIR = path.resolve(config.CACHE_DIR, '__MMT_CACHE__');
|
||||||
args['cache-dir'] ?? config.CACHE_DIR,
|
const TMP_DIR = path.resolve(config.CACHE_DIR, '__MMT_TMP__');
|
||||||
'__MMT_CACHE__'
|
const DEFAULT_PATH = config.DEFAULT_PATH ?? 'v1';
|
||||||
);
|
const VERBOSE = config.LOG_REQUESTS ?? false;
|
||||||
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;
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
PORT,
|
PORT,
|
||||||
|
|
16
yarn.lock
16
yarn.lock
|
@ -528,13 +528,6 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
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":
|
"@types/morgan@npm:^1.9.9":
|
||||||
version: 1.9.9
|
version: 1.9.9
|
||||||
resolution: "@types/morgan@npm:1.9.9"
|
resolution: "@types/morgan@npm:1.9.9"
|
||||||
|
@ -2727,7 +2720,6 @@ __metadata:
|
||||||
"@types/express": "npm:^4.17.21"
|
"@types/express": "npm:^4.17.21"
|
||||||
"@types/got": "npm:^9.6.12"
|
"@types/got": "npm:^9.6.12"
|
||||||
"@types/js-yaml": "npm:^4.0.9"
|
"@types/js-yaml": "npm:^4.0.9"
|
||||||
"@types/minimist": "npm:^1.2.5"
|
|
||||||
"@types/morgan": "npm:^1.9.9"
|
"@types/morgan": "npm:^1.9.9"
|
||||||
chalk: "npm:^5.3.0"
|
chalk: "npm:^5.3.0"
|
||||||
eslint: "npm:^9.9.1"
|
eslint: "npm:^9.9.1"
|
||||||
|
@ -2738,7 +2730,6 @@ __metadata:
|
||||||
got: "npm:^14.4.2"
|
got: "npm:^14.4.2"
|
||||||
js-yaml: "npm:^4.1.0"
|
js-yaml: "npm:^4.1.0"
|
||||||
lefthook: "npm:^1.7.14"
|
lefthook: "npm:^1.7.14"
|
||||||
minimist: "npm:^1.2.8"
|
|
||||||
morgan: "npm:^1.10.0"
|
morgan: "npm:^1.10.0"
|
||||||
pm2: "npm:^5.4.2"
|
pm2: "npm:^5.4.2"
|
||||||
prettier: "npm:^3.3.3"
|
prettier: "npm:^3.3.3"
|
||||||
|
@ -2844,13 +2835,6 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
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":
|
"minipass-collect@npm:^2.0.1":
|
||||||
version: 2.0.1
|
version: 2.0.1
|
||||||
resolution: "minipass-collect@npm:2.0.1"
|
resolution: "minipass-collect@npm:2.0.1"
|
||||||
|
|
Loading…
Add table
Reference in a new issue