修复游戏创作脚本剩余ESLint错误
Project CI / Repository checks (push) Successful in 1m7s
Project CI / Frontend tests (push) Successful in 2m52s
Project CI / Backend tests (push) Successful in 3m3s
Project CI / Native shell tests (push) Failing after 6m25s

整理配置检查与测试文件导入顺序
调整配置向导无限循环写法通过Lint门禁
This commit is contained in:
AIGameCreator App
2026-07-28 12:49:48 +08:00
parent d155873454
commit 26ef00f7b9
3 changed files with 20 additions and 20 deletions
@@ -5,6 +5,10 @@ import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import {
appIdentifier,
defaultRealSwarmTestTask,
} from './agent-swarm-test-chat.mjs';
import {
askHidden,
assertSafeGameCreatorConfigDestination,
@@ -13,10 +17,6 @@ import {
writeGameCreatorConfigAtomically,
writeGameCreatorWizardConfig,
} from './game-creator-config-wizard.mjs';
import {
appIdentifier,
defaultRealSwarmTestTask,
} from './agent-swarm-test-chat.mjs';
const packageConfig = JSON.parse(
fs.readFileSync(new URL('../package.json', import.meta.url), 'utf8'),
@@ -450,7 +450,7 @@ export async function readGameCreatorWizardConfigState(
async function resolvePathThroughExistingAncestor(targetPath) {
let cursor = path.resolve(targetPath);
const missingSegments = [];
while (true) {
for (;;) {
try {
const canonical = await realpath(cursor);
return path.join(canonical, ...missingSegments.reverse());
@@ -476,7 +476,7 @@ function pathIsWithin(rootPath, targetPath) {
async function findContainingGitRoot(targetPath, runGit) {
let cursor = targetPath;
while (true) {
for (;;) {
const metadata = await lstat(cursor).catch((error) => {
if (error?.code === 'ENOENT' || error?.code === 'ENOTDIR') return null;
throw error;
@@ -812,7 +812,7 @@ export async function askHidden(
async function askChoice(title, choices, fallbackIndex = 0) {
console.log(title);
choices.forEach((choice, index) => console.log(` ${index + 1}. ${choice}`));
while (true) {
for (;;) {
const answer = await askVisible(`请选择 [${fallbackIndex + 1}]: `);
if (!answer) return fallbackIndex;
const index = Number(answer) - 1;
@@ -823,7 +823,7 @@ async function askChoice(title, choices, fallbackIndex = 0) {
}
async function askRequired(prompt, fallback = '') {
while (true) {
for (;;) {
const value = await askVisible(prompt, fallback);
if (value.trim()) return value.trim();
console.log('该项不能为空。');
@@ -17,16 +17,6 @@ import { deflateSync } from 'node:zlib';
import { describe, expect, it } from 'vitest';
import {
buildGameCreatorWizardConfig,
gameCreatorProviderPresets,
normalizeWizardBaseUrl,
parseConfigWizardArguments,
readGameCreatorWizardConfigState,
resolveGameCreatorAppConfigDir,
writeGameCreatorConfigAtomically,
writeGameCreatorWizardConfig,
} from '../scripts/game-creator-config-wizard.mjs';
import {
appIdentifier,
buildCargoCliArguments,
@@ -51,21 +41,31 @@ import {
prepareSwarmTestRuntimeConfig,
removeDirectoryWithTimeout,
requiredSwarmManifestTaskIds,
runnerEndpointFileName,
resolveSwarmTestTimeoutMs,
runnerEndpointFileName,
shouldStartPersistentPreview,
terminateChildTree,
testProjectPrefix,
testProjectSentinelName,
testProjectSentinelSchema,
testRuntimeConfigPrefix,
testRuntimeConfigSentinelName,
testRuntimeConfigSentinelSchema,
terminateChildTree,
ungeneratedGameEntryMarker,
validatePngBytes,
validatePreviewUrl,
validateSwarmProjectArtifacts,
} from '../scripts/agent-swarm-test-chat.mjs';
import {
buildGameCreatorWizardConfig,
gameCreatorProviderPresets,
normalizeWizardBaseUrl,
parseConfigWizardArguments,
readGameCreatorWizardConfigState,
resolveGameCreatorAppConfigDir,
writeGameCreatorConfigAtomically,
writeGameCreatorWizardConfig,
} from '../scripts/game-creator-config-wizard.mjs';
const appRoot = path.resolve(fileURLToPath(new URL('..', import.meta.url)));