diff --git a/eslint.config.mjs b/eslint.config.mjs index 1e58203..e31805d 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -4,6 +4,7 @@ import { ESLintConfig, globals } from "@openally/config.eslint"; export default [ ...ESLintConfig, { + files: ["**/*.js", "**/*.mjs"], languageOptions: { sourceType: "module", globals: { diff --git a/index.html b/index.html index a53ccd9..6c8162a 100644 --- a/index.html +++ b/index.html @@ -185,8 +185,8 @@

Join Us

- - + + diff --git a/package.json b/package.json index 6cbf657..cb61b8a 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,10 @@ "type": "module", "scripts": { "dev": "vite", - "contributors": "node scripts/generate-contributors.js", + "contributors": "node scripts/generate-contributors.ts", "build": "vite build", "preview": "vite preview", - "lint": "eslint src scripts plugins" + "lint": "eslint \"**/*.{js,mjs}\"" }, "repository": { "type": "git", @@ -24,6 +24,7 @@ "homepage": "https://github.com/NodeSecure/landing#readme", "devDependencies": { "@openally/config.eslint": "2.4.2", + "@types/node": "25.6.0", "vite": "8.0.5" }, "dependencies": { diff --git a/plugins/zupTransformer.js b/plugins/zupTransformer.ts similarity index 62% rename from plugins/zupTransformer.js rename to plugins/zupTransformer.ts index 9cee045..c44d65d 100644 --- a/plugins/zupTransformer.js +++ b/plugins/zupTransformer.ts @@ -5,9 +5,21 @@ import path from "node:path"; // Import Third-party Dependencies import compile from "zup"; +interface ZupTransformerOptions { + [key: string]: any; +} + +interface TransformResult { + code: string; + map: null; +} + export default function zupTransformer( - data = {} -) { + data: ZupTransformerOptions = {} +): { + name: string; + transform: (src: string, id: string) => TransformResult | undefined; +} { return { name: "zup-transformer", @@ -15,7 +27,7 @@ export default function zupTransformer( * @param {!string} src * @param {!string} id */ - transform(src, id) { + transform(src: string, id: string): TransformResult | undefined { if ( path.extname(id) === ".html" && path.basename(id) === "index.html" diff --git a/public/contributors.json b/public/contributors.json index 8ece0ea..0c87943 100644 --- a/public/contributors.json +++ b/public/contributors.json @@ -19,7 +19,7 @@ "type": "core", "user_view_type": "public", "site_admin": false, - "contributions": 614 + "contributions": 631 }, { "login": "PierreDemailly", @@ -41,7 +41,7 @@ "type": "core", "user_view_type": "public", "site_admin": false, - "contributions": 91 + "contributions": 113 }, { "login": "clemgbld", @@ -63,7 +63,7 @@ "type": "core", "user_view_type": "public", "site_admin": false, - "contributions": 33 + "contributions": 36 }, { "login": "targos", @@ -87,6 +87,28 @@ "site_admin": false, "contributions": 22 }, + { + "login": "ErwanRaulo", + "id": 22614778, + "node_id": "MDQ6VXNlcjIyNjE0Nzc4", + "avatar_url": "https://avatars.githubusercontent.com/u/22614778?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/ErwanRaulo", + "html_url": "https://github.com/ErwanRaulo", + "followers_url": "https://api.github.com/users/ErwanRaulo/followers", + "following_url": "https://api.github.com/users/ErwanRaulo/following{/other_user}", + "gists_url": "https://api.github.com/users/ErwanRaulo/gists{/gist_id}", + "starred_url": "https://api.github.com/users/ErwanRaulo/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/ErwanRaulo/subscriptions", + "organizations_url": "https://api.github.com/users/ErwanRaulo/orgs", + "repos_url": "https://api.github.com/users/ErwanRaulo/repos", + "events_url": "https://api.github.com/users/ErwanRaulo/events{/privacy}", + "received_events_url": "https://api.github.com/users/ErwanRaulo/received_events", + "type": "contributor", + "user_view_type": "public", + "site_admin": false, + "contributions": 8 + }, { "login": "fabnguess", "id": 72697416, @@ -176,44 +198,44 @@ "contributions": 6 }, { - "login": "ErwanRaulo", - "id": 22614778, - "node_id": "MDQ6VXNlcjIyNjE0Nzc4", - "avatar_url": "https://avatars.githubusercontent.com/u/22614778?v=4", + "login": "zeearth", + "id": 1954929, + "node_id": "MDQ6VXNlcjE5NTQ5Mjk=", + "avatar_url": "https://avatars.githubusercontent.com/u/1954929?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/ErwanRaulo", - "html_url": "https://github.com/ErwanRaulo", - "followers_url": "https://api.github.com/users/ErwanRaulo/followers", - "following_url": "https://api.github.com/users/ErwanRaulo/following{/other_user}", - "gists_url": "https://api.github.com/users/ErwanRaulo/gists{/gist_id}", - "starred_url": "https://api.github.com/users/ErwanRaulo/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/ErwanRaulo/subscriptions", - "organizations_url": "https://api.github.com/users/ErwanRaulo/orgs", - "repos_url": "https://api.github.com/users/ErwanRaulo/repos", - "events_url": "https://api.github.com/users/ErwanRaulo/events{/privacy}", - "received_events_url": "https://api.github.com/users/ErwanRaulo/received_events", + "url": "https://api.github.com/users/zeearth", + "html_url": "https://github.com/zeearth", + "followers_url": "https://api.github.com/users/zeearth/followers", + "following_url": "https://api.github.com/users/zeearth/following{/other_user}", + "gists_url": "https://api.github.com/users/zeearth/gists{/gist_id}", + "starred_url": "https://api.github.com/users/zeearth/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/zeearth/subscriptions", + "organizations_url": "https://api.github.com/users/zeearth/orgs", + "repos_url": "https://api.github.com/users/zeearth/repos", + "events_url": "https://api.github.com/users/zeearth/events{/privacy}", + "received_events_url": "https://api.github.com/users/zeearth/received_events", "type": "contributor", "user_view_type": "public", "site_admin": false, - "contributions": 5 + "contributions": 3 }, { - "login": "FredGuiou", - "id": 99122562, - "node_id": "U_kgDOBeh9gg", - "avatar_url": "https://avatars.githubusercontent.com/u/99122562?v=4", + "login": "Markobobby", + "id": 15210179, + "node_id": "MDQ6VXNlcjE1MjEwMTc5", + "avatar_url": "https://avatars.githubusercontent.com/u/15210179?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/FredGuiou", - "html_url": "https://github.com/FredGuiou", - "followers_url": "https://api.github.com/users/FredGuiou/followers", - "following_url": "https://api.github.com/users/FredGuiou/following{/other_user}", - "gists_url": "https://api.github.com/users/FredGuiou/gists{/gist_id}", - "starred_url": "https://api.github.com/users/FredGuiou/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/FredGuiou/subscriptions", - "organizations_url": "https://api.github.com/users/FredGuiou/orgs", - "repos_url": "https://api.github.com/users/FredGuiou/repos", - "events_url": "https://api.github.com/users/FredGuiou/events{/privacy}", - "received_events_url": "https://api.github.com/users/FredGuiou/received_events", + "url": "https://api.github.com/users/Markobobby", + "html_url": "https://github.com/Markobobby", + "followers_url": "https://api.github.com/users/Markobobby/followers", + "following_url": "https://api.github.com/users/Markobobby/following{/other_user}", + "gists_url": "https://api.github.com/users/Markobobby/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Markobobby/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Markobobby/subscriptions", + "organizations_url": "https://api.github.com/users/Markobobby/orgs", + "repos_url": "https://api.github.com/users/Markobobby/repos", + "events_url": "https://api.github.com/users/Markobobby/events{/privacy}", + "received_events_url": "https://api.github.com/users/Markobobby/received_events", "type": "contributor", "user_view_type": "public", "site_admin": false, @@ -242,44 +264,66 @@ "contributions": 3 }, { - "login": "halcin", - "id": 7302407, - "node_id": "MDQ6VXNlcjczMDI0MDc=", - "avatar_url": "https://avatars.githubusercontent.com/u/7302407?v=4", + "login": "FredGuiou", + "id": 99122562, + "node_id": "U_kgDOBeh9gg", + "avatar_url": "https://avatars.githubusercontent.com/u/99122562?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/halcin", - "html_url": "https://github.com/halcin", - "followers_url": "https://api.github.com/users/halcin/followers", - "following_url": "https://api.github.com/users/halcin/following{/other_user}", - "gists_url": "https://api.github.com/users/halcin/gists{/gist_id}", - "starred_url": "https://api.github.com/users/halcin/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/halcin/subscriptions", - "organizations_url": "https://api.github.com/users/halcin/orgs", - "repos_url": "https://api.github.com/users/halcin/repos", - "events_url": "https://api.github.com/users/halcin/events{/privacy}", - "received_events_url": "https://api.github.com/users/halcin/received_events", + "url": "https://api.github.com/users/FredGuiou", + "html_url": "https://github.com/FredGuiou", + "followers_url": "https://api.github.com/users/FredGuiou/followers", + "following_url": "https://api.github.com/users/FredGuiou/following{/other_user}", + "gists_url": "https://api.github.com/users/FredGuiou/gists{/gist_id}", + "starred_url": "https://api.github.com/users/FredGuiou/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/FredGuiou/subscriptions", + "organizations_url": "https://api.github.com/users/FredGuiou/orgs", + "repos_url": "https://api.github.com/users/FredGuiou/repos", + "events_url": "https://api.github.com/users/FredGuiou/events{/privacy}", + "received_events_url": "https://api.github.com/users/FredGuiou/received_events", + "type": "contributor", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "rahuld109", + "id": 62885871, + "node_id": "MDQ6VXNlcjYyODg1ODcx", + "avatar_url": "https://avatars.githubusercontent.com/u/62885871?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/rahuld109", + "html_url": "https://github.com/rahuld109", + "followers_url": "https://api.github.com/users/rahuld109/followers", + "following_url": "https://api.github.com/users/rahuld109/following{/other_user}", + "gists_url": "https://api.github.com/users/rahuld109/gists{/gist_id}", + "starred_url": "https://api.github.com/users/rahuld109/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/rahuld109/subscriptions", + "organizations_url": "https://api.github.com/users/rahuld109/orgs", + "repos_url": "https://api.github.com/users/rahuld109/repos", + "events_url": "https://api.github.com/users/rahuld109/events{/privacy}", + "received_events_url": "https://api.github.com/users/rahuld109/received_events", "type": "contributor", "user_view_type": "public", "site_admin": false, "contributions": 2 }, { - "login": "antoine-coulon", - "id": 43391199, - "node_id": "MDQ6VXNlcjQzMzkxMTk5", - "avatar_url": "https://avatars.githubusercontent.com/u/43391199?v=4", + "login": "Kawacrepe", + "id": 40260517, + "node_id": "MDQ6VXNlcjQwMjYwNTE3", + "avatar_url": "https://avatars.githubusercontent.com/u/40260517?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/antoine-coulon", - "html_url": "https://github.com/antoine-coulon", - "followers_url": "https://api.github.com/users/antoine-coulon/followers", - "following_url": "https://api.github.com/users/antoine-coulon/following{/other_user}", - "gists_url": "https://api.github.com/users/antoine-coulon/gists{/gist_id}", - "starred_url": "https://api.github.com/users/antoine-coulon/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/antoine-coulon/subscriptions", - "organizations_url": "https://api.github.com/users/antoine-coulon/orgs", - "repos_url": "https://api.github.com/users/antoine-coulon/repos", - "events_url": "https://api.github.com/users/antoine-coulon/events{/privacy}", - "received_events_url": "https://api.github.com/users/antoine-coulon/received_events", + "url": "https://api.github.com/users/Kawacrepe", + "html_url": "https://github.com/Kawacrepe", + "followers_url": "https://api.github.com/users/Kawacrepe/followers", + "following_url": "https://api.github.com/users/Kawacrepe/following{/other_user}", + "gists_url": "https://api.github.com/users/Kawacrepe/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Kawacrepe/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Kawacrepe/subscriptions", + "organizations_url": "https://api.github.com/users/Kawacrepe/orgs", + "repos_url": "https://api.github.com/users/Kawacrepe/repos", + "events_url": "https://api.github.com/users/Kawacrepe/events{/privacy}", + "received_events_url": "https://api.github.com/users/Kawacrepe/received_events", "type": "core", "user_view_type": "public", "site_admin": false, @@ -308,49 +352,71 @@ "contributions": 2 }, { - "login": "Kawacrepe", - "id": 40260517, - "node_id": "MDQ6VXNlcjQwMjYwNTE3", - "avatar_url": "https://avatars.githubusercontent.com/u/40260517?v=4", + "login": "antoine-coulon", + "id": 43391199, + "node_id": "MDQ6VXNlcjQzMzkxMTk5", + "avatar_url": "https://avatars.githubusercontent.com/u/43391199?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/Kawacrepe", - "html_url": "https://github.com/Kawacrepe", - "followers_url": "https://api.github.com/users/Kawacrepe/followers", - "following_url": "https://api.github.com/users/Kawacrepe/following{/other_user}", - "gists_url": "https://api.github.com/users/Kawacrepe/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Kawacrepe/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Kawacrepe/subscriptions", - "organizations_url": "https://api.github.com/users/Kawacrepe/orgs", - "repos_url": "https://api.github.com/users/Kawacrepe/repos", - "events_url": "https://api.github.com/users/Kawacrepe/events{/privacy}", - "received_events_url": "https://api.github.com/users/Kawacrepe/received_events", + "url": "https://api.github.com/users/antoine-coulon", + "html_url": "https://github.com/antoine-coulon", + "followers_url": "https://api.github.com/users/antoine-coulon/followers", + "following_url": "https://api.github.com/users/antoine-coulon/following{/other_user}", + "gists_url": "https://api.github.com/users/antoine-coulon/gists{/gist_id}", + "starred_url": "https://api.github.com/users/antoine-coulon/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/antoine-coulon/subscriptions", + "organizations_url": "https://api.github.com/users/antoine-coulon/orgs", + "repos_url": "https://api.github.com/users/antoine-coulon/repos", + "events_url": "https://api.github.com/users/antoine-coulon/events{/privacy}", + "received_events_url": "https://api.github.com/users/antoine-coulon/received_events", "type": "core", "user_view_type": "public", "site_admin": false, "contributions": 2 }, { - "login": "rahuld109", - "id": 62885871, - "node_id": "MDQ6VXNlcjYyODg1ODcx", - "avatar_url": "https://avatars.githubusercontent.com/u/62885871?v=4", + "login": "halcin", + "id": 7302407, + "node_id": "MDQ6VXNlcjczMDI0MDc=", + "avatar_url": "https://avatars.githubusercontent.com/u/7302407?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/rahuld109", - "html_url": "https://github.com/rahuld109", - "followers_url": "https://api.github.com/users/rahuld109/followers", - "following_url": "https://api.github.com/users/rahuld109/following{/other_user}", - "gists_url": "https://api.github.com/users/rahuld109/gists{/gist_id}", - "starred_url": "https://api.github.com/users/rahuld109/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/rahuld109/subscriptions", - "organizations_url": "https://api.github.com/users/rahuld109/orgs", - "repos_url": "https://api.github.com/users/rahuld109/repos", - "events_url": "https://api.github.com/users/rahuld109/events{/privacy}", - "received_events_url": "https://api.github.com/users/rahuld109/received_events", + "url": "https://api.github.com/users/halcin", + "html_url": "https://github.com/halcin", + "followers_url": "https://api.github.com/users/halcin/followers", + "following_url": "https://api.github.com/users/halcin/following{/other_user}", + "gists_url": "https://api.github.com/users/halcin/gists{/gist_id}", + "starred_url": "https://api.github.com/users/halcin/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/halcin/subscriptions", + "organizations_url": "https://api.github.com/users/halcin/orgs", + "repos_url": "https://api.github.com/users/halcin/repos", + "events_url": "https://api.github.com/users/halcin/events{/privacy}", + "received_events_url": "https://api.github.com/users/halcin/received_events", "type": "contributor", "user_view_type": "public", "site_admin": false, "contributions": 2 }, + { + "login": "zlplzp123wyt", + "id": 268106051, + "node_id": "U_kgDOD_r5Qw", + "avatar_url": "https://avatars.githubusercontent.com/u/268106051?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/zlplzp123wyt", + "html_url": "https://github.com/zlplzp123wyt", + "followers_url": "https://api.github.com/users/zlplzp123wyt/followers", + "following_url": "https://api.github.com/users/zlplzp123wyt/following{/other_user}", + "gists_url": "https://api.github.com/users/zlplzp123wyt/gists{/gist_id}", + "starred_url": "https://api.github.com/users/zlplzp123wyt/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/zlplzp123wyt/subscriptions", + "organizations_url": "https://api.github.com/users/zlplzp123wyt/orgs", + "repos_url": "https://api.github.com/users/zlplzp123wyt/repos", + "events_url": "https://api.github.com/users/zlplzp123wyt/events{/privacy}", + "received_events_url": "https://api.github.com/users/zlplzp123wyt/received_events", + "type": "contributor", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, { "login": "abdellah-housni", "id": 39569278, @@ -439,28 +505,6 @@ "site_admin": false, "contributions": 1 }, - { - "login": "Markobobby", - "id": 15210179, - "node_id": "MDQ6VXNlcjE1MjEwMTc5", - "avatar_url": "https://avatars.githubusercontent.com/u/15210179?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Markobobby", - "html_url": "https://github.com/Markobobby", - "followers_url": "https://api.github.com/users/Markobobby/followers", - "following_url": "https://api.github.com/users/Markobobby/following{/other_user}", - "gists_url": "https://api.github.com/users/Markobobby/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Markobobby/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Markobobby/subscriptions", - "organizations_url": "https://api.github.com/users/Markobobby/orgs", - "repos_url": "https://api.github.com/users/Markobobby/repos", - "events_url": "https://api.github.com/users/Markobobby/events{/privacy}", - "received_events_url": "https://api.github.com/users/Markobobby/received_events", - "type": "contributor", - "user_view_type": "public", - "site_admin": false, - "contributions": 1 - }, { "login": "AlexandreMalaj", "id": 32218832, @@ -549,50 +593,6 @@ "site_admin": false, "contributions": 1 }, - { - "login": "7amed3li", - "id": 190534558, - "node_id": "U_kgDOC1tTng", - "avatar_url": "https://avatars.githubusercontent.com/u/190534558?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/7amed3li", - "html_url": "https://github.com/7amed3li", - "followers_url": "https://api.github.com/users/7amed3li/followers", - "following_url": "https://api.github.com/users/7amed3li/following{/other_user}", - "gists_url": "https://api.github.com/users/7amed3li/gists{/gist_id}", - "starred_url": "https://api.github.com/users/7amed3li/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/7amed3li/subscriptions", - "organizations_url": "https://api.github.com/users/7amed3li/orgs", - "repos_url": "https://api.github.com/users/7amed3li/repos", - "events_url": "https://api.github.com/users/7amed3li/events{/privacy}", - "received_events_url": "https://api.github.com/users/7amed3li/received_events", - "type": "contributor", - "user_view_type": "public", - "site_admin": false, - "contributions": 1 - }, - { - "login": "franky47", - "id": 1174092, - "node_id": "MDQ6VXNlcjExNzQwOTI=", - "avatar_url": "https://avatars.githubusercontent.com/u/1174092?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/franky47", - "html_url": "https://github.com/franky47", - "followers_url": "https://api.github.com/users/franky47/followers", - "following_url": "https://api.github.com/users/franky47/following{/other_user}", - "gists_url": "https://api.github.com/users/franky47/gists{/gist_id}", - "starred_url": "https://api.github.com/users/franky47/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/franky47/subscriptions", - "organizations_url": "https://api.github.com/users/franky47/orgs", - "repos_url": "https://api.github.com/users/franky47/repos", - "events_url": "https://api.github.com/users/franky47/events{/privacy}", - "received_events_url": "https://api.github.com/users/franky47/received_events", - "type": "contributor", - "user_view_type": "public", - "site_admin": false, - "contributions": 1 - }, { "login": "s-oleh", "id": 130577508, @@ -615,6 +615,28 @@ "site_admin": false, "contributions": 4 }, + { + "login": "HoyeongJeon", + "id": 78394999, + "node_id": "MDQ6VXNlcjc4Mzk0OTk5", + "avatar_url": "https://avatars.githubusercontent.com/u/78394999?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/HoyeongJeon", + "html_url": "https://github.com/HoyeongJeon", + "followers_url": "https://api.github.com/users/HoyeongJeon/followers", + "following_url": "https://api.github.com/users/HoyeongJeon/following{/other_user}", + "gists_url": "https://api.github.com/users/HoyeongJeon/gists{/gist_id}", + "starred_url": "https://api.github.com/users/HoyeongJeon/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/HoyeongJeon/subscriptions", + "organizations_url": "https://api.github.com/users/HoyeongJeon/orgs", + "repos_url": "https://api.github.com/users/HoyeongJeon/repos", + "events_url": "https://api.github.com/users/HoyeongJeon/events{/privacy}", + "received_events_url": "https://api.github.com/users/HoyeongJeon/received_events", + "type": "contributor", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, { "login": "AntonioliBenjamin", "id": 111560667, @@ -725,6 +747,28 @@ "site_admin": false, "contributions": 1 }, + { + "login": "7amed3li", + "id": 190534558, + "node_id": "U_kgDOC1tTng", + "avatar_url": "https://avatars.githubusercontent.com/u/190534558?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/7amed3li", + "html_url": "https://github.com/7amed3li", + "followers_url": "https://api.github.com/users/7amed3li/followers", + "following_url": "https://api.github.com/users/7amed3li/following{/other_user}", + "gists_url": "https://api.github.com/users/7amed3li/gists{/gist_id}", + "starred_url": "https://api.github.com/users/7amed3li/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/7amed3li/subscriptions", + "organizations_url": "https://api.github.com/users/7amed3li/orgs", + "repos_url": "https://api.github.com/users/7amed3li/repos", + "events_url": "https://api.github.com/users/7amed3li/events{/privacy}", + "received_events_url": "https://api.github.com/users/7amed3li/received_events", + "type": "contributor", + "user_view_type": "public", + "site_admin": false, + "contributions": 5 + }, { "login": "intincrab", "id": 93028153, @@ -1100,88 +1144,88 @@ "contributions": 3 }, { - "login": "fless-lab", - "id": 71844440, - "node_id": "MDQ6VXNlcjcxODQ0NDQw", - "avatar_url": "https://avatars.githubusercontent.com/u/71844440?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/fless-lab", - "html_url": "https://github.com/fless-lab", - "followers_url": "https://api.github.com/users/fless-lab/followers", - "following_url": "https://api.github.com/users/fless-lab/following{/other_user}", - "gists_url": "https://api.github.com/users/fless-lab/gists{/gist_id}", - "starred_url": "https://api.github.com/users/fless-lab/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/fless-lab/subscriptions", - "organizations_url": "https://api.github.com/users/fless-lab/orgs", - "repos_url": "https://api.github.com/users/fless-lab/repos", - "events_url": "https://api.github.com/users/fless-lab/events{/privacy}", - "received_events_url": "https://api.github.com/users/fless-lab/received_events", + "login": "Anne-Flower", + "id": 139115974, + "node_id": "U_kgDOCEq9xg", + "avatar_url": "https://avatars.githubusercontent.com/u/139115974?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Anne-Flower", + "html_url": "https://github.com/Anne-Flower", + "followers_url": "https://api.github.com/users/Anne-Flower/followers", + "following_url": "https://api.github.com/users/Anne-Flower/following{/other_user}", + "gists_url": "https://api.github.com/users/Anne-Flower/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Anne-Flower/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Anne-Flower/subscriptions", + "organizations_url": "https://api.github.com/users/Anne-Flower/orgs", + "repos_url": "https://api.github.com/users/Anne-Flower/repos", + "events_url": "https://api.github.com/users/Anne-Flower/events{/privacy}", + "received_events_url": "https://api.github.com/users/Anne-Flower/received_events", "type": "contributor", "user_view_type": "public", "site_admin": false, - "contributions": 1 + "contributions": 2 }, { - "login": "mdinaya", - "id": 101329759, - "node_id": "U_kgDOBgorXw", - "avatar_url": "https://avatars.githubusercontent.com/u/101329759?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/mdinaya", - "html_url": "https://github.com/mdinaya", - "followers_url": "https://api.github.com/users/mdinaya/followers", - "following_url": "https://api.github.com/users/mdinaya/following{/other_user}", - "gists_url": "https://api.github.com/users/mdinaya/gists{/gist_id}", - "starred_url": "https://api.github.com/users/mdinaya/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/mdinaya/subscriptions", - "organizations_url": "https://api.github.com/users/mdinaya/orgs", - "repos_url": "https://api.github.com/users/mdinaya/repos", - "events_url": "https://api.github.com/users/mdinaya/events{/privacy}", - "received_events_url": "https://api.github.com/users/mdinaya/received_events", + "login": "cskwork", + "id": 76669236, + "node_id": "MDQ6VXNlcjc2NjY5MjM2", + "avatar_url": "https://avatars.githubusercontent.com/u/76669236?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/cskwork", + "html_url": "https://github.com/cskwork", + "followers_url": "https://api.github.com/users/cskwork/followers", + "following_url": "https://api.github.com/users/cskwork/following{/other_user}", + "gists_url": "https://api.github.com/users/cskwork/gists{/gist_id}", + "starred_url": "https://api.github.com/users/cskwork/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/cskwork/subscriptions", + "organizations_url": "https://api.github.com/users/cskwork/orgs", + "repos_url": "https://api.github.com/users/cskwork/repos", + "events_url": "https://api.github.com/users/cskwork/events{/privacy}", + "received_events_url": "https://api.github.com/users/cskwork/received_events", "type": "contributor", "user_view_type": "public", "site_admin": false, - "contributions": 1 + "contributions": 2 }, { - "login": "M4gie", - "id": 33150916, - "node_id": "MDQ6VXNlcjMzMTUwOTE2", - "avatar_url": "https://avatars.githubusercontent.com/u/33150916?v=4", + "login": "zxkmm", + "id": 24917424, + "node_id": "MDQ6VXNlcjI0OTE3NDI0", + "avatar_url": "https://avatars.githubusercontent.com/u/24917424?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/M4gie", - "html_url": "https://github.com/M4gie", - "followers_url": "https://api.github.com/users/M4gie/followers", - "following_url": "https://api.github.com/users/M4gie/following{/other_user}", - "gists_url": "https://api.github.com/users/M4gie/gists{/gist_id}", - "starred_url": "https://api.github.com/users/M4gie/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/M4gie/subscriptions", - "organizations_url": "https://api.github.com/users/M4gie/orgs", - "repos_url": "https://api.github.com/users/M4gie/repos", - "events_url": "https://api.github.com/users/M4gie/events{/privacy}", - "received_events_url": "https://api.github.com/users/M4gie/received_events", + "url": "https://api.github.com/users/zxkmm", + "html_url": "https://github.com/zxkmm", + "followers_url": "https://api.github.com/users/zxkmm/followers", + "following_url": "https://api.github.com/users/zxkmm/following{/other_user}", + "gists_url": "https://api.github.com/users/zxkmm/gists{/gist_id}", + "starred_url": "https://api.github.com/users/zxkmm/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/zxkmm/subscriptions", + "organizations_url": "https://api.github.com/users/zxkmm/orgs", + "repos_url": "https://api.github.com/users/zxkmm/repos", + "events_url": "https://api.github.com/users/zxkmm/events{/privacy}", + "received_events_url": "https://api.github.com/users/zxkmm/received_events", "type": "contributor", "user_view_type": "public", "site_admin": false, "contributions": 1 }, { - "login": "michaelmior", - "id": 82501, - "node_id": "MDQ6VXNlcjgyNTAx", - "avatar_url": "https://avatars.githubusercontent.com/u/82501?v=4", + "login": "milapemi", + "id": 65869801, + "node_id": "MDQ6VXNlcjY1ODY5ODAx", + "avatar_url": "https://avatars.githubusercontent.com/u/65869801?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/michaelmior", - "html_url": "https://github.com/michaelmior", - "followers_url": "https://api.github.com/users/michaelmior/followers", - "following_url": "https://api.github.com/users/michaelmior/following{/other_user}", - "gists_url": "https://api.github.com/users/michaelmior/gists{/gist_id}", - "starred_url": "https://api.github.com/users/michaelmior/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/michaelmior/subscriptions", - "organizations_url": "https://api.github.com/users/michaelmior/orgs", - "repos_url": "https://api.github.com/users/michaelmior/repos", - "events_url": "https://api.github.com/users/michaelmior/events{/privacy}", - "received_events_url": "https://api.github.com/users/michaelmior/received_events", + "url": "https://api.github.com/users/milapemi", + "html_url": "https://github.com/milapemi", + "followers_url": "https://api.github.com/users/milapemi/followers", + "following_url": "https://api.github.com/users/milapemi/following{/other_user}", + "gists_url": "https://api.github.com/users/milapemi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/milapemi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/milapemi/subscriptions", + "organizations_url": "https://api.github.com/users/milapemi/orgs", + "repos_url": "https://api.github.com/users/milapemi/repos", + "events_url": "https://api.github.com/users/milapemi/events{/privacy}", + "received_events_url": "https://api.github.com/users/milapemi/received_events", "type": "contributor", "user_view_type": "public", "site_admin": false, @@ -1210,22 +1254,44 @@ "contributions": 1 }, { - "login": "milapemi", - "id": 65869801, - "node_id": "MDQ6VXNlcjY1ODY5ODAx", - "avatar_url": "https://avatars.githubusercontent.com/u/65869801?v=4", + "login": "michaelmior", + "id": 82501, + "node_id": "MDQ6VXNlcjgyNTAx", + "avatar_url": "https://avatars.githubusercontent.com/u/82501?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/milapemi", - "html_url": "https://github.com/milapemi", - "followers_url": "https://api.github.com/users/milapemi/followers", - "following_url": "https://api.github.com/users/milapemi/following{/other_user}", - "gists_url": "https://api.github.com/users/milapemi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/milapemi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/milapemi/subscriptions", - "organizations_url": "https://api.github.com/users/milapemi/orgs", - "repos_url": "https://api.github.com/users/milapemi/repos", - "events_url": "https://api.github.com/users/milapemi/events{/privacy}", - "received_events_url": "https://api.github.com/users/milapemi/received_events", + "url": "https://api.github.com/users/michaelmior", + "html_url": "https://github.com/michaelmior", + "followers_url": "https://api.github.com/users/michaelmior/followers", + "following_url": "https://api.github.com/users/michaelmior/following{/other_user}", + "gists_url": "https://api.github.com/users/michaelmior/gists{/gist_id}", + "starred_url": "https://api.github.com/users/michaelmior/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/michaelmior/subscriptions", + "organizations_url": "https://api.github.com/users/michaelmior/orgs", + "repos_url": "https://api.github.com/users/michaelmior/repos", + "events_url": "https://api.github.com/users/michaelmior/events{/privacy}", + "received_events_url": "https://api.github.com/users/michaelmior/received_events", + "type": "contributor", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "M4gie", + "id": 33150916, + "node_id": "MDQ6VXNlcjMzMTUwOTE2", + "avatar_url": "https://avatars.githubusercontent.com/u/33150916?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/M4gie", + "html_url": "https://github.com/M4gie", + "followers_url": "https://api.github.com/users/M4gie/followers", + "following_url": "https://api.github.com/users/M4gie/following{/other_user}", + "gists_url": "https://api.github.com/users/M4gie/gists{/gist_id}", + "starred_url": "https://api.github.com/users/M4gie/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/M4gie/subscriptions", + "organizations_url": "https://api.github.com/users/M4gie/orgs", + "repos_url": "https://api.github.com/users/M4gie/repos", + "events_url": "https://api.github.com/users/M4gie/events{/privacy}", + "received_events_url": "https://api.github.com/users/M4gie/received_events", "type": "contributor", "user_view_type": "public", "site_admin": false, diff --git a/scripts/generate-contributors.js b/scripts/generate-contributors.ts similarity index 58% rename from scripts/generate-contributors.js rename to scripts/generate-contributors.ts index 70076c8..f1c8211 100644 --- a/scripts/generate-contributors.js +++ b/scripts/generate-contributors.ts @@ -2,12 +2,36 @@ import { writeFile } from "node:fs/promises"; import { loadEnvFile } from "node:process"; import path from "node:path"; -loadEnvFile(); +import { fileURLToPath } from "node:url"; -async function generateContributors() { +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +try { + loadEnvFile(); +} catch { + // .env file is optional +} + +interface Contributor { + login: string; + html_url: string; + avatar_url: string; + type?: "core" | "contributor"; +} + +interface CoreContributor { + github: string; +} + +interface CoreContributorsResponse { + core: CoreContributor[]; +} + +async function generateContributors(): Promise { const contributors = await getContributors(); const filepath = path.join( - import.meta.dirname, + __dirname, "..", "public", "contributors.json" @@ -17,7 +41,7 @@ async function generateContributors() { await writeFile(filepath, payload); } -const bots = [ +const bots: string[] = [ "dependabot[bot]", "allcontributors[bot]", "snyk-bot", @@ -26,7 +50,7 @@ const bots = [ "greenkeeper[bot]" ]; -const repositories = [ +const repositories: string[] = [ "cli", "vulnera", "ci", @@ -40,8 +64,8 @@ const repositories = [ "flags" ]; -async function getRepositoryContributors(repository) { - const headers = {}; +async function getRepositoryContributors(repository: string): Promise { + const headers: Record = {}; // GITHUB_TOKEN is not necessary to make request to /contributors // but the rate limits for calls without auth is very low. if (process.env.GITHUB_TOKEN) { @@ -55,24 +79,37 @@ async function getRepositoryContributors(repository) { } ); - return response.json(); + if (!response.ok) { + throw new Error(`Failed to fetch contributors for ${repository}: ${response.status}`); + } + const data = await response.json(); + if (!Array.isArray(data)) { + throw new Error("Invalid response format"); } -async function getCoreContributors() { +return data as Contributor[]; +} + +async function getCoreContributors(): Promise { const responseCore = await fetch("https://raw.githubusercontent.com/NodeSecure/Governance/main/contributors.json"); - const responseCoreContributors = await responseCore.json(); - const coreContributors = responseCoreContributors.core.map((contributor) => contributor.github); + + if (!responseCore.ok) { + throw new Error(`Failed to fetch core contributors: ${responseCore.status}`); + } + + const responseCoreContributors = await responseCore.json() as CoreContributorsResponse; + const coreContributors = responseCoreContributors.core.map((contributor: CoreContributor) => contributor.github); return coreContributors; } -async function getContributors() { +async function getContributors(): Promise { const allContributors = await Promise.all( repositories.map((repository) => getRepositoryContributors(repository)) ); const contributors = allContributors.flat(); - const uniqueContributors = new Map(); + const uniqueContributors = new Map(); const coreContributors = await getCoreContributors(); @@ -92,4 +129,5 @@ async function getContributors() { return Array.from(uniqueContributors.values()); } + await generateContributors(); diff --git a/src/hydrate-contributors.js b/src/hydrate-contributors.ts similarity index 68% rename from src/hydrate-contributors.js rename to src/hydrate-contributors.ts index eff19df..14ceb67 100644 --- a/src/hydrate-contributors.js +++ b/src/hydrate-contributors.ts @@ -1,14 +1,26 @@ -async function hydrateContributors() { +interface Contributor { + login: string; + html_url: string; + avatar_url: string; + type?: "core" | "contributor"; +} + +async function hydrateContributors(): Promise { const coreRow = document.getElementById("core-row"); const commitersRow = document.getElementById("contributors-row"); + if (!coreRow || !commitersRow) { + console.error("Required elements not found in DOM"); + return; + } + const response = await fetch("/contributors.json"); if (!response.ok) { throw new Error(`Error while fetching contributors list: ${response.status}`); } - const contributors = await response.json(); + const contributors: Contributor[] = await response.json(); for (const contributor of contributors) { if (contributor.type === "core") { @@ -25,7 +37,7 @@ async function hydrateContributors() { } } -function createContributorElement(data, type = "contributor") { +function createContributorElement(data: Contributor, type: "core" | "contributor" = "contributor"): HTMLAnchorElement { const cLink = document.createElement("a"); cLink.href = data.html_url; @@ -46,4 +58,4 @@ function createContributorElement(data, type = "contributor") { return cLink; } -hydrateContributors(); +hydrateContributors().catch(console.error); diff --git a/src/particules.js b/src/particules.ts similarity index 78% rename from src/particules.js rename to src/particules.ts index 981a12b..07b6a4d 100644 --- a/src/particules.js +++ b/src/particules.ts @@ -1,14 +1,29 @@ -(function particulesIIFE() { +interface Point { + x: number; + y: number; + dx: number; + dy: number; + color: string; +} + +function particulesIIFE(): void { const palette = ["#00D1FF", "#3722AF", "#5A44DA"]; - const canvas = document.getElementById("network-bg"); - const ctx = canvas.getContext("2d"); + const canvas = document.getElementById("network-bg") as HTMLCanvasElement; + const ctx = canvas.getContext("2d")!; + + if (!ctx) { + console.error("Unable to get 2D context"); + return; + } + let width = window.innerWidth; let height = window.innerHeight; canvas.width = width; canvas.height = height; - const points = []; + const points: Point[] = []; const numPoints = Math.floor((width * height) / 9000); + for (let i = 0; i < numPoints; i++) { points.push({ x: Math.random() * width, @@ -19,8 +34,9 @@ }); } - function draw() { + function draw(): void { ctx.clearRect(0, 0, width, height); + // Draw lines for (let i = 0; i < points.length; i++) { for (let j = i + 1; j < points.length; j++) { @@ -36,6 +52,7 @@ } } } + // Draw points for (const p of points) { ctx.globalAlpha = 0.38; @@ -47,7 +64,7 @@ ctx.globalAlpha = 1; } - function animate() { + function animate(): void { for (const p of points) { p.x += p.dx; p.y += p.dy; @@ -62,13 +79,15 @@ requestAnimationFrame(animate); } - function resize() { + function resize(): void { width = window.innerWidth; height = window.innerHeight; canvas.width = width; canvas.height = height; } + window.addEventListener("resize", resize); - animate(); -}()); +} + +particulesIIFE(); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..36f7b7f --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "noEmit": true, + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true, + "moduleDetection": "force", + "resolveJsonModule": true, + "isolatedModules": true, + "verbatimModuleSyntax": false, + "types": ["node"] + }, + "include": [ + "src/**/*", + "scripts/**/*" + ], + "exclude": [ + "node_modules", + "dist" + ] +} diff --git a/types/zup.d.ts b/types/zup.d.ts new file mode 100644 index 0000000..8367ce9 --- /dev/null +++ b/types/zup.d.ts @@ -0,0 +1,9 @@ +declare module "zup" { + interface ZupData { + [key: string]: any; + } + + function zup(html: string): (data?: ZupData) => string; + + export default zup; +} diff --git a/vite.config.js b/vite.config.js index 1230797..2200fab 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,10 +2,16 @@ import { defineConfig } from "vite"; // Import Internal Dependencies -import zupTransformer from "./plugins/zupTransformer.js"; +import zupTransformer from "./plugins/zupTransformer.ts"; export default defineConfig({ plugins: [ zupTransformer({}) - ] + ], + esbuild: { + target: "es2020", + supported: { + "top-level-await": true + } + } });