hiroppy 1.0.15 → 1.0.16

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.
Binary file
@@ -104,10 +104,6 @@
104
104
  "siteUrl": "https://daiki-skm.hatenablog.com/entry/2023/03/31/164744"
105
105
  },
106
106
  {
107
- "title": "[7/26]Cybozu Frontend Monthly#25 (ゲスト:株式会社Yuimedi)",
108
- "description": "2022年7月26日(火) 17時開催Cybozu Frontend Monthly#25 (ゲスト:株式会社Yuimedi)のライブ配信ですイベントの詳細:https://cybozu.connpass.com/event/254325/ライブ配信は、16時50分からスタートする予定です(イベントは17時から)...",
109
- "image": "/images/aS55dGltZy5jb20vdmkvUWJXalZsb2FBdVkvbWF4cmVzZGVmYXVsdC5qcGc=.webp",
110
- "siteName": "YouTube",
111
107
  "siteUrl": "https://www.youtube.com/watch?v=QbWjVloaAuY"
112
108
  }
113
109
  ],
@@ -122,9 +118,6 @@
122
118
  "description": "技術顧問から正社員として復職し、再度入社。JPでは[Mercari Web](https://jp.mercari.com/)の0から作成するプロジェクトである[GroundUP App プロジェクト](https://engineering.mercari.com/blog/entry/20221213-ground-up-app/)に立ち上げ参加。\n\n後に100%子会社であるSouzohの立ち上げ時に出向として参加し、[Mercari Shops](https://mercari-shops.com/)リリースまでの8ヶ月間、フロントエンドの開発をほぼ一人で担当。リリース後は[Enabling TeamとしてStream-aligned team](https://engineering.mercari.com/blog/entry/20210812-team-topologies-in-souzoh/)をサポート。",
123
119
  "links": [
124
120
  {
125
- "title": "メルカリShops のフロントエンド | メルカリエンジニアリング",
126
- "description": "こんにちは。ソウゾウの Software Engineer の hiroppy です。「連載:「メルカリ Shops」プレオープンまでの開発の裏側」 の最後は、Web フロントエンドの紹介をしたいと思います。メルカリ Shops は既存のメ",
127
- "image": "/images/ZW5naW5lZXJpbmcubWVyY2FyaS5jb20vL2ltZy9vZ3Avb2dwX2EuanBn.webp",
128
121
  "siteUrl": "https://engineering.mercari.com/blog/entry/20210823-a57631d32e/"
129
122
  },
130
123
  {
@@ -138,17 +131,9 @@
138
131
  "siteUrl": "https://mercan.mercari.com/articles/28113/"
139
132
  },
140
133
  {
141
- "title": "Souzoh Tech Talk #03: Frontend",
142
- "description": "9/1(水)に行ったSouzoh Tech Talk #03: Frontendの様子です!ぜひご覧ください。",
143
- "image": "/images/aS55dGltZy5jb20vdmkvWU5MdklrcVJDLWcvaHFkZWZhdWx0LmpwZw==.webp",
144
- "siteName": "YouTube",
145
134
  "siteUrl": "https://www.youtube.com/watch?v=YNLvIkqRC-g"
146
135
  },
147
136
  {
148
- "title": "Souzoh Tech Talk #05:Infrastructure",
149
- "description": "9/15(水)に行われたSouzoh Tech Talk #05:Infrastructureの様子です。ぜひご覧ください!",
150
- "image": "/images/aS55dGltZy5jb20vdmkvMXVDV3pmYUllZEUvaHFkZWZhdWx0LmpwZw==.webp",
151
- "siteName": "YouTube",
152
137
  "siteUrl": "https://www.youtube.com/watch?v=1uCWzfaIedE"
153
138
  }
154
139
  ],
@@ -370,10 +355,6 @@
370
355
  "description": "フロントエンド改善支援",
371
356
  "links": [
372
357
  {
373
- "title": "Next.js App Router / React Server Components(RSC)を紐解いてみた - estie inside blog",
374
- "description": "デザインエンジニアの表(@HirokiOmote)です。 Next.jsでApp Routerがリリースされて、1年が過ぎました。 弊社では、@hiroppyさんを技術顧問に迎え、Frontendを中心とした長期的な技術選定にご協力いただきました。 本日は、そこで得た学びをご紹介したいと思います。 App Routerについて 2023年5月にNext.js 13.4がstableとしてリリースされ、App Routerが登場しました。 ツリー構造でのファイル配置が基本となりました。 ディレクトリ構成とルーティング page単位・feature(機能)ごとに切り分けたディレクトリ構成が可能にな…",
375
- "image": "/images/Y2RuLmltYWdlLnN0LWhhdGVuYS5jb20vaW1hZ2Uvc2NhbGUvMWY0YWFlZGU1ZDliYzhjODczZGU2N2E1YTJiOTM5M2.webp",
376
- "siteName": "estie inside blog",
377
358
  "siteUrl": "https://www.estie.jp/blog/entry/2024/08/05/183235"
378
359
  }
379
360
  ],
@@ -105,7 +105,7 @@
105
105
  "description": "OSS engineer. Core committer of @nodejs and @webpack.",
106
106
  "image": "/images/cmVzLmNsb3VkaW5hcnkuY29tL3RlY2hmZWVkL2ltYWdlL3VwbG9hZC93XzI4MCxoXzI4MC92MTU4NzcyNjUyMS91c2.webp",
107
107
  "siteName": "TechFeed",
108
- "siteUrl": "https://techfeed.io/people/@hiroppy"
108
+ "siteUrl": "https://techfeed.io/people/@hiroppy/"
109
109
  }
110
110
  ]
111
111
  }
package/lib/github.mjs ADDED
@@ -0,0 +1,95 @@
1
+ import { Octokit } from "octokit";
2
+
3
+ let octokit = null;
4
+
5
+ function getOctokit() {
6
+ if (!octokit) {
7
+ const token = process.env.GITHUB_TOKEN;
8
+ if (!token) {
9
+ throw new Error("GITHUB_TOKEN environment variable is required");
10
+ }
11
+ octokit = new Octokit({ auth: token });
12
+ }
13
+ return octokit;
14
+ }
15
+
16
+ /**
17
+ * Get star count for a repository
18
+ * @param owner - Repository owner
19
+ * @param repo - Repository name
20
+ * @returns Promise<number> - Star count
21
+ */
22
+ export async function getStarCount(owner, repo) {
23
+ try {
24
+ const octokit = getOctokit();
25
+ const { data } = await octokit.rest.repos.get({
26
+ owner,
27
+ repo,
28
+ });
29
+ return data.stargazers_count;
30
+ } catch (error) {
31
+ console.error(`Failed to fetch star count for ${owner}/${repo}:`, error);
32
+ return 0;
33
+ }
34
+ }
35
+
36
+ /**
37
+ * Get star counts for multiple repositories
38
+ * @param repos - Array of repository names in "owner/repo" format
39
+ * @returns Promise<Record<string, number>> - Object mapping repo names to star counts
40
+ */
41
+ export async function getStarCounts(repos) {
42
+ const results = {};
43
+
44
+ const promises = repos.map(async (repoName) => {
45
+ const [owner, repo] = repoName.split("/");
46
+ if (!owner || !repo) {
47
+ console.warn(
48
+ `Invalid repository name format: ${repoName}. Expected "owner/repo"`,
49
+ );
50
+ return;
51
+ }
52
+
53
+ const stars = await getStarCount(owner, repo);
54
+ results[repoName] = stars;
55
+ });
56
+
57
+ await Promise.all(promises);
58
+ return results;
59
+ }
60
+
61
+ /**
62
+ * Get repository information including star count
63
+ * @param owner - Repository owner
64
+ * @param repo - Repository name
65
+ * @returns Promise<object> - Repository information
66
+ */
67
+ export async function getRepositoryInfo(owner, repo) {
68
+ try {
69
+ const octokit = getOctokit();
70
+ const { data } = await octokit.rest.repos.get({
71
+ owner,
72
+ repo,
73
+ });
74
+
75
+ return {
76
+ name: data.full_name,
77
+ url: data.html_url,
78
+ description: data.description,
79
+ language: data.language,
80
+ stars: data.stargazers_count,
81
+ forks: data.forks_count,
82
+ openIssues: data.open_issues_count,
83
+ defaultBranch: data.default_branch,
84
+ createdAt: data.created_at,
85
+ updatedAt: data.updated_at,
86
+ avatar: data.owner.avatar_url,
87
+ };
88
+ } catch (error) {
89
+ console.error(
90
+ `Failed to fetch repository info for ${owner}/${repo}:`,
91
+ error,
92
+ );
93
+ throw error;
94
+ }
95
+ }
package/lib/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export * from "./github.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hiroppy",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "packageManager": "pnpm@10.11.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -15,9 +15,8 @@
15
15
  "default": "./generated/images/*"
16
16
  },
17
17
  "./helpers": {
18
- "import": "./lib/index.js",
19
- "require": "./lib/index.js",
20
- "default": "./lib/index.js"
18
+ "import": "./lib/index.mjs",
19
+ "default": "./lib/index.mjs"
21
20
  }
22
21
  },
23
22
  "scripts": {
@@ -39,6 +38,7 @@
39
38
  "license": "MIT",
40
39
  "files": [
41
40
  "generated",
41
+ "lib",
42
42
  "scripts/decompress-images.js"
43
43
  ],
44
44
  "publishConfig": {