c-hive / team-contribution-calendar Goto Github PK
View Code? Open in Web Editor NEWGitHub-like contribution calendar for the whole team
License: MIT License
GitHub-like contribution calendar for the whole team
License: MIT License
Consider the mandatory/optional params that will be passed to the entry function.
Mandatory params(check whether they're defined or not):
Optional params:
Tasks:
At first, don't try to deal with complex things, just ensure that all of the params are in the appropriate form(unit tests should be included).
See:
team-contribution-calendar/package.json
Lines 71 to 73 in 2541568
Add a script (and possibly some code) so that when running npm run dev
a local instance of TCC is served from source.
Add support for timeframes, i.e. certain user's contributions to be shown for only a certain timeframe, defined in days. The parameter must be optional, no breaking changes.
Document usage instructions for the minified version in dist
in the readme. Keep the instruction simple and code example focused.
Also, think about renaming index.min.js
to perhaps team-contribution-calendar.min.js
.
Make sure that the first GH user's calendar is full-width.
Tasks:
Our proxy didn't work with a test heroku deployment for some reason, but it should be the default.
Besides the JavaScript codes, the current distified version contains the imported resources at the top of the files. I'm not sure of the proper way of handling this case, but the idea might be to exclude these files and store them separately - as browserify
provides roughly the same functionality.
Is anyone familiar with this topic? If so, it'd be great if one could leave some ideas/proposals. Either way, let's try to find the "conventionals" / best practices that are related to this particular case.
Let's see the outcome of this: flexdinesh/npm-module-boilerplate#5
AFAICT, the issue is that Babel relies on the browserlist
entry to transpile the code to the target environment(s). IIRC, this was crucial to support evergreen browsers in dev
environment(e.g. to transpile async/await, see #44). However, it's incompatible with our distifying flow(since we support the latest two versions of popular browsers, ES6 keywords aren't transpiled to ES5, that's why uglify-js
complains about the const
keyword).
Currently the whole process is vague to me, but one solution could be to separate the dev/parcel and prod/distify environments from each other.
When fetch fails there's an exception and the loading spinner is stuck. Instead, it should be handled gracefully and it should not remain in a loading state.
Prepare the whole structure for the future changes.
Tasks:
prepublishOnly
hook along with the related scripts,dist
folder -> automate commit/push to the master branch).Our default CORS proxy server is forbidden for some reason.
Perhaps GitHub denies the requests specifically from our server as TCC works fine with my self-hosted server.
As it doesn't reflect the latest state. Use a similar gif.
Depends on #56.
As we discuss c-hive/dotdev#76 (comment) , we could improve the calendar to a more flexible component, if apply these css rules to the .container:
min-width: 415px;
max-width: 800px;
width: 58%;
Figure out the way of displaying the pre-prepared basic/empty calendar in pure JS. The flow might be changed depending on #1.
Tasks:
At this point, we should do integration testing so that examine whether the features work as expected or not. Test the project locally as:
There're some existing fetch is not defined
errors that appear during running the tests. Not sure about the exact reason for this behavior but the errors are coming from the cases in which the async
calendars fetching are being tested(aggregateUserCalendars
). Interestingly enough, the functions have already been mocked in these cases - that's why I don't really understand why it'd like to use fetch
(it somehow reaches the implementation of the related function instead of returning the defined value in these cases):
getJsonFormattedCalendarAsyncStub = sandbox.stub(GitHubUtils, 'getJsonFormattedCalendarAsync').returns(gitHubUserJsonCalendar);
Obviously, mocha
doesn't provide the built-in fetch
as it runs under NodeJS, but this still doesn't answer/solve the question of this unexpected behavior.
Add support for nightly mode.
IMO the "stutter" of loading the first user doesn't look great. Let's do the following:
See: c-hive/guides#8
vs
GH uses bigger text for the X contributions in the last year
text which we could also follow
GH uses more grey text colos for the colum/row names and less/more text which we could also follow
spinner resets during loading (possibly related to loading the first user separately)
The issue has already been discussed in the other repo.
The list might be extended with other requirements along the way. We can even "steal" some ideas from this repo.
I have digged deeper and read a couple of articles about the different ways of structuring/building npm packages. At first, I'd establish a simple boilerplate that comprises the elements below:
BABEL
TESTING ENVIRONMENT
ESLINT
PACKAGE.JSON
.NPMIGNORE
STRUCTURE
ADDITIONALS
Any other ideas/proposals are welcome.
Noticed that on one deployment the contributions are misaligned. Let's verify if this is a bug with the latest version.
Follow-up of #40.
(1) The "X contributions in the last year" message doesn't respect timeframes(i.e. it always displays the contributions from a full-year perspective).
(2) The timeframe's to
field isn't accurate, i.e. it goes a few days back compared to the date it's given. E.g. when it's set to 2019-09-02
it goes back to 2019-09-01
:
It's something that didn't turn out while working on this feature for some reason. My gut feeling is that the way we're "playing" with the dates causes this inaccuracy. We may switch to moment
for a more precise date comparison rather than relying on the built-in Date()
object.
Ran into a few things when setting up another npm project which could be implemented here as well:
See:
And a question: why did you need to explicitly require a file in the test script? --require ./src/utils/TestUtils/mockNonJsResources.js
Accomplish the same hover text effect that GH provides.
@thisismydesign has already described the requirements in the other repo:
N contributions on <date>
.This way it will blend better with sites that have a different background.
Started in https://github.com/c-hive/team-contribution-calendar/pull/52/files
TODO:
octokit
. you authenticate using a github token (which is part of the secret store by default) as seen here: https://github.com/babel/actions/blob/master/trigger-github-release/release.js (i think octokit can commit but i didn't check for sure)Implement the same flow as before. The idea would be to create a class that comprises the following fields:
actualCalendar
,totalContributions
,isLoading
.The class behaves as an actual state and exposes getters/setters so that:
Tasks:
As a part of the GH integration, don't forget to implement the remaining task in #1(loading indicator).
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.