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

[pull] master from anuraghazra:master #16

Merged
merged 45 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e5b5da8
tests: add basic wakatime endpoint test (#3454)
qwerty541 Nov 6, 2023
79cee30
infra: enable constructor-super eslint rule (#3457)
qwerty541 Nov 7, 2023
bc7ea33
build(deps): Bump rickstaa/empty-issues-closer-action (#3460)
dependabot[bot] Nov 7, 2023
a99abe8
build(deps): Bump rickstaa/top-issues-action from 1.3.64 to 1.3.65 (#…
dependabot[bot] Nov 7, 2023
843b15e
build(deps-dev): Bump eslint from 8.52.0 to 8.53.0 (#3459)
dependabot[bot] Nov 7, 2023
8d7e9df
themes: add ambient_gradient theme for test (#3399)
qwerty541 Nov 7, 2023
dda9647
fix(express deploy): fix situations when env variables doesn't load b…
wolfcomp Nov 7, 2023
aa90efc
docs(theme): auto update theme readme (#3462)
qwerty541 Nov 7, 2023
edf9f74
infra: enable keyword-spacing eslint rule and remove decrecated space…
qwerty541 Nov 10, 2023
5ea6595
infra: enable no-delete-var eslint rule (#3465)
qwerty541 Nov 10, 2023
51eefa2
infra: enable no-caller eslint rule (#3473)
qwerty541 Nov 13, 2023
d654fe5
infra: enable no-alert eslint rule (#3472)
qwerty541 Nov 13, 2023
034ee06
build(deps-dev): Bump lint-staged from 15.0.2 to 15.1.0 (#3477)
dependabot[bot] Nov 13, 2023
36bbea2
build(deps): Bump axios from 1.6.0 to 1.6.1 (#3478)
dependabot[bot] Nov 13, 2023
e04e139
build(deps-dev): Bump prettier from 3.0.3 to 3.1.0 (#3476)
dependabot[bot] Nov 13, 2023
e50a9b4
build(deps): Bump rickstaa/top-issues-action from 1.3.65 to 1.3.69 (#…
dependabot[bot] Nov 13, 2023
4997308
build(deps): Bump rickstaa/empty-issues-closer-action (#3480)
dependabot[bot] Nov 13, 2023
3a15963
ci: add wakatime endpoint test file into pull requests labeler (#3482)
qwerty541 Nov 15, 2023
f26b83d
tests: fix typo inside card class proper height/width test (#3489)
qwerty541 Nov 20, 2023
d4f1a5d
docs: grammar/Clarity Fixes. (#3463)
krple Nov 20, 2023
ddcc30d
feat(repo card): add description lines count query parameter (#3453)
qwerty541 Nov 20, 2023
68c49dd
build(deps): Bump rickstaa/empty-issues-closer-action (#3490)
dependabot[bot] Nov 20, 2023
723cdd7
build(deps): Bump rickstaa/top-issues-action from 1.3.69 to 1.3.71 (#…
dependabot[bot] Nov 20, 2023
ffe2862
build(deps): Bump axios from 1.6.1 to 1.6.2 (#3492)
dependabot[bot] Nov 20, 2023
afcb773
build(deps-dev): Bump eslint from 8.53.0 to 8.54.0 (#3493)
dependabot[bot] Nov 20, 2023
a8663a8
feat(wakatime card): add disable animations query option (#3496)
qwerty541 Nov 23, 2023
b8983dd
feat: show wakatime stats in percentage (resolves #3016) (#3326)
ritik48 Nov 23, 2023
1262002
fix(wakatime card): add percent display format for compact layout (re…
qwerty541 Nov 25, 2023
c6c4a88
docs: improve query options appereance using tables (#3484)
qwerty541 Nov 25, 2023
4793de4
build(deps): Bump rickstaa/top-issues-action from 1.3.71 to 1.3.75 (#…
dependabot[bot] Nov 27, 2023
7595456
build(deps): Bump rickstaa/empty-issues-closer-action (#3507)
dependabot[bot] Nov 27, 2023
0616df3
tests: add gist card performance test (#3372)
qwerty541 Nov 28, 2023
1656ec6
tests: add pin card performance test (#3374)
qwerty541 Nov 28, 2023
80b2d23
build(deps-dev): Bump @adobe/css-tools from 4.3.1 to 4.3.2 (#3516)
dependabot[bot] Dec 1, 2023
1cba9c1
build(deps-dev): Bump eslint from 8.54.0 to 8.55.0 (#3522)
dependabot[bot] Dec 4, 2023
105e136
build(deps-dev): Bump lint-staged from 15.1.0 to 15.2.0 (#3524)
dependabot[bot] Dec 4, 2023
91889a3
build(deps-dev): Bump eslint-config-prettier from 9.0.0 to 9.1.0 (#3523)
dependabot[bot] Dec 4, 2023
4412af8
build(deps-dev): Bump @testing-library/jest-dom from 6.1.4 to 6.1.5 (…
dependabot[bot] Dec 4, 2023
34c67ff
build(deps): Bump rickstaa/top-issues-action from 1.3.75 to 1.3.77 (#…
dependabot[bot] Dec 4, 2023
6633d68
build(deps): Bump rickstaa/empty-issues-closer-action (#3527)
dependabot[bot] Dec 4, 2023
23472f4
build(deps): Bump actions/labeler from 4.3.0 to 5.0.0 (#3526)
dependabot[bot] Dec 4, 2023
c31f3e8
ci: update labeler config to match latest action version (#3533)
qwerty541 Dec 11, 2023
2259870
docs: fix wakatime card api_domain option default value (#3532)
qwerty541 Dec 11, 2023
c402a23
refactor: add missing export for wakatime options type (#3531)
qwerty541 Dec 11, 2023
f831dad
build(deps-dev): Bump prettier from 3.1.0 to 3.1.1 (#3540)
dependabot[bot] Dec 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
// "arrow-body-style": [ "error", "always" ],
// "arrow-parens": [ "error", "always" ],
// "arrow-spacing": [ "error", { "before": true, "after": true }],
// "constructor-super": "error",
"constructor-super": "error",
// "generator-star-spacing": [ "error", "before" ],
// "no-arrow-condition": "error",
"no-class-assign": "error",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/empty-issues-closer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Run empty issues closer action
uses: rickstaa/empty-issues-closer-action@2ee9f86f16acb1d888a480f2080407d84248f475 # v1.1.39
uses: rickstaa/empty-issues-closer-action@37f2cd30a4fb97504bbb570dc73264cfa522dee3 # v1.1.40
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/top-issues-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Run top issues action
uses: rickstaa/top-issues-action@f72e408e2ca430a9d79620f27183d7fd85c7494a # v1.3.64
uses: rickstaa/top-issues-action@da2fb7f2bd61828135e0971f8d33efb1a079e9a9 # v1.3.65
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
3 changes: 1 addition & 2 deletions express.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import "dotenv/config";
import statsCard from "./api/index.js";
import repoCard from "./api/pin.js";
import langCard from "./api/top-langs.js";
import wakatimeCard from "./api/wakatime.js";
import gistCard from "./api/gist.js";
import express from "express";
import dotenv from "dotenv";

dotenv.config();
const app = express();
app.listen(process.env.port || 9000);

Expand Down
58 changes: 29 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@uppercod/css-to-object": "^1.1.1",
"axios-mock-adapter": "^1.22.0",
"color-contrast-checker": "^2.1.0",
"eslint": "^8.52.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"hjson": "^3.2.2",
"husky": "^8.0.3",
Expand Down
123 changes: 123 additions & 0 deletions tests/wakatime.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import { jest } from "@jest/globals";
import "@testing-library/jest-dom";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
import wakatime from "../api/wakatime.js";
import { renderWakatimeCard } from "../src/cards/wakatime-card.js";
import { expect, it, describe, afterEach } from "@jest/globals";

const wakaTimeData = {
data: {
categories: [
{
digital: "22:40",
hours: 22,
minutes: 40,
name: "Coding",
percent: 100,
text: "22 hrs 40 mins",
total_seconds: 81643.570077,
},
],
daily_average: 16095,
daily_average_including_other_language: 16329,
days_including_holidays: 7,
days_minus_holidays: 5,
editors: [
{
digital: "22:40",
hours: 22,
minutes: 40,
name: "VS Code",
percent: 100,
text: "22 hrs 40 mins",
total_seconds: 81643.570077,
},
],
holidays: 2,
human_readable_daily_average: "4 hrs 28 mins",
human_readable_daily_average_including_other_language: "4 hrs 32 mins",
human_readable_total: "22 hrs 21 mins",
human_readable_total_including_other_language: "22 hrs 40 mins",
id: "random hash",
is_already_updating: false,
is_coding_activity_visible: true,
is_including_today: false,
is_other_usage_visible: true,
is_stuck: false,
is_up_to_date: true,
languages: [
{
digital: "0:19",
hours: 0,
minutes: 19,
name: "Other",
percent: 1.43,
text: "19 mins",
total_seconds: 1170.434361,
},
{
digital: "0:01",
hours: 0,
minutes: 1,
name: "TypeScript",
percent: 0.1,
text: "1 min",
total_seconds: 83.293809,
},
{
digital: "0:00",
hours: 0,
minutes: 0,
name: "YAML",
percent: 0.07,
text: "0 secs",
total_seconds: 54.975151,
},
],
operating_systems: [
{
digital: "22:40",
hours: 22,
minutes: 40,
name: "Mac",
percent: 100,
text: "22 hrs 40 mins",
total_seconds: 81643.570077,
},
],
percent_calculated: 100,
range: "last_7_days",
status: "ok",
timeout: 15,
total_seconds: 80473.135716,
total_seconds_including_other_language: 81643.570077,
user_id: "random hash",
username: "anuraghazra",
writes_only: false,
},
};

const mock = new MockAdapter(axios);

afterEach(() => {
mock.reset();
});

describe("Test /api/wakatime", () => {
it("should test the request", async () => {
const username = "anuraghazra";
const req = { query: { username } };
const res = { setHeader: jest.fn(), send: jest.fn() };
mock
.onGet(
`https://wakatime.com/api/v1/users/${username}/stats?is_including_today=true`,
)
.reply(200, wakaTimeData);

await wakatime(req, res);

expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
expect(res.send).toBeCalledWith(renderWakatimeCard(wakaTimeData.data, {}));
});
});
10 changes: 6 additions & 4 deletions themes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Use `?theme=THEME_NAME` parameter like so:

## Stats

> These themes works with all five our cards: Stats Card, Repo Card, Gist Card, Top languages Card and Wakatime Card.
> These themes works with all five our cards: Stats Card, Repo Card, Gist Card, Top languages Card and WakaTime Card.

| | | |
| :--: | :--: | :--: |
Expand Down Expand Up @@ -40,11 +40,11 @@ Use `?theme=THEME_NAME` parameter like so:
| `rose_pine` ![rose_pine][rose_pine] | `catppuccin_latte` ![catppuccin_latte][catppuccin_latte] | `catppuccin_mocha` ![catppuccin_mocha][catppuccin_mocha] |
| `date_night` ![date_night][date_night] | `one_dark_pro` ![one_dark_pro][one_dark_pro] | `rose` ![rose][rose] |
| `holi` ![holi][holi] | `neon` ![neon][neon] | `blue_navy` ![blue_navy][blue_navy] |
| `calm_pink` ![calm_pink][calm_pink] | | [Add your theme][add-theme] |
| `calm_pink` ![calm_pink][calm_pink] | `ambient_gradient` ![ambient_gradient][ambient_gradient] | [Add your theme][add-theme] |

## Repo Card

> These themes works with all five our cards: Stats Card, Repo Card, Gist Card, Top languages Card and Wakatime Card.
> These themes works with all five our cards: Stats Card, Repo Card, Gist Card, Top languages Card and WakaTime Card.

| | | |
| :--: | :--: | :--: |
Expand Down Expand Up @@ -72,7 +72,7 @@ Use `?theme=THEME_NAME` parameter like so:
| `rose_pine` ![rose_pine][rose_pine_repo] | `catppuccin_latte` ![catppuccin_latte][catppuccin_latte_repo] | `catppuccin_mocha` ![catppuccin_mocha][catppuccin_mocha_repo] |
| `date_night` ![date_night][date_night_repo] | `one_dark_pro` ![one_dark_pro][one_dark_pro_repo] | `rose` ![rose][rose_repo] |
| `holi` ![holi][holi_repo] | `neon` ![neon][neon_repo] | `blue_navy` ![blue_navy][blue_navy_repo] |
| `calm_pink` ![calm_pink][calm_pink_repo] | | [Add your theme][add-theme] |
| `calm_pink` ![calm_pink][calm_pink_repo] | `ambient_gradient` ![ambient_gradient][ambient_gradient_repo] | [Add your theme][add-theme] |


[default]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=default
Expand Down Expand Up @@ -149,6 +149,7 @@ Use `?theme=THEME_NAME` parameter like so:
[neon]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=neon
[blue_navy]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=blue_navy
[calm_pink]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=calm_pink
[ambient_gradient]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=ambient_gradient


[default_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=default
Expand Down Expand Up @@ -225,6 +226,7 @@ Use `?theme=THEME_NAME` parameter like so:
[neon_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=neon
[blue_navy_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=blue_navy
[calm_pink_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=calm_pink
[ambient_gradient_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=ambient_gradient


[add-theme]: https://github.com/anuraghazra/github-readme-stats/edit/master/themes/index.js
Expand Down
6 changes: 6 additions & 0 deletions themes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,12 @@ export const themes = {
border_color: "e1bc29",
bg_color: "2b2d40",
},
ambient_gradient: {
title_color: "ffffff",
text_color: "ffffff",
icon_color: "ffffff",
bg_color: "35,4158d0,c850c0,ffcc70",
},
};

export default themes;
Loading