From 50e08aa356170a0e6d052eb6ea4285d835b1a92f Mon Sep 17 00:00:00 2001 From: Wixewr Date: Thu, 25 Jul 2024 20:43:33 +0200 Subject: [PATCH] feat(js): added a verdaccio listen address to configuration (#26976) Co-authored-by: William van der Vegt Co-authored-by: Craigory Coppola --- docs/generated/packages/js/executors/verdaccio.json | 4 ++++ packages/js/src/executors/verdaccio/schema.d.ts | 1 + packages/js/src/executors/verdaccio/schema.json | 4 ++++ packages/js/src/executors/verdaccio/verdaccio.impl.ts | 5 ++++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/generated/packages/js/executors/verdaccio.json b/docs/generated/packages/js/executors/verdaccio.json index 2591b416bc69f..7bf72585df9aa 100644 --- a/docs/generated/packages/js/executors/verdaccio.json +++ b/docs/generated/packages/js/executors/verdaccio.json @@ -23,6 +23,10 @@ "type": "number", "description": "Port of local registry that Verdaccio should listen to" }, + "listenAddress": { + "type": "string", + "description": "Listen address that Verdaccio should listen to" + }, "config": { "type": "string", "description": "Path to the custom Verdaccio config file" diff --git a/packages/js/src/executors/verdaccio/schema.d.ts b/packages/js/src/executors/verdaccio/schema.d.ts index 3af9bfc76a952..a8a47e1937507 100644 --- a/packages/js/src/executors/verdaccio/schema.d.ts +++ b/packages/js/src/executors/verdaccio/schema.d.ts @@ -2,6 +2,7 @@ export interface VerdaccioExecutorSchema { location: 'global' | 'user' | 'project' | 'none'; storage?: string; port?: number; + listenAddress?: string; config?: string; clear?: boolean; scopes?: string[]; diff --git a/packages/js/src/executors/verdaccio/schema.json b/packages/js/src/executors/verdaccio/schema.json index bb619f8b0f4e2..4bd7a0ee83e1d 100644 --- a/packages/js/src/executors/verdaccio/schema.json +++ b/packages/js/src/executors/verdaccio/schema.json @@ -20,6 +20,10 @@ "type": "number", "description": "Port of local registry that Verdaccio should listen to" }, + "listenAddress": { + "type": "string", + "description": "Listen address that Verdaccio should listen to" + }, "config": { "type": "string", "description": "Path to the custom Verdaccio config file" diff --git a/packages/js/src/executors/verdaccio/verdaccio.impl.ts b/packages/js/src/executors/verdaccio/verdaccio.impl.ts index 7667c95bc7f10..f8db563666c2f 100644 --- a/packages/js/src/executors/verdaccio/verdaccio.impl.ts +++ b/packages/js/src/executors/verdaccio/verdaccio.impl.ts @@ -126,7 +126,10 @@ function createVerdaccioOptions( options.port ??= 4873; // set default port if config is not provided } if (options.port) { - verdaccioArgs.push('--listen', options.port.toString()); + const listenAddress = options.listenAddress + ? `${options.listenAddress}:${options.port.toString()}` + : options.port.toString(); + verdaccioArgs.push('--listen', listenAddress); } return verdaccioArgs; }