@chtc/web-components 2.0.2 → 2.0.4
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/Article/{Article.d.ts → components/Article.d.ts} +1 -1
- package/Article/components/Article.d.ts.map +1 -0
- package/Article/{Article.js → components/Article.js} +2 -2
- package/Article/components/Article.js.map +1 -0
- package/{ArticleCard → Article/components}/ArticleCard.d.ts +1 -1
- package/Article/components/ArticleCard.d.ts.map +1 -0
- package/{ArticleCard → Article/components}/ArticleCard.js +1 -1
- package/Article/components/ArticleCard.js.map +1 -0
- package/{HorizontalArticleCard → Article/components}/HorizontalArticleCard.d.ts +1 -1
- package/Article/components/HorizontalArticleCard.d.ts.map +1 -0
- package/{HorizontalArticleCard → Article/components}/HorizontalArticleCard.js +1 -1
- package/{HorizontalArticleCard → Article/components}/HorizontalArticleCard.js.map +1 -1
- package/Article/index.d.ts +8 -1
- package/Article/index.d.ts.map +1 -1
- package/Article/index.js +7 -1
- package/Article/index.js.map +1 -1
- package/Article/types.d.ts +40 -0
- package/Article/types.d.ts.map +1 -0
- package/Article/types.js +2 -0
- package/Article/types.js.map +1 -0
- package/{utils → Article/utils}/filterArticles.d.ts +3 -2
- package/Article/utils/filterArticles.d.ts.map +1 -0
- package/Article/utils/filterArticles.js +13 -0
- package/Article/utils/filterArticles.js.map +1 -0
- package/Article/utils/getArticle.d.ts +10 -0
- package/Article/utils/getArticle.d.ts.map +1 -0
- package/Article/utils/getArticle.js +34 -0
- package/Article/utils/getArticle.js.map +1 -0
- package/Article/utils/getArticles.d.ts +10 -0
- package/Article/utils/getArticles.d.ts.map +1 -0
- package/Article/utils/getArticles.js +16 -0
- package/Article/utils/getArticles.js.map +1 -0
- package/Article/utils/sortArticles.d.ts +5 -0
- package/Article/utils/sortArticles.d.ts.map +1 -0
- package/Article/utils/sortArticles.js +6 -0
- package/Article/utils/sortArticles.js.map +1 -0
- package/BigNumber/BigNumber.d.ts +1 -1
- package/BigNumber/BigNumber.d.ts.map +1 -1
- package/ColorBar/ColorBar.d.ts +1 -1
- package/ColorBar/ColorBar.d.ts.map +1 -1
- package/ConfirmButton/ConfirmButton.d.ts +1 -1
- package/ConfirmButton/ConfirmButton.d.ts.map +1 -1
- package/Milestone/index.d.ts +4 -0
- package/Milestone/index.d.ts.map +1 -0
- package/Milestone/index.js +3 -0
- package/Milestone/index.js.map +1 -0
- package/Milestone/types.d.ts +18 -0
- package/Milestone/types.d.ts.map +1 -0
- package/Milestone/types.js +2 -0
- package/Milestone/types.js.map +1 -0
- package/Milestone/utils/findCurrentMilestone.d.ts +15 -0
- package/Milestone/utils/findCurrentMilestone.d.ts.map +1 -0
- package/Milestone/utils/findCurrentMilestone.js +18 -0
- package/Milestone/utils/findCurrentMilestone.js.map +1 -0
- package/Milestone/utils/getMilestones.d.ts +16 -0
- package/Milestone/utils/getMilestones.d.ts.map +1 -0
- package/Milestone/utils/getMilestones.js +14 -0
- package/Milestone/utils/getMilestones.js.map +1 -0
- package/PieChart/PieChart.d.ts +1 -1
- package/PieChart/PieChart.d.ts.map +1 -1
- package/Presentation/components/Presentation.d.ts +4 -0
- package/Presentation/components/Presentation.d.ts.map +1 -0
- package/Presentation/{Presentation.js → components/Presentation.js} +3 -3
- package/Presentation/components/Presentation.js.map +1 -0
- package/{PresentationCard → Presentation/components}/PresentationCard.d.ts +3 -3
- package/Presentation/components/PresentationCard.d.ts.map +1 -0
- package/{PresentationCard → Presentation/components}/PresentationCard.js +4 -4
- package/Presentation/components/PresentationCard.js.map +1 -0
- package/Presentation/index.d.ts +6 -1
- package/Presentation/index.d.ts.map +1 -1
- package/Presentation/index.js +5 -1
- package/Presentation/index.js.map +1 -1
- package/Presentation/types.d.ts +36 -0
- package/Presentation/types.d.ts.map +1 -0
- package/Presentation/types.js +2 -0
- package/Presentation/types.js.map +1 -0
- package/Presentation/utils/filterPresentations.d.ts +9 -0
- package/Presentation/utils/filterPresentations.d.ts.map +1 -0
- package/Presentation/utils/filterPresentations.js +13 -0
- package/Presentation/utils/filterPresentations.js.map +1 -0
- package/Presentation/utils/getPresentation.d.ts +10 -0
- package/Presentation/utils/getPresentation.d.ts.map +1 -0
- package/Presentation/utils/getPresentation.js +35 -0
- package/Presentation/utils/getPresentation.js.map +1 -0
- package/Presentation/utils/getPresentations.d.ts +12 -0
- package/Presentation/utils/getPresentations.d.ts.map +1 -0
- package/Presentation/utils/getPresentations.js +18 -0
- package/Presentation/utils/getPresentations.js.map +1 -0
- package/Release/index.d.ts +4 -0
- package/Release/index.d.ts.map +1 -0
- package/Release/index.js +3 -0
- package/Release/index.js.map +1 -0
- package/Release/types.d.ts +26 -0
- package/Release/types.d.ts.map +1 -0
- package/Release/types.js +2 -0
- package/Release/types.js.map +1 -0
- package/Release/utils/getReleases.d.ts +13 -0
- package/Release/utils/getReleases.d.ts.map +1 -0
- package/Release/utils/getReleases.js +17 -0
- package/Release/utils/getReleases.js.map +1 -0
- package/Release/utils/organizeReleases.d.ts +10 -0
- package/Release/utils/organizeReleases.d.ts.map +1 -0
- package/Release/utils/organizeReleases.js +26 -0
- package/Release/utils/organizeReleases.js.map +1 -0
- package/Security/index.d.ts +7 -0
- package/Security/index.d.ts.map +1 -0
- package/Security/index.js +6 -0
- package/Security/index.js.map +1 -0
- package/Security/types.d.ts +53 -0
- package/Security/types.d.ts.map +1 -0
- package/Security/types.js +2 -0
- package/Security/types.js.map +1 -0
- package/Security/utils/getAdvisoryCvss.d.ts +8 -0
- package/Security/utils/getAdvisoryCvss.d.ts.map +1 -0
- package/Security/utils/getAdvisoryCvss.js +18 -0
- package/Security/utils/getAdvisoryCvss.js.map +1 -0
- package/Security/utils/getAdvisoryPublishedTime.d.ts +5 -0
- package/Security/utils/getAdvisoryPublishedTime.d.ts.map +1 -0
- package/Security/utils/getAdvisoryPublishedTime.js +6 -0
- package/Security/utils/getAdvisoryPublishedTime.js.map +1 -0
- package/Security/utils/getPatchedVersions.d.ts +5 -0
- package/Security/utils/getPatchedVersions.d.ts.map +1 -0
- package/Security/utils/getPatchedVersions.js +9 -0
- package/Security/utils/getPatchedVersions.js.map +1 -0
- package/Security/utils/getRecentAdvisories.d.ts +16 -0
- package/Security/utils/getRecentAdvisories.d.ts.map +1 -0
- package/Security/utils/getRecentAdvisories.js +19 -0
- package/Security/utils/getRecentAdvisories.js.map +1 -0
- package/Security/utils/getSecurityAdvisories.d.ts +12 -0
- package/Security/utils/getSecurityAdvisories.d.ts.map +1 -0
- package/Security/utils/getSecurityAdvisories.js +18 -0
- package/Security/utils/getSecurityAdvisories.js.map +1 -0
- package/Staff/components/StaffCard.d.ts +4 -0
- package/Staff/components/StaffCard.d.ts.map +1 -0
- package/Staff/components/StaffCard.js.map +1 -0
- package/Staff/index.d.ts +4 -0
- package/Staff/index.d.ts.map +1 -0
- package/Staff/index.js +3 -0
- package/Staff/index.js.map +1 -0
- package/Staff/types.d.ts +34 -0
- package/Staff/types.d.ts.map +1 -0
- package/Staff/types.js +2 -0
- package/Staff/types.js.map +1 -0
- package/Staff/utils/getStaff.d.ts +19 -0
- package/Staff/utils/getStaff.d.ts.map +1 -0
- package/Staff/utils/getStaff.js +36 -0
- package/Staff/utils/getStaff.js.map +1 -0
- package/Table/Table.d.ts +1 -1
- package/Table/Table.d.ts.map +1 -1
- package/TimeBar/TimeBar.d.ts +1 -1
- package/TimeBar/TimeBar.d.ts.map +1 -1
- package/UW/Banner/Banner.d.ts +1 -1
- package/UW/Banner/Banner.d.ts.map +1 -1
- package/UW/Footer/ContactCard.d.ts +1 -1
- package/UW/Footer/ContactCard.d.ts.map +1 -1
- package/UW/Footer/Footer.d.ts +1 -1
- package/UW/Footer/Footer.d.ts.map +1 -1
- package/UW/Footer/FooterMenu.d.ts +1 -1
- package/UW/Footer/FooterMenu.d.ts.map +1 -1
- package/UW/Footer/FooterSection.d.ts +1 -1
- package/UW/Footer/FooterSection.d.ts.map +1 -1
- package/UW/Footer/MenuLink.d.ts +1 -1
- package/UW/Footer/MenuLink.d.ts.map +1 -1
- package/UW/Footer/SocialLink.d.ts +1 -1
- package/UW/Footer/SocialLink.d.ts.map +1 -1
- package/UW/Logo/Logo.d.ts +1 -1
- package/UW/Logo/Logo.d.ts.map +1 -1
- package/content/index.d.ts +2 -9
- package/content/index.d.ts.map +1 -1
- package/content/index.js +3 -8
- package/content/index.js.map +1 -1
- package/github/getAllPages.d.ts +11 -0
- package/github/getAllPages.d.ts.map +1 -0
- package/github/getAllPages.js +34 -0
- package/github/getAllPages.js.map +1 -0
- package/github/getRawFile.d.ts +7 -0
- package/github/getRawFile.d.ts.map +1 -0
- package/github/getRawFile.js +13 -0
- package/github/getRawFile.js.map +1 -0
- package/github/getRepoPaths.d.ts +7 -0
- package/github/getRepoPaths.d.ts.map +1 -0
- package/github/getRepoPaths.js +10 -0
- package/github/getRepoPaths.js.map +1 -0
- package/github/getTree.d.ts +7 -0
- package/github/getTree.d.ts.map +1 -0
- package/github/getTree.js +11 -0
- package/github/getTree.js.map +1 -0
- package/github/githubFetch.d.ts +13 -0
- package/github/githubFetch.d.ts.map +1 -0
- package/github/githubFetch.js +36 -0
- package/github/githubFetch.js.map +1 -0
- package/github/index.d.ts +10 -0
- package/github/index.d.ts.map +1 -0
- package/github/index.js +9 -0
- package/github/index.js.map +1 -0
- package/github/types.d.ts +32 -0
- package/github/types.d.ts.map +1 -0
- package/github/types.js +2 -0
- package/github/types.js.map +1 -0
- package/index.d.ts +10 -21
- package/index.d.ts.map +1 -1
- package/index.js +12 -20
- package/index.js.map +1 -1
- package/markdownComponents/MarkdownContent.d.ts +1 -1
- package/markdownComponents/MarkdownContent.d.ts.map +1 -1
- package/package.json +13 -7
- package/tsconfig.tsbuildinfo +1 -1
- package/types.d.ts +3 -61
- package/types.d.ts.map +1 -1
- package/types.js +1 -1
- package/types.js.map +1 -1
- package/utils/formatLongDate.d.ts +7 -0
- package/utils/formatLongDate.d.ts.map +1 -0
- package/utils/{formatDate.js → formatLongDate.js} +4 -3
- package/utils/formatLongDate.js.map +1 -0
- package/utils/getDateFromPath.d.ts +6 -0
- package/utils/getDateFromPath.d.ts.map +1 -0
- package/utils/getDateFromPath.js +9 -0
- package/utils/getDateFromPath.js.map +1 -0
- package/utils/getSlugFromPath.d.ts +8 -0
- package/utils/getSlugFromPath.d.ts.map +1 -0
- package/utils/getSlugFromPath.js +11 -0
- package/utils/getSlugFromPath.js.map +1 -0
- package/utils/getTagColor.d.ts +3 -0
- package/utils/getTagColor.d.ts.map +1 -0
- package/utils/getTagColor.js +21 -0
- package/utils/getTagColor.js.map +1 -0
- package/utils/index.d.ts +6 -6
- package/utils/index.d.ts.map +1 -1
- package/utils/index.js +6 -5
- package/utils/index.js.map +1 -1
- package/utils/isDatedMarkdown.d.ts +7 -0
- package/utils/isDatedMarkdown.d.ts.map +1 -0
- package/utils/isDatedMarkdown.js +9 -0
- package/utils/isDatedMarkdown.js.map +1 -0
- package/utils/toArray.d.ts +7 -0
- package/utils/toArray.d.ts.map +1 -0
- package/utils/toArray.js +12 -0
- package/utils/toArray.js.map +1 -0
- package/Article/Article.d.ts.map +0 -1
- package/Article/Article.js.map +0 -1
- package/ArticleCard/ArticleCard.d.ts.map +0 -1
- package/ArticleCard/ArticleCard.js.map +0 -1
- package/ArticleCard/index.d.ts +0 -2
- package/ArticleCard/index.d.ts.map +0 -1
- package/ArticleCard/index.js +0 -2
- package/ArticleCard/index.js.map +0 -1
- package/HorizontalArticleCard/HorizontalArticleCard.d.ts.map +0 -1
- package/HorizontalArticleCard/index.d.ts +0 -2
- package/HorizontalArticleCard/index.d.ts.map +0 -1
- package/HorizontalArticleCard/index.js +0 -2
- package/HorizontalArticleCard/index.js.map +0 -1
- package/Presentation/Presentation.d.ts +0 -4
- package/Presentation/Presentation.d.ts.map +0 -1
- package/Presentation/Presentation.js.map +0 -1
- package/PresentationCard/PresentationCard.d.ts.map +0 -1
- package/PresentationCard/PresentationCard.js.map +0 -1
- package/PresentationCard/index.d.ts +0 -2
- package/PresentationCard/index.d.ts.map +0 -1
- package/PresentationCard/index.js +0 -2
- package/PresentationCard/index.js.map +0 -1
- package/StaffCard/StaffCard.d.ts +0 -15
- package/StaffCard/StaffCard.d.ts.map +0 -1
- package/StaffCard/StaffCard.js.map +0 -1
- package/StaffCard/index.d.ts +0 -2
- package/StaffCard/index.d.ts.map +0 -1
- package/StaffCard/index.js +0 -2
- package/StaffCard/index.js.map +0 -1
- package/utils/filterArticles.d.ts.map +0 -1
- package/utils/filterArticles.js +0 -9
- package/utils/filterArticles.js.map +0 -1
- package/utils/formatDate.d.ts +0 -6
- package/utils/formatDate.d.ts.map +0 -1
- package/utils/formatDate.js.map +0 -1
- package/utils/getArticle.d.ts +0 -14
- package/utils/getArticle.d.ts.map +0 -1
- package/utils/getArticle.js +0 -47
- package/utils/getArticle.js.map +0 -1
- package/utils/getArticles.d.ts +0 -61
- package/utils/getArticles.d.ts.map +0 -1
- package/utils/getArticles.js +0 -57
- package/utils/getArticles.js.map +0 -1
- package/utils/tagColor.d.ts +0 -6
- package/utils/tagColor.d.ts.map +0 -1
- package/utils/tagColor.js +0 -20
- package/utils/tagColor.js.map +0 -1
- /package/{StaffCard → Staff/components}/StaffCard.js +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Default data-cache lifetime for GitHub responses, in seconds. */
|
|
2
|
+
export const GITHUB_REVALIDATE = 60 * 60;
|
|
3
|
+
/** Hosts that accept the GitHub token. It is never sent anywhere else. */
|
|
4
|
+
const GITHUB_HOSTS = new Set(["api.github.com", "raw.githubusercontent.com"]);
|
|
5
|
+
/**
|
|
6
|
+
* The single place this library talks to GitHub.
|
|
7
|
+
*
|
|
8
|
+
* Adds the bearer token (when available and the host is GitHub's), the Next.js
|
|
9
|
+
* data-cache hint, and a default JSON `Accept` header. Throws on any non-2xx
|
|
10
|
+
* response so callers never parse an error page as data.
|
|
11
|
+
*/
|
|
12
|
+
export async function githubFetch(url, options, init = {}) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const target = new URL(url);
|
|
15
|
+
const token = (_a = options === null || options === void 0 ? void 0 : options.token) !== null && _a !== void 0 ? _a : process.env.GITHUB_TOKEN;
|
|
16
|
+
const revalidate = (_b = options === null || options === void 0 ? void 0 : options.revalidate) !== null && _b !== void 0 ? _b : GITHUB_REVALIDATE;
|
|
17
|
+
const headers = new Headers(init.headers);
|
|
18
|
+
if (!headers.has("accept")) {
|
|
19
|
+
headers.set("accept", "application/vnd.github+json");
|
|
20
|
+
}
|
|
21
|
+
if (token && GITHUB_HOSTS.has(target.hostname)) {
|
|
22
|
+
headers.set("authorization", `Bearer ${token}`);
|
|
23
|
+
}
|
|
24
|
+
const res = await fetch(target, {
|
|
25
|
+
...init,
|
|
26
|
+
headers,
|
|
27
|
+
// Next.js extends RequestInit with `next`; harmless elsewhere.
|
|
28
|
+
...{ next: { revalidate } },
|
|
29
|
+
});
|
|
30
|
+
if (!res.ok) {
|
|
31
|
+
throw new Error(`GitHub request failed (${res.status} ${res.statusText}): ${target}`);
|
|
32
|
+
}
|
|
33
|
+
return res;
|
|
34
|
+
}
|
|
35
|
+
export default githubFetch;
|
|
36
|
+
//# sourceMappingURL=githubFetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"githubFetch.js","sourceRoot":"","sources":["../../src/github/githubFetch.ts"],"names":[],"mappings":"AAEA,oEAAoE;AACpE,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,EAAE,CAAC;AAEzC,0EAA0E;AAC1E,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,gBAAgB,EAAE,2BAA2B,CAAC,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,GAAiB,EACjB,OAA4B,EAC5B,OAAoB,EAAE;;IAEtB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,MAAM,KAAK,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IACzD,MAAM,UAAU,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,mCAAI,iBAAiB,CAAC;IAE5D,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC;IACvD,CAAC;IACD,IAAI,KAAK,IAAI,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/C,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE;QAC9B,GAAG,IAAI;QACP,OAAO;QACP,+DAA+D;QAC/D,GAAI,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,EAA8B;KACzD,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,0BAA0B,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,UAAU,MAAM,MAAM,EAAE,CACrE,CAAC;IACJ,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { githubFetch, GITHUB_REVALIDATE } from "./githubFetch";
|
|
2
|
+
export { getTree } from "./getTree";
|
|
3
|
+
export { getRepoPaths } from "./getRepoPaths";
|
|
4
|
+
export { getRawFile } from "./getRawFile";
|
|
5
|
+
export { getAllPages } from "./getAllPages";
|
|
6
|
+
export type { GitHubFetchOptions, GitTree, GitTreeItem } from "./types";
|
|
7
|
+
export * from "../Release";
|
|
8
|
+
export * from "../Security";
|
|
9
|
+
export * from "../Milestone";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/github/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,kBAAkB,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAExE,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
package/github/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { githubFetch, GITHUB_REVALIDATE } from "./githubFetch";
|
|
2
|
+
export { getTree } from "./getTree";
|
|
3
|
+
export { getRepoPaths } from "./getRepoPaths";
|
|
4
|
+
export { getRawFile } from "./getRawFile";
|
|
5
|
+
export { getAllPages } from "./getAllPages";
|
|
6
|
+
export * from "../Release";
|
|
7
|
+
export * from "../Security";
|
|
8
|
+
export * from "../Milestone";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/github/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options accepted by every GitHub getter in this library.
|
|
3
|
+
*/
|
|
4
|
+
export interface GitHubFetchOptions {
|
|
5
|
+
/**
|
|
6
|
+
* GitHub token sent as a bearer token to api.github.com and
|
|
7
|
+
* raw.githubusercontent.com. Defaults to `process.env.GITHUB_TOKEN` when set.
|
|
8
|
+
* Raises the API rate limit from 60 to 5,000 requests per hour.
|
|
9
|
+
*/
|
|
10
|
+
token?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Seconds to keep responses in Next.js's data cache (`next: { revalidate }`).
|
|
13
|
+
* Defaults to one hour so dev renders and incremental rebuilds don't re-hit
|
|
14
|
+
* GitHub for every file. Pass `0` to always fetch fresh.
|
|
15
|
+
*/
|
|
16
|
+
revalidate?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface GitTreeItem {
|
|
19
|
+
path: string;
|
|
20
|
+
mode: string;
|
|
21
|
+
type: string;
|
|
22
|
+
sha: string;
|
|
23
|
+
size: number;
|
|
24
|
+
url: string;
|
|
25
|
+
}
|
|
26
|
+
export interface GitTree {
|
|
27
|
+
sha: string;
|
|
28
|
+
url: string;
|
|
29
|
+
tree: GitTreeItem[];
|
|
30
|
+
truncated: boolean;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/github/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,WAAW,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB"}
|
package/github/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/github/types.ts"],"names":[],"mappings":""}
|
package/index.d.ts
CHANGED
|
@@ -1,33 +1,22 @@
|
|
|
1
|
-
export { default as Article } from "./Article";
|
|
2
1
|
export * from "./Article";
|
|
3
|
-
export
|
|
4
|
-
export * from "./
|
|
2
|
+
export * from "./Presentation";
|
|
3
|
+
export * from "./Staff";
|
|
4
|
+
export * from "./Release";
|
|
5
|
+
export * from "./Security";
|
|
6
|
+
export * from "./Milestone";
|
|
7
|
+
export { githubFetch, GITHUB_REVALIDATE, getTree, getRepoPaths, getRawFile, getAllPages, type GitHubFetchOptions, type GitTree, type GitTreeItem, } from "./github";
|
|
8
|
+
export { default as MarkdownContent } from "./markdownComponents/MarkdownContent";
|
|
9
|
+
export { default as markdownComponents } from "./markdownComponents";
|
|
5
10
|
export { default as BigNumber, type BigNumberProps } from "./BigNumber";
|
|
6
|
-
export
|
|
11
|
+
export { default as PieChart, type PieChartData } from "./PieChart";
|
|
7
12
|
export { default as ColorBar } from "./ColorBar";
|
|
8
|
-
export * from "./ColorBar";
|
|
9
13
|
export { default as ConfirmButton } from "./ConfirmButton";
|
|
10
|
-
export * from "./ConfirmButton";
|
|
11
|
-
export { default as HorizontalArticleCard } from "./HorizontalArticleCard";
|
|
12
|
-
export * from "./HorizontalArticleCard";
|
|
13
|
-
export { default as PieChart, type PieChartData } from "./PieChart";
|
|
14
|
-
export * from "./PieChart";
|
|
15
|
-
export { default as StaffCard, type Staff } from "./StaffCard";
|
|
16
|
-
export * from "./StaffCard";
|
|
17
14
|
export { default as Table, type TableProps } from "./Table";
|
|
18
|
-
export * from "./Table";
|
|
19
15
|
export { default as TimeBar } from "./TimeBar";
|
|
20
16
|
export * from "./TimeBar";
|
|
21
17
|
export { default as TopStyledBlock } from "./TopStyledBlock";
|
|
22
|
-
export * from "./TopStyledBlock";
|
|
23
|
-
export { default as Presentation } from "./Presentation";
|
|
24
|
-
export * from "./Presentation";
|
|
25
|
-
export { default as PresentationCard } from "./PresentationCard";
|
|
26
|
-
export * from "./PresentationCard";
|
|
27
18
|
export * from "./UW";
|
|
28
|
-
export {
|
|
29
|
-
export { default as markdownComponents } from "./markdownComponents";
|
|
30
|
-
export type { Article as ArticleData, BackendArticle, ArticleCardProps, Image as ArticleImage, website, tag, article_type, Presentation as PresentationData, } from "./types";
|
|
19
|
+
export type { Website } from "./types";
|
|
31
20
|
export * from "./utils";
|
|
32
21
|
export * from "./themes";
|
|
33
22
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAG5B,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,WAAW,GACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAGrE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,cAAc,MAAM,CAAC;AAErB,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
// Content: components, data types, and GitHub-backed getters per domain.
|
|
2
2
|
export * from "./Article";
|
|
3
|
-
export
|
|
4
|
-
export * from "./
|
|
3
|
+
export * from "./Presentation";
|
|
4
|
+
export * from "./Staff";
|
|
5
|
+
export * from "./Release";
|
|
6
|
+
export * from "./Security";
|
|
7
|
+
export * from "./Milestone";
|
|
8
|
+
// Shared GitHub client the getters are built on.
|
|
9
|
+
export { githubFetch, GITHUB_REVALIDATE, getTree, getRepoPaths, getRawFile, getAllPages, } from "./github";
|
|
10
|
+
export { default as MarkdownContent } from "./markdownComponents/MarkdownContent";
|
|
11
|
+
export { default as markdownComponents } from "./markdownComponents";
|
|
12
|
+
// Standalone components.
|
|
5
13
|
export { default as BigNumber } from "./BigNumber";
|
|
6
|
-
export
|
|
14
|
+
export { default as PieChart } from "./PieChart";
|
|
7
15
|
export { default as ColorBar } from "./ColorBar";
|
|
8
|
-
export * from "./ColorBar";
|
|
9
16
|
export { default as ConfirmButton } from "./ConfirmButton";
|
|
10
|
-
export * from "./ConfirmButton";
|
|
11
|
-
export { default as HorizontalArticleCard } from "./HorizontalArticleCard";
|
|
12
|
-
export * from "./HorizontalArticleCard";
|
|
13
|
-
export { default as PieChart } from "./PieChart";
|
|
14
|
-
export * from "./PieChart";
|
|
15
|
-
export { default as StaffCard } from "./StaffCard";
|
|
16
|
-
export * from "./StaffCard";
|
|
17
17
|
export { default as Table } from "./Table";
|
|
18
|
-
export * from "./Table";
|
|
19
18
|
export { default as TimeBar } from "./TimeBar";
|
|
20
19
|
export * from "./TimeBar";
|
|
21
20
|
export { default as TopStyledBlock } from "./TopStyledBlock";
|
|
22
|
-
export * from "./TopStyledBlock";
|
|
23
|
-
export { default as Presentation } from "./Presentation";
|
|
24
|
-
export * from "./Presentation";
|
|
25
|
-
export { default as PresentationCard } from "./PresentationCard";
|
|
26
|
-
export * from "./PresentationCard";
|
|
27
21
|
export * from "./UW";
|
|
28
|
-
export { default as MarkdownContent } from "./markdownComponents/MarkdownContent";
|
|
29
|
-
export { default as markdownComponents } from "./markdownComponents";
|
|
30
22
|
export * from "./utils";
|
|
31
23
|
export * from "./themes";
|
|
32
24
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAE5B,iDAAiD;AACjD,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,GAIZ,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAErE,yBAAyB;AACzB,OAAO,EAAE,OAAO,IAAI,SAAS,EAAuB,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAqB,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAmB,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,cAAc,MAAM,CAAC;AAGrB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
|
@@ -9,6 +9,6 @@ interface MarkdownContentProps {
|
|
|
9
9
|
* Centralizes the `rehypeRaw` + components wiring shared across Article,
|
|
10
10
|
* Presentation and PresentationCard.
|
|
11
11
|
*/
|
|
12
|
-
declare const MarkdownContent: ({ children, components, }: MarkdownContentProps) => import("react
|
|
12
|
+
declare const MarkdownContent: ({ children, components, }: MarkdownContentProps) => import("react").JSX.Element;
|
|
13
13
|
export default MarkdownContent;
|
|
14
14
|
//# sourceMappingURL=MarkdownContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownContent.d.ts","sourceRoot":"","sources":["../../src/markdownComponents/MarkdownContent.tsx"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI3D,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED;;;;GAIG;AACH,QAAA,MAAM,eAAe,GAAI,2BAGtB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"MarkdownContent.d.ts","sourceRoot":"","sources":["../../src/markdownComponents/MarkdownContent.tsx"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI3D,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED;;;;GAIG;AACH,QAAA,MAAM,eAAe,GAAI,2BAGtB,oBAAoB,gCAItB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chtc/web-components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"homepage": "https://path-cc.io/web-components/",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"types": "./content/index.d.ts",
|
|
23
23
|
"default": "./content/index.js"
|
|
24
24
|
},
|
|
25
|
+
"./github": {
|
|
26
|
+
"types": "./github/index.d.ts",
|
|
27
|
+
"default": "./github/index.js"
|
|
28
|
+
},
|
|
25
29
|
"./themes": {
|
|
26
30
|
"types": "./themes/index.d.ts",
|
|
27
31
|
"default": "./themes/index.js"
|
|
@@ -31,10 +35,6 @@
|
|
|
31
35
|
"files": [
|
|
32
36
|
"*"
|
|
33
37
|
],
|
|
34
|
-
"scripts": {
|
|
35
|
-
"publish:local": "npm publish --access public --omit=dev",
|
|
36
|
-
"publish:increment": "npm version patch --no-git-tag-version && npm publish --omit=dev --access public"
|
|
37
|
-
},
|
|
38
38
|
"sideEffects": [
|
|
39
39
|
"BigNumber/*.*",
|
|
40
40
|
"PieChart/*.*",
|
|
@@ -43,8 +43,9 @@
|
|
|
43
43
|
"author": "",
|
|
44
44
|
"license": "Apache-2.0",
|
|
45
45
|
"dependencies": {
|
|
46
|
+
"@11ty/gray-matter": "^3.0.0",
|
|
46
47
|
"colorjs.io": "^0.5.2",
|
|
47
|
-
"
|
|
48
|
+
"js-yaml": "^5.4.3",
|
|
48
49
|
"react-wrap-balancer": "^1.1.1"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
"chart.js": "^4.4.0",
|
|
56
57
|
"chartjs-adapter-luxon": "^1.3.0",
|
|
57
58
|
"luxon": "^3.0.0",
|
|
59
|
+
"next": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
58
60
|
"react": "^18.0.0 || ^19.0.0",
|
|
59
61
|
"react-chartjs-2": "^5.0.0",
|
|
60
62
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
@@ -83,5 +85,9 @@
|
|
|
83
85
|
"rehype-raw": {
|
|
84
86
|
"optional": true
|
|
85
87
|
}
|
|
88
|
+
},
|
|
89
|
+
"scripts": {
|
|
90
|
+
"publish:local": "pnpm publish --access public --no-git-checks",
|
|
91
|
+
"publish:increment": "pnpm version patch --no-git-tag-version && pnpm publish --access public --no-git-checks"
|
|
86
92
|
}
|
|
87
|
-
}
|
|
93
|
+
}
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/types.ts","../src/charts/index.ts","../src/content/index.ts"],"version":"5.
|
|
1
|
+
{"root":["../src/index.ts","../src/types.ts","../src/charts/index.ts","../src/content/index.ts","../src/github/getAllPages.ts","../src/github/getRawFile.ts","../src/github/getRepoPaths.ts","../src/github/getTree.ts","../src/github/githubFetch.ts","../src/github/index.ts","../src/github/types.ts"],"version":"5.9.3"}
|
package/types.d.ts
CHANGED
|
@@ -1,64 +1,6 @@
|
|
|
1
|
-
export * from "./TimeBar";
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* Sites that share this component library. Content (articles, presentations,
|
|
3
|
+
* staff) is tagged with the sites it should appear on.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
href: string;
|
|
7
|
-
article: BackendArticle;
|
|
8
|
-
}
|
|
9
|
-
/** Sites an article can be syndicated to via its `publish_on` frontmatter. */
|
|
10
|
-
export type website = "htcondor" | "path" | "osg" | "chtc" | "pelican" | "fabaid";
|
|
11
|
-
export type tag = "chtc_featured_article";
|
|
12
|
-
export type article_type = "news" | "user" | "tech-blog";
|
|
13
|
-
export interface Image {
|
|
14
|
-
path: string;
|
|
15
|
-
alt: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* An article from the shared CHTC/Articles repository. Field names mirror the
|
|
19
|
-
* markdown frontmatter documented in that repository's README.
|
|
20
|
-
*/
|
|
21
|
-
export interface Article {
|
|
22
|
-
/** Markdown body with the frontmatter removed. */
|
|
23
|
-
content: string;
|
|
24
|
-
title: string;
|
|
25
|
-
author?: string;
|
|
26
|
-
/** Parsed from the `YYYY-MM-DD-` prefix of the file name. */
|
|
27
|
-
date: Date;
|
|
28
|
-
/** Sites this article should appear on. Always an array, even if the frontmatter gave a single value. */
|
|
29
|
-
publish_on: website[];
|
|
30
|
-
type: article_type;
|
|
31
|
-
/** Always an array, even if the frontmatter gave a single value. */
|
|
32
|
-
tag?: tag[];
|
|
33
|
-
image: Image;
|
|
34
|
-
excerpt?: string;
|
|
35
|
-
banner_src?: string;
|
|
36
|
-
banner_alt?: string;
|
|
37
|
-
/** Absolute URL of the canonical copy, for `<link rel="canonical">` and attribution. */
|
|
38
|
-
canonical_url?: string;
|
|
39
|
-
}
|
|
40
|
-
export interface BackendArticle extends Article {
|
|
41
|
-
slug: string[];
|
|
42
|
-
path: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Presentation Types
|
|
46
|
-
*/
|
|
47
|
-
export interface Presentation {
|
|
48
|
-
title: string;
|
|
49
|
-
presenter: string;
|
|
50
|
-
event?: string;
|
|
51
|
-
date: string;
|
|
52
|
-
description?: string;
|
|
53
|
-
keywords?: string[];
|
|
54
|
-
links?: {
|
|
55
|
-
name: string;
|
|
56
|
-
value: string;
|
|
57
|
-
}[];
|
|
58
|
-
thumbnail?: {
|
|
59
|
-
src: string;
|
|
60
|
-
alt: string;
|
|
61
|
-
} | null;
|
|
62
|
-
youtubeId?: string;
|
|
63
|
-
}
|
|
5
|
+
export type Website = "htcondor" | "path" | "osg" | "chtc" | "pelican" | "fabaid";
|
|
64
6
|
//# sourceMappingURL=types.d.ts.map
|
package/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC"}
|
package/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a date as e.g. "January 5, 2025" in UTC, the display format used
|
|
3
|
+
* across the content components.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatLongDate(date: string | number | Date): string;
|
|
6
|
+
export default formatLongDate;
|
|
7
|
+
//# sourceMappingURL=formatLongDate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatLongDate.d.ts","sourceRoot":"","sources":["../../src/utils/formatLongDate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,CAOnE;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Format a date as e.g. "January 5, 2025" in UTC, the display format used
|
|
3
|
+
* across the content components.
|
|
4
4
|
*/
|
|
5
5
|
export function formatLongDate(date) {
|
|
6
6
|
return new Date(date).toLocaleString("en-US", {
|
|
@@ -10,4 +10,5 @@ export function formatLongDate(date) {
|
|
|
10
10
|
timeZone: "UTC",
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
export default formatLongDate;
|
|
14
|
+
//# sourceMappingURL=formatLongDate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatLongDate.js","sourceRoot":"","sources":["../../src/utils/formatLongDate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAA4B;IACzD,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE;QAC5C,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,SAAS;QACd,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC;AACL,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDateFromPath.d.ts","sourceRoot":"","sources":["../../src/utils/getDateFromPath.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAGlD;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date encoded in a `YYYY-MM-DD-title.md` file name, as UTC midnight.
|
|
3
|
+
*/
|
|
4
|
+
export function getDateFromPath(path) {
|
|
5
|
+
const parts = path.slice(0, -3).split("-");
|
|
6
|
+
return new Date(Date.parse(parts.slice(0, 3).join("-")));
|
|
7
|
+
}
|
|
8
|
+
export default getDateFromPath;
|
|
9
|
+
//# sourceMappingURL=getDateFromPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDateFromPath.js","sourceRoot":"","sources":["../../src/utils/getDateFromPath.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3C,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split a dated markdown file name into its URL slug segments.
|
|
3
|
+
*
|
|
4
|
+
* `2026-10-06-some-title.md` → `["2026", "10", "06", "some-title"]`
|
|
5
|
+
*/
|
|
6
|
+
export declare function getSlugFromPath(path: string): string[];
|
|
7
|
+
export default getSlugFromPath;
|
|
8
|
+
//# sourceMappingURL=getSlugFromPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSlugFromPath.d.ts","sourceRoot":"","sources":["../../src/utils/getSlugFromPath.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAGtD;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split a dated markdown file name into its URL slug segments.
|
|
3
|
+
*
|
|
4
|
+
* `2026-10-06-some-title.md` → `["2026", "10", "06", "some-title"]`
|
|
5
|
+
*/
|
|
6
|
+
export function getSlugFromPath(path) {
|
|
7
|
+
const parts = path.slice(0, -3).split("-");
|
|
8
|
+
return [parts[0], parts[1], parts[2], parts.slice(3).join("-")];
|
|
9
|
+
}
|
|
10
|
+
export default getSlugFromPath;
|
|
11
|
+
//# sourceMappingURL=getSlugFromPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSlugFromPath.js","sourceRoot":"","sources":["../../src/utils/getSlugFromPath.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3C,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTagColor.d.ts","sourceRoot":"","sources":["../../src/utils/getTagColor.ts"],"names":[],"mappings":"AAYA,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ/C;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministically map a string (e.g. a keyword or tag) to a stable color so
|
|
3
|
+
* the same tag always renders with the same color across components.
|
|
4
|
+
*/
|
|
5
|
+
function getStringHash(value) {
|
|
6
|
+
let hash = 0;
|
|
7
|
+
for (let i = 0; i < value.length; i++) {
|
|
8
|
+
hash = value.charCodeAt(i) + ((hash << 5) - hash);
|
|
9
|
+
}
|
|
10
|
+
return hash;
|
|
11
|
+
}
|
|
12
|
+
export function getTagColor(tag) {
|
|
13
|
+
// Math.abs keeps the hue in range; the hash itself can be negative.
|
|
14
|
+
let hue = Math.abs(getStringHash(tag)) % 360;
|
|
15
|
+
if (hue >= 60 && hue <= 140) {
|
|
16
|
+
hue = (hue + 80) % 360; // skip the harsh yellow/green band
|
|
17
|
+
}
|
|
18
|
+
return `hsl(${hue}, 70%, 40%)`;
|
|
19
|
+
}
|
|
20
|
+
export default getTagColor;
|
|
21
|
+
//# sourceMappingURL=getTagColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTagColor.js","sourceRoot":"","sources":["../../src/utils/getTagColor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,SAAS,aAAa,CAAC,KAAa;IAClC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,oEAAoE;IACpE,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;IAC7C,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;QAC5B,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,mCAAmC;IAC7D,CAAC;IAED,OAAO,OAAO,GAAG,aAAa,CAAC;AACjC,CAAC;AAED,eAAe,WAAW,CAAC"}
|
package/utils/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
1
|
+
export { formatLongDate } from "./formatLongDate";
|
|
2
|
+
export { getTagColor } from "./getTagColor";
|
|
3
|
+
export { getSlugFromPath } from "./getSlugFromPath";
|
|
4
|
+
export { getDateFromPath } from "./getDateFromPath";
|
|
5
|
+
export { isDatedMarkdown } from "./isDatedMarkdown";
|
|
6
|
+
export { toArray } from "./toArray";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
package/utils/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
1
|
+
export { formatLongDate } from "./formatLongDate";
|
|
2
|
+
export { getTagColor } from "./getTagColor";
|
|
3
|
+
export { getSlugFromPath } from "./getSlugFromPath";
|
|
4
|
+
export { getDateFromPath } from "./getDateFromPath";
|
|
5
|
+
export { isDatedMarkdown } from "./isDatedMarkdown";
|
|
6
|
+
export { toArray } from "./toArray";
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matches content files named `YYYY-MM-DD-title.md` at the repository root.
|
|
3
|
+
* Articles and presentations both use this convention.
|
|
4
|
+
*/
|
|
5
|
+
export declare function isDatedMarkdown(path: string): boolean;
|
|
6
|
+
export default isDatedMarkdown;
|
|
7
|
+
//# sourceMappingURL=isDatedMarkdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDatedMarkdown.d.ts","sourceRoot":"","sources":["../../src/utils/isDatedMarkdown.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matches content files named `YYYY-MM-DD-title.md` at the repository root.
|
|
3
|
+
* Articles and presentations both use this convention.
|
|
4
|
+
*/
|
|
5
|
+
export function isDatedMarkdown(path) {
|
|
6
|
+
return /^\d{4}-\d{1,2}-\d{1,2}-.+\.md$/.test(path);
|
|
7
|
+
}
|
|
8
|
+
export default isDatedMarkdown;
|
|
9
|
+
//# sourceMappingURL=isDatedMarkdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDatedMarkdown.js","sourceRoot":"","sources":["../../src/utils/isDatedMarkdown.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,gCAAgC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frontmatter list fields may be absent, null, or a bare scalar. Normalize to
|
|
3
|
+
* an array so callers can iterate or search without guarding first.
|
|
4
|
+
*/
|
|
5
|
+
export declare function toArray<T>(value: T | T[] | null | undefined): T[];
|
|
6
|
+
export default toArray;
|
|
7
|
+
//# sourceMappingURL=toArray.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toArray.d.ts","sourceRoot":"","sources":["../../src/utils/toArray.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,EAAE,CAKjE;AAED,eAAe,OAAO,CAAC"}
|
package/utils/toArray.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frontmatter list fields may be absent, null, or a bare scalar. Normalize to
|
|
3
|
+
* an array so callers can iterate or search without guarding first.
|
|
4
|
+
*/
|
|
5
|
+
export function toArray(value) {
|
|
6
|
+
if (value === null || value === undefined) {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
return Array.isArray(value) ? value : [value];
|
|
10
|
+
}
|
|
11
|
+
export default toArray;
|
|
12
|
+
//# sourceMappingURL=toArray.js.map
|