Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement helper in utils near execute-process to parse an object to command line arguments #43

Closed
4 tasks
BioPhoton opened this issue Sep 8, 2023 · 0 comments · Fixed by #52
Closed
4 tasks
Labels
➕ enhancement new feature or request

Comments

@BioPhoton
Copy link
Collaborator

BioPhoton commented Sep 8, 2023

Motivation

Plugin authors can already use our executeProcess function in their code to writ plugins faster.
The helper objectToCliArgs helps to create an array of command line arguments from a object in the common standard e.g. --param, --no-param etc...

This helps library authors to execute their code and avoids errors. The function should be used separately from the executeProcess function to have more flexibility.

Usage in a custom plugin

In custom plugins the function is most useful for runner arguments:

export async function myPlugin(config?: NxValidatorsPluginConfig) {
  const { outputPath } = config || {};
  return {
    // ...
    runner: {
      command: 'node',
      args: objectToCliArgs({ _: 'bin.js', interactive: false }),
      outputPath: 'out.json'
    },
    // ...
  };
}

Todos

  • implement the logic
  • implement tests
  • document it with JS docs
  • export it as public API
@BioPhoton BioPhoton added the ➕ enhancement new feature or request label Sep 8, 2023
@BioPhoton BioPhoton changed the title Implement helper in utils execute-process to parse and object to command line arguments Implement helper in utils execute-process to parse an object to command line arguments Sep 16, 2023
@BioPhoton BioPhoton changed the title Implement helper in utils execute-process to parse an object to command line arguments Implement helper in utils near execute-process to parse an object to command line arguments Sep 16, 2023
BioPhoton added a commit that referenced this issue Sep 18, 2023
This PR includes:
- the logic
- tests
- JS docs
- exports as public API

closes #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
➕ enhancement new feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant