| Summary: | Investigate parsing package.json (and other well known files) for dependent libraries | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Steve Northover <steve_northover> |
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P2 | CC: | kuschel, Michael_Rennie |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | 2017-02-24 | ||
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see: https://dev.eclipse.org/mhonarc/lists/orion-dev/msg04002.html It is still important that we use this information to pre-load the tooling Some thoughts: 1. if you have a node_modules folder (you have done an 'npm install'), we don't need to read this file since we will trace the dependencies into that folder 2. if you have no node_modules, we could look in the file to find package name + version to use to look up a definition for it. For example if we ever get the support completed to grab and convert a DefinitelyTyped interface into a Tern index, we could use this info to know which interface to look for. The .tern-project file is for power users only. If one is there, we use it (let's say entries in it override package.json ... need to decide). None of our tooling ever creates it. We can also get the version information from these files and warn the developer that our version of the type lib files doesn't match the version that is being use (I think that the thing McQ recently hit) Bug 511482 has the fix for this bug in it - it reads package.json and will auto-load any tern plugins available for the listed dependencies. Bug 512517 was opened to track support for pre-loading plugins based on indexes added in the .definitions folder. Closing this as fixed (via bug 511482). |
1) Node.js and npm are pretty standard 2) Here is a package.json: { "name": "NodejsStarterApp", "version": "0.0.1", "description": "A sample nodejs app for Bluemix", "dependencies": { "express": "3.4.7" }, "engines": { "node": "0.10.*" }, "repository": {} } 3) We can see that it uses express 4) FEATURE REQUEST: make .tern use this information automatically The first cut would be to initialize the .tern-project file but better would be to teach tern to eat this file so that when the file changes, tern is always up to date.