回退合并时被钩子误格式化的无关文件
过程中发现并修复:本地 pre-commit 钩子在提交合并时pipeline里prettier会重排无关文件,导致本PR携带与客户端无关的上下文 本提交把20个纯格式化文件恢复为主线内容,PR只保留macOS构建管线和发布链路相关改动 后续提交不再把这些文件纳入范围
This commit is contained in:
@@ -185,12 +185,7 @@ test('nextVersion 只在 patch 位递增', () => {
|
||||
|
||||
test('ossutil 参数默认使用 v1 签名,并可按需带 region 与 v4', () => {
|
||||
const base = {
|
||||
args: [
|
||||
'cp',
|
||||
'--force',
|
||||
'/tmp/a.json',
|
||||
'oss://agc-dev/agc/global-version.json',
|
||||
],
|
||||
args: ['cp', '--force', '/tmp/a.json', 'oss://agc-dev/agc/global-version.json'],
|
||||
endpoint: 'oss-rg-china-mainland.aliyuncs.com',
|
||||
accessKeyId: 'id',
|
||||
accessKeySecret: 'secret',
|
||||
|
||||
@@ -1192,7 +1192,7 @@ async function main() {
|
||||
function isDirectModuleExecution() {
|
||||
return Boolean(
|
||||
process.argv[1] &&
|
||||
resolve(process.argv[1]) === fileURLToPath(import.meta.url),
|
||||
resolve(process.argv[1]) === fileURLToPath(import.meta.url),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -166,10 +166,10 @@ export function ActiveProjectRunsPanel({
|
||||
const elapsed = formatActiveTurnElapsed(turn.startedAt, now);
|
||||
const isCurrent = Boolean(
|
||||
currentProjectPath &&
|
||||
projectPathsMatchForInvalidation(
|
||||
turn.projectPath,
|
||||
currentProjectPath,
|
||||
),
|
||||
projectPathsMatchForInvalidation(
|
||||
turn.projectPath,
|
||||
currentProjectPath,
|
||||
),
|
||||
);
|
||||
return (
|
||||
<li key={`${turn.projectPath}:${turn.turnId}`}>
|
||||
@@ -215,10 +215,10 @@ export function ActiveProjectRunsPanel({
|
||||
const elapsed = formatActiveTurnElapsed(turn.startedAt, now);
|
||||
const isCurrent = Boolean(
|
||||
currentProjectPath &&
|
||||
projectPathsMatchForInvalidation(
|
||||
turn.projectPath,
|
||||
currentProjectPath,
|
||||
),
|
||||
projectPathsMatchForInvalidation(
|
||||
turn.projectPath,
|
||||
currentProjectPath,
|
||||
),
|
||||
);
|
||||
return (
|
||||
<li key={`${turn.projectPath}:${turn.turnId}`}>
|
||||
|
||||
+1
-3
@@ -4,6 +4,4 @@
|
||||
* 审批 / 提问请求与解决:本轮只透传,不并入聊天状态。
|
||||
*/
|
||||
export type DirectThreadRequestKind =
|
||||
| 'approval.requested'
|
||||
| 'ask.requested'
|
||||
| 'request.resolved';
|
||||
'approval.requested' | 'ask.requested' | 'request.resolved';
|
||||
|
||||
@@ -48,9 +48,9 @@ export function isResourceCanvasPanTarget(
|
||||
if (!isResourceCanvasInteractionTarget(target)) return true;
|
||||
return Boolean(
|
||||
target.closest('.game-resource-card') &&
|
||||
!target.closest(
|
||||
'button:not(.game-resource-card-select), [role="button"], input, textarea, select, a, audio, video',
|
||||
),
|
||||
!target.closest(
|
||||
'button:not(.game-resource-card-select), [role="button"], input, textarea, select, a, audio, video',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -40,9 +40,7 @@ export type ResourceCanvasGenerationPlaceholderPanel =
|
||||
* - `failed`:这次生成失败;占位留在画布上,点它可以用同一份输入与引用重试。
|
||||
*/
|
||||
export type ResourceCanvasGenerationPlaceholderStatus =
|
||||
| 'draft'
|
||||
| 'submitted'
|
||||
| 'failed';
|
||||
'draft' | 'submitted' | 'failed';
|
||||
|
||||
/**
|
||||
* 工具点击后先在当前栏目创建的临时占位卡。
|
||||
|
||||
@@ -78,12 +78,7 @@ const defaultRuntimeConfigDraft: GameCreatorAppConfig = {
|
||||
};
|
||||
|
||||
type RuntimeSettingsSection =
|
||||
| 'general'
|
||||
| 'workspace'
|
||||
| 'agents'
|
||||
| 'extensions'
|
||||
| 'advanced'
|
||||
| 'about';
|
||||
'general' | 'workspace' | 'agents' | 'extensions' | 'advanced' | 'about';
|
||||
|
||||
type RuntimeConfigToast = {
|
||||
tone: 'success' | 'error';
|
||||
|
||||
@@ -61,9 +61,8 @@ export function ResourceModelViewer({
|
||||
void (async () => {
|
||||
try {
|
||||
const THREE = await import('three');
|
||||
const { OrbitControls } = await import(
|
||||
'three/examples/jsm/controls/OrbitControls.js'
|
||||
);
|
||||
const { OrbitControls } =
|
||||
await import('three/examples/jsm/controls/OrbitControls.js');
|
||||
if (disposed) {
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-2
@@ -22,8 +22,7 @@ export type ResourceBatchTagTarget = {
|
||||
};
|
||||
|
||||
export type ResourceBatchTagTargetResolution =
|
||||
| { ok: true; assetIds: string[] }
|
||||
| { ok: false; reason: string };
|
||||
{ ok: true; assetIds: string[] } | { ok: false; reason: string };
|
||||
|
||||
export function resolveResourceBatchTagTargets(
|
||||
resources: readonly {
|
||||
|
||||
+4
-4
@@ -127,10 +127,10 @@ function validResourceCanvasCardSize(
|
||||
): size is ResourceCanvasCardSize {
|
||||
return Boolean(
|
||||
size &&
|
||||
Number.isFinite(size.width) &&
|
||||
Number.isFinite(size.height) &&
|
||||
size.width > 0 &&
|
||||
size.height > 0,
|
||||
Number.isFinite(size.width) &&
|
||||
Number.isFinite(size.height) &&
|
||||
size.width > 0 &&
|
||||
size.height > 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,14 +32,12 @@ export async function loadResourceModelObject(
|
||||
source: ResourceModelSource,
|
||||
): Promise<ThreeTypes.Object3D> {
|
||||
if (isResourceModelFbx(source)) {
|
||||
const { FBXLoader } = await import(
|
||||
'three/examples/jsm/loaders/FBXLoader.js'
|
||||
);
|
||||
const { FBXLoader } =
|
||||
await import('three/examples/jsm/loaders/FBXLoader.js');
|
||||
return new FBXLoader().loadAsync(source.sourceUrl);
|
||||
}
|
||||
const { GLTFLoader } = await import(
|
||||
'three/examples/jsm/loaders/GLTFLoader.js'
|
||||
);
|
||||
const { GLTFLoader } =
|
||||
await import('three/examples/jsm/loaders/GLTFLoader.js');
|
||||
const gltf = await new GLTFLoader().loadAsync(source.sourceUrl);
|
||||
if (!gltf.scene) {
|
||||
throw new Error('模型内容为空');
|
||||
@@ -106,8 +104,7 @@ export function disposeResourceModelObject(object: ThreeTypes.Object3D) {
|
||||
entry as unknown as Record<string, unknown>,
|
||||
)) {
|
||||
const texture = value as
|
||||
| { isTexture?: boolean; dispose?: () => void }
|
||||
| undefined;
|
||||
{ isTexture?: boolean; dispose?: () => void } | undefined;
|
||||
if (texture?.isTexture && typeof texture.dispose === 'function') {
|
||||
texture.dispose();
|
||||
}
|
||||
|
||||
+1
-3
@@ -439,9 +439,7 @@ function reconcileLayout(
|
||||
* 做,磁盘上仍是旧栏目取值的坐标不会因为 `section` 字面量不同而漏出整理范围。
|
||||
*/
|
||||
organizeSections:
|
||||
| readonly ProjectResourceCanvasCategory[]
|
||||
| null
|
||||
| undefined = undefined,
|
||||
readonly ProjectResourceCanvasCategory[] | null | undefined = undefined,
|
||||
) {
|
||||
// `undefined` = 不是整理;`null` = 整理全部栏目;否则按集合判定。
|
||||
const organizedSections =
|
||||
|
||||
@@ -605,11 +605,9 @@ function createProjectSupervisorRuntimeHarness({
|
||||
}) => void)
|
||||
| null = null;
|
||||
let designAgentUpdateHandler:
|
||||
| ((event: { payload: Record<string, unknown> }) => void)
|
||||
| null = null;
|
||||
((event: { payload: Record<string, unknown> }) => void) | null = null;
|
||||
let directThreadNotifyHandler:
|
||||
| ((event: { payload: { subscriptionId: string } }) => void)
|
||||
| null = null;
|
||||
((event: { payload: { subscriptionId: string } }) => void) | null = null;
|
||||
let directThreadSubscriptionId: string | null = null;
|
||||
let directThreadSubscriptionSequence = 0;
|
||||
// 未消费的运行态事件队列:`subscribe` 的 bootstrap 与 `consume` 都从这里取,
|
||||
|
||||
@@ -43,9 +43,8 @@ describe('AGC 客户端更新', () => {
|
||||
it('开发态开关关闭时不请求清单', async () => {
|
||||
vi.stubEnv('VITE_AGC_ENABLE_APP_UPDATE_CHECK', '0');
|
||||
vi.resetModules();
|
||||
const { checkForAppUpdate, resetAppUpdateCheckForTests } = await import(
|
||||
'../src/services/appUpdate'
|
||||
);
|
||||
const { checkForAppUpdate, resetAppUpdateCheckForTests } =
|
||||
await import('../src/services/appUpdate');
|
||||
|
||||
await expect(checkForAppUpdate()).resolves.toBeNull();
|
||||
expect(checkMock).not.toHaveBeenCalled();
|
||||
@@ -56,9 +55,8 @@ describe('AGC 客户端更新', () => {
|
||||
vi.stubEnv('VITE_AGC_ENABLE_APP_UPDATE_CHECK', '1');
|
||||
vi.resetModules();
|
||||
checkMock.mockResolvedValue(fakeUpdate() as never);
|
||||
const { checkForAppUpdate, resetAppUpdateCheckForTests } = await import(
|
||||
'../src/services/appUpdate'
|
||||
);
|
||||
const { checkForAppUpdate, resetAppUpdateCheckForTests } =
|
||||
await import('../src/services/appUpdate');
|
||||
|
||||
await expect(checkForAppUpdate()).resolves.toEqual({
|
||||
version: '99.0.0',
|
||||
@@ -74,9 +72,8 @@ describe('AGC 客户端更新', () => {
|
||||
vi.stubEnv('VITE_AGC_ENABLE_APP_UPDATE_CHECK', '1');
|
||||
vi.resetModules();
|
||||
checkMock.mockRejectedValue(new Error('updater: manifest 404'));
|
||||
const { checkForAppUpdate, resetAppUpdateCheckForTests } = await import(
|
||||
'../src/services/appUpdate'
|
||||
);
|
||||
const { checkForAppUpdate, resetAppUpdateCheckForTests } =
|
||||
await import('../src/services/appUpdate');
|
||||
|
||||
await expect(checkForAppUpdate()).resolves.toBeNull();
|
||||
resetAppUpdateCheckForTests();
|
||||
@@ -110,9 +107,8 @@ describe('AGC 客户端更新', () => {
|
||||
it('没有待安装更新时安装请求失败关闭', async () => {
|
||||
vi.stubEnv('VITE_AGC_ENABLE_APP_UPDATE_CHECK', '1');
|
||||
vi.resetModules();
|
||||
const { installAppUpdate, resetAppUpdateCheckForTests } = await import(
|
||||
'../src/services/appUpdate'
|
||||
);
|
||||
const { installAppUpdate, resetAppUpdateCheckForTests } =
|
||||
await import('../src/services/appUpdate');
|
||||
|
||||
await expect(installAppUpdate()).rejects.toThrow('没有可安装的更新');
|
||||
resetAppUpdateCheckForTests();
|
||||
|
||||
@@ -297,8 +297,7 @@ function renderReplacementWorkbench(options: RenderOptions = {}) {
|
||||
}
|
||||
if (command === 'update_local_project_resource_classification') {
|
||||
const input = args?.input as
|
||||
| { assetId?: string; category?: string; tags?: string[] }
|
||||
| undefined;
|
||||
{ assetId?: string; category?: string; tags?: string[] } | undefined;
|
||||
return {
|
||||
asset: {
|
||||
id: input?.assetId,
|
||||
|
||||
@@ -21,8 +21,7 @@ import {
|
||||
|
||||
const homeProjectOverride = vi.hoisted(() => ({
|
||||
openProject: null as
|
||||
| null
|
||||
| ((path: string, mode: 'open' | 'create') => Promise<void>),
|
||||
null | ((path: string, mode: 'open' | 'create') => Promise<void>),
|
||||
}));
|
||||
|
||||
vi.mock('../src/features/app-shell/useHomeProjectCreation', async () => {
|
||||
|
||||
@@ -1313,7 +1313,7 @@ export function ImageCanvasWorldView({
|
||||
{canvasGenerationDialogs.map((dialog) => {
|
||||
const hasGeneratedLayer = Boolean(
|
||||
dialog.generatedLayerId &&
|
||||
layers.some((layer) => layer.id === dialog.generatedLayerId),
|
||||
layers.some((layer) => layer.id === dialog.generatedLayerId),
|
||||
);
|
||||
return dialog.placeholder && !hasGeneratedLayer
|
||||
? (() => {
|
||||
|
||||
@@ -887,7 +887,7 @@ export async function fetchWithApiAuth(
|
||||
requestHeaders[REQUEST_ID_HEADER] = requestId;
|
||||
let hasAuthHeader = Boolean(
|
||||
requestHeaders.Authorization?.trim() ||
|
||||
requestHeaders.authorization?.trim(),
|
||||
requestHeaders.authorization?.trim(),
|
||||
);
|
||||
|
||||
if (
|
||||
@@ -903,7 +903,7 @@ export async function fetchWithApiAuth(
|
||||
requestHeaders[REQUEST_ID_HEADER] = requestId;
|
||||
hasAuthHeader = Boolean(
|
||||
requestHeaders.Authorization?.trim() ||
|
||||
requestHeaders.authorization?.trim(),
|
||||
requestHeaders.authorization?.trim(),
|
||||
);
|
||||
} catch (error) {
|
||||
if (requestSignal?.aborted) {
|
||||
|
||||
@@ -211,8 +211,7 @@ describe('editorProjectClient', () => {
|
||||
{ deadlineAt: expect.any(Number) },
|
||||
);
|
||||
const requestOptions = requestJsonMock.mock.calls[0]?.[3] as
|
||||
| { deadlineAt?: number }
|
||||
| undefined;
|
||||
{ deadlineAt?: number } | undefined;
|
||||
expect(requestOptions?.deadlineAt).toBeGreaterThanOrEqual(
|
||||
startedAt + 60_000,
|
||||
);
|
||||
|
||||
@@ -219,9 +219,7 @@ export type EditorAssetGenerationInputs = {
|
||||
};
|
||||
|
||||
export type EditorProjectResourceSourceType =
|
||||
| 'uploaded'
|
||||
| 'generated'
|
||||
| 'mock_generated';
|
||||
'uploaded' | 'generated' | 'mock_generated';
|
||||
|
||||
export type EditorProjectResourceSnapshot = {
|
||||
resourceId: string;
|
||||
@@ -330,11 +328,7 @@ export type EditorImageGenerationInput = {
|
||||
prompt: string;
|
||||
size?: string;
|
||||
kind?:
|
||||
| 'spec'
|
||||
| 'character'
|
||||
| 'quick-edit'
|
||||
| 'ui-design'
|
||||
| 'publication-material';
|
||||
'spec' | 'character' | 'quick-edit' | 'ui-design' | 'publication-material';
|
||||
model?: string;
|
||||
screenColor?: string;
|
||||
segModel?: string;
|
||||
@@ -544,12 +538,7 @@ export type EditorIconSpritesheetSliceResult = {
|
||||
export type EditorCharacterAnimationResolution = '480p' | '720p';
|
||||
|
||||
export type EditorCharacterAnimationRatio =
|
||||
| 'same'
|
||||
| '1:1'
|
||||
| '4:3'
|
||||
| '16:9'
|
||||
| '9:16'
|
||||
| '3:4';
|
||||
'same' | '1:1' | '4:3' | '16:9' | '9:16' | '3:4';
|
||||
|
||||
export type EditorCharacterAnimationFrameCount = 32 | 40 | 48;
|
||||
|
||||
@@ -611,12 +600,7 @@ export type EditorVideoModel =
|
||||
export type EditorVideoResolution = '480p' | '720p' | '1080p';
|
||||
export type EditorVideoSoundMode = 'on' | 'off';
|
||||
export type EditorVideoAspectRatio =
|
||||
| '16:9'
|
||||
| '9:16'
|
||||
| '1:1'
|
||||
| '4:3'
|
||||
| '3:4'
|
||||
| '21:9';
|
||||
'16:9' | '9:16' | '1:1' | '4:3' | '3:4' | '21:9';
|
||||
|
||||
export type EditorVideoGenerationInput = {
|
||||
prompt: string;
|
||||
|
||||
Reference in New Issue
Block a user