From 382b90f2d99020da0ac463a208050e33a21e1652 Mon Sep 17 00:00:00 2001 From: William van der Vegt Date: Thu, 18 Jul 2024 13:09:30 +0200 Subject: [PATCH 1/2] feat(js): added a verdaccio listen address to configuration Added a Verdaccio listen address to the configuration so that you are able to configure the listen address of Verdaccio. --- 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 | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/js/src/executors/verdaccio/schema.d.ts b/packages/js/src/executors/verdaccio/schema.d.ts index e90513aad1b8e..3f07873713084 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; } diff --git a/packages/js/src/executors/verdaccio/schema.json b/packages/js/src/executors/verdaccio/schema.json index ce099fc017423..44c1a785169be 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 5496ce747aced..107aa6ac891c0 100644 --- a/packages/js/src/executors/verdaccio/verdaccio.impl.ts +++ b/packages/js/src/executors/verdaccio/verdaccio.impl.ts @@ -126,7 +126,8 @@ 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; } From 9f84df3e197e30e9a93d0e5efe3eea9fe5d6b3f3 Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Mon, 22 Jul 2024 17:32:05 -0400 Subject: [PATCH 2/2] chore(js): run docs --- docs/generated/packages/js/executors/verdaccio.json | 4 ++++ packages/js/src/executors/verdaccio/verdaccio.impl.ts | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/generated/packages/js/executors/verdaccio.json b/docs/generated/packages/js/executors/verdaccio.json index ad707dfaf3a68..5e53e945ca8f4 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/verdaccio.impl.ts b/packages/js/src/executors/verdaccio/verdaccio.impl.ts index 107aa6ac891c0..8aa77bb5db2c9 100644 --- a/packages/js/src/executors/verdaccio/verdaccio.impl.ts +++ b/packages/js/src/executors/verdaccio/verdaccio.impl.ts @@ -126,7 +126,9 @@ function createVerdaccioOptions( options.port ??= 4873; // set default port if config is not provided } if (options.port) { - const listenAddress = options.listenAddress ? `${options.listenAddress}:${options.port.toString()}` : options.port.toString(); + const listenAddress = options.listenAddress + ? `${options.listenAddress}:${options.port.toString()}` + : options.port.toString(); verdaccioArgs.push('--listen', listenAddress); } return verdaccioArgs;