@takagaki/cortex-decisions-viewer 0.12.194 → 0.12.196

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
package/dist/build.js CHANGED
@@ -316,6 +316,7 @@ exports.GUIDE_VIDEO_SOURCES = {
316
316
  backlog: { video: path.join(__dirname, "..", "assets", "guides", "backlog.mp4") },
317
317
  slack: { video: path.join(__dirname, "..", "assets", "guides", "slack.mp4") },
318
318
  github: { video: path.join(__dirname, "..", "assets", "guides", "github.mp4") },
319
+ meet: { video: path.join(__dirname, "..", "assets", "guides", "meet.mp4") },
319
320
  };
320
321
  /**
321
322
  * ファイルを内容ハッシュ名で `outAbs/assets/` へコピーする。CSS/JS と同じ規約
@@ -338,7 +339,21 @@ async function copyHashedAsset(outAbs, srcAbsPath, namePrefix) {
338
339
  const fileExt = path.extname(srcAbsPath).replace(/^\./, "") || "bin";
339
340
  const fileName = `${namePrefix}.${hash}.${fileExt}`;
340
341
  await node_fs_1.promises.mkdir(path.join(outAbs, "assets"), { recursive: true });
341
- await node_fs_1.promises.writeFile(path.join(outAbs, "assets", fileName), bytes);
342
+ const destAbs = path.join(outAbs, "assets", fileName);
343
+ // 同じディスクならハードリンクで済ませる(テストが組み立てを何百回も回しても容量を食わない・#1388)。
344
+ // 別ディスク・リンク不可の環境、または同名が既にあるときだけ、従来どおり書く(同名=同じ内容ハッシュ)。
345
+ // 出力先の assets/ をあとから in-place で書き換える処理を足すと、リンク元(パッケージ内の動画)まで変わる
346
+ try {
347
+ await node_fs_1.promises.link(srcAbsPath, destAbs);
348
+ }
349
+ catch (e) {
350
+ const code = e.code;
351
+ if (code !== "EEXIST")
352
+ await node_fs_1.promises.writeFile(destAbs, bytes);
353
+ // 既存が途中で切れていたら(前回の書き込み中断)、従来どおり上書きして直す
354
+ else if ((await node_fs_1.promises.stat(destAbs)).size !== bytes.length)
355
+ await node_fs_1.promises.writeFile(destAbs, bytes);
356
+ }
342
357
  return `assets/${fileName}`;
343
358
  }
344
359
  /**