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

Always sync before select? #34

Closed
mikestopcontinues opened this issue Mar 29, 2020 · 8 comments
Closed

Always sync before select? #34

mikestopcontinues opened this issue Mar 29, 2020 · 8 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@mikestopcontinues
Copy link

Hey, I love the plugin! Just wondering if you could set it to always sync before opening the select GUI. I think this would definitely help streamline the UI.

@folke
Copy link
Owner

folke commented Mar 29, 2020

Ha, just left you a note on the visual studio marketplace about feature requests and seems you already posted one :)

Definitely possible. I'll look into it tomorrow!

@folke folke added the enhancement New feature or request label Mar 29, 2020
@folke
Copy link
Owner

folke commented Mar 29, 2020

Just to be clear:

  • the sync command, syncs all packages as workspace folders
  • you don't need to sync to open the select ui, meaning if a new package has been added to your repo (or removed), then clicking select, will show that new package too. No need to sync

Initially I thought you wanted to have the "sync" happen automatically when opening VSCode, but this is probably not what you want.

Things probably already work as you would like them to work.

I might need to rename sync to something different though, since it might be a bit confusing for sure...

@folke folke added the question Further information is requested label Mar 29, 2020
@folke
Copy link
Owner

folke commented Mar 29, 2020

Thinking about it, I should probably remove the sync option altogether, since using select and selecting all packages pretty much does the same

@mikestopcontinues
Copy link
Author

That sounds good to me. If that's the case, though, I think there's a bug when you create new subpackages. Neither sync nor select picks them up.

Given:

{
  "packages": ["apps/*", "libs/*"]
}

Then:

lerna create new-pack

Only a restart, then a sync will get it to show up. (First time it happened, some combination of syncs and selects got it to work for me, and that's why I opened this issue.)

@folke
Copy link
Owner

folke commented Mar 30, 2020

Looks indeed like a bug. Something is probably cached somewhere. I'll have a look!

@folke
Copy link
Owner

folke commented Mar 30, 2020

I just checked and it seems to work as expected on my end.

However, I think it's because you're using Lerna together with Yarn Workspaces.

When using both, we use the detector for Yarn, which should be in sync with Lerna anyways, for Lerna to work properly.

Can you check the following things?

  • What does the description say of the first label? (Yarn Workspace Root in the example below)
  • Is your yarn workspaces configuration in your top level package.json up to date? Should be something like:
{
  "workspaces": {
    "packages": ["apps/*", "libs/*"]
  }
}

image

@mikestopcontinues
Copy link
Author

Nah, I use npm. Been holding out for npm workspaces for like two years now. ;) But I did some further digging, and the problem was a mix of me doing something wrong and lerna doing something wrong.

I was running lerna create pkg libs/pkg instead of lerna create pkg libs. This had lerna putting the package in the default location apps (being the first glob that matches, I guess). So once I started using the command properly, sync started working fine. (And I apologize for wasting your time!)

But the fact remains that lerna create has got a bug, misrecording the actual location of the new package. So I'm gonna bring this over to them.

In any case, thanks again for the plugin (and for ultra, which I'm playing around with now). It really helps clean up the project.

@folke
Copy link
Owner

folke commented Mar 30, 2020

Glad you figured it out!

Have fun with ultra. It's being used under the hood by this vscode extension :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants