Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ NEXT_PUBLIC_DEMO_MODE="false"

# GitHub Pages等サブパス公開時のベースパス /
# Base path when publishing under a sub-path (e.g. GitHub Pages)
NEXT_PUBLIC_BASE_PATH=""
BASE_PATH=""

# Live2D機能の有効/無効 /
# Enable/disable Live2D features (requires license agreement with Live2D Inc.)
Expand Down
5 changes: 4 additions & 1 deletion src/__tests__/features/stores/envExampleConsistency.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import path from 'path'
const ENV_EXAMPLE_PATH = path.join(process.cwd(), '.env.example')
const SRC_DIR = path.join(process.cwd(), 'src')

// BASE_PATH から next.config.js がクライアント用に生成する。
const GENERATED_BY_NEXT = new Set(['NEXT_PUBLIC_BASE_PATH'])

// .env.example にのみ存在してよい(コードから直接参照されない)変数。
// 追加する場合は理由をコメントで明記すること。
const ALLOWED_UNREFERENCED_IN_CODE: string[] = []
Expand Down Expand Up @@ -67,7 +70,7 @@ describe('.env.example / NEXT_PUBLIC_* consistency', () => {

it('should not reference NEXT_PUBLIC_* variables missing from .env.example', () => {
const missing = Array.from(referencedVars)
.filter((v) => !declaredVars.has(v))
.filter((v) => !declaredVars.has(v) && !GENERATED_BY_NEXT.has(v))
.sort()

expect(missing).toEqual([])
Expand Down