Skip to content
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

Adding a frontend CLI command #1272

Open
Beanow opened this issue Aug 8, 2019 · 3 comments
Open

Adding a frontend CLI command #1272

Beanow opened this issue Aug 8, 2019 · 3 comments

Comments

@Beanow
Copy link
Member

@Beanow Beanow commented Aug 8, 2019

As a preparation for NPM packages #1232
Having a lightweight sourcecred frontend command of sorts would be swell.

Ideally we would not need to use webpack, babel, flow, etc for this command.
It would take a pre-compiled frontend template and make the necessary modifications based on the loaded sourcecred data.

Looking into the current situation, I think that means preparing /api/v1/data and injecting some titles and hrefs in /prototype/index.html and /(timeline|prototype)/<org>/<repo>/index.html.

Doing this would allow an NPM package to ship and have both frontend and backend capabilities without depending on all the webpack tooling. Slimming down the package significantly.

@decentralion

This comment has been minimized.

Copy link
Member

@decentralion decentralion commented Aug 8, 2019

This is a great suggestion @Beanow. Getting something like this working well is vital to making the future sourcecred command fully usable for setting up an instance.

I think the trickiest bit will be getting the routing for the projects to work correctly. The way the project ids get piped around is a little weird, they get put into the process environment in config/env.js, you can grep for PROJECT_IDS to find the usage.

@Beanow

This comment has been minimized.

Copy link
Member Author

@Beanow Beanow commented Aug 8, 2019

Note from #1232 musings, the frontend generation may be part of the update command, so like the refactored load command is probably best as a combination of a javascript api + cli code to call that.

@Beanow

This comment has been minimized.

Copy link
Member Author

@Beanow Beanow commented Oct 3, 2019

New suggestion here https://discourse.sourcecred.io/t/sourcecred-instance-system/244/2
To avoid needing to compile the frontend entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.