[{"data":1,"prerenderedAt":203},["ShallowReactive",2],{"content-/measure-deploy-validation":3,"all-pages-for-dir":181,"related-/measure-deploy-validation":182,"og-image-/measure-deploy-validation":202},{"id":4,"title":5,"body":6,"category":166,"concepts":166,"description":167,"extension":168,"meta":169,"navigation":170,"ogImage":166,"path":171,"project_name":166,"published":172,"publishedAt":173,"seo":174,"source":166,"stem":175,"tags":176,"todo":166,"unpublished":172,"updatedAt":166,"__hash__":180},"pages/2026-01/2026-01-04/measure-deploy-validation.md","measure-deploy.ps1のPre-deploy Validation機能",{"type":7,"value":8,"toc":157},"minimark",[9,13,29,32,38,41,44,97,101,136,139,147,150,153],[10,11,12],"h2",{"id":12},"結論",[14,15,16,20,21,24,25,28],"p",{},[17,18,19],"code",{},"scripts\\measure-deploy.ps1","に追加されたPre-deploy Validationは、コンテンツファイルのfrontmatterで",[17,22,23],{},"path:","フィールドに",[17,26,27],{},"/prompts/","が含まれている場合を検出し、デプロイを阻止するガードレール機能である。",[10,30,31],{"id":31},"背景",[14,33,34,35,37],{},"過去に",[17,36,27],{},"パスでルーティングやビルドの問題が発生したため、防止する仕組みとして追加された。",[10,39,40],{"id":40},"追加されたバリデーション",[14,42,43],{},"28〜49行目に以下のPre-deploy Validationが追加されている。",[45,46,51],"pre",{"className":47,"code":48,"language":49,"meta":50,"style":50},"language-powershell shiki shiki-themes vitesse-light vitesse-light","# Check for problematic path patterns in content files\nGet-ChildItem -Path \"apps/web/content\" -Filter \"*.md\" -Recurse | ForEach-Object {\n    $content = Get-Content $_.FullName -Raw -ErrorAction SilentlyContinue\n    if ($content -match 'path:\\s*[\"\\x27]?(/[^\"\\x27\\n]*\\/prompts\\/[^\"\\x27\\n]*)') {\n        $validationErrors += \"  - $($_.Name): path contains /prompts/ → $($Matches[1])\"\n    }\n}\n","powershell","",[17,52,53,61,67,73,79,85,91],{"__ignoreMap":50},[54,55,58],"span",{"class":56,"line":57},"line",1,[54,59,60],{},"# Check for problematic path patterns in content files\n",[54,62,64],{"class":56,"line":63},2,[54,65,66],{},"Get-ChildItem -Path \"apps/web/content\" -Filter \"*.md\" -Recurse | ForEach-Object {\n",[54,68,70],{"class":56,"line":69},3,[54,71,72],{},"    $content = Get-Content $_.FullName -Raw -ErrorAction SilentlyContinue\n",[54,74,76],{"class":56,"line":75},4,[54,77,78],{},"    if ($content -match 'path:\\s*[\"\\x27]?(/[^\"\\x27\\n]*\\/prompts\\/[^\"\\x27\\n]*)') {\n",[54,80,82],{"class":56,"line":81},5,[54,83,84],{},"        $validationErrors += \"  - $($_.Name): path contains /prompts/ → $($Matches[1])\"\n",[54,86,88],{"class":56,"line":87},6,[54,89,90],{},"    }\n",[54,92,94],{"class":56,"line":93},7,[54,95,96],{},"}\n",[98,99,100],"h3",{"id":100},"処理の流れ",[102,103,104,115,118,126,129],"ol",{},[105,106,107,110,111,114],"li",{},[17,108,109],{},"apps/web/content","配下の全",[17,112,113],{},".md","ファイルを再帰的に取得",[105,116,117],{},"各ファイルの内容を読み込み",[105,119,120,121,24,123,125],{},"正規表現で",[17,122,23],{},[17,124,27],{},"が含まれるかチェック",[105,127,128],{},"問題が見つかった場合、エラーメッセージを収集",[105,130,131,132,135],{},"エラーがあれば",[17,133,134],{},"exit 1","でデプロイを中断",[98,137,138],{"id":138},"エラー発生時の出力",[45,140,145],{"className":141,"code":143,"language":144},[142],"language-text","[ERROR] Pre-deploy validation failed!\nThe following files have problematic path fields:\n  - article.md: path contains /prompts/ → /prompts/example\nFix these paths before deploying (remove /prompts/ from path field)\n","text",[17,146,143],{"__ignoreMap":50},[10,148,149],{"id":149},"まとめ",[14,151,152],{},"このバリデーションにより、誤ったパス設定のまま本番環境にデプロイすることを防止できる。デプロイ前の自動チェックとして機能し、問題のある記事を事前に検出する。",[154,155,156],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":50,"searchDepth":63,"depth":63,"links":158},[159,160,161,165],{"id":12,"depth":63,"text":12},{"id":31,"depth":63,"text":31},{"id":40,"depth":63,"text":40,"children":162},[163,164],{"id":100,"depth":69,"text":100},{"id":138,"depth":69,"text":138},{"id":149,"depth":63,"text":149},null,"デプロイ計測スクリプトに追加されたパス検証機能の目的と仕組み","md",{},true,"/measure-deploy-validation",false,"2026-01-04T00:00:00.000Z",{"title":5,"description":167},"2026-01/2026-01-04/measure-deploy-validation",[177,178,49,179],"cloudflare","deploy","validation","PA-Whgea93MEPqGZIuDeif6Vv2s9h2tvxNdCYaYRDig",[],[183,187,191,195,198],{"title":184,"path":185,"publishedAt":186},"Nuxt の pnpm generate を measure-deploy.ps1 でフェーズ別に計測した","/nuxt-build-deploy-time-measurement","2026-06-04T00:00:00.000Z",{"title":188,"path":189,"publishedAt":190},"Nuxt 2をCloudflareにデプロイしたらwranglerエラーで失敗した","/nuxt2-cloudflare-deploy-error","2026-01-07T00:00:00.000Z",{"title":192,"path":193,"publishedAt":194},"2026年7月27日の開発日記 - 画像3,810件の配信復旧とHeroku停止の実測","/2026-07-27-diary","2026-07-27T00:00:00.000Z",{"title":196,"path":197,"publishedAt":194},"Notion 9,375ページの移行先を設計し直す — 原本243MBの抜けと、Markdown→Googleドキュメント変換の実測","/notion-archive-migration-google-docs",{"title":199,"path":200,"publishedAt":201},"2026年7月26日の開発日記 - WordPressサイトをついに本番切替した日","/2026-07-26-diary","2026-07-26T00:00:00.000Z","https://log.eurekapu.com/og/blog/measure-deploy-validation.png?v=2026-01-04T00%3A00%3A00.000Z&title=measure-deploy.ps1%E3%81%AEPre-deploy%20Validation%E6%A9%9F%E8%83%BD&author=Kei%20Komatsu&sig=17aba31efc7e70c3",1785654707283]