issue-map 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +163 -0
- package/README.md +118 -53
- package/README.zh-CN.md +135 -0
- package/README.zh-TW.md +133 -0
- package/package.json +6 -2
- package/scripts/issue-map-i18n.ts +486 -0
- package/scripts/issue-map-model.ts +33 -13
- package/scripts/issue-map-page.ts +241 -75
- package/scripts/issue-map-serve.ts +2 -1
- package/scripts/issue-map.html +43 -12
- package/scripts/issue-map.ts +15 -7
package/scripts/issue-map.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<title
|
|
1
|
+
<title>Dev map</title>
|
|
2
2
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
3
3
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
4
4
|
<link
|
|
@@ -35,8 +35,16 @@
|
|
|
35
35
|
--t3: #8c5a24;
|
|
36
36
|
--t4: #2f7a5a;
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
/*
|
|
39
|
+
* CJK 的部分只到 Noto Sans TC 為止是網路字型,簡體與日文交給系統字型(PingFang SC、
|
|
40
|
+
* Hiragino、YaHei、Meiryo)——四種語言各拉一套 Noto 會讓這頁多下載幾百 KB,而這是本機
|
|
41
|
+
* 開發用的頁面。
|
|
42
|
+
*/
|
|
43
|
+
--cjk:
|
|
44
|
+
'Noto Sans TC', 'PingFang TC', 'PingFang SC', 'Hiragino Sans', 'Microsoft JhengHei',
|
|
45
|
+
'Microsoft YaHei', Meiryo;
|
|
46
|
+
--display: 'Bricolage Grotesque', var(--cjk), sans-serif;
|
|
47
|
+
--body: 'Public Sans', var(--cjk), system-ui, sans-serif;
|
|
40
48
|
--mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
|
|
41
49
|
color-scheme: light;
|
|
42
50
|
}
|
|
@@ -143,6 +151,14 @@
|
|
|
143
151
|
flex-direction: column;
|
|
144
152
|
gap: 14px;
|
|
145
153
|
}
|
|
154
|
+
/* 抬頭第一行:左邊是 repo 與抓取時間,右邊是語言。 */
|
|
155
|
+
.masthead-top {
|
|
156
|
+
display: flex;
|
|
157
|
+
flex-wrap: wrap;
|
|
158
|
+
align-items: center;
|
|
159
|
+
justify-content: space-between;
|
|
160
|
+
gap: 8px 16px;
|
|
161
|
+
}
|
|
146
162
|
.eyebrow {
|
|
147
163
|
font-family: var(--mono);
|
|
148
164
|
font-size: 11px;
|
|
@@ -151,6 +167,21 @@
|
|
|
151
167
|
text-transform: uppercase;
|
|
152
168
|
color: var(--faint);
|
|
153
169
|
}
|
|
170
|
+
/* 語言用原生 select:鍵盤與行動裝置都不必自己實作,而且四個選項不值得一套下拉選單。 */
|
|
171
|
+
.lang {
|
|
172
|
+
font-family: var(--mono);
|
|
173
|
+
font-size: 11.5px;
|
|
174
|
+
color: var(--muted);
|
|
175
|
+
background: var(--card);
|
|
176
|
+
border: 1px solid var(--line-strong);
|
|
177
|
+
border-radius: 2px;
|
|
178
|
+
padding: 4px 8px;
|
|
179
|
+
cursor: pointer;
|
|
180
|
+
}
|
|
181
|
+
.lang:hover {
|
|
182
|
+
color: var(--ink);
|
|
183
|
+
border-color: var(--ink);
|
|
184
|
+
}
|
|
154
185
|
h1 {
|
|
155
186
|
font-family: var(--display);
|
|
156
187
|
font-weight: 700;
|
|
@@ -844,8 +875,11 @@
|
|
|
844
875
|
|
|
845
876
|
<div class="page">
|
|
846
877
|
<header class="masthead">
|
|
847
|
-
<div class="
|
|
848
|
-
|
|
878
|
+
<div class="masthead-top">
|
|
879
|
+
<div class="eyebrow" id="eyebrow"></div>
|
|
880
|
+
<select class="lang" id="lang"></select>
|
|
881
|
+
</div>
|
|
882
|
+
<h1 id="page-title"></h1>
|
|
849
883
|
<p class="lede" id="lede"></p>
|
|
850
884
|
<div class="stats" id="stats"></div>
|
|
851
885
|
</header>
|
|
@@ -857,20 +891,17 @@
|
|
|
857
891
|
<section class="group">
|
|
858
892
|
<div class="list-head">
|
|
859
893
|
<div class="group-head">
|
|
860
|
-
<h2
|
|
894
|
+
<h2 id="list-title"></h2>
|
|
861
895
|
<span class="sub" id="list-sub"></span>
|
|
862
896
|
</div>
|
|
863
|
-
<div class="tabs" id="tabs" role="group"
|
|
897
|
+
<div class="tabs" id="tabs" role="group"></div>
|
|
864
898
|
</div>
|
|
865
899
|
<div class="rows" id="rows"></div>
|
|
866
900
|
</section>
|
|
867
901
|
|
|
868
902
|
<footer>
|
|
869
|
-
<div
|
|
870
|
-
<div>
|
|
871
|
-
重跑 <code>bun run issue-map</code> 產檔,或
|
|
872
|
-
<code>bun run issue-map:serve</code> 讓重新整理就是最新。
|
|
873
|
-
</div>
|
|
903
|
+
<div id="foot-truth"></div>
|
|
904
|
+
<div id="foot-refresh"></div>
|
|
874
905
|
<div id="foot-config"></div>
|
|
875
906
|
</footer>
|
|
876
907
|
</div>
|
package/scripts/issue-map.ts
CHANGED
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
criticalPathOf,
|
|
34
34
|
groupsOf,
|
|
35
35
|
type MapIssue,
|
|
36
|
+
type NextStep,
|
|
36
37
|
type Snapshot,
|
|
37
38
|
type Status,
|
|
38
39
|
} from './issue-map-model.ts'
|
|
@@ -228,16 +229,23 @@ function describeIssue(raw: Issue, context: Context): MapIssue {
|
|
|
228
229
|
return waitingFor.length ? 'blocked' : 'ready'
|
|
229
230
|
}
|
|
230
231
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
if (status === '
|
|
234
|
-
if (status === '
|
|
232
|
+
/** 只算出「是哪一種下一步」。句子是頁面的事,在 `issue-map-i18n.ts` 依語言組出來。 */
|
|
233
|
+
function nextStepOf(status: Status): NextStep {
|
|
234
|
+
if (status === 'done') return { kind: 'none' }
|
|
235
|
+
if (status === 'triage') return { kind: 'command', command: CONFIG.triageCommand }
|
|
236
|
+
if (status === 'active') {
|
|
237
|
+
// 沒有 assignee 但掛了 active 標籤時,能講的就只有那個標籤名。
|
|
238
|
+
const label = CONFIG.active[0]
|
|
239
|
+
return { kind: 'active', who: assignees.length ? assignees : label ? [label] : [] }
|
|
240
|
+
}
|
|
235
241
|
if (isParent) {
|
|
236
242
|
const left = context.openChildren.get(raw.number) ?? 0
|
|
237
|
-
return left ?
|
|
243
|
+
return left ? { kind: 'waitChildren', count: left } : { kind: 'parentReady' }
|
|
238
244
|
}
|
|
239
|
-
if (status === 'blocked') return
|
|
240
|
-
return has(CONFIG.human)
|
|
245
|
+
if (status === 'blocked') return { kind: 'waitIssues', issues: waitingFor }
|
|
246
|
+
return has(CONFIG.human)
|
|
247
|
+
? { kind: 'manual' }
|
|
248
|
+
: { kind: 'command', command: CONFIG.implementCommand }
|
|
241
249
|
}
|
|
242
250
|
|
|
243
251
|
const status = statusOf()
|