-
Notifications
You must be signed in to change notification settings - Fork 242
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
Extend and improve cordova info
output
#616
Conversation
This only clutters users' projects. If a user wants the output in a file, they can simply redirect stdout.
* Output files last & delimit them in HEREDOC style * Indent all regular blocks * Remove empty trailing lines * Code cleanup
This contains * OS (process.platform) * Node version * npm version
src/cordova/info.js
Outdated
.filter(name => name.startsWith('cordova-')) | ||
.map(name => `${name}@${versionFor(name)}`) | ||
.join('\n'); | ||
return `Cordova version ${pkg.version} with:\n${indent(deps)}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=> Cordova CLI version ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, actually it's the cordova-lib version. CLI is should really only be a thin wrapper around lib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. Ohhhh.
Well, that's too complicated for me ;)
How about outputting the CLI version in the "headline" and adding cordova-lib
in the list of "packages" then? That would be what some user (read: me) expects and still have all the information you need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, that would be difficult with the current approach (we are looking at our dependencies, CLI depends on us though).
This should definitely go onto our TODO list though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now an issue at: #659
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change it to Cordova lib version
here in the meantime to avoid confusion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
|
||
function listPlugins (projectRoot) { | ||
var pluginPath = path.join(projectRoot, 'plugins'); | ||
var plugins = cordova_util.findPlugins(pluginPath); | ||
var plugins = cordova_util.findPlugins(pluginPath).join('\n'); | ||
return 'Plugins:' + (plugins.length ? '\n' + indent(plugins) : ' []'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this also output the plugin version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. We would have to check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now tracked at #660
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh very nice!
Could you maybe add "Platforms:" section similar to "Plugins" or "Environment" (with version info) before the platform details (getPlatformInfo
) are output?
(And see other comments in code directly)
@janpio Would you agree to merge my current version and collect further improvements in an issue for them to be implemented in later PRs? That way, we can have some improvement now and polish it later (I have no time to do so, right now) |
Ok, will do the Cordova => Cordova lib change myself and extract the other stuff into issues, then merge. |
@janpio Great, thanks! |
Platform information request now tracked in #661 |
What it does
Extend and improve
cordova info
output as well as a code cleanup ofinfo.js
.Before
After
What testing has been done on this change?
Ran
cordova info
in various settings.