github-weekly-reporter 0.2.9 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -79
- package/dist/cli/commands/deploy.d.ts +1 -0
- package/dist/cli/commands/deploy.d.ts.map +1 -1
- package/dist/cli/commands/deploy.js +1 -1
- package/dist/cli/commands/deploy.js.map +1 -1
- package/dist/cli/commands/fetch.d.ts +11 -0
- package/dist/cli/commands/fetch.d.ts.map +1 -1
- package/dist/cli/commands/fetch.js +7 -7
- package/dist/cli/commands/fetch.js.map +1 -1
- package/dist/cli/commands/generate.d.ts +11 -0
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +1 -5
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/render.d.ts.map +1 -1
- package/dist/cli/commands/render.js +14 -3
- package/dist/cli/commands/render.js.map +1 -1
- package/dist/cli/commands/setup/constants.d.ts +11 -0
- package/dist/cli/commands/setup/constants.d.ts.map +1 -0
- package/dist/cli/commands/setup/constants.js +42 -0
- package/dist/cli/commands/setup/constants.js.map +1 -0
- package/dist/cli/commands/setup/github-api.d.ts +13 -0
- package/dist/cli/commands/setup/github-api.d.ts.map +1 -0
- package/dist/cli/commands/setup/github-api.js +133 -0
- package/dist/cli/commands/setup/github-api.js.map +1 -0
- package/dist/cli/commands/setup/validate-model.d.ts +6 -0
- package/dist/cli/commands/setup/validate-model.d.ts.map +1 -0
- package/dist/cli/commands/setup/validate-model.js +74 -0
- package/dist/cli/commands/setup/validate-model.js.map +1 -0
- package/dist/cli/commands/setup/workflows.d.ts +25 -0
- package/dist/cli/commands/setup/workflows.d.ts.map +1 -0
- package/dist/cli/commands/setup/workflows.js +169 -0
- package/dist/cli/commands/setup/workflows.js.map +1 -0
- package/dist/cli/commands/setup.d.ts +2 -0
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +6 -410
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/index.js +7 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/collector/date-range.d.ts +6 -0
- package/dist/collector/date-range.d.ts.map +1 -1
- package/dist/collector/date-range.js +25 -1
- package/dist/collector/date-range.js.map +1 -1
- package/dist/collector/fetch-events.d.ts +2 -1
- package/dist/collector/fetch-events.d.ts.map +1 -1
- package/dist/collector/fetch-events.js +4 -2
- package/dist/collector/fetch-events.js.map +1 -1
- package/dist/collector/fetch-repo-prs.d.ts +1 -0
- package/dist/collector/fetch-repo-prs.d.ts.map +1 -1
- package/dist/collector/fetch-repo-prs.js +4 -2
- package/dist/collector/fetch-repo-prs.js.map +1 -1
- package/dist/deployer/index-page.d.ts +1 -1
- package/dist/deployer/index-page.d.ts.map +1 -1
- package/dist/deployer/index-page.js +14 -396
- package/dist/deployer/index-page.js.map +1 -1
- package/dist/deployer/index.d.ts +1 -0
- package/dist/deployer/index.d.ts.map +1 -1
- package/dist/deployer/index.js +2 -3
- package/dist/deployer/index.js.map +1 -1
- package/dist/deployer/week.d.ts +1 -0
- package/dist/deployer/week.d.ts.map +1 -1
- package/dist/deployer/week.js +14 -10
- package/dist/deployer/week.js.map +1 -1
- package/dist/llm/index.d.ts +2 -1
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +3 -3
- package/dist/llm/index.js.map +1 -1
- package/dist/llm/providers/anthropic.d.ts +1 -1
- package/dist/llm/providers/anthropic.d.ts.map +1 -1
- package/dist/llm/providers/anthropic.js +2 -1
- package/dist/llm/providers/anthropic.js.map +1 -1
- package/dist/llm/providers/grok.d.ts +1 -1
- package/dist/llm/providers/grok.d.ts.map +1 -1
- package/dist/llm/providers/grok.js +3 -2
- package/dist/llm/providers/grok.js.map +1 -1
- package/dist/llm/providers/groq.d.ts +1 -1
- package/dist/llm/providers/groq.d.ts.map +1 -1
- package/dist/llm/providers/groq.js +3 -2
- package/dist/llm/providers/groq.js.map +1 -1
- package/dist/llm/providers/openai.d.ts +1 -1
- package/dist/llm/providers/openai.d.ts.map +1 -1
- package/dist/llm/providers/openai.js +3 -2
- package/dist/llm/providers/openai.js.map +1 -1
- package/dist/llm/providers/openrouter.d.ts +1 -1
- package/dist/llm/providers/openrouter.d.ts.map +1 -1
- package/dist/llm/providers/openrouter.js +3 -2
- package/dist/llm/providers/openrouter.js.map +1 -1
- package/dist/llm/types.d.ts +2 -0
- package/dist/llm/types.d.ts.map +1 -1
- package/dist/llm/types.js +2 -1
- package/dist/llm/types.js.map +1 -1
- package/dist/renderer/index.d.ts +1 -0
- package/dist/renderer/index.d.ts.map +1 -1
- package/dist/renderer/index.js +1 -0
- package/dist/renderer/index.js.map +1 -1
- package/dist/renderer/og-image.d.ts +7 -0
- package/dist/renderer/og-image.d.ts.map +1 -1
- package/dist/renderer/og-image.js +102 -0
- package/dist/renderer/og-image.js.map +1 -1
- package/dist/renderer/themes.d.ts.map +1 -1
- package/dist/renderer/themes.js +0 -1
- package/dist/renderer/themes.js.map +1 -1
- package/package.json +22 -9
- package/src/renderer/templates/index-page.hbs +403 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Daily fetch: grab all public events and accumulate
|
|
3
3
|
const EVENTS_PER_PAGE = 100;
|
|
4
4
|
const MAX_PAGES = 3; // GitHub Events API hard limit is 300 events (3 pages)
|
|
5
|
-
const summarizePayload = (type, raw) => {
|
|
5
|
+
export const summarizePayload = (type, raw) => {
|
|
6
6
|
switch (type) {
|
|
7
7
|
case "PushEvent": {
|
|
8
8
|
const commits = Array.isArray(raw.commits)
|
|
@@ -62,8 +62,10 @@ const fetchPage = async (token, username, page) => {
|
|
|
62
62
|
"User-Agent": "github-weekly-reporter",
|
|
63
63
|
},
|
|
64
64
|
});
|
|
65
|
-
if (!response.ok)
|
|
65
|
+
if (!response.ok) {
|
|
66
|
+
console.warn(`Failed to fetch events page ${page}: ${response.status} ${response.statusText}`);
|
|
66
67
|
return [];
|
|
68
|
+
}
|
|
67
69
|
return (await response.json());
|
|
68
70
|
};
|
|
69
71
|
export const isInRange = (eventDate, range) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-events.js","sourceRoot":"","sources":["../../src/collector/fetch-events.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,qDAAqD;AAcrD,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,SAAS,GAAG,CAAC,CAAC,CAAC,uDAAuD;AAE5E,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,GAA4B,EAAgB,EAAE;
|
|
1
|
+
{"version":3,"file":"fetch-events.js","sourceRoot":"","sources":["../../src/collector/fetch-events.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,qDAAqD;AAcrD,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,SAAS,GAAG,CAAC,CAAC,CAAC,uDAAuD;AAE5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,GAA4B,EAAgB,EAAE;IAC3F,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,WAAW,CAAC,CAAC,CAAC;YACjB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;gBACxC,CAAC,CAAE,GAAG,CAAC,OAAiC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;gBAC9D,CAAC,CAAC,EAAE,CAAC;YACP,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;QAC/D,CAAC;QACD,KAAK,wBAAwB,CAAC;QAC9B,KAAK,+BAA+B,CAAC,CAAC,CAAC;YACrC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAA4B,CAAC;YAC/D,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,MAAM,CAAC,GA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,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAqB,EAAiB,EAAE;IACnE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QACzB,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAAE,OAAO,KAAK,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-repo-prs.d.ts","sourceRoot":"","sources":["../../src/collector/fetch-repo-prs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch-repo-prs.d.ts","sourceRoot":"","sources":["../../src/collector/fetch-repo-prs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAyB/C,eAAO,MAAM,QAAQ,GAAI,OAAO,MAAM,EAAE,UAAU,MAAM,GAAG,IAAI,KAAG,WAAW,CAAC,OAAO,CAGpF,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA8CF,eAAO,MAAM,cAAc,GACzB,OAAO,MAAM,EACb,MAAM,KAAK,EAAE,KACZ,OAAO,CAAC,WAAW,EAAE,CAevB,CAAC"}
|
|
@@ -6,7 +6,7 @@ const GITHUB_HEADERS = (token) => ({
|
|
|
6
6
|
"X-GitHub-Api-Version": "2022-11-28",
|
|
7
7
|
"User-Agent": "github-weekly-reporter",
|
|
8
8
|
});
|
|
9
|
-
const mapState = (state, mergedAt) => {
|
|
9
|
+
export const mapState = (state, mergedAt) => {
|
|
10
10
|
if (mergedAt)
|
|
11
11
|
return "merged";
|
|
12
12
|
return state === "closed" ? "closed" : "open";
|
|
@@ -14,8 +14,10 @@ const mapState = (state, mergedAt) => {
|
|
|
14
14
|
const fetchSinglePR = async (token, ref) => {
|
|
15
15
|
const url = `https://api.github.com/repos/${ref.repo}/pulls/${ref.number}`;
|
|
16
16
|
const response = await fetch(url, { headers: GITHUB_HEADERS(token) });
|
|
17
|
-
if (!response.ok)
|
|
17
|
+
if (!response.ok) {
|
|
18
|
+
console.warn(`Failed to fetch PR ${ref.repo}#${ref.number}: ${response.status} ${response.statusText}`);
|
|
18
19
|
return null;
|
|
20
|
+
}
|
|
19
21
|
const pr = (await response.json());
|
|
20
22
|
return {
|
|
21
23
|
title: pr.title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-repo-prs.js","sourceRoot":"","sources":["../../src/collector/fetch-repo-prs.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAmB5C,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC;IACzC,aAAa,EAAE,UAAU,KAAK,EAAE;IAChC,MAAM,EAAE,6BAA6B;IACrC,sBAAsB,EAAE,YAAY;IACpC,YAAY,EAAE,wBAAwB;CACvC,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,QAAuB,EAAwB,EAAE;
|
|
1
|
+
{"version":3,"file":"fetch-repo-prs.js","sourceRoot":"","sources":["../../src/collector/fetch-repo-prs.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAmB5C,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC;IACzC,aAAa,EAAE,UAAU,KAAK,EAAE;IAChC,MAAM,EAAE,6BAA6B;I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M,GAAG,GAAkB,EAAE,CAAC;IAE9B,MAAM,kBAAkB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QAC3D,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC3C,IAAI,EAAE;YAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -18,6 +18,6 @@ export type ReportEntry = {
|
|
|
18
18
|
dateLabel: string;
|
|
19
19
|
stats?: ReportEntryStats;
|
|
20
20
|
};
|
|
21
|
-
export declare const renderIndexPage: (reports: ReportEntry[], pageData?: IndexPageData, language?: Language, siteTitle?: string) => string;
|
|
21
|
+
export declare const renderIndexPage: (reports: ReportEntry[], pageData?: IndexPageData, language?: Language, siteTitle?: string, baseUrl?: string) => string;
|
|
22
22
|
export declare const buildReportEntry: (path: string, title?: string, subtitle?: string, stats?: ReportEntryStats) => ReportEntry;
|
|
23
23
|
//# sourceMappingURL=index-page.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-page.d.ts","sourceRoot":"","sources":["../../src/deployer/index-page.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index-page.d.ts","sourceRoot":"","sources":["../../src/deployer/index-page.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAIzD,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAgCF,eAAO,MAAM,eAAe,GAC1B,SAAS,WAAW,EAAE,EACtB,WAAW,aAAa,EACxB,WAAU,QAAe,EACzB,YAAY,MAAM,EAClB,UAAU,MAAM,KACf,MA4BF,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,QAAQ,gBAAgB,KACvB,WAQD,CAAC"}
|
|
@@ -1,400 +1,12 @@
|
|
|
1
1
|
// Generate the index.html that lists all archived reports
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { join, dirname } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
2
5
|
import Handlebars from "handlebars";
|
|
3
6
|
import { getLocale, getFontConfig } from "../i18n/index.js";
|
|
4
7
|
import { buildCSS } from "../renderer/themes.js";
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
<head>
|
|
8
|
-
<title>{{siteTitle}}</title>
|
|
9
|
-
<meta charset="utf-8" />
|
|
10
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
11
|
-
<meta name="description" content="{{siteTitle}}" />
|
|
12
|
-
<meta name="view-transition" content="same-origin" />
|
|
13
|
-
<style>{{{css}}}</style>
|
|
14
|
-
<style>
|
|
15
|
-
body { background: #050505; color: #e8e8e8; overflow-x: hidden; }
|
|
16
|
-
|
|
17
|
-
/* GRAIN OVERLAY */
|
|
18
|
-
body::after {
|
|
19
|
-
content: '';
|
|
20
|
-
position: fixed;
|
|
21
|
-
inset: 0;
|
|
22
|
-
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
|
|
23
|
-
pointer-events: none;
|
|
24
|
-
z-index: 9999;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/* NAV */
|
|
28
|
-
.index-nav {
|
|
29
|
-
position: fixed;
|
|
30
|
-
top: 0; left: 0; right: 0;
|
|
31
|
-
z-index: 100;
|
|
32
|
-
background: rgba(5,5,5,0.8);
|
|
33
|
-
backdrop-filter: blur(16px);
|
|
34
|
-
border-bottom: 1px solid rgba(255,255,255,0.06);
|
|
35
|
-
}
|
|
36
|
-
.index-nav-inner {
|
|
37
|
-
max-width: 960px;
|
|
38
|
-
margin: 0 auto;
|
|
39
|
-
padding: 0.75rem 3rem;
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
min-height: 56px;
|
|
43
|
-
}
|
|
44
|
-
.nav-site-title {
|
|
45
|
-
font-size: 0.75rem;
|
|
46
|
-
font-weight: 600;
|
|
47
|
-
letter-spacing: 0.2em;
|
|
48
|
-
text-transform: uppercase;
|
|
49
|
-
color: rgba(255,255,255,0.4);
|
|
50
|
-
white-space: nowrap;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* HERO */
|
|
54
|
-
.hero {
|
|
55
|
-
position: relative;
|
|
56
|
-
min-height: 100vh;
|
|
57
|
-
display: flex;
|
|
58
|
-
flex-direction: column;
|
|
59
|
-
justify-content: flex-end;
|
|
60
|
-
padding: 0 3rem 6rem;
|
|
61
|
-
overflow: hidden;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* GEOMETRIC DECORATIONS */
|
|
65
|
-
.geo-circle {
|
|
66
|
-
position: absolute;
|
|
67
|
-
border-radius: 50%;
|
|
68
|
-
border: 1px solid rgba(255,255,255,0.04);
|
|
69
|
-
}
|
|
70
|
-
.geo-circle-1 { width: 600px; height: 600px; top: -200px; right: -100px; }
|
|
71
|
-
.geo-circle-2 { width: 400px; height: 400px; top: 10%; left: -150px; border-color: {{accentColor}}15; }
|
|
72
|
-
.geo-circle-3 { width: 200px; height: 200px; bottom: 20%; right: 10%; background: {{accentColor}}08; }
|
|
73
|
-
.geo-line {
|
|
74
|
-
position: absolute;
|
|
75
|
-
background: rgba(255,255,255,0.03);
|
|
76
|
-
}
|
|
77
|
-
.geo-line-1 { width: 1px; height: 100%; top: 0; left: 33.33%; }
|
|
78
|
-
.geo-line-2 { width: 1px; height: 100%; top: 0; left: 66.66%; }
|
|
79
|
-
.geo-dot {
|
|
80
|
-
position: absolute;
|
|
81
|
-
width: 4px; height: 4px;
|
|
82
|
-
border-radius: 50%;
|
|
83
|
-
background: {{accentColor}}40;
|
|
84
|
-
}
|
|
85
|
-
.geo-dot-1 { top: 30%; left: 33.33%; }
|
|
86
|
-
.geo-dot-2 { top: 60%; left: 66.66%; }
|
|
87
|
-
.geo-dot-3 { top: 45%; right: 15%; }
|
|
88
|
-
|
|
89
|
-
.hero-inner {
|
|
90
|
-
max-width: 960px;
|
|
91
|
-
margin: 0 auto;
|
|
92
|
-
width: 100%;
|
|
93
|
-
position: relative;
|
|
94
|
-
z-index: 1;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/* AVATAR - offset, large, with gradient ring */
|
|
98
|
-
.hero-avatar-wrap {
|
|
99
|
-
position: absolute;
|
|
100
|
-
top: 25vh;
|
|
101
|
-
right: 3rem;
|
|
102
|
-
z-index: 2;
|
|
103
|
-
}
|
|
104
|
-
.hero-avatar {
|
|
105
|
-
width: 180px; height: 180px;
|
|
106
|
-
border-radius: 50%;
|
|
107
|
-
border: 3px solid transparent;
|
|
108
|
-
background-image: linear-gradient(#050505, #050505), linear-gradient(135deg, {{accentColor}}, #8957e5, #f78166);
|
|
109
|
-
background-origin: border-box;
|
|
110
|
-
background-clip: padding-box, border-box;
|
|
111
|
-
transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
|
|
112
|
-
}
|
|
113
|
-
.hero-avatar-wrap:hover .hero-avatar {
|
|
114
|
-
transform: scale(1.08) rotate(3deg);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* MASSIVE TITLE */
|
|
118
|
-
.hero-title {
|
|
119
|
-
font-size: clamp(4rem, 12vw, 9rem);
|
|
120
|
-
font-weight: 900;
|
|
121
|
-
letter-spacing: -0.06em;
|
|
122
|
-
line-height: 0.85;
|
|
123
|
-
color: #ffffff;
|
|
124
|
-
margin-bottom: 3rem;
|
|
125
|
-
max-width: 70%;
|
|
126
|
-
white-space: pre-line;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/* PROFILE - asymmetric, stacked */
|
|
130
|
-
.hero-profile {
|
|
131
|
-
display: inline-flex;
|
|
132
|
-
align-items: flex-start;
|
|
133
|
-
gap: 4rem;
|
|
134
|
-
text-decoration: none;
|
|
135
|
-
color: inherit;
|
|
136
|
-
transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
|
|
137
|
-
}
|
|
138
|
-
.hero-profile:hover .hero-display-name {
|
|
139
|
-
color: {{accentColor}};
|
|
140
|
-
text-shadow: 0 0 30px {{accentColor}}80, 0 0 80px {{accentColor}}30;
|
|
141
|
-
}
|
|
142
|
-
.hero-profile:hover .hero-handle {
|
|
143
|
-
text-shadow: 0 0 12px {{accentColor}}60;
|
|
144
|
-
}
|
|
145
|
-
.hero-profile:hover .hero-avatar {
|
|
146
|
-
border-color: {{accentColor}};
|
|
147
|
-
box-shadow: 0 0 30px {{accentColor}}40;
|
|
148
|
-
}
|
|
149
|
-
.hero-profile:hover .hero-stat-value {
|
|
150
|
-
color: {{accentColor}};
|
|
151
|
-
text-shadow: 0 0 16px {{accentColor}}50;
|
|
152
|
-
}
|
|
153
|
-
.hero-name-block {}
|
|
154
|
-
.hero-display-name {
|
|
155
|
-
font-size: 1.5rem;
|
|
156
|
-
font-weight: 300;
|
|
157
|
-
letter-spacing: 0.05em;
|
|
158
|
-
color: rgba(255,255,255,0.9);
|
|
159
|
-
margin-bottom: 0.5rem;
|
|
160
|
-
transition: all 0.4s ease;
|
|
161
|
-
}
|
|
162
|
-
.hero-handle {
|
|
163
|
-
font-family: {{monoFamily}};
|
|
164
|
-
font-size: 0.6875rem;
|
|
165
|
-
color: {{accentColor}};
|
|
166
|
-
letter-spacing: 0.05em;
|
|
167
|
-
transition: all 0.4s ease;
|
|
168
|
-
}
|
|
169
|
-
.hero-bio {
|
|
170
|
-
font-size: 0.875rem;
|
|
171
|
-
color: rgba(255,255,255,0.35);
|
|
172
|
-
margin-top: 0.75rem;
|
|
173
|
-
max-width: 300px;
|
|
174
|
-
line-height: 1.6;
|
|
175
|
-
}
|
|
176
|
-
.hero-stats {
|
|
177
|
-
display: flex;
|
|
178
|
-
flex-direction: column;
|
|
179
|
-
gap: 0.75rem;
|
|
180
|
-
}
|
|
181
|
-
.hero-stat {
|
|
182
|
-
font-family: {{monoFamily}};
|
|
183
|
-
font-size: 0.6875rem;
|
|
184
|
-
color: rgba(255,255,255,0.25);
|
|
185
|
-
}
|
|
186
|
-
.hero-stat-value {
|
|
187
|
-
display: block;
|
|
188
|
-
font-size: 2rem;
|
|
189
|
-
font-weight: 800;
|
|
190
|
-
letter-spacing: -0.03em;
|
|
191
|
-
color: rgba(255,255,255,0.9);
|
|
192
|
-
line-height: 1;
|
|
193
|
-
margin-bottom: 0.125rem;
|
|
194
|
-
transition: all 0.4s ease;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/* CONTENT */
|
|
198
|
-
.index-content {
|
|
199
|
-
max-width: 960px;
|
|
200
|
-
margin: 0 auto;
|
|
201
|
-
padding: 0 3rem 6rem;
|
|
202
|
-
position: relative;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.year-group { margin-bottom: 5rem; }
|
|
206
|
-
.year-label {
|
|
207
|
-
font-family: {{monoFamily}};
|
|
208
|
-
font-size: 6rem;
|
|
209
|
-
font-weight: 900;
|
|
210
|
-
letter-spacing: -0.05em;
|
|
211
|
-
color: rgba(255,255,255,0.04);
|
|
212
|
-
line-height: 1;
|
|
213
|
-
margin-bottom: 2rem;
|
|
214
|
-
user-select: none;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/* WEEK ITEMS - editorial layout */
|
|
218
|
-
.week-list {
|
|
219
|
-
display: flex;
|
|
220
|
-
flex-direction: column;
|
|
221
|
-
gap: 0;
|
|
222
|
-
}
|
|
223
|
-
.week-item {
|
|
224
|
-
display: grid;
|
|
225
|
-
grid-template-columns: 80px 1fr auto;
|
|
226
|
-
gap: 2rem;
|
|
227
|
-
align-items: baseline;
|
|
228
|
-
padding: 2rem 0;
|
|
229
|
-
text-decoration: none;
|
|
230
|
-
color: inherit;
|
|
231
|
-
border-top: 1px solid rgba(255,255,255,0.06);
|
|
232
|
-
transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
|
|
233
|
-
position: relative;
|
|
234
|
-
}
|
|
235
|
-
.week-item:last-child { border-bottom: 1px solid rgba(255,255,255,0.06); }
|
|
236
|
-
.week-item::before {
|
|
237
|
-
content: '';
|
|
238
|
-
position: absolute;
|
|
239
|
-
left: -3rem; top: 0; bottom: 0;
|
|
240
|
-
width: 2px;
|
|
241
|
-
background: {{accentColor}};
|
|
242
|
-
transform: scaleY(0);
|
|
243
|
-
transform-origin: top;
|
|
244
|
-
transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
|
|
245
|
-
}
|
|
246
|
-
.week-item:hover { padding-left: 1rem; }
|
|
247
|
-
.week-item:hover::before { transform: scaleY(1); }
|
|
248
|
-
|
|
249
|
-
.week-item-week {
|
|
250
|
-
font-family: {{monoFamily}};
|
|
251
|
-
font-size: 0.6875rem;
|
|
252
|
-
font-weight: 700;
|
|
253
|
-
color: {{accentColor}};
|
|
254
|
-
letter-spacing: 0.1em;
|
|
255
|
-
}
|
|
256
|
-
.week-item-content {}
|
|
257
|
-
.week-item-title {
|
|
258
|
-
font-size: 1.25rem;
|
|
259
|
-
font-weight: 600;
|
|
260
|
-
letter-spacing: -0.01em;
|
|
261
|
-
margin-bottom: 0.375rem;
|
|
262
|
-
transition: color 0.3s;
|
|
263
|
-
}
|
|
264
|
-
.week-item:hover .week-item-title { color: {{accentColor}}; }
|
|
265
|
-
.week-item-subtitle {
|
|
266
|
-
font-size: 0.875rem;
|
|
267
|
-
color: rgba(255,255,255,0.35);
|
|
268
|
-
line-height: 1.5;
|
|
269
|
-
display: -webkit-box;
|
|
270
|
-
-webkit-line-clamp: 1;
|
|
271
|
-
-webkit-box-orient: vertical;
|
|
272
|
-
overflow: hidden;
|
|
273
|
-
}
|
|
274
|
-
.week-item-date {
|
|
275
|
-
font-family: {{monoFamily}};
|
|
276
|
-
font-size: 0.75rem;
|
|
277
|
-
margin-top: 0.5rem;
|
|
278
|
-
font-size: 0.75rem;
|
|
279
|
-
color: rgba(255,255,255,0.2);
|
|
280
|
-
padding-top: 0.25rem;
|
|
281
|
-
}
|
|
282
|
-
.week-item-stat-value { font-weight: 700; }
|
|
283
|
-
.stat-commits .week-item-stat-value { color: #3fb950; }
|
|
284
|
-
.stat-prs .week-item-stat-value { color: #8957e5; }
|
|
285
|
-
.stat-reviews .week-item-stat-value { color: #58a6ff; }
|
|
286
|
-
|
|
287
|
-
/* FOOTER */
|
|
288
|
-
.footer {
|
|
289
|
-
max-width: 960px;
|
|
290
|
-
margin: 0 auto;
|
|
291
|
-
text-align: center;
|
|
292
|
-
padding: 4rem 3rem;
|
|
293
|
-
font-size: 0.8125rem;
|
|
294
|
-
color: rgba(255,255,255,0.3);
|
|
295
|
-
border-top: 1px solid rgba(255,255,255,0.08);
|
|
296
|
-
}
|
|
297
|
-
.footer a { color: rgba(255,255,255,0.5); text-decoration: none; transition: color 0.2s; }
|
|
298
|
-
.footer a:hover { color: rgba(255,255,255,0.6); }
|
|
299
|
-
|
|
300
|
-
@media (max-width: 768px) {
|
|
301
|
-
.hero { padding: 0 1.5rem 4rem; min-height: auto; padding-top: 8rem; }
|
|
302
|
-
.hero-title { font-size: clamp(3rem, 15vw, 5rem); max-width: 100%; }
|
|
303
|
-
.hero-avatar-wrap { position: relative; top: auto; right: auto; margin-bottom: 2rem; }
|
|
304
|
-
.hero-avatar { width: 100px; height: 100px; }
|
|
305
|
-
.hero-profile { flex-direction: column; gap: 2rem; }
|
|
306
|
-
.hero-stats { flex-direction: row; gap: 2rem; }
|
|
307
|
-
.index-nav-inner { padding: 0.75rem 1.5rem; }
|
|
308
|
-
.index-content { padding: 0 1.5rem 4rem; }
|
|
309
|
-
.week-item { grid-template-columns: 1fr; gap: 0.5rem; }
|
|
310
|
-
.week-item::before { left: -1.5rem; }
|
|
311
|
-
.week-item-stats { margin-top: 0.5rem; }
|
|
312
|
-
.year-label { font-size: 3rem; }
|
|
313
|
-
}
|
|
314
|
-
</style>
|
|
315
|
-
</head>
|
|
316
|
-
<body>
|
|
317
|
-
|
|
318
|
-
<nav class="index-nav">
|
|
319
|
-
<div class="index-nav-inner">
|
|
320
|
-
<span class="nav-site-title">{{siteTitleInline}}</span>
|
|
321
|
-
</div>
|
|
322
|
-
</nav>
|
|
323
|
-
|
|
324
|
-
<section class="hero">
|
|
325
|
-
<!-- Geometric decorations -->
|
|
326
|
-
<div class="geo-circle geo-circle-1"></div>
|
|
327
|
-
<div class="geo-circle geo-circle-2"></div>
|
|
328
|
-
<div class="geo-circle geo-circle-3"></div>
|
|
329
|
-
<div class="geo-line geo-line-1"></div>
|
|
330
|
-
<div class="geo-line geo-line-2"></div>
|
|
331
|
-
<div class="geo-dot geo-dot-1"></div>
|
|
332
|
-
<div class="geo-dot geo-dot-2"></div>
|
|
333
|
-
<div class="geo-dot geo-dot-3"></div>
|
|
334
|
-
|
|
335
|
-
{{#if avatarUrl}}
|
|
336
|
-
<a href="https://github.com/{{username}}" class="hero-avatar-wrap" target="_blank" rel="noopener nofollow">
|
|
337
|
-
<img src="{{avatarUrl}}" alt="{{username}}" class="hero-avatar" width="180" height="180" />
|
|
338
|
-
</a>
|
|
339
|
-
{{/if}}
|
|
340
|
-
|
|
341
|
-
<div class="hero-inner">
|
|
342
|
-
<h1 class="hero-title">{{siteTitle}}</h1>
|
|
343
|
-
|
|
344
|
-
{{#if username}}
|
|
345
|
-
<a href="https://github.com/{{username}}" class="hero-profile" target="_blank" rel="noopener nofollow">
|
|
346
|
-
<div class="hero-name-block">
|
|
347
|
-
<div class="hero-display-name">{{displayName}}</div>
|
|
348
|
-
<div class="hero-handle">@{{username}}</div>
|
|
349
|
-
{{#if profile.company}}<div class="hero-bio">{{profile.company}}</div>{{/if}}
|
|
350
|
-
{{#if profile.location}}<div class="hero-bio">{{profile.location}}</div>{{/if}}
|
|
351
|
-
</div>
|
|
352
|
-
{{#if profile}}
|
|
353
|
-
<div class="hero-stats">
|
|
354
|
-
{{#if profile.followers}}<div class="hero-stat"><span class="hero-stat-value">{{profile.followers}}</span>followers</div>{{/if}}
|
|
355
|
-
{{#if profile.publicRepos}}<div class="hero-stat"><span class="hero-stat-value">{{profile.publicRepos}}</span>repos</div>{{/if}}
|
|
356
|
-
</div>
|
|
357
|
-
{{/if}}
|
|
358
|
-
</a>
|
|
359
|
-
{{/if}}
|
|
360
|
-
</div>
|
|
361
|
-
</section>
|
|
362
|
-
|
|
363
|
-
<div class="index-content">
|
|
364
|
-
{{#each yearGroups}}
|
|
365
|
-
<div class="year-group">
|
|
366
|
-
<div class="year-label">{{this.year}}</div>
|
|
367
|
-
<div class="week-list">
|
|
368
|
-
{{#each this.reports}}
|
|
369
|
-
<a href="{{this.path}}/" class="week-item">
|
|
370
|
-
<div class="week-item-week">{{this.week}}</div>
|
|
371
|
-
<div class="week-item-content">
|
|
372
|
-
<div class="week-item-title">{{#if this.title}}{{this.title}}{{else}}Week {{this.week}}{{/if}}</div>
|
|
373
|
-
{{#if this.subtitle}}<div class="week-item-subtitle">{{this.subtitle}}</div>{{/if}}
|
|
374
|
-
<div class="week-item-date">{{this.dateLabel}}</div>
|
|
375
|
-
</div>
|
|
376
|
-
{{#if this.stats}}
|
|
377
|
-
<div class="week-item-stats">
|
|
378
|
-
<span class="week-item-stat stat-commits"><span class="week-item-stat-value">{{this.stats.commits}}</span> commits</span>
|
|
379
|
-
<span class="week-item-stat stat-prs"><span class="week-item-stat-value">{{this.stats.prs}}</span> PRs</span>
|
|
380
|
-
<span class="week-item-stat stat-reviews"><span class="week-item-stat-value">{{this.stats.reviews}}</span> reviews</span>
|
|
381
|
-
</div>
|
|
382
|
-
{{/if}}
|
|
383
|
-
</a>
|
|
384
|
-
{{/each}}
|
|
385
|
-
</div>
|
|
386
|
-
</div>
|
|
387
|
-
{{/each}}
|
|
388
|
-
</div>
|
|
389
|
-
|
|
390
|
-
<footer class="footer">
|
|
391
|
-
{{poweredBy}} <a href="https://deariary.com?utm_source=github-weekly-reporter&utm_medium=footer" target="_blank" rel="noopener">deariary</a>
|
|
392
|
-
·
|
|
393
|
-
{{generatedWith}} <a href="https://github.com/deariary/github-weekly-reporter" target="_blank" rel="noopener">github-weekly-reporter</a>
|
|
394
|
-
</footer>
|
|
395
|
-
|
|
396
|
-
</body>
|
|
397
|
-
</html>`;
|
|
8
|
+
const TEMPLATES_DIR = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "src", "renderer", "templates");
|
|
9
|
+
const TEMPLATE = readFileSync(join(TEMPLATES_DIR, "index-page.hbs"), "utf-8");
|
|
398
10
|
const weekToDateLabel = (path) => {
|
|
399
11
|
const [year, week] = path.split("/");
|
|
400
12
|
return `${year} ${week}`;
|
|
@@ -409,21 +21,27 @@ const groupByYear = (reports) => {
|
|
|
409
21
|
});
|
|
410
22
|
return [...groups.entries()].map(([year, reps]) => ({ year, reports: reps }));
|
|
411
23
|
};
|
|
412
|
-
export const renderIndexPage = (reports, pageData, language = "en", siteTitle) => {
|
|
24
|
+
export const renderIndexPage = (reports, pageData, language = "en", siteTitle, baseUrl) => {
|
|
413
25
|
const locale = getLocale(language);
|
|
414
26
|
const fontConfig = getFontConfig(language);
|
|
415
27
|
const resolvedSiteTitle = (siteTitle ?? "Dev\nPulse").replace(/\\n/g, "\n");
|
|
416
28
|
const siteTitleInline = resolvedSiteTitle.replace(/\n/g, " ");
|
|
29
|
+
const username = pageData?.username ?? "";
|
|
30
|
+
const description = `Weekly reports by @${username}`;
|
|
31
|
+
const ogImageUrl = baseUrl ? `${baseUrl}/og.png` : "og.png";
|
|
417
32
|
const template = Handlebars.compile(TEMPLATE);
|
|
418
33
|
return template({
|
|
419
34
|
yearGroups: groupByYear(reports),
|
|
420
35
|
css: buildCSS(language),
|
|
421
|
-
username
|
|
36
|
+
username,
|
|
422
37
|
avatarUrl: pageData?.avatarUrl,
|
|
423
38
|
profile: pageData?.profile,
|
|
424
|
-
displayName: pageData?.profile?.name ??
|
|
39
|
+
displayName: pageData?.profile?.name ?? username,
|
|
425
40
|
siteTitle: resolvedSiteTitle,
|
|
426
41
|
siteTitleInline,
|
|
42
|
+
description,
|
|
43
|
+
ogImageUrl,
|
|
44
|
+
baseUrl,
|
|
427
45
|
lang: language,
|
|
428
46
|
weeklyReports: locale.weeklyReports,
|
|
429
47
|
poweredBy: locale.poweredBy,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-page.js","sourceRoot":"","sources":["../../src/deployer/index-page.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAE1D,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA6BjD,MAAM,QAAQ,GAAG
|
|
1
|
+
{"version":3,"file":"index-page.js","sourceRoot":"","sources":["../../src/deployer/index-page.ts"],"names":[],"mappings":"AAAA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,OAAO,EAAE,QAAQ,EAAE,OAAO;QAC1B,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,IAAI,QAAQ;QAChD,SAAS,EAAE,iBAAiB;QAC5B,eAAe;QACf,WAAW;QACX,UAAU;QACV,OAAO;QACP,IAAI,EAAE,QAAQ;QACd,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,UAAU,EAAE,UAAU,CAAC,UAAU;QACjC,WAAW,EAAE,SAAS;KACvB,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,IAAY,EACZ,KAAc,EACd,QAAiB,EACjB,KAAwB,EACX,EAAE,CAAC,CAAC;IACjB,IAAI;IACJ,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI;IAChC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;IAC9B,KAAK;IACL,QAAQ;IACR,SAAS,EAAE,eAAe,CAAC,IAAI,CAAC;IAChC,KAAK;CACN,CAAC,CAAC"}
|
package/dist/deployer/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deployer/index.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,MAAM,GAAU,SAAS,aAAa,KAAG,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deployer/index.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,MAAM,GAAU,SAAS,aAAa,KAAG,OAAO,CAAC,IAAI,CAoCjE,CAAC"}
|
package/dist/deployer/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { join } from "node:path";
|
|
|
6
6
|
import { tmpdir } from "node:os";
|
|
7
7
|
const exec = promisify(execFile);
|
|
8
8
|
const git = (args, cwd) => exec("git", args, { cwd });
|
|
9
|
+
/** Deploy the output directory to the gh-pages branch via force push. */
|
|
9
10
|
export const deploy = async (options) => {
|
|
10
11
|
const { repoUrl, directory, message = "deploy" } = options;
|
|
11
12
|
const tmp = await mkdtemp(join(tmpdir(), "gwr-deploy-"));
|
|
@@ -27,10 +28,8 @@ export const deploy = async (options) => {
|
|
|
27
28
|
// Stage all changes
|
|
28
29
|
await git(["add", "."], tmp);
|
|
29
30
|
const { stdout } = await git(["status", "--porcelain"], tmp);
|
|
30
|
-
if (!stdout.trim())
|
|
31
|
-
console.log("No changes to deploy.");
|
|
31
|
+
if (!stdout.trim())
|
|
32
32
|
return;
|
|
33
|
-
}
|
|
34
33
|
await git(["commit", "-m", message], tmp);
|
|
35
34
|
await git(["push", repoUrl, "gh-pages", "--force"], tmp);
|
|
36
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/deployer/index.ts"],"names":[],"mappings":"AAAA,wEAAwE;AAExE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,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E3B,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC;QAC1C,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3D,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;AACH,CAAC,CAAC"}
|
package/dist/deployer/week.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"week.d.ts","sourceRoot":"","sources":["../../src/deployer/week.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"week.d.ts","sourceRoot":"","sources":["../../src/deployer/week.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAUF,eAAO,MAAM,SAAS,GACpB,OAAM,IAAiB,EACvB,WAAU,MAAc,KACvB,MAWF,CAAC;AAIF,eAAO,MAAM,gBAAgB,GAC3B,OAAM,IAAiB,EACvB,WAAU,MAAc,KACvB,MAUF,CAAC"}
|
package/dist/deployer/week.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
// ISO week number calculation (timezone-aware)
|
|
2
|
-
|
|
3
|
-
const fmt = new Intl.DateTimeFormat("en-CA", {
|
|
4
|
-
timeZone: tz,
|
|
5
|
-
year: "numeric",
|
|
6
|
-
month: "2-digit",
|
|
7
|
-
day: "2-digit",
|
|
8
|
-
});
|
|
9
|
-
const [year, month, day] = fmt.format(date).split("-").map(Number);
|
|
10
|
-
return { year, month: month - 1, day };
|
|
11
|
-
};
|
|
2
|
+
import { localDateParts } from "../collector/date-range.js";
|
|
12
3
|
const getISOWeekNumber = (date, timezone) => {
|
|
13
4
|
const { year, month, day } = localDateParts(date, timezone);
|
|
14
5
|
const d = new Date(Date.UTC(year, month, day));
|
|
@@ -28,4 +19,17 @@ export const getWeekId = (date = new Date(), timezone = "UTC") => {
|
|
|
28
19
|
const padded = String(prevWeek).padStart(2, "0");
|
|
29
20
|
return { year: prevYear, week: prevWeek, path: `${prevYear}/W${padded}` };
|
|
30
21
|
};
|
|
22
|
+
// Current ISO week ID. Used by daily-fetch to store events for the
|
|
23
|
+
// week that is still in progress.
|
|
24
|
+
export const getCurrentWeekId = (date = new Date(), timezone = "UTC") => {
|
|
25
|
+
const { year, month, day } = localDateParts(date, timezone);
|
|
26
|
+
const d = new Date(Date.UTC(year, month, day));
|
|
27
|
+
const dow = d.getUTCDay() || 7; // 1=Mon..7=Sun
|
|
28
|
+
// This week's Thursday
|
|
29
|
+
const thisThursday = new Date(Date.UTC(year, month, day - (dow - 1) + 3));
|
|
30
|
+
const week = getISOWeekNumber(thisThursday, timezone);
|
|
31
|
+
const weekYear = localDateParts(thisThursday, timezone).year;
|
|
32
|
+
const padded = String(week).padStart(2, "0");
|
|
33
|
+
return { year: weekYear, week, path: `${weekYear}/W${padded}` };
|
|
34
|
+
};
|
|
31
35
|
//# sourceMappingURL=week.js.map
|