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

vsce publish includes files from adjacent directories. #777

Closed
romainmenke opened this issue Oct 12, 2022 · 11 comments
Closed

vsce publish includes files from adjacent directories. #777

romainmenke opened this issue Oct 12, 2022 · 11 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@romainmenke
Copy link

romainmenke commented Oct 12, 2022

Workspace outline :

'./' workspace A root
  - `./projects/1/` project 1
  - `./projects/2/` project 2
  - `./projects/3/` project 3
  - ...
'./vscode-extensions/' workspace B root
  - './vscode-extensions/node_modules' shared `node_modules`
  - './vscode-extensions/extension-1' extension 1
  - './vscode-extensions/extension-2' extension 2
  - ...

Each is a npm workspace with a single package-lock.json and a shared node_modules directory.

When we try to publish extension 1 it fails with : ERROR invalid relative path: extension/../.DS_Store

vscode ls reveals :

../.DS_Store
dist/extension.js
package.json
README.md
../extension-2/.eslintrc.js
../extension-2/.gitignore
...

So it tries to include extension 2 while publishing extension 1.


I have no idea if workspace A is relevant in any way.
I wanted to provide an as complete picture of our setup as possible.

@romainmenke
Copy link
Author

When I remove workspace B root and treat each extension as completely separate it works fine.

vscode ls :

dist/extension.js
package.json
README.md

@joaomoreno
Copy link
Member

It's hard to understand the full steps here. Can you scaffold a project and put it in GitHub so I can run vsce against it and reproduce? Also, when you run vsce, which directory exactly are you running it from?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Oct 19, 2022
@joaomoreno joaomoreno self-assigned this Oct 19, 2022
@romainmenke
Copy link
Author

Minimal repro of our setup : https://github.com/romainmenke/vsce-workspace-bug-1

@joaomoreno
Copy link
Member

I continue not to fully understand from where you run vsce. In your sample, I just ran it from .vscode-no-workspaces/extensions/a and it works:

image

@romainmenke
Copy link
Author

@joaomoreno Thank you for taking a look.
I am unsure how or why this was unclear :/
But please let me know how I can improve the readme on the repo.

To trigger the failure you follow these steps :

Fails with workspaces :

cd .vscode/extensions/a
npm install
npm run vsce ls

@joaomoreno
Copy link
Member

Oh I completely ignored the README. Sorry about that.

@joaomoreno
Copy link
Member

joaomoreno commented Oct 20, 2022

Got it. This is about npm workspaces, which vsce doesn't support yet: #580

@joaomoreno joaomoreno closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2022
@romainmenke
Copy link
Author

Thanks for the reply and link to that issue.

Is it possible to have a more specific error message?

It took me a long time to figure out that workspaces were a factor and it didn't even occur to me that they were not supported at all (we've had them for some time now).

I don't mind that they aren't supported (yet) but if possible and low effort a good error message would be nice.

@joaomoreno
Copy link
Member

It's hard to detect workspaces from a's viewpoint. What is detected is the presence of symlinks. We could add a disclaimer maybe you're using npm workspaces? to the error message.

@romainmenke
Copy link
Author

If it is not possible to accurately detect workspaces it is likely better to do nothing.
Otherwise we risk making it confusing for other cases.

@hayemaxi
Copy link

as a workaround, you can add adjacent directories to your .vscodeignore file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants