nx icon indicating copy to clipboard operation
nx copied to clipboard

@nx/js:verdaccio does not respect "listen" in config.yml. Always uses "port" from nx options (with default). This prevents using https.

Open mwiedmann opened this issue 1 year ago • 0 comments

Current Behavior

If you add a "listen" option to the config.yml for the purposes of running Verdaccio on https, the setting is ignored. The reason is because the "port" option from the nx settings for Verdaccio are required (and have a default) and always are used instead. This results in Verdaccio running with --listen PORT.

The related code is:

function createVerdaccioOptions(
  options: VerdaccioExecutorSchema,
  workspaceRoot: string
) {
  const verdaccioArgs: string[] = [];
  if (options.port) {
    verdaccioArgs.push('--listen', options.port.toString());
  }

options.port will always have a value (because of the default in schema.json, so the "listen" value in the config.yml is always ignored it seems.

Expected Behavior

I expect the "listen" setting to be used.

GitHub Repo

No response

Steps to Reproduce

  1. Remove the "port" setting from the nx settings options for Verdaccio
  2. Create a ".verdaccio/config.yml" and add a "listen" setting like listen: "https://localhost:4444"
  3. Reference the config in the nx Verdaccio settings options with `"config": ".verdaccio/config.yml"
  4. Start Verdaccio with nx and note that it still starts on http with the default 4873 port

Nx Report

NX   Report complete - copy this into the issue template



Node   : 20.11.0

OS     : darwin-arm64

yarn   : 4.1.0



nx                 : 18.1.2

@nx/js             : 18.1.2

@nx/jest           : 18.1.2

@nx/linter         : 18.1.2

@nx/eslint         : 18.1.2

@nx/workspace      : 18.1.2

@nx/cypress        : 18.1.2

@nx/devkit         : 18.1.2

@nx/eslint-plugin  : 18.1.2

@nx/react          : 18.1.2

@nx/rollup         : 18.1.2

@nrwl/tao          : 18.1.2

@nx/vite           : 18.1.2

@nx/web            : 18.1.2

typescript         : 5.4.5

Failure Logs

No response

Package Manager Version

No response

Operating System

  • [X] macOS
  • [ ] Linux
  • [ ] Windows
  • [ ] Other (Please specify)

Additional Information

No response

mwiedmann avatar Apr 25 '24 15:04 mwiedmann