Skip to content

Commit d84bba4

Browse files
rickstaadevantler
authored andcommitted
build: create npm package (anuraghazra#2151)
* build: create npm package This commit makes sure that the common modules of the GRS package can be imported as an npm package. * feat: export card render functions * style: update formatting
1 parent 9306d25 commit d84bba4

File tree

5 files changed

+60
-8
lines changed

5 files changed

+60
-8
lines changed

package.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
{
22
"name": "github-readme-stats",
33
"version": "1.0.0",
4-
"description": "Dynamically generate stats for your github readmes",
5-
"main": "index.js",
4+
"description": "Dynamically generate stats for your GitHub readme",
5+
"keywords": [
6+
"github-readme-stats",
7+
"readme-stats",
8+
"cards",
9+
"card-generator"
10+
],
11+
"main": "src/index.js",
612
"type": "module",
13+
"homepage": "https://github.com/anuraghazra/github-readme-stats",
14+
"bugs": {
15+
"url": "https://github.com/anuraghazra/github-readme-stats/issues"
16+
},
17+
"repository": {
18+
"type": "git",
19+
"url": "https://github.com/anuraghazra/github-readme-stats.git"
20+
},
721
"scripts": {
822
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage",
923
"test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch",

src/cards/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export { renderRepoCard } from "./repo-card.js";
2+
export { renderStatsCard } from "./stats-card.js";
3+
export { renderTopLanguages } from "./top-languages-card.js";
4+
export { renderWakatimeCard } from "./wakatime-card.js";

src/common/index.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
export { blacklist } from "./blacklist.js";
2+
export { Card } from "./Card.js";
3+
export { createProgressNode } from "./createProgressNode.js";
4+
export { i18n } from "./i18n.js";
5+
export { icons } from "./icons.js";
6+
export { retryer } from "./retryer.js";
7+
export {
8+
ERROR_CARD_LENGTH,
9+
renderError,
10+
encodeHTML,
11+
kFormatter,
12+
isValidHexColor,
13+
parseBoolean,
14+
parseArray,
15+
clampValue,
16+
isValidGradient,
17+
fallbackColor,
18+
request,
19+
flexLayout,
20+
getCardColors,
21+
wrapTextMultiline,
22+
logger,
23+
CONSTANTS,
24+
CustomError,
25+
MissingParamError,
26+
measureText,
27+
lowercaseTrim,
28+
chunkArray,
29+
parseEmojis,
30+
} from "./utils.js";

src/common/utils.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,25 +414,26 @@ function parseEmojis(str) {
414414
}
415415

416416
export {
417+
ERROR_CARD_LENGTH,
417418
renderError,
418-
kFormatter,
419419
encodeHTML,
420+
kFormatter,
420421
isValidHexColor,
421-
request,
422-
parseArray,
423422
parseBoolean,
423+
parseArray,
424+
clampValue,
425+
isValidGradient,
424426
fallbackColor,
427+
request,
425428
flexLayout,
426429
getCardColors,
427-
clampValue,
428430
wrapTextMultiline,
429-
measureText,
430431
logger,
431432
CONSTANTS,
432433
CustomError,
433434
MissingParamError,
435+
measureText,
434436
lowercaseTrim,
435437
chunkArray,
436438
parseEmojis,
437-
ERROR_CARD_LENGTH,
438439
};

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from "./common/index.js";
2+
export * from "./cards/index.js";
3+
export { getStyles, getAnimations } from "./getStyles.js";

0 commit comments

Comments
 (0)