Skip to content

[email protected] breaks my (admittedly weird) .vscodeignore configuration #576

Closed

Description

@Pustur

Hello,

I maintain a vscode theme and with [email protected] 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 [email protected] 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

Activity

  1. changed the title [-][email protected] breaks my (admittedly) weird .vscodeignore configuration[/-] [+][email protected] breaks my (admittedly weird) .vscodeignore configuration[/+] on Jun 6, 2021
  2. fyangstudio commented on Jun 7, 2021

    @fyangstudio

    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

  3. larshp commented on Jun 7, 2021

    @larshp

    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
  4. added a commit that references this issue on Jun 7, 2021
    da2176c
  5. joaomoreno commented on Jun 7, 2021

    @joaomoreno
    Contributor

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


    Loris Bettazza (@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
    

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


    Lars Hvam (@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
    
  6. Pustur commented on Jun 7, 2021

    @Pustur
    Author

    Thanks João Moreno (@joaomoreno) your solution works perfectly for me.

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

  7. larshp commented on Jun 7, 2021

    @larshp

    yea, thanks, I'll figure it out 👍

  8. fyangstudio commented on Jun 7, 2021

    @fyangstudio

    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 [email protected].

  9. joaomoreno commented on Jun 7, 2021

    @joaomoreno
    Contributor

    yangfan (@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
    
  10. fyangstudio commented on Jun 7, 2021

    @fyangstudio

    thx a lot

  11. fyangstudio commented on Jun 7, 2021

    @fyangstudio

    By the way João Moreno (@joaomoreno) why this break change not upgrade to 2.0.0

  12. joaomoreno commented on Jun 7, 2021

    @joaomoreno
    Contributor

    yangfan (@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.

  13. kitsonk commented on Jun 8, 2021

    @kitsonk

    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. 😢

  14. 12 remaining items

  15. added a commit that references this issue on Jun 23, 2021
  16. Timmmm commented on Jun 24, 2021

    @Timmmm

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

  17. Timmmm commented on Jun 24, 2021

    @Timmmm

    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/**
    
  18. joaomoreno commented on Jun 25, 2021

    @joaomoreno
    Contributor

    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.

  19. added a commit that references this issue on Jun 27, 2021
  20. added a commit that references this issue on Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions