Skip to content

Commit

Permalink
fixes: adjust code for yargs upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
t83714 committed Feb 9, 2025
1 parent aaca3ef commit 7f19e2b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": "tsc -b",
"watch": "tsc -b --watch",
"start": "node dist/index.js",
"dev": "run-typescript-in-nodemon src/index.ts",
"dev": "tsx src/index.ts",
"test": "mocha",
"docker-build-local": "create-docker-context-for-node-component --build --push --tag auto --local",
"docker-build-prod": "create-docker-context-for-node-component --build --push --tag auto",
Expand All @@ -33,7 +33,7 @@
"@types/passport": "1.0.17",
"@types/serve-static": "^1.15.7",
"@types/urijs": "^1.19.12",
"@types/yargs": "^15.0.9",
"@types/yargs": "^17.0.33",
"mocha": "^10.2.0",
"rimraf": "^3.0.2",
"tsx": "^4.7.0",
Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import express from "express";
import path from "path";
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
import google from "./google.js";
import AuthApiClient, { UserToken } from "@magda/auth-api-client";
import {
Expand All @@ -10,7 +11,7 @@ import {

const coerceJson = (path?: string) => path && require(path);

const argv = yargs
const argv = yargs(hideBin(process.argv))
.config()
.help()
.option("listenPort", {
Expand Down Expand Up @@ -101,7 +102,8 @@ const argv = yargs
"The user id to use when making authenticated requests to the registry",
type: "string",
default: process.env.USER_ID || process.env.npm_package_config_userId
}).argv;
})
.parseSync();

const authPluginConfig = argv.authPluginConfigJson as any as AuthPluginConfig;
const allowedExternalRedirectDomains = argv
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,14 @@
integrity sha512-XOfUup9r3Y06nFAZh3WvO0rBU4OtlfPB/vgxpjg+NRdGU6CN6djdc6OEiH+PcqHCY6eFLo9Ista73uarf4gnBg==

"@types/yargs-parser@*":
version "15.0.0"
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d"
integrity sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==

"@types/yargs@^15.0.9":
version "15.0.9"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.9.tgz#524cd7998fe810cdb02f26101b699cccd156ff19"
integrity sha512-HmU8SeIRhZCWcnRskCs36Q1Q00KBV6Cqh/ora8WN1+22dY07AZdn6Gel8QZ3t26XYPImtcL8WV/eqjhVmMEw4g==
version "21.0.3"
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15"
integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==

"@types/yargs@^17.0.33":
version "17.0.33"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.33.tgz#8c32303da83eec050a84b3c7ae7b9f922d13e32d"
integrity sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==
dependencies:
"@types/yargs-parser" "*"

Expand Down

0 comments on commit 7f19e2b

Please sign in to comment.