Open CapriciousRebel opened 2 years ago
Hey @CapriciousRebel! Nice work all around. Really excited for the GUI! Just thought I'll add a few thoughts here:
I don't think we're using tailwindcss the right way. Pretty sure we don't have to add that huge static/style.css
in our repo. I see a lot of similar stylesheets in node_modules/tailwindcss/dist/
so double check if this is the right way.
Do we need a server to view the static file? Why don't we generate the html file with ejs, store it in a folder (like cache) and just open up the file on the browser? Doesn't that seem simpler?
We have an eslint config set up so It'd be nice if you could lint the code before each commit :)
@thehanimo thanks for your comments!
I agree with each point that you have mentioned. I just wanted to create a Proof of Concept as soon as possible and so I worked on this over the weekend. I will address each point you mentioned in future commits :)
@rosekamallove I have squashed all the commits into one, and fixed all eslint issues as well, now you can rebase and continue work!
It is the 4th task, see the first comment
It is the 4th task, see the first comment
Got it! My bad.
@rosekamallove added the purge command, kindly rebase once.
You can run it using npm run build:css
@rosekamallove what is the update on your tasks?
Will push the changes by the end of this week, Diwali
@ljharb This PR is ready from my end, kindly review the changes at your earliest convenience!
Is there anything to work on right now? @CapriciousRebel
@rosekamallove As of now, I'm waiting for a review from Jordan, post which we can find some more issues/tasks to work on
@ljharb a gentle reminder for a review on this PR
Will update the PR before the end of the year :)
@ljharb updated my PR, left replies on your comments. Could you please give a further review?
@ljharb updated my PR, also left replies on some comments for further discussion.
@ljharb I have left more replies on our conversations, I guess we are really close to finishing this PR :) :excited:
also see some of the hidden conversations (https://github.com/ljharb/repo-report/pull/59#discussion_r776028853)
@ljharb updated my PR to include the token as a flag or positional argument from the frontend itself, also added a minimal error handler as well for when the user doesn't provide the token, maybe someday we could evolve the error handling to a modal in the frontend, after having handled all errors in the backend (ex: Bad Credentials error for GitHub token is not handled yet in the backend) Could you please give the PR another glance and leave your comments?
Also could you please address https://github.com/ljharb/repo-report/pull/59#discussion_r766080666
I'm confused; the frontend shouldn't be supplying the token - the invocation to start the server should be.
I see, so basically, a person does this:
repo-report --gui --token=<token>
This flow makes perfect sense to me, but I am a bit confused as to where will the token be stored during this time?
The token cannot be stored on the server, unless we use some in-memory store or a global variable that remains persistent through the operation because the most important point to focus on is that we run yargs-parser
every time a command is sent from the frontend:
In normal cases, the token is stored in the frontend as an HTTP-only cookie (safe from XSS attacks) or as a session variable that can be killed the moment the session ends, but we ruled out the possibility of storing the token in the frontend in our earlier discussions.
Summary: Where would the GitHub token be stored once the user provides it at the time of GUI invocation so that the user doesn't have to provide it every time from the frontend via the command?
@ljharb gentle reminder to give an update on this PR
Currently, the GUI is a work in progress.
How to use it?
npm install
..env
file.--gui
optionlocalhost:3000
! To run a different command, go back to terminal, and run another command along with the--gui
option (close the terminal that was running first withCmd + C
), then come back and refresh the browserAt this stage, I have used the following stack: Ejs: Generating HTML using templating. Express: Serving the generated HTML and the static files(CSS styles). TailwindCSS: For styling the HTML.
Tasks: