Skip to content

Commit

Permalink
Merge branch 'master' into create_npm_package
Browse files Browse the repository at this point in the history
  • Loading branch information
rickstaa committed Oct 13, 2022
2 parents 3341532 + 39535db commit 08eeec1
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 31 deletions.
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ body:
attributes:
label: Is your feature request related to a problem? Please describe.
description:
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
A clear and concise description of what the problem is. Ex. I'm always
frustrated when [...]
- type: textarea
attributes:
label: Describe the solution you'd like
Expand All @@ -16,7 +17,8 @@ body:
attributes:
label: Describe alternatives you've considered
description:
A clear and concise description of any alternative solutions or features you've considered.
A clear and concise description of any alternative solutions or features
you've considered.
- type: textarea
attributes:
label: Additional context
Expand Down
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
themes: themes/index.js
doc-translation: docs/*
card-i18n: src/assets/translations.js
card-i18n: src/translations.js
2 changes: 1 addition & 1 deletion api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
renderError,
} from "../src/common/utils.js";
import { fetchStats } from "../src/fetchers/stats-fetcher.js";
import { isLocaleAvailable } from "../src/assets/translations.js";
import { isLocaleAvailable } from "../src/translations.js";

dotenv.config();

Expand Down
2 changes: 1 addition & 1 deletion api/pin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
renderError,
} from "../src/common/utils.js";
import { fetchRepo } from "../src/fetchers/repo-fetcher.js";
import { isLocaleAvailable } from "../src/assets/translations.js";
import { isLocaleAvailable } from "../src/translations.js";

export default async (req, res) => {
const {
Expand Down
2 changes: 1 addition & 1 deletion api/top-langs.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
renderError,
} from "../src/common/utils.js";
import { fetchTopLanguages } from "../src/fetchers/top-languages-fetcher.js";
import { isLocaleAvailable } from "../src/assets/translations.js";
import { isLocaleAvailable } from "../src/translations.js";

dotenv.config();

Expand Down
2 changes: 1 addition & 1 deletion api/wakatime.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
renderError,
} from "../src/common/utils.js";
import { fetchWakatimeStats } from "../src/fetchers/wakatime-fetcher.js";
import { isLocaleAvailable } from "../src/assets/translations.js";
import { isLocaleAvailable } from "../src/translations.js";

dotenv.config();

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/cards/repo-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
parseEmojis,
wrapTextMultiline,
} from "../common/utils.js";
import { repoCardLocales } from "../assets/translations.js";
import { repoCardLocales } from "../translations.js";

/**
* Retrieves the repository description and wraps it to fit the card width.
Expand Down
4 changes: 2 additions & 2 deletions src/cards/stats-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
kFormatter,
measureText,
} from "../common/utils.js";
import { getStyles } from "../common/getStyles.js";
import { statCardLocales } from "../assets/translations.js";
import { getStyles } from "../getStyles.js";
import { statCardLocales } from "../translations.js";

/**
* Create a stats card text item.
Expand Down
2 changes: 1 addition & 1 deletion src/cards/top-languages-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
lowercaseTrim,
measureText,
} from "../common/utils.js";
import { langCardLocales } from "../assets/translations.js";
import { langCardLocales } from "../translations.js";

const DEFAULT_CARD_WIDTH = 300;
const MIN_CARD_WIDTH = 230;
Expand Down
4 changes: 2 additions & 2 deletions src/cards/wakatime-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
getCardColors,
lowercaseTrim,
} from "../common/utils.js";
import { getStyles } from "../common/getStyles.js";
import { wakatimeCardLocales } from "../assets/translations.js";
import { getStyles } from "../getStyles.js";
import { wakatimeCardLocales } from "../translations.js";

/** Import language colors.
*
Expand Down
2 changes: 1 addition & 1 deletion src/common/Card.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getAnimations } from "./getStyles.js";
import { getAnimations } from "../getStyles.js";
import { encodeHTML, flexLayout } from "./utils.js";

class Card {
Expand Down
13 changes: 7 additions & 6 deletions src/common/index.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
export { blacklist } from "./blacklist.js";
export { Card } from "./Card.js";
export { createProgressNode } from "./createProgressNode.js";
export { getStyles, getAnimations } from "./getStyles.js";
export { i18n } from "./i18n.js";
export { icons } from "./icons.js";
export { retryer } from "./retryer.js";
export {
ERROR_CARD_LENGTH,
renderError,
kFormatter,
encodeHTML,
kFormatter,
isValidHexColor,
request,
parseArray,
parseBoolean,
parseArray,
clampValue,
isValidGradient,
fallbackColor,
request,
flexLayout,
getCardColors,
clampValue,
wrapTextMultiline,
measureText,
logger,
CONSTANTS,
CustomError,
MissingParamError,
measureText,
lowercaseTrim,
chunkArray,
parseEmojis,
Expand Down
13 changes: 7 additions & 6 deletions src/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,25 +414,26 @@ function parseEmojis(str) {
}

export {
ERROR_CARD_LENGTH,
renderError,
kFormatter,
encodeHTML,
kFormatter,
isValidHexColor,
request,
parseArray,
parseBoolean,
parseArray,
clampValue,
isValidGradient,
fallbackColor,
request,
flexLayout,
getCardColors,
clampValue,
wrapTextMultiline,
measureText,
logger,
CONSTANTS,
CustomError,
MissingParamError,
measureText,
lowercaseTrim,
chunkArray,
parseEmojis,
ERROR_CARD_LENGTH,
};
2 changes: 1 addition & 1 deletion src/fetchers/stats-fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import axios from "axios";
import * as dotenv from "dotenv";
import githubUsernameRegex from "github-username-regex";
import { calculateRank } from "./helpers/calculateRank.js";
import { calculateRank } from "../calculateRank.js";
import { retryer } from "../common/retryer.js";
import {
CustomError,
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./common/index.js";
export * from "./cards/index.js";
export { getStyles, getAnimations } from "./getStyles.js";
2 changes: 1 addition & 1 deletion src/assets/translations.js → src/translations.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { encodeHTML } from "../common/utils.js";
import { encodeHTML } from "./common/utils.js";

/**
* Retrieves stat card labels in the available locales.
Expand Down
2 changes: 1 addition & 1 deletion tests/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { jest } from "@jest/globals";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
import api from "../api/index.js";
import { calculateRank } from "../src/fetchers/helpers/calculateRank.js";
import { calculateRank } from "../src/calculateRank.js";
import { renderStatsCard } from "../src/cards/stats-card.js";
import { CONSTANTS, renderError } from "../src/common/utils.js";

Expand Down
2 changes: 1 addition & 1 deletion tests/calculateRank.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "@testing-library/jest-dom";
import { calculateRank } from "../src/fetchers/helpers/calculateRank.js";
import { calculateRank } from "../src/calculateRank.js";

describe("Test calculateRank", () => {
it("should calculate rank correctly", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/fetchStats.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "@testing-library/jest-dom";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
import { calculateRank } from "../src/fetchers/helpers/calculateRank.js";
import { calculateRank } from "../src/calculateRank.js";
import { fetchStats } from "../src/fetchers/stats-fetcher.js";

const data = {
Expand Down

0 comments on commit 08eeec1

Please sign in to comment.