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

There is no way to show the NPM scripts explorer when there is no top level package.json #104591

Closed
ghost opened this issue Aug 13, 2020 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release tasks Task system issues verified Verification succeeded

Comments

@ghost
Copy link

ghost commented Aug 13, 2020

Issue Type: Bug

Previous to this version, NPM Script Explorer would show for the following scenario:

Solution
- Project1
- package.json (with scripts)
- Project2
- package.json (with scripts)
- Project3
- no package.json

To test if this was an extension causing this issue, I installed the latest insider:
(Version: 1.48.0-insider (user setup)
Commit: db40434
Date: 2020-08-11T23:21:50.282Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.19041)

I made sure that no extensions were installed and that NPM Script Explorer was turned on. When I opened up the solution, the NPM Script Explorer did not show up.

If I open up by project, the NPM Script Explorer appears as expected.

I checked the Dev Tools and there were no errors in the console.

VS Code version: Code 1.48.0 (db40434, 2020-08-13T07:50:42.600Z)
OS version: Windows_NT x64 10.0.19041

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2808)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.83GB (16.61GB free)
Process Argv --folder-uri file:///c%3A/dev/Repos/site-dental-ecom
Screen Reader no
VM 0%
@IllusionMH
Copy link
Contributor

Same problem: it will find all needed package.json files if there is one in the root of workspace, but view won't be shown if there is no root package.json even if checkbox for "npm.enableScriptExplorer": true suggests that it will search for non-top files.

Looks like enableScriptExplorer is not referenced in sources.

@alexr00
Copy link
Member

alexr00 commented Aug 14, 2020

By default, the NPM script explorer is now hidden when you open a project that you haven't opened before. We decided to do this because the Explorer viewlet can have a lot of views in it, and it's important to us that we keep it form being cluttered. Since not everyone uses the NPM script explorer, it seemed like a logical choice to hide by default.

You can unhide it by using the Views menu in the explorer:
recording (16)

The old setting is confusing however, and should be deprecated with a useful message.

@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release tasks Task system issues and removed new release labels Aug 14, 2020
@alexr00 alexr00 changed the title NPM Script Explorer not showing for solution enableScriptExplorer should have a useful deprecation message Aug 14, 2020
@IllusionMH
Copy link
Contributor

IllusionMH commented Aug 14, 2020

@alexr00 This was first thing I've tried, but I don't see NPM Scripts at all (even as hidden) if there in no package.json in the root of the workspace. I think original report also refers to this problem.
On the screenshot you can see opened package.json in *-ui-web folder, bit view is not available there.
image

But if I add empty package.json to the root of workspace (one level above *-ui-web) I can see all scripts form package.json files in *-ui-web and nested folders.


Just tried 1.46.1 - it has NPM Scripts view even without package.json in the root of workspace folder which is what I expect.

@alexr00
Copy link
Member

alexr00 commented Aug 14, 2020

I see the problem, thanks for elaborating further!

@alexr00 alexr00 changed the title enableScriptExplorer should have a useful deprecation message There is no way to show the NPM scripts explorer when there is no top level package.json Aug 14, 2020
@alexr00 alexr00 added this to the July 2020 Recovery milestone Aug 14, 2020
alexr00 added a commit that referenced this issue Aug 14, 2020
alexr00 added a commit that referenced this issue Aug 14, 2020
@alexr00 alexr00 closed this as completed Aug 18, 2020
@alexr00
Copy link
Member

alexr00 commented Aug 19, 2020

To verify:

  • Start VS Code with a fresh user data dir
  • Open a folder that doesn't have a package.json at the top level.
  • Verify that if you open the Explorer "..." views menu you see NPM scripts and can show it.

@sandy081 sandy081 added the verified Verification succeeded label Aug 19, 2020
@gadreash
Copy link

To verify:

  • Start VS Code with a fresh user data dir
  • Open a folder that doesn't have a package.json at the top level.
  • Verify that if you open the Explorer "..." views menu you see NPM scripts and can show it.

Do you know which vscode build is this patch supposed to be in?

@alexr00
Copy link
Member

alexr00 commented Aug 26, 2020

It is available in 1.48.1

@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release tasks Task system issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants