Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8886b93

Browse files
committed
refactor: clean up imports
1 parent41d6760 commit8886b93

23 files changed

+90
-36
lines changed

‎api/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import*asdotenvfrom"dotenv";
2-
importrenderStatsCardfrom"../src/cards/stats-card.js";
3-
importblacklistfrom"../src/common/blacklist.js";
2+
import{renderStatsCard}from"../src/cards/stats-card.js";
3+
import{blacklist}from"../src/common/blacklist.js";
44
import{
55
clampValue,
66
CONSTANTS,
77
parseArray,
88
parseBoolean,
99
renderError,
1010
}from"../src/common/utils.js";
11-
importfetchStatsfrom"../src/fetchers/stats-fetcher.js";
11+
import{fetchStats}from"../src/fetchers/stats-fetcher.js";
1212
import{isLocaleAvailable}from"../src/translations.js";
1313

1414
dotenv.config();

‎api/pin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
importrenderRepoCardfrom"../src/cards/repo-card.js";
2-
importblacklistfrom"../src/common/blacklist.js";
1+
import{renderRepoCard}from"../src/cards/repo-card.js";
2+
import{blacklist}from"../src/common/blacklist.js";
33
import{
44
clampValue,
55
CONSTANTS,
66
parseBoolean,
77
renderError,
88
}from"../src/common/utils.js";
9-
importfetchRepofrom"../src/fetchers/repo-fetcher.js";
9+
import{fetchRepo}from"../src/fetchers/repo-fetcher.js";
1010
import{isLocaleAvailable}from"../src/translations.js";
1111

1212
exportdefaultasync(req,res)=>{

‎api/top-langs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import*asdotenvfrom"dotenv";
22
import{renderTopLanguages}from"../src/cards/top-languages-card.js";
3-
importblacklistfrom"../src/common/blacklist.js";
3+
import{blacklist}from"../src/common/blacklist.js";
44
import{
55
clampValue,
66
CONSTANTS,
77
parseArray,
88
parseBoolean,
99
renderError,
1010
}from"../src/common/utils.js";
11-
importfetchTopLanguagesfrom"../src/fetchers/top-languages-fetcher.js";
11+
import{fetchTopLanguages}from"../src/fetchers/top-languages-fetcher.js";
1212
import{isLocaleAvailable}from"../src/translations.js";
1313

1414
dotenv.config();

‎api/wakatime.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import*asdotenvfrom"dotenv";
2-
importwakatimeCardfrom"../src/cards/wakatime-card.js";
2+
import{renderWakatimeCard}from"../src/cards/wakatime-card.js";
33
import{
44
clampValue,
55
CONSTANTS,
66
parseArray,
77
parseBoolean,
88
renderError,
99
}from"../src/common/utils.js";
10-
importfetchWakatimeStatsfrom"../src/fetchers/wakatime-fetcher.js";
10+
import{fetchWakatimeStats}from"../src/fetchers/wakatime-fetcher.js";
1111
import{isLocaleAvailable}from"../src/translations.js";
1212

1313
dotenv.config();
@@ -58,7 +58,7 @@ export default async (req, res) => {
5858
res.setHeader("Cache-Control",`public, max-age=${cacheSeconds}`);
5959

6060
returnres.send(
61-
wakatimeCard(stats,{
61+
renderWakatimeCard(stats,{
6262
custom_title,
6363
hide_title:parseBoolean(hide_title),
6464
hide_border:parseBoolean(hide_border),

‎jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export default {
22
clearMocks:true,
33
transform:{},
44
testEnvironment:"jsdom",
5+
coverageProvider:"v8",
56
};

‎package-lock.json

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
"@actions/github":"^4.0.0",
2525
"@testing-library/dom":"^8.17.1",
2626
"@testing-library/jest-dom":"^5.16.5",
27-
"jest-environment-jsdom":"^29.0.3",
28-
"jest":"^29.0.3",
2927
"@uppercod/css-to-object":"^1.1.1",
3028
"axios-mock-adapter":"^1.18.1",
3129
"color-contrast-checker":"^2.1.0",
3230
"hjson":"^3.2.2",
3331
"husky":"^4.2.5",
32+
"jest":"^29.0.3",
33+
"jest-environment-jsdom":"^29.0.3",
3434
"js-yaml":"^4.1.0",
3535
"lodash.snakecase":"^4.1.1",
3636
"parse-diff":"^0.7.0",

‎src/common/Card.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import{encodeHTML,flexLayout}from"../common/utils.js";
21
import{getAnimations}from"../getStyles.js";
2+
import{encodeHTML,flexLayout}from"./utils.js";
33

44
classCard{
55
/**

‎src/common/createProgressNode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import{clampValue}from"../common/utils.js";
1+
import{clampValue}from"./utils.js";
22

33
constcreateProgressNode=({
44
x,

‎src/common/languageColors.json

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
"ATS":"#1ac620",
1616
"ActionScript":"#882B0F",
1717
"Ada":"#02f88c",
18+
"Adblock Filter List":"#800000",
1819
"Adobe Font Metrics":"#fa0f00",
1920
"Agda":"#315665",
2021
"Alloy":"#64C800",
2122
"Alpine Abuild":"#0D597F",
2223
"Altium Designer":"#A89663",
2324
"AngelScript":"#C7D7DC",
2425
"Ant Build System":"#A9157E",
26+
"Antlers":"#ff269e",
2527
"ApacheConf":"#d12127",
2628
"Apex":"#1797c0",
2729
"Apollo Guidance Computer":"#0B3D91",
@@ -41,8 +43,10 @@
4143
"Ballerina":"#FF5000",
4244
"Batchfile":"#C1F12E",
4345
"Beef":"#a52f4e",
46+
"Berry":"#15A13C",
4447
"BibTeX":"#778899",
4548
"Bicep":"#519aba",
49+
"Bikeshed":"#5562ac",
4650
"Bison":"#6A463F",
4751
"BitBake":"#00bce4",
4852
"Blade":"#f7523f",
@@ -52,11 +56,13 @@
5256
"Boo":"#d4bec1",
5357
"Boogie":"#c80fa0",
5458
"Brainfuck":"#2F2530",
59+
"BrighterScript":"#66AABB",
5560
"Brightscript":"#662D91",
5661
"Browserslist":"#ffd539",
5762
"C":"#555555",
5863
"C#":"#178600",
5964
"C++":"#f34b7d",
65+
"CAP CDS":"#0092d1",
6066
"CLIPS":"#00A300",
6167
"CMake":"#DA3434",
6268
"COLLADA":"#F1A42B",
@@ -66,7 +72,9 @@
6672
"CUE":"#5886E1",
6773
"CWeb":"#00007a",
6874
"Cabal Config":"#483465",
75+
"Cadence":"#00ef8b",
6976
"Cairo":"#ff4a48",
77+
"CameLIGO":"#3be133",
7078
"Cap'n Proto":"#c42727",
7179
"Ceylon":"#dfa535",
7280
"Chapel":"#8dc63f",
@@ -120,6 +128,7 @@
120128
"Eiffel":"#4d6977",
121129
"Elixir":"#6e4a7e",
122130
"Elm":"#60B5CC",
131+
"Elvish":"#55BB55",
123132
"Emacs Lisp":"#c065db",
124133
"EmberScript":"#FFF4F3",
125134
"Erlang":"#B83998",
@@ -153,6 +162,9 @@
153162
"GSC":"#FF6800",
154163
"Game Maker Language":"#71b417",
155164
"Gemfile.lock":"#701516",
165+
"Gemini":"#ff6900",
166+
"Genero":"#63408e",
167+
"Genero Forms":"#d8df39",
156168
"Genie":"#fb855d",
157169
"Genshi":"#951531",
158170
"Gentoo Ebuild":"#9400ff",
@@ -161,6 +173,7 @@
161173
"Gherkin":"#5B2063",
162174
"Git Attributes":"#F44D27",
163175
"Git Config":"#F44D27",
176+
"Git Revision List":"#F44D27",
164177
"Gleam":"#ffaff3",
165178
"Glyph":"#c1ac7f",
166179
"Gnuplot":"#f0a9f0",
@@ -178,6 +191,7 @@
178191
"Groovy Server Pages":"#4298b8",
179192
"HAProxy":"#106da9",
180193
"HLSL":"#aace60",
194+
"HOCON":"#9ff8ee",
181195
"HTML":"#e34c26",
182196
"HTML+ECR":"#2e1052",
183197
"HTML+EEX":"#6e4a7e",
@@ -222,6 +236,7 @@
222236
"JavaScript":"#f1e05a",
223237
"JavaScript+ERB":"#f1e05a",
224238
"Jest Snapshot":"#15c213",
239+
"JetBrains MPS":"#21D789",
225240
"Jinja":"#a52a22",
226241
"Jison":"#56b3cb",
227242
"Jison Lex":"#56b3cb",
@@ -246,6 +261,7 @@
246261
"Latte":"#f2a542",
247262
"Less":"#1d365d",
248263
"Lex":"#DBCA00",
264+
"LigoLANG":"#0e74ff",
249265
"LilyPond":"#9ccc7c",
250266
"Liquid":"#67b8de",
251267
"Literate Agda":"#315665",
@@ -278,13 +294,16 @@
278294
"Modelica":"#de1d31",
279295
"Modula-2":"#10253f",
280296
"Modula-3":"#223388",
297+
"Monkey C":"#8D6747",
281298
"MoonScript":"#ff4585",
282299
"Motoko":"#fbb03b",
283300
"Motorola 68K Assembly":"#005daa",
301+
"Move":"#4a137a",
284302
"Mustache":"#724b3b",
285303
"NCL":"#28431f",
286304
"NPM Config":"#cb3837",
287305
"NWScript":"#111522",
306+
"Nasal":"#1d2c4e",
288307
"Nearley":"#990000",
289308
"Nemerle":"#3d3c6e",
290309
"NetLinx":"#0aa0ff",
@@ -332,6 +351,7 @@
332351
"PigLatin":"#fcd7de",
333352
"Pike":"#005390",
334353
"PogoScript":"#d80074",
354+
"Portugol":"#f8bd00",
335355
"PostCSS":"#dc3a0c",
336356
"PostScript":"#da291c",
337357
"PowerBuilder":"#8f0f8d",
@@ -366,6 +386,7 @@
366386
"Rascal":"#fffaa0",
367387
"ReScript":"#ed5051",
368388
"Reason":"#ff5847",
389+
"ReasonLIGO":"#ff5847",
369390
"Rebol":"#358a5b",
370391
"Record Jar":"#0673ba",
371392
"Red":"#f50000",
@@ -377,6 +398,7 @@
377398
"Roff":"#ecdebe",
378399
"Roff Manpage":"#ecdebe",
379400
"Rouge":"#cc0088",
401+
"RouterOS Script":"#DE3941",
380402
"Ruby":"#701516",
381403
"Rust":"#dea584",
382404
"SAS":"#B34936",
@@ -386,6 +408,7 @@
386408
"SQL":"#e38c00",
387409
"SQLPL":"#e38c00",
388410
"SRecode Template":"#348a34",
411+
"STL":"#373b5e",
389412
"SVG":"#ff9900",
390413
"SaltStack":"#646464",
391414
"Sass":"#a53b70",
@@ -425,8 +448,9 @@
425448
"TOML":"#9c4221",
426449
"TSQL":"#e38c00",
427450
"TSV":"#237346",
428-
"TSX":"#2b7489",
451+
"TSX":"#3178c6",
429452
"TXL":"#0178b8",
453+
"Talon":"#333333",
430454
"Tcl":"#e4cc98",
431455
"TeX":"#3D6117",
432456
"Terra":"#00004c",
@@ -435,7 +459,7 @@
435459
"Thrift":"#D12127",
436460
"Turing":"#cf142b",
437461
"Twig":"#c1d026",
438-
"TypeScript":"#2b7489",
462+
"TypeScript":"#3178c6",
439463
"Unified Parallel C":"#4e3617",
440464
"Unity3D Asset":"#222c37",
441465
"Uno":"#9933cc",
@@ -446,8 +470,9 @@
446470
"VBScript":"#15dcdc",
447471
"VCL":"#148AA8",
448472
"VHDL":"#adb2cb",
449-
"Vala":"#fbe5cd",
473+
"Vala":"#a56de2",
450474
"Valve Data Format":"#f26025",
475+
"Velocity Template Language":"#507cff",
451476
"Verilog":"#b2b7f8",
452477
"Vim Help File":"#199f4b",
453478
"Vim Script":"#199f4b",
@@ -458,11 +483,13 @@
458483
"Vyper":"#2980b9",
459484
"Web Ontology Language":"#5b70bd",
460485
"WebAssembly":"#04133b",
486+
"Whiley":"#d5c397",
461487
"Wikitext":"#fc5757",
462488
"Windows Registry Entries":"#52d5ff",
463489
"Witcher Script":"#ff0000",
464490
"Wollok":"#a23738",
465491
"World of Warcraft Addon Data":"#f7e43f",
492+
"Wren":"#383838",
466493
"X10":"#4B6BEF",
467494
"XC":"#99DA07",
468495
"XML":"#0060ac",
@@ -476,6 +503,7 @@
476503
"YARA":"#220000",
477504
"YASnippet":"#32AB90",
478505
"Yacc":"#4B6C4B",
506+
"Yul":"#794932",
479507
"ZAP":"#0d665e",
480508
"ZIL":"#dc75e5",
481509
"ZenScript":"#00BCD1",
@@ -499,4 +527,4 @@
499527
"wdl":"#42f1f4",
500528
"wisp":"#7582D1",
501529
"xBase":"#403a40"
502-
}
530+
}

‎src/common/retryer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import{CustomError,logger}from"../common/utils.js";
1+
import{CustomError,logger}from"./utils.js";
22

33
constretryer=async(fetcher,variables,retries=0)=>{
44
if(retries>7){

‎tests/__snapshots__/renderWakatimeCard.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1
134134
y="0"
135135
width="0.465"
136136
height="8"
137-
fill="#2b7489"
137+
fill="#3178c6"
138138
/>
139139
140140
@@ -146,7 +146,7 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1
146146
</g>
147147
148148
<gtransform="translate(230, 25)">
149-
<circlecx="5"cy="6"r="5"fill="#2b7489" />
149+
<circlecx="5"cy="6"r="5"fill="#3178c6" />
150150
<textdata-testid="lang-name"x="15"y="10"class='lang-name'>
151151
TypeScript - 1 min
152152
</text>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp