melos icon indicating copy to clipboard operation
melos copied to clipboard

request: add bootstrap shortcut only for current package

Open ekasetiawans opened this issue 3 years ago • 2 comments

Is there an existing feature request for this?

  • [X] I have searched the existing issues.

Command

melos bootstrap current

Description

A shortcut command for melos bootstrap --scope current_package_name when we call the command from the package directory.

Reasoning

Sometimes, we have to bootstrap only for current package. Currently, this can be done with melos bootstrap --scope current_package_name. But it will be easier if we have a shortcut command like melos bootstrap current.

Additional context and comments

No response

ekasetiawans avatar Jun 02 '22 01:06 ekasetiawans

We could add a filter flag (e.g. --current) that selects the package which contains the current working directory. That would enable this features for all commands that support filters.

blaugold avatar Jun 03 '22 08:06 blaugold

I just got an idea, it seems that it would be better if it could detect the current working directory, if it is a project directory it will select only those projects, but if the directory is a directory containing several projects, it will select those projects.

For example, lets say we have this project structure:

melos.yaml
packages
-- apple
    -- apple_android
    -- apple_ios
    -- apple_web
-- orange
   -- orange_android
   -- orange_ios
   -- orange_web

If our working directory is packages folder, then it will select all projects (from apple_android to orange_web). If our working directory is apple folder, then it will select all apple projects (from apple_android to apple_web). If our working directory is apple_android then it will select only apple_android project.

ekasetiawans avatar Jun 03 '22 08:06 ekasetiawans