修正 AI 游戏创作 Shell ESLint 规范
Project CI / Frontend tests (pull_request) Failing after 56s
Project CI / Repository checks (pull_request) Failing after 2m20s
Project CI / Backend tests (pull_request) Successful in 6m19s
Project CI / Native shell tests (pull_request) Failing after 12m13s

整理配置检查脚本与智能体测试的导入顺序。

将配置向导中的常量条件循环改为等价循环语法。
This commit is contained in:
2026-07-27 05:47:09 +00:00
parent 445559bfea
commit 9eca3bd657
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'),
@@ -446,7 +446,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());
@@ -472,7 +472,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;
@@ -808,7 +808,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;
@@ -819,7 +819,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)));