wentwrong / gh-canary Goto Github PK
View Code? Open in Web Editor NEWLearning project: dashboard for Github Issues (TypeScript/Web Components/Express.js)
License: MIT License
Learning project: dashboard for Github Issues (TypeScript/Web Components/Express.js)
License: MIT License
Let's use the debug module instead of console.log to output debug info.
We might add Github OAuth for safe user authorization (and webhook creation for repos selected by him). Do we need it at this moment?
Main functionality feature of our application should be maintainers notification through comments (user mention) on non-collaborator pull requests. For that purpose, at first, we need authenticate our comment-bot on Github.
.env
variables;For now, useful content delivers to user via server-side rendering. I propose to split into client side logic (fetch
data and render) and server-side REST-service.
.js/.css/etc
(and injecting .js
to .html
via HtmlWebpackPlugin
)fetch
on client-side for requesting data from server;debug
module in client scripts.unhandledrejection
and error
event handlers to the window
object.Notes:
Try to implement transpiling in #16 and enable the strict typechecking via the strict: true in another PR.
Currently, mock-data is retrieved manually and for tests we are using two services: one for actual App
and another for mock github API endpoints.
Using Nock module can be quite useful:
App
which host mock third-party API.Thus, I think that using this module should lead to simplicity of code.
As mentioned in the pull request #30, our template system on the client is far from perfect and can certainly be improved.
We can move our page to a dedicate directory (e.g. resources/html
) and use app.static
to allow Express optimizing requests to it.
Currently, our code is limited to start just one server. To make our code reusable, we should create and export an App class, that allows creating multiple instances of our app on different ports.
Take a look at the dotenv module to get server's host and port from environment variables and .env
files.
Let's add TypeScript to our project and use import
/export
instead of require
/module.exports
.
I don't insist that you should transform all your JS files to TS files right now. Just try setting allowJS: true
& checkJs: false
and compile your JS files without type checking.
Some other hints about the initial configuration:
esModuleInterop: true
target: es2018
Note: we can use TypeScript for client scripts too, and enable the built-in SystemJS bundling.
We should be able to update user statuses on the fly. Let's do it via polling as the first attempt. We can introduce a config option (e.g. POLLING_INTERVAL
) and constantly query our API. We also have to write a functional (e2e) test to cover this functionality.
For now, Express instance incapsulated in our App class and we don't have any way to configure settings.
Let's build a prototype that will be given via .env
files or env variables:
/
+ repo name)No fancy UI is required, you can use regular HTML tables to display the data.
For dynamic created stuff (fetched PRs, etc) we need some kind of template engine.
Currently, the npm start
cannot start our app. We should fix it.
Hint: take a look at the process.mainModule and this paragraph about modules :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.