This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 227194

Summary: Add more metadata into project for each added JavaScript file
Product: javascript Reporter: Tomas Mysik <tmysik>
Component: LibrariesAssignee: Jan Stola <jstola>
Status: RESOLVED FIXED    
Severity: normal CC: dkonecny, pjiricka, tmysik
Priority: P3    
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 227195    

Description Tomas Mysik 2013-03-08 07:30:28 UTC
From David's e-mail:

CDNJS gives us quite a lot of useful information about each library and I think we should store it along side of downloaded JS file. That is, in addition to creating libs/jquery/jquery.min.js we should create also libs/jquery/package.json with content from the CDNJS. For example in jquery case it could be at least:

{
    "origin": "http://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"
    "name": "jquery",
    "filename": "jquery.min.js",
    "version": "1.9.0",
    "description": "jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.",
    "homepage": "http://jquery.com/",
    "repositories": [
       {
           "type": "git",
           "url": "https://github.com/jquery/jquery.git"
       }
   ]
}

This could be used in the NetBeans UI to indicate which version of library is being used in project, where it came from and where is library's repository/homepage.
Comment 1 Petr Jiricka 2013-03-08 08:52:44 UTC
I agree the ability to upgrade libraries could be beneficial to users, but if we create package.json by default, could some users see this as us cluttering their sources? Especially those not interested in upgrade functionality.

Also, doesn't this feature overlap with package managers like Bower?
Comment 2 Tomas Mysik 2013-03-08 12:00:20 UTC
I have to agree with Petr.
Comment 3 Tomas Mysik 2013-03-08 12:02:49 UTC
OTOH, if one uses dependency/package manager then the JS Libs panel will not be likely interesting for him at all...
Comment 4 David Konecny 2013-03-10 21:14:14 UTC
(In reply to comment #1)
> I agree the ability to upgrade libraries could be beneficial to users, but if

An ability to upgrade a library is one usecase. Second is to give user simply some information about the library itself. Things like that are handy in long term - when you need to figure half a year later where a library come from etc. Sure you can google it.

> we create package.json by default, could some users see this as us cluttering
> their sources? Especially those not interested in upgrade functionality.

Maybe. It's a library descriptor. No harm done.

If really an issue we could store those files under nbproject folder perhaps??

> Also, doesn't this feature overlap with package managers like Bower?

They do something similar I think.
Comment 5 Tomas Mysik 2014-09-10 10:58:15 UTC
Reassigning to Honza, he will implement new JS libraries.

Thanks.
Comment 6 Jan Stola 2015-06-16 11:57:18 UTC
I believe that this can be closed as we store some metadata about the libraries installed into user projects. npm libraries are tracked in package.json, bower libraries are tracked in bower.json and CDNJS libraries are tracked project's auxiliary configuration.