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

paste in package #97

Open
jimmywarting opened this issue Sep 4, 2021 · 11 comments
Open

paste in package #97

jimmywarting opened this issue Sep 4, 2021 · 11 comments

Comments

@jimmywarting
Copy link

jimmywarting commented Sep 4, 2021

I work with private packages that are not hosted on npm...
so it would make life easier if it where just possible to copy paste in the raw content of the package.json (or the file itself) and paste it in anywhere onto the site

@stof
Copy link
Contributor

stof commented Oct 28, 2021

you can already select your package.json file or drag-and-drop it.

Maybe you meant working with the lock file instead ?

@jimmywarting
Copy link
Author

jimmywarting commented Oct 28, 2021

I was more thinking in terms of viewing a package.json file on github, copy the raw content into clipboard and just pasting it as plain text without any files or drag and drop as an other mean of having to drag and drop files.

kindof how you can do it on svgo UI (with paste markup).

Say that you would want to view this for instance:

{
  "name": "foo"
  "dependencies": {
    "standard": "*"
  }
}

(hover it, copy the content to clipboard with the copy button and then paste it into the web ui somehow)

but hey, working with the lock file would also be cool if it could do that :)

@stof
Copy link
Contributor

stof commented Oct 28, 2021

ah, if the goal is to support cases where you don't have the package.json locally, it makes more sense indeed.

@jimmywarting
Copy link
Author

yea!
also if i could stay within the editor and not having to bring up the file in explorer then i could just copy the content and go straight to https://npmgraph.js.org/ and paste the json text without using the mouse to dragging in files or look for them on my local machine :P

@broofa
Copy link
Collaborator

broofa commented Oct 28, 2021

copy the content and go straight to https://npmgraph.js.org/

I agree. I've had use cases for this sort of thing as well.

This is fertile ground for improvement here. E.g. If we add a package.json viewer-editor, and drive the graph from that, then we have a single point of control where we can drop packag.json content from pretty much anywhere - pasteboard, github repos, local (private) servers, dropped files... you name it.

@fregante
Copy link
Member

fregante commented Oct 28, 2021

viewer-editor

Sounds a bit much, especially because the editor would likely require something like CodeMirror and bring no serious benefits. We really just need a label like "You can also paste the contents of package.json in the search field" on the info tab and automatically detect the paste of a valid JSON file. It won't be editable in that field of course, it's just a paste point

Related:

@jimmywarting
Copy link
Author

We really just need a label like "You can also paste the contents of package.json in the search field" on the info tab and automatically detect the paste of a valid JSON file. It won't be editable in that field of course, it's just a paste point

☝️ yea, this is what i want to have

@fregante
Copy link
Member

fregante commented Oct 30, 2021

Example UI from https://www.remove.bg, no field used

Screen Shot 3

@jimmywarting
Copy link
Author

as long as the windows has focus then it's okey to use it. (window.onpaste) otherwise a thing like clipboard access and reading it from clipboard on a click event could work too Read json package from clipboard

@broofa
Copy link
Collaborator

broofa commented Sep 23, 2022

Just a quick note to add that being able to work with yarn.lock files would be nice as well

@broofa
Copy link
Collaborator

broofa commented Oct 16, 2023

Just noting that this should be straight-forward to implement now that we have the packages hash param.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants