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@1.92.0 breaks my (admittedly weird) .vscodeignore configuration #576

Closed
Pustur opened this issue Jun 6, 2021 · 16 comments
Closed

vsce@1.92.0 breaks my (admittedly weird) .vscodeignore configuration #576

Pustur opened this issue Jun 6, 2021 · 16 comments
Assignees

Comments

@Pustur
Copy link

Pustur commented Jun 6, 2021

Hello,

I maintain a vscode theme and with vsce@1.92.0 I noticed that I couldn't run vsce package anymore, it would throw the following error:

 ERROR  The specified icon 'extension/img/logo.jpg' wasn't found in the extension.

After a bit of digging I noticed that the command vsce ls would not list all the needed files and would only output

package.json
README.md

Here's what it should output:

img/logo.jpg
img/screenshots/css.png
img/screenshots/editor.png
img/screenshots/html.png
img/screenshots/js.png
package.json
README.md
themes/Rapture-color-theme.json

So I think something changed in how the .vscodeignore file is handled. Here's my ignore file, I think the "weird hack" I was using doesn't work anymore:

# Ignore everything
*
*/**

# Whitelist needed files
!themes/*
!img/**/*{png,jpg}
!README.md

Was working with vsce@1.91.0 and below.

Is there any better way to whitelist files that I need instead of blacklisting the files that I don't need?

Thanks in advance.

PS: repo where this happens: Pustur/rapture-vscode

@Pustur Pustur changed the title vsce@1.92.0 breaks my (admittedly) weird .vscodeignore configuration vsce@1.92.0 breaks my (admittedly weird) .vscodeignore configuration Jun 6, 2021
@fyangstudio
Copy link

me too

.vscode/**
.vscode-test/**
src/**
.gitignore
**/tsconfig.json
**/*.map
**/*.ts
web/**
node_modules
!node_modules/prettier
!node_modules/@iceworks/code-generator

the node_modules/prettier not exist

@larshp
Copy link

larshp commented Jun 7, 2021

same issue here, vsce ls gives following files for different vsce versions, reproduce with https://github.com/abaplint/vscode-abaplint

1.88.0,

  • client/out/extension.js
  • img/abaplint_icon.png
  • img/abaplint.svg
  • img/outline.png
  • img/screenshot_20181108.png
  • img/screenshot_20190907.png
  • img/screenshot_20200824.png
  • LICENSE
  • package.json
  • README.md
  • server/out/server.js

1.92.0,

  • client/package.json
  • img/abaplint_icon.png
  • img/abaplint.svg
  • img/outline.png
  • img/screenshot_20181108.png
  • img/screenshot_20190907.png
  • img/screenshot_20200824.png
  • LICENSE
  • package.json
  • README.md
  • server/package.json

fyangstudio added a commit to fyangstudio/vscode-vsce that referenced this issue Jun 7, 2021
@joaomoreno joaomoreno self-assigned this Jun 7, 2021
@joaomoreno
Copy link
Member

Having adopted ignore, vsce now follows the exact rules of .gitignore. Sorry for the breakage.


@Pustur, see in the .gitignore documentation:

Example to exclude everything except a specific directory foo/bar (note the /* - without the slash, the wildcard would also exclude everything within foo/bar):

   /*
   !/foo
   /foo/*
   !/foo/bar

That would mean for you:

# Ignore everything
/*

# Whitelist needed files
!themes
!img
!README.md

@fyangstudio If you give me a pointer to your repo, I can try to figure out what adoption you need.


@larshp Can you try this?

.vscode/*
.github/*
.gitignore
**/tsconfig.eslint.json
**/tsconfig.base.json
**/.eslintrc.js
shared.webpack.config.js
client/*
!client/out
client/out/*
!client/out/extension.js
server/**
!server/out/server.js

@Pustur
Copy link
Author

Pustur commented Jun 7, 2021

Thanks @joaomoreno your solution works perfectly for me.

Feel free to close the issue or keep it open in case someone needs further assistance.

@larshp
Copy link

larshp commented Jun 7, 2021

yea, thanks, I'll figure it out 👍

@fyangstudio
Copy link

My extension:https://github.com/appworks-lab/pack/tree/master/extensions/material-helper

.vscodeignore:

.vscode/**
.vscode-test/**
src/**
.gitignore
**/tsconfig.json
**/*.map
**/*.ts
web/**
node_modules
!node_modules/prettier
!node_modules/@iceworks/code-generator

Using webpack to build my project, for some reason we external the prettier and @iceworks/code-generator.
So we ignore the node_modules but keep these two packages.

Unfortunately, it not working with vsce@1.92.x.

@joaomoreno
Copy link
Member

@fyangstudio It's exactly the same suggestion as for the others, can you try this:

.vscode/**
.vscode-test/**
src/**
.gitignore
**/tsconfig.json
**/*.map
**/*.ts
web/**
node_modules/*
!node_modules/prettier
!node_modules/@iceworks
node_modules/@iceworks/*
!node_modules/@iceworks/code-generator

@fyangstudio
Copy link

thx a lot

yhatt added a commit to marp-team/marp-vscode that referenced this issue Jun 7, 2021
@fyangstudio
Copy link

By the way @joaomoreno why this break change not upgrade to 2.0.0

@joaomoreno
Copy link
Member

@fyangstudio It's a good point, we maybe should. I wasn't aware of the massive breakage. At the same time, the ignore rules weren't documented at all. Now they are actually defined to be 100% matching what .gitignore does.

@kitsonk
Copy link

kitsonk commented Jun 8, 2021

Just commenting that it broke publishing of https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno. Suddenly getting reports that the extension is broken, and narrowed it down that v1.91.0 works but v1.92.0 and later breaks. Going to have to figure out what to change to make it work again. 😢

@joaomoreno
Copy link
Member

@kitsonk Oh no, sorry about that. I see you have found the issue and pushed a fix meanwhile, good to know.

smorimoto added a commit to ocamllabs/vscode-ocaml-platform that referenced this issue Jun 10, 2021
Signed-off-by: Sora Morimoto <sora@morimoto.io>
Pustur added a commit to Pustur/rapture-vscode that referenced this issue Jun 10, 2021
James-Yu added a commit to James-Yu/LaTeX-Workshop that referenced this issue Jun 11, 2021
strager added a commit to quick-lint/quick-lint-js that referenced this issue Jun 12, 2021
vsce recently changed their interpretation of .vscodeignore [1]. This change
causes node_modules/quick-lint-js-wasm/dist/quick-lint-js-vscode.wasm
and other important files to be omitted from the .vsix package.

Fix our .vscodeignore syntax to work with newer versions of vsce.

[1] microsoft/vscode-vsce#576
strager added a commit to quick-lint/quick-lint-js that referenced this issue Jun 12, 2021
quick-lint-js' .vsix packaging broke because of an upstream update to
vsce [1][2]. Prevent such problems from happening in the future by
requesting a specific version of vsce.

For publishing, always using the latest version of vsce is probably a
good idea, so leave the publishing instructions as-is.

[1] #356
[2] microsoft/vscode-vsce#576
robertoaloi added a commit to erlang-ls/vscode that referenced this issue Jun 14, 2021
SPGoding added a commit to SpyglassMC/vscode-datapack that referenced this issue Jun 18, 2021
Fix not packaging the resource folder per microsoft/vscode-vsce#576
SPGoding added a commit to SpyglassMC/Spyglass that referenced this issue Jun 18, 2021
Thanks to a breaking change on vsce's side: microsoft/vscode-vsce#576.
SPGoding added a commit to SpyglassMC/Spyglass that referenced this issue Jun 21, 2021
Thanks to a breaking change on vsce's side: microsoft/vscode-vsce#576.
@joaomoreno
Copy link
Member

joaomoreno commented Jun 23, 2021

Closing this as people have started adopting the new syntax. Admittedly we should've bumped the major version. By now it feels we might be on the tail end of changes though.

wangweixuan added a commit to wangweixuan/yithemes that referenced this issue Jun 23, 2021
@Timmmm
Copy link

Timmmm commented Jun 24, 2021

So as I understand it there's now no way to ignore everything by default and then whitelist files to include?

@Timmmm
Copy link

Timmmm commented Jun 24, 2021

In particular, the official LSP extension example surely no longer works?

.vscode/**
**/*.ts
**/*.map
.gitignore
**/tsconfig.json
**/tsconfig.base.json
contributing.md
.travis.yml
client/node_modules/**
!client/node_modules/vscode-jsonrpc/**    <-- the following lines will not be included because the parent is ignored.
!client/node_modules/vscode-languageclient/**
!client/node_modules/vscode-languageserver-protocol/**
!client/node_modules/vscode-languageserver-types/**
!client/node_modules/semver/**

@joaomoreno
Copy link
Member

So as I understand it there's now no way to ignore everything by default and then whitelist files to include?

Correct, just like gitignore.

In particular, the official LSP extension example surely no longer works?

I'll fix it accordingly.

@joaomoreno joaomoreno pinned this issue Jun 25, 2021
joaomoreno added a commit to joaomoreno/vscode-ocaml-platform that referenced this issue Jun 25, 2021
Jason3S added a commit to streetsidesoftware/vscode-spell-checker that referenced this issue Jun 27, 2021
Related to [vsce@1.92.0 breaks .vscodeignore configuration · Issue #576 · microsoft/vscode-vsce](microsoft/vscode-vsce#576)
ulugbekna pushed a commit to ulugbekna/vscode-ocaml-platform that referenced this issue Jun 30, 2021
@joaomoreno joaomoreno unpinned this issue Jul 12, 2021
ulugbekna pushed a commit to ulugbekna/vscode-ocaml-platform that referenced this issue Jul 31, 2021
Signed-off-by: Sora Morimoto <sora@morimoto.io>
ulugbekna pushed a commit to ulugbekna/vscode-ocaml-platform that referenced this issue Jul 31, 2021
ulugbekna pushed a commit to ulugbekna/vscode-ocaml-platform that referenced this issue Aug 4, 2021
Signed-off-by: Sora Morimoto <sora@morimoto.io>
ulugbekna pushed a commit to ulugbekna/vscode-ocaml-platform that referenced this issue Aug 4, 2021
misode pushed a commit to misode/SPYGlass that referenced this issue Dec 26, 2022
Thanks to a breaking change on vsce's side: microsoft/vscode-vsce#576.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants