I was testing the vsce ls command with my extension and have the following properties set in my package.json:
"vsce": {
"dependencies": false
},
"files": [
"dist/extension.min.cjs",
"assets/**/*",
"LICENSE"
],
Yet when running npx @vscode/vsce ls --tree it outputs:
regex-radar-0.1.0.vsix
├─ LICENSE [1.07 KB]
├─ package.json [7 KB]
├─ ../
│ └─ ../
│ ├─ .gitignore [0.13 KB]
│ ├─ .prettierrc [0.73 KB]
│ ├─ LICENSE [1.07 KB]
│ ├─ README.md [6.34 KB]
│ ├─ package-lock.json [54.05 KB]
│ ├─ package.json [0.83 KB]
│ ├─ tsconfig.json [0.89 KB]
│ ├─ turbo.json [0.55 KB]
│ ├─ .git/
│ └─ <huge output of files>
│ ├─ .vscode/
│ │ ├─ di.json.code-snippets [0.55 KB]
│ │ ├─ extensions.json [0.1 KB]
│ │ └─ launch.json [3.46 KB]
│ ├─ assets/
│ │ ├─ logo-wide.png [544.75 KB]
│ │ └─ logo.png [424.46 KB]
│ ├─ esbuild/
│ │ ├─ shared-options.js [1.15 KB]
│ │ └─ plugins/
│ │ ├─ problem-matcher-plugin.js [0.64 KB]
│ │ ├─ scm-importer-plugin.js [0.71 KB]
│ │ └─ workspace-packages-plugin.js [1.16 KB]
│ ├─ examples/
│ │ ├─ .gitignore [0.01 KB]
│ │ ├─ examples.js [2.37 KB]
│ │ ├─ examples.ts [2.3 KB]
│ │ ├─ .vscode/
│ │ │ └─ settings.json [0.06 KB]
│ │ └─ node_modules/
│ │ └─ index.js [0.11 KB]
│ ├─ node_modules/
│ └─ <huge output of files>
├─ assets/
│ └─ icon.png [49.63 KB]
└─ dist/
└─ extension.min.cjs [776.61 KB]
When I run npx @vscode/vsce ls --tree --no-dependencies it outputs:
regex-radar-0.1.0.vsix
├─ LICENSE [1.07 KB]
├─ package.json [7 KB]
├─ assets/
│ └─ icon.png [49.63 KB]
└─ dist/
└─ extension.min.cjs [776.61 KB]
Which is also what is the result in the vsix when I run npx @vscode/vsce pack.
My project is a monorepo setup like:
root
apps
vscode-extension
package.json (this is where vsce is invoked)
packages
node_modules
I would expect the ls command to:
- respect the
vsce field just like publish and pack do.
- even if
dependencies is true, I would not expect ls files/folders from the directory where node_modules is located. Especially folders like .vscode which the docs say will always be ignored and .git which makes no sense to ever include.
I think the reason it does not respect the vsce options is because ls is not using patchOptionsWithManifest like package and publish are.
I do not understand why ls is showing other files and folders from the root directory.
I was testing the
vsce lscommand with my extension and have the following properties set in mypackage.json:Yet when running
npx @vscode/vsce ls --treeit outputs:When I run
npx @vscode/vsce ls --tree --no-dependenciesit outputs:Which is also what is the result in the
vsixwhen I runnpx @vscode/vsce pack.My project is a monorepo setup like:
rootappsvscode-extensionpackage.json(this is wherevsceis invoked)packagesserverlsp-typesparsersnode_modulesI would expect the
lscommand to:vscefield just likepublishandpackdo.dependenciesistrue, I would not expectlsfiles/folders from the directory wherenode_modulesis located. Especially folders like.vscodewhich the docs say will always be ignored and.gitwhich makes no sense to ever include.I think the reason it does not respect the
vsceoptions is becauselsis not usingpatchOptionsWithManifestlikepackageandpublishare.I do not understand why
lsis showing other files and folders from the root directory.