backlog-exporter 0.2.3 → 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.md CHANGED
@@ -58,7 +58,7 @@ $ npm install -g backlog-exporter
58
58
  $ backlog-exporter COMMAND
59
59
  running command...
60
60
  $ backlog-exporter (--version)
61
- backlog-exporter/0.2.3 linux-x64 node-v23.9.0
61
+ backlog-exporter/0.3.0 linux-x64 node-v23.9.0
62
62
  $ backlog-exporter --help [COMMAND]
63
63
  USAGE
64
64
  $ backlog-exporter COMMAND
@@ -219,7 +219,7 @@ EXAMPLES
219
219
  最大1000件の課題を取得する(デフォルトは100件)
220
220
  ```
221
221
 
222
- _See code: [src/commands/all/index.ts](https://github.com/ShuntaToda/backlog-exporter/blob/v0.2.3/src/commands/all/index.ts)_
222
+ _See code: [src/commands/all/index.ts](https://github.com/ShuntaToda/backlog-exporter/blob/v0.3.0/src/commands/all/index.ts)_
223
223
 
224
224
  ## `backlog-exporter help [COMMAND]`
225
225
 
@@ -275,7 +275,7 @@ EXAMPLES
275
275
  最大10000件の課題を取得する(デフォルトは5000件)
276
276
  ```
277
277
 
278
- _See code: [src/commands/issue/index.ts](https://github.com/ShuntaToda/backlog-exporter/blob/v0.2.3/src/commands/issue/index.ts)_
278
+ _See code: [src/commands/issue/index.ts](https://github.com/ShuntaToda/backlog-exporter/blob/v0.3.0/src/commands/issue/index.ts)_
279
279
 
280
280
  ## `backlog-exporter plugins`
281
281
 
@@ -604,7 +604,7 @@ EXAMPLES
604
604
  指定したディレクトリの設定を使用して更新する
605
605
  ```
606
606
 
607
- _See code: [src/commands/update/index.ts](https://github.com/ShuntaToda/backlog-exporter/blob/v0.2.3/src/commands/update/index.ts)_
607
+ _See code: [src/commands/update/index.ts](https://github.com/ShuntaToda/backlog-exporter/blob/v0.3.0/src/commands/update/index.ts)_
608
608
 
609
609
  ## `backlog-exporter wiki`
610
610
 
@@ -631,7 +631,7 @@ EXAMPLES
631
631
  指定したディレクトリにWikiを保存する
632
632
  ```
633
633
 
634
- _See code: [src/commands/wiki/index.ts](https://github.com/ShuntaToda/backlog-exporter/blob/v0.2.3/src/commands/wiki/index.ts)_
634
+ _See code: [src/commands/wiki/index.ts](https://github.com/ShuntaToda/backlog-exporter/blob/v0.3.0/src/commands/wiki/index.ts)_
635
635
  <!-- commandsstop -->
636
636
 
637
637
  # 出力形式
@@ -3,6 +3,7 @@ import * as fs from 'node:fs/promises';
3
3
  import path from 'node:path';
4
4
  import process from 'node:process';
5
5
  import { sanitizeFileName, sanitizeWikiFileName } from './common.js';
6
+ import { appendLog } from './log.js';
6
7
  import { RateLimiter } from './sleep.js';
7
8
  /**
8
9
  * Backlogから課題をダウンロードする
@@ -130,6 +131,9 @@ export async function downloadIssues(command, options) {
130
131
  ${issue.description || '詳細情報なし'}${commentsSection}`;
131
132
  // eslint-disable-next-line no-await-in-loop
132
133
  await fs.writeFile(issueFilePath, markdownContent);
134
+ // ログに記録
135
+ // eslint-disable-next-line no-await-in-loop
136
+ await appendLog(options.outputDir, `課題「${issue.summary}」を更新しました: ${backlogIssueUrl}`);
133
137
  }
134
138
  catch (error) {
135
139
  command.warn(`課題 ${issue.issueKey} の保存に失敗しました: ${error instanceof Error ? error.message : String(error)}`);
@@ -238,6 +242,9 @@ export async function downloadWikis(command, options) {
238
242
  const markdownContent = `# ${wiki.name}\n\n[Backlog Wiki Link](${backlogWikiUrl})\n\n${content}`;
239
243
  // eslint-disable-next-line no-await-in-loop
240
244
  await fs.writeFile(wikiFilePath, markdownContent);
245
+ // ログに記録
246
+ // eslint-disable-next-line no-await-in-loop
247
+ await appendLog(options.outputDir, `Wiki「${wiki.name}」を更新しました: ${backlogWikiUrl}`);
241
248
  // 進捗状況を一行で更新
242
249
  const wikiIndex = filteredWikis.indexOf(wiki) + 1;
243
250
  process.stdout.write(`\rWikiを保存中... (${wikiIndex}/${filteredWikis.length}件)`);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 更新ログを記録する
3
+ * @param outputDir 出力ディレクトリ
4
+ * @param message ログメッセージ
5
+ */
6
+ export declare function appendLog(outputDir: string, message: string): Promise<void>;
@@ -0,0 +1,18 @@
1
+ import * as fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ /**
4
+ * 更新ログを記録する
5
+ * @param outputDir 出力ディレクトリ
6
+ * @param message ログメッセージ
7
+ */
8
+ export async function appendLog(outputDir, message) {
9
+ const logPath = path.join(outputDir, 'backlog-update.log');
10
+ const timestamp = new Date().toLocaleString('ja-JP');
11
+ const logMessage = `[${timestamp}] ${message}\n`;
12
+ try {
13
+ await fs.appendFile(logPath, logMessage, 'utf8');
14
+ }
15
+ catch (error) {
16
+ console.error(`ログの記録に失敗しました: ${error instanceof Error ? error.message : String(error)}`);
17
+ }
18
+ }
@@ -289,5 +289,5 @@
289
289
  ]
290
290
  }
291
291
  },
292
- "version": "0.2.3"
292
+ "version": "0.3.0"
293
293
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "backlog-exporter",
3
3
  "description": "A new CLI generated with oclif",
4
- "version": "0.2.3",
4
+ "version": "0.3.0",
5
5
  "author": "ShuntaToda",
6
6
  "bin": {
7
7
  "backlog-exporter": "bin/run.js"