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
add system info cli command #329
Conversation
Closes #321 |
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.
This is awesome! I've left some feedback that might make the code easier to read and a bit more modern.
packages/cli/src/commands/info.js
Outdated
npmPackages: ['@redwoodjs/core'], | ||
Databases: ['SQLite'], | ||
}) | ||
.then((envinfoOutput) => { |
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 think our handlers support async/ await. So you could write this as:
export const handler = async () => {
try {
const output = await envinfo.run()
} catch (e) {
console.error("Cannot access env info.")
process.exit(1)
}
}
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.
Updated to use async/await. The const output = ...
didn't seem necessary here. But I could be missing something obvious; just let me know.
Can you let me know what the import error is?
I personally don't think we should mess with people's clipboards.
I think what you have is perfect. |
The output is only copied when a user deliberately passes the flag, right? I think it's handy. |
I think this is in great shape!
Though it's a nice feature, I lean towards the idea of keeping things lean. It isn't that difficult to copy something to clipboard manually.
Looks great! Do we want to add printing out the version of |
Thanks, all. I’ll get back to these comments later today. Realized I never added the current output for feedback: $ yarn rw info -C
yarn run v1.22.4
$ /Users/price/Repos/xx-redwoodblog/node_modules/.bin/rw info -C
System:
OS: macOS 10.15.3
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.16.0 - /var/folders/gj/_y54h7q11mz9rwnhn16h6yrr0000gn/T/yarn--1585031216782-0.8567735743019371/node
Yarn: 1.22.4 - /var/folders/gj/_y54h7q11mz9rwnhn16h6yrr0000gn/T/yarn--1585031216782-0.8567735743019371/yarn
Databases:
SQLite: 3.28.0 - /usr/bin/sqlite3
Browsers:
Chrome: 80.0.3987.149
Firefox: 73.0.1
Safari: 13.0.5
npmPackages:
@redwoodjs/core: ^0.2.2 => 0.2.5
System info copied to clipboard ✂️ 📋
✨ Done in 1.13s. |
Thanks for the feedback and help here, everyone. Latest version changes:
@peterp Could not find a declaration file for module 'envinfo'. '/Users/price/Repos/redwoodjs-redwood/node_modules/envinfo/dist/envinfo.js' implicitly has an 'any' type.
Try `npm install @types/envinfo` if it exists or add a new declaration (.d.ts) file containing `declare module 'envinfo';`ts(7016) |
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.
nice work! One last thing - you left the "copy-to-clipboard" flag included on the command, even though we took out that functionality.
(whoops, forgot to include suggested changes, sorry, you can delete this comment)
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.
@thedavidprice - nice work! One last thing - you left the "copy-to-clipboard" flag included on the command, even though we took out that functionality.
Note: some updates to our ESLint/Prettier config were causing Lint check error. I committed simple fix to master here bd98d07 |
add system info cli command
Notes/Questions: