@c-time/frelio-cli 1.4.11 → 1.4.12
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.
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Migration } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* #127 — deploy-admin.yml が admin をサブディレクトリ配置し管理画面を 404 にする。
|
|
4
|
+
*
|
|
5
|
+
* 旧テンプレは `cp -r admin functions workers _redirects _routes.json .admin-deploy/`
|
|
6
|
+
* で admin を「サブディレクトリ」として配置し、さらに content 配信用の root
|
|
7
|
+
* `_redirects`(`/* → /public/:splat`)/`_routes.json` を同梱していた。
|
|
8
|
+
* - admin バンドルの index.html は asset を**ルート絶対パス** `/assets/*` で参照するが、
|
|
9
|
+
* SPA が `.admin-deploy/admin/` に置かれるため `/assets/*` を解決できない。
|
|
10
|
+
* - root の catch-all `_redirects` が `/assets/*` を `/public/assets/*` へ吸い込む。
|
|
11
|
+
* 結果、CI は success するのに本番管理画面が全面 404 になる。
|
|
12
|
+
*
|
|
13
|
+
* 検出: `.github/workflows/deploy-admin.yml` に `cp -r admin <空白>` の
|
|
14
|
+
* 「素の admin サブディレクトリコピー」が残っているか。
|
|
15
|
+
* - 旧(壊れ): `cp -r admin functions …` → `admin` の直後が空白でマッチ
|
|
16
|
+
* - 修正後 : `cp -r admin/. .admin-deploy/` → `admin` の直後が `/` で非マッチ
|
|
17
|
+
*
|
|
18
|
+
* 参考: https://github.com/c-time/frelio-develop/issues/127
|
|
19
|
+
*/
|
|
20
|
+
export declare const deployAdminSubdirIssue127: Migration;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #127 — deploy-admin.yml が admin をサブディレクトリ配置し管理画面を 404 にする。
|
|
3
|
+
*
|
|
4
|
+
* 旧テンプレは `cp -r admin functions workers _redirects _routes.json .admin-deploy/`
|
|
5
|
+
* で admin を「サブディレクトリ」として配置し、さらに content 配信用の root
|
|
6
|
+
* `_redirects`(`/* → /public/:splat`)/`_routes.json` を同梱していた。
|
|
7
|
+
* - admin バンドルの index.html は asset を**ルート絶対パス** `/assets/*` で参照するが、
|
|
8
|
+
* SPA が `.admin-deploy/admin/` に置かれるため `/assets/*` を解決できない。
|
|
9
|
+
* - root の catch-all `_redirects` が `/assets/*` を `/public/assets/*` へ吸い込む。
|
|
10
|
+
* 結果、CI は success するのに本番管理画面が全面 404 になる。
|
|
11
|
+
*
|
|
12
|
+
* 検出: `.github/workflows/deploy-admin.yml` に `cp -r admin <空白>` の
|
|
13
|
+
* 「素の admin サブディレクトリコピー」が残っているか。
|
|
14
|
+
* - 旧(壊れ): `cp -r admin functions …` → `admin` の直後が空白でマッチ
|
|
15
|
+
* - 修正後 : `cp -r admin/. .admin-deploy/` → `admin` の直後が `/` で非マッチ
|
|
16
|
+
*
|
|
17
|
+
* 参考: https://github.com/c-time/frelio-develop/issues/127
|
|
18
|
+
*/
|
|
19
|
+
export const deployAdminSubdirIssue127 = {
|
|
20
|
+
id: 'deploy-admin-subdir-issue127',
|
|
21
|
+
title: 'deploy-admin.yml を admin ルート配信方式へ更新(管理画面 404 修正)',
|
|
22
|
+
description: '生成済みの deploy-admin.yml が admin/ をサブディレクトリとして配置し、content 配信用の' +
|
|
23
|
+
' root _redirects / _routes.json を同梱しているため、管理画面バンドルのルート絶対参照' +
|
|
24
|
+
'(/assets/*)が解決できず、デプロイ後に管理画面が全面 404 になります(CI は success のため気づきにくい)。',
|
|
25
|
+
severity: 'critical',
|
|
26
|
+
detection: {
|
|
27
|
+
files: ['.github/workflows/deploy-admin.yml'],
|
|
28
|
+
patterns: ['cp\\s+-r\\s+admin\\s'],
|
|
29
|
+
flags: 'm',
|
|
30
|
+
},
|
|
31
|
+
remediation: '`npx @c-time/frelio-cli update --templates-only` を実行して deploy-admin.yml を' +
|
|
32
|
+
'最新テンプレート(admin/ の中身を deploy root へ展開する方式)で再生成してください。',
|
|
33
|
+
command: 'npx @c-time/frelio-cli update --templates-only',
|
|
34
|
+
referenceUrl: 'https://github.com/c-time/frelio-develop/issues/127',
|
|
35
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { node20ToNode24 } from './node20-to-node24.js';
|
|
2
|
+
import { deployAdminSubdirIssue127 } from './deploy-admin-subdir-issue127.js';
|
|
2
3
|
/**
|
|
3
4
|
* 既知のマイグレーション一覧(実装順 = 登録順)。
|
|
4
5
|
* frelio doctor がこの一覧を走査して未適用を検出する。
|
|
5
6
|
*/
|
|
6
|
-
export const MIGRATIONS = [node20ToNode24];
|
|
7
|
+
export const MIGRATIONS = [node20ToNode24, deployAdminSubdirIssue127];
|
|
7
8
|
/**
|
|
8
9
|
* frelio が期待する最新テンプレート世代。
|
|
9
10
|
* バージョンは「世代」を表す単純な整数文字列で、破壊的なテンプレ変更ごとに上げる。
|