tracker-boot-git-hooks 0.1.2 → 0.1.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/README.md +60 -0
- package/package.json +1 -1
- package/src/hook.js +2 -2
- package/src/i18n.js +3 -3
package/README.md
CHANGED
|
@@ -120,6 +120,26 @@ tracker-boot-git-hooks install --base-url https://trackerboot.staging.example.co
|
|
|
120
120
|
|
|
121
121
|
---
|
|
122
122
|
|
|
123
|
+
### 環境変数
|
|
124
|
+
|
|
125
|
+
git設定の代わりに環境変数で認証情報を指定できます — CodespacesなどのGit設定が使えない非インタラクティブ環境で便利です:
|
|
126
|
+
|
|
127
|
+
| 変数 | 置き換えるもの |
|
|
128
|
+
|---|---|
|
|
129
|
+
| `TRACKER_BOOT_API_KEY` | `tracker.apiKey` グローバルgit設定 |
|
|
130
|
+
| `TRACKER_BOOT_PROJECT_ID` | `tracker.projectId` ローカルgit設定 |
|
|
131
|
+
| `LANG` | 表示言語の設定(例: `ja_JP.UTF-8`、`ko_KR.UTF-8`、`en_US.UTF-8`) |
|
|
132
|
+
|
|
133
|
+
いずれかの変数が設定されている場合、フックはその値を直接使用し、対話型プロンプトと保存ステップをスキップします。
|
|
134
|
+
|
|
135
|
+
デフォルトの表示言語は**日本語**です。`LANG` 環境変数が未設定またはサポートされていない言語に設定されている場合は日本語にフォールバックします。対応言語は `ja`(日本語)、`ko`(韓国語)、`en`(英語)です。Codespacesなどの環境でデフォルト言語を変更するには、`LANG` を明示的に設定してください:
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
export LANG=en_US.UTF-8
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
123
143
|
### 既知の制限事項
|
|
124
144
|
|
|
125
145
|
**コミットリンクはGitHubのみ対応。** リモートがGitHub URL(HTTPSまたはSSH)の場合のみ、コメントにハイパーリンク付きのコミットSHAが含まれます。その他のホスト(GitLab、Bitbucketなど)ではプレーンテキストで表示されます。
|
|
@@ -262,6 +282,26 @@ tracker-boot-git-hooks install --base-url https://trackerboot.staging.example.co
|
|
|
262
282
|
|
|
263
283
|
---
|
|
264
284
|
|
|
285
|
+
### 환경 변수
|
|
286
|
+
|
|
287
|
+
git 설정 대신 환경 변수로 인증 정보를 제공할 수 있습니다 — Codespaces 등 비대화형 환경에서 유용합니다:
|
|
288
|
+
|
|
289
|
+
| 변수 | 대체 항목 |
|
|
290
|
+
|---|---|
|
|
291
|
+
| `TRACKER_BOOT_API_KEY` | `tracker.apiKey` 전역 git 설정 |
|
|
292
|
+
| `TRACKER_BOOT_PROJECT_ID` | `tracker.projectId` 로컬 git 설정 |
|
|
293
|
+
| `LANG` | 표시 언어 설정(예: `ja_JP.UTF-8`、`ko_KR.UTF-8`、`en_US.UTF-8`) |
|
|
294
|
+
|
|
295
|
+
변수가 설정된 경우 훅은 해당 값을 직접 사용하며 대화형 프롬프트와 저장 단계를 건너뜁니다。
|
|
296
|
+
|
|
297
|
+
기본 표시 언어는 **일본어**입니다。`LANG` 환경 변수가 설정되지 않았거나 지원되지 않는 언어로 설정된 경우 일본어로 폴백됩니다。지원 언어는 `ja`(일본어)、`ko`(한국어)、`en`(영어)입니다。Codespaces 등의 환경에서 기본 언어를 변경하려면 `LANG`을 명시적으로 설정하세요:
|
|
298
|
+
|
|
299
|
+
```sh
|
|
300
|
+
export LANG=ko_KR.UTF-8
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
265
305
|
### 알려진 제한 사항
|
|
266
306
|
|
|
267
307
|
**커밋 링크는 GitHub 전용입니다。** 리모트가 GitHub URL(HTTPS 또는 SSH)인 경우에만 댓글에 하이퍼링크된 커밋 SHA가 포함됩니다。다른 호스트(GitLab、Bitbucket 등)에서는 일반 텍스트로 표시됩니다。
|
|
@@ -404,6 +444,26 @@ tracker-boot-git-hooks install --base-url https://trackerboot.staging.example.co
|
|
|
404
444
|
|
|
405
445
|
---
|
|
406
446
|
|
|
447
|
+
### Environment variables
|
|
448
|
+
|
|
449
|
+
Credentials can be supplied via environment variables instead of git config — useful in Codespaces or other non-interactive environments where git config isn't available:
|
|
450
|
+
|
|
451
|
+
| Variable | Replaces |
|
|
452
|
+
|---|---|
|
|
453
|
+
| `TRACKER_BOOT_API_KEY` | `tracker.apiKey` global git config |
|
|
454
|
+
| `TRACKER_BOOT_PROJECT_ID` | `tracker.projectId` local git config |
|
|
455
|
+
| `LANG` | Display language (e.g. `ja_JP.UTF-8`, `ko_KR.UTF-8`, `en_US.UTF-8`) |
|
|
456
|
+
|
|
457
|
+
When a variable is set, the hook uses it directly and skips the interactive prompt and storing step for that credential.
|
|
458
|
+
|
|
459
|
+
The default display language is **Japanese**. If `LANG` is unset or set to an unsupported language, the tool falls back to Japanese. Supported languages are `ja` (Japanese), `ko` (Korean), and `en` (English). In environments like Codespaces where `LANG` may not reflect your preference, set it explicitly:
|
|
460
|
+
|
|
461
|
+
```sh
|
|
462
|
+
export LANG=en_US.UTF-8
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
407
467
|
### Known limitations
|
|
408
468
|
|
|
409
469
|
**Commit links are GitHub-only.** The comment includes a hyperlinked commit SHA when the remote is a GitHub URL (HTTPS or SSH). For other hosts (GitLab, Bitbucket, etc.) the SHA appears as plain text.
|
package/package.json
CHANGED
package/src/hook.js
CHANGED
|
@@ -31,8 +31,8 @@ function openTtyPrompt(question) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
async function ensureCredentials({ lang, deps }) {
|
|
34
|
-
let apiKey = deps.getConfig('tracker.apiKey', { global: true })
|
|
35
|
-
let projectId = deps.getConfig('tracker.projectId', { local: true })
|
|
34
|
+
let apiKey = process.env.TRACKER_BOOT_API_KEY || deps.getConfig('tracker.apiKey', { global: true })
|
|
35
|
+
let projectId = process.env.TRACKER_BOOT_PROJECT_ID || deps.getConfig('tracker.projectId', { local: true })
|
|
36
36
|
|
|
37
37
|
if (!apiKey) {
|
|
38
38
|
apiKey = await deps.prompt(t('promptApiKey', lang))
|
package/src/i18n.js
CHANGED
|
@@ -32,13 +32,13 @@ const MESSAGES = {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export function detectLang(langEnv) {
|
|
35
|
-
if (!langEnv) return '
|
|
35
|
+
if (!langEnv) return 'ja'
|
|
36
36
|
const code = langEnv.split('_')[0].toLowerCase()
|
|
37
|
-
return MESSAGES[code] ? code : '
|
|
37
|
+
return MESSAGES[code] ? code : 'ja'
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export function t(key, lang, vars = {}) {
|
|
41
|
-
const messages = MESSAGES[lang] ?? MESSAGES.
|
|
41
|
+
const messages = MESSAGES[lang] ?? MESSAGES.ja
|
|
42
42
|
const template = messages[key] ?? MESSAGES.en[key] ?? key
|
|
43
43
|
return template.replace(/\{(\w+)\}/g, (_, k) => vars[k] ?? `{${k}}`)
|
|
44
44
|
}
|