Skip to content

Commit

Permalink
fix(js): remove default port for verdaccio (#26502)
Browse files Browse the repository at this point in the history
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- remove default port for verdaccio so it can take port from config file

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #23007
  • Loading branch information
xiongemi authored Jun 12, 2024
1 parent 4a5eb23 commit 471f82c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions docs/generated/packages/js/executors/verdaccio.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
},
"port": {
"type": "number",
"description": "Port of local registry that Verdaccio should listen to",
"default": 4873
"description": "Port of local registry that Verdaccio should listen to"
},
"config": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion packages/js/src/executors/verdaccio/schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface VerdaccioExecutorSchema {
location: 'global' | 'user' | 'project' | 'none';
storage?: string;
port: number;
port?: number;
config?: string;
clear?: boolean;
}
3 changes: 1 addition & 2 deletions packages/js/src/executors/verdaccio/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
},
"port": {
"type": "number",
"description": "Port of local registry that Verdaccio should listen to",
"default": 4873
"description": "Port of local registry that Verdaccio should listen to"
},
"config": {
"type": "string",
Expand Down
8 changes: 5 additions & 3 deletions packages/js/src/executors/verdaccio/verdaccio.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ function createVerdaccioOptions(
workspaceRoot: string
) {
const verdaccioArgs: string[] = [];
if (options.port) {
verdaccioArgs.push('--listen', options.port.toString());
}
if (options.config) {
verdaccioArgs.push('--config', join(workspaceRoot, options.config));
} else {
options.port ??= 4873; // set default port if config is not provided
}
if (options.port) {
verdaccioArgs.push('--listen', options.port.toString());
}
return verdaccioArgs;
}
Expand Down

0 comments on commit 471f82c

Please sign in to comment.