newscorp-ghfb / NewsKit

The NewsKit Design system
https://newskit.co.uk
Other
129 stars 13 forks source link

Developer Quick Start Command Lines in ReadMe.md #913

Open dj-kmuldoon opened 1 year ago

dj-kmuldoon commented 1 year ago

Is your feature request related to a problem? Please describe.

As a developer who does not code daily in NewsKit rep, it would be helpful to provide a list of common commands in the ReadMe.md to allow me to quickly do basic tasks. The package.json file has 72 commands and difficult to know which to run or next steps required.

Describe the solution you'd like

1) Document how to run the documentation site locally (with the URL we need to launch in the browser) 2) Document how to run specific tests (running all will run out of memory). 3) Best practice to implement dark-mode in your app (perhaps a link to the doc site that describes) 4) More to come, I'm sure.

Describe alternatives you've considered

Developers who are not day-to-day familiar with NewsKit could store commands in a code snippet manager, but seems unlikely that would be scalable.

Additional context

A Dow Jones developer asked about how to implement dark-mode in the NewsKit way, and I had difficulty finding basic commands to verify I was giving the correct information. Additionally, with a quick start command line documentation, the developer could have self-discovered the answers needed.

mutebg commented 1 year ago

Hey @dj-kmuldoon here is a list of npm scripts -> https://github.com/newscorp-ghfb/NewsKit/blob/main/docs/scripts.md We need to make this more evident so it is not so difficult to find.

Quick answers to you questions: 1 -> If you want to run site locally it is dev:docs I think the console/terminal will show you the URL ( http://localhost:8081/ )

2 -> About that we rely on jest, for example, you can run "yarn test:unit:watch" which will run all unit tests in "watch" mode, which means every time you update test or file it will run only related tests. You can also press "P" and it will show you Usage menu where you can filter or execute other commands

Screenshot 2023-08-14 at 9 48 45

3 -> I guess this is up to the developers, I personally don't think there is best "practice" about it, at the end of the day for devs is just switching 2 themes. There are too many variables for how to do that like do you rely on OS theme, do you give option to user to switch it, if so where do you save the current theme like, cooking, localstorage, user preferences?

Happy to discuss in more details any of these and help with improving docs