-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat: add support for targetting specific workspaces #1212
base: main
Are you sure you want to change the base?
Conversation
4ac8c52
to
a26d8da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some things require chen. see my remarks.
also, please add proper unit tests
@@ -166,6 +167,12 @@ function makeCommand (process: NodeJS.Process): Command { | |||
).default( | |||
Enums.ComponentType.Application | |||
) | |||
).addOption( | |||
new Option( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the things we pass truth to npm, it is intended to mimic the CLI of npm - so that the CLI args are familiar to the users.
the proposed option workspaces
here does not do so.
compare with npm ls:
List installed packages
Usage:
npm ls <package-spec>
Options:
[-a|--all] [--json] [-l|--long] [-p|--parseable] [-g|--global] [--depth <depth>]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]] [--link]
[--package-lock-only] [--no-unicode]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
[-ws|--workspaces] [--include-workspace-root] [--install-links]
alias: list
Run "npm help ls" for more info
Happy to do the changes. I would think some integration tests would be required for this change as it is not really feasible to test it in isolation due to the logic effectively sitting on the I agree with the requirement of testing. I spent some time initially before making the PR going through the existing unit and integration tests and it is not very clear to me how we should go about adding tests for new functionality. For example, I do not see tests for several of the CLI options (such as Could you provide a bit of a guide regarding how we should lay out tests for new functionality going forward as well as a brief of how the existing integration tests work and how they are structured. I intend on making additional PRs in the future for other issues and features so this would be very beneficial for me (and I'm sure other community members). |
@MalickBurger, for adding additional integration tests,
since you are planning on adding conditional parameters in the |
caused by #1212 --------- Signed-off-by: Jan Kowalleck <[email protected]>
Looking at this, could you provide some testing support for an existing argument that is passed to |
will do. just bare with me, it may take a while |
I am currently working on a solution. Will ping as soon as I have something for you. |
@@ -166,6 +167,12 @@ function makeCommand (process: NodeJS.Process): Command { | |||
).default( | |||
Enums.ComponentType.Application | |||
) | |||
).addOption( | |||
new Option( | |||
'--workspaces <workspace...>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'--workspaces <workspace...>', | |
'-w, --workspace <workspace-name...>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An option '-ws, --workspaces'
is to be added, too. it should be piped to npm-ls
, just like '-w, --workspace ...'
I've overhauled the integration tests. you might add something like // region workspace
['workspace not supported npm 6', `6.${rMinor}.${rPatch}`, ['--workspace my-wsA', '--workspace my-wsB'], [...npm6ArgsGeneral]],
['workspace npm 7', `7.${rMinor}.${rPatch}`, ['--workspace my-wsA', '--workspace my-wsB'], [...npm7ArgsGeneral, '--workspace my-wsA', '--workspace my-wsB']],
['workspace npm 8', `8.${rMinor}.${rPatch}`, ['--workspace my-wsA', '--workspace my-wsB'], [...npm8ArgsGeneral, '--workspace my-wsA', '--workspace my-wsB']],
['workspace npm 9', `9.${rMinor}.${rPatch}`, ['--workspace my-wsA', '--workspace my-wsB'], [...npm9ArgsGeneral, '--workspace my-wsA', '--workspace my-wsB']],
['workspace npm 10', `10.${rMinor}.${rPatch}`, ['--workspace my-wsA', '--workspace my-wsB'], [...npm10ArgsGeneral, '--workspace my-wsA', '--workspace my-wsB']]
// endregion workspace PS: i've also prepared demo data for additional integration tests. I might add them as soon as the basic pass-through tests are done |
Signed-off-by: MalickBurger <[email protected]>
d95dee9
to
052b2a6
Compare
fixes #1126