修复:生成绑定校验不再用 prettier 改写生成文件
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m54s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m36s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 4m44s
Project CI / Backend tests (pull_request) Successful in 5m46s
Project CI / Frontend tests (pull_request) Successful in 2m50s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m41s
Project CI / Native shell tests (pull_request) Successful in 6m39s
Project CI / Repository checks (pull_request) Successful in 6m12s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m54s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m36s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 4m44s
Project CI / Backend tests (pull_request) Successful in 5m46s
Project CI / Frontend tests (pull_request) Successful in 2m50s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m41s
Project CI / Native shell tests (pull_request) Successful in 6m39s
Project CI / Repository checks (pull_request) Successful in 6m12s
- scripts/check-generated-bindings.mjs:删掉生成后的 prettier 归一化,直接逐字节比较 ts-rs 原始输出 - .prettierignore 与 .eslintrc.cjs:四个 ts-rs 生成目录统一排除,禁止格式化工具二次改写 - .prettierrc.json:删除 contracts/generated 的 printWidth / singleQuote 覆盖 - .gitattributes:生成目录标 linguist-generated 并豁免 trailing-space,保证 git diff --check 通过 - 重新生成 AGC chat/generated 与 services/generated 的 51 个绑定,改为提交 ts-rs 原始输出(纯格式,语义不变) - docs/project-memory:记录生成绑定不再经 prettier 的口径,修正旧流程说明
This commit is contained in:
@@ -164,6 +164,10 @@ module.exports = {
|
||||
'server-rs/target-*',
|
||||
'apps/desktop-shell/src-tauri/target',
|
||||
'apps/ai-game-creator-shell/src/features/ui-editor/types/**',
|
||||
// ts-rs 生成绑定:不接受 eslint --fix 二次改写,必须与原始输出逐字节一致
|
||||
'packages/shared/src/contracts/generated/**',
|
||||
'apps/ai-game-creator-shell/src/view/project-development/chat/generated/**',
|
||||
'apps/ai-game-creator-shell/src/services/generated/**',
|
||||
'apps/ai-game-creator-shell/src/features/project-workspace/generated/**',
|
||||
'target',
|
||||
'src/main.tsx',
|
||||
|
||||
+7
-2
@@ -24,5 +24,10 @@
|
||||
*.anim text
|
||||
*.controller text
|
||||
|
||||
# Rust ts-rs 生成的共享契约:保留在仓库中供 TS 消费,但不作为手写源文件统计。
|
||||
packages/shared/src/contracts/generated/** linguist-generated=true
|
||||
# ts-rs 生成绑定:保留在仓库中供 TS 消费,但不作为手写源文件统计。
|
||||
# ts-rs 原始输出在多行对象 / 枚举变体后带行尾空格,生成目录统一豁免行尾空白检查;
|
||||
# 一致性由 `npm run check:generated-bindings` 逐字节比对原始输出来保证。
|
||||
packages/shared/src/contracts/generated/** linguist-generated=true whitespace=-trailing-space
|
||||
apps/ai-game-creator-shell/src/features/ui-editor/types/** linguist-generated=true whitespace=-trailing-space
|
||||
apps/ai-game-creator-shell/src/view/project-development/chat/generated/** linguist-generated=true whitespace=-trailing-space
|
||||
apps/ai-game-creator-shell/src/services/generated/** linguist-generated=true whitespace=-trailing-space
|
||||
|
||||
@@ -3,7 +3,11 @@ node_modules
|
||||
.git
|
||||
.codex-logs
|
||||
public/Icons
|
||||
# ts-rs 生成绑定:一律以原始输出提交,禁止 prettier 二次改写
|
||||
packages/shared/src/contracts/generated/
|
||||
apps/ai-game-creator-shell/src/features/ui-editor/types/
|
||||
apps/ai-game-creator-shell/src/view/project-development/chat/generated/
|
||||
apps/ai-game-creator-shell/src/services/generated/
|
||||
apps/ai-game-creator-shell/src-tauri/resources/agc-skills/
|
||||
media
|
||||
*.log
|
||||
|
||||
+1
-10
@@ -1,14 +1,5 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"semi": true,
|
||||
"trailingComma": "all",
|
||||
"overrides": [
|
||||
{
|
||||
"files": "packages/shared/src/contracts/generated/**/*.ts",
|
||||
"options": {
|
||||
"printWidth": 1000,
|
||||
"singleQuote": false
|
||||
}
|
||||
}
|
||||
]
|
||||
"trailingComma": "all"
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
/**
|
||||
* 认证网络客户端构建失败的原始错误明细。
|
||||
*/
|
||||
export type AuthClientInitFailed = { detail: string };
|
||||
export type AuthClientInitFailed = { detail: string, };
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { AuthNetworkReason } from './AuthNetworkReason';
|
||||
import type { AuthNetworkReason } from "./AuthNetworkReason";
|
||||
|
||||
/**
|
||||
* 连接登录服务的传输层失败原因。
|
||||
*/
|
||||
export type AuthNetworkFailure = { reason: AuthNetworkReason };
|
||||
export type AuthNetworkFailure = { reason: AuthNetworkReason, };
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
/**
|
||||
* 连接登录服务失败的具体原因。
|
||||
*/
|
||||
export type AuthNetworkReason = 'timeout' | 'unreachable';
|
||||
export type AuthNetworkReason = "timeout" | "unreachable";
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { AuthResponseInvalidReason } from './AuthResponseInvalidReason';
|
||||
import type { AuthResponseInvalidReason } from "./AuthResponseInvalidReason";
|
||||
|
||||
/**
|
||||
* 登录响应契约破损的原因与服务端原文。
|
||||
*/
|
||||
export type AuthResponseInvalid = {
|
||||
reason: AuthResponseInvalidReason;
|
||||
/**
|
||||
* 只有 `serverRejected` 可能带服务端原文;其余是 `null`。
|
||||
*/
|
||||
serverMessage: string | null;
|
||||
};
|
||||
export type AuthResponseInvalid = { reason: AuthResponseInvalidReason,
|
||||
/**
|
||||
* 只有 `serverRejected` 可能带服务端原文;其余是 `null`。
|
||||
*/
|
||||
serverMessage: string | null, };
|
||||
|
||||
+1
-6
@@ -3,9 +3,4 @@
|
||||
/**
|
||||
* 登录响应契约破损的具体原因。
|
||||
*/
|
||||
export type AuthResponseInvalidReason =
|
||||
| 'notJson'
|
||||
| 'invalidBody'
|
||||
| 'missingRefreshCookie'
|
||||
| 'missingUserIdentity'
|
||||
| 'serverRejected';
|
||||
export type AuthResponseInvalidReason = "notJson" | "invalidBody" | "missingRefreshCookie" | "missingUserIdentity" | "serverRejected";
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@
|
||||
/**
|
||||
* 登录服务 5xx 的状态码。
|
||||
*/
|
||||
export type AuthServiceUnavailable = { status: number };
|
||||
export type AuthServiceUnavailable = { status: number, };
|
||||
|
||||
@@ -1,35 +1,17 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { AuthClientInitFailed } from './AuthClientInitFailed';
|
||||
import type { AuthNetworkFailure } from './AuthNetworkFailure';
|
||||
import type { AuthResponseInvalid } from './AuthResponseInvalid';
|
||||
import type { AuthServiceUnavailable } from './AuthServiceUnavailable';
|
||||
import type { ClientSessionPersistFailed } from './ClientSessionPersistFailed';
|
||||
import type { PasswordLoginRejected } from './PasswordLoginRejected';
|
||||
import type { PhoneCodeLoginRejected } from './PhoneCodeLoginRejected';
|
||||
import type { RuntimeSessionInstallFailed } from './RuntimeSessionInstallFailed';
|
||||
import type { SendCodeRejected } from './SendCodeRejected';
|
||||
import type { ServerAddressRejected } from './ServerAddressRejected';
|
||||
import type { UnexpectedRejection } from './UnexpectedRejection';
|
||||
import type { AuthClientInitFailed } from "./AuthClientInitFailed";
|
||||
import type { AuthNetworkFailure } from "./AuthNetworkFailure";
|
||||
import type { AuthResponseInvalid } from "./AuthResponseInvalid";
|
||||
import type { AuthServiceUnavailable } from "./AuthServiceUnavailable";
|
||||
import type { ClientSessionPersistFailed } from "./ClientSessionPersistFailed";
|
||||
import type { PasswordLoginRejected } from "./PasswordLoginRejected";
|
||||
import type { PhoneCodeLoginRejected } from "./PhoneCodeLoginRejected";
|
||||
import type { RuntimeSessionInstallFailed } from "./RuntimeSessionInstallFailed";
|
||||
import type { SendCodeRejected } from "./SendCodeRejected";
|
||||
import type { ServerAddressRejected } from "./ServerAddressRejected";
|
||||
import type { UnexpectedRejection } from "./UnexpectedRejection";
|
||||
|
||||
/**
|
||||
* 变体名就是线上的分流键(`type`),带载荷的变体持有同名载荷类型。
|
||||
*/
|
||||
export type ClientAuthError =
|
||||
| ({ type: 'serverAddressRejected' } & ServerAddressRejected)
|
||||
| { type: 'phoneNumberInvalid' }
|
||||
| { type: 'passwordMissing' }
|
||||
| { type: 'loginCodeMissing' }
|
||||
| ({ type: 'passwordLoginRejected' } & PasswordLoginRejected)
|
||||
| { type: 'phoneOrPasswordMismatch' }
|
||||
| ({ type: 'sendCodeRejected' } & SendCodeRejected)
|
||||
| { type: 'smsCodeThrottled' }
|
||||
| ({ type: 'phoneCodeLoginRejected' } & PhoneCodeLoginRejected)
|
||||
| { type: 'sessionInvalidated' }
|
||||
| { type: 'permissionDenied' }
|
||||
| ({ type: 'authNetworkFailure' } & AuthNetworkFailure)
|
||||
| ({ type: 'authServiceUnavailable' } & AuthServiceUnavailable)
|
||||
| ({ type: 'unexpectedRejection' } & UnexpectedRejection)
|
||||
| ({ type: 'authResponseInvalid' } & AuthResponseInvalid)
|
||||
| ({ type: 'clientSessionPersistFailed' } & ClientSessionPersistFailed)
|
||||
| ({ type: 'runtimeSessionInstallFailed' } & RuntimeSessionInstallFailed)
|
||||
| ({ type: 'authClientInitFailed' } & AuthClientInitFailed);
|
||||
export type ClientAuthError = { "type": "serverAddressRejected" } & ServerAddressRejected | { "type": "phoneNumberInvalid" } | { "type": "passwordMissing" } | { "type": "loginCodeMissing" } | { "type": "passwordLoginRejected" } & PasswordLoginRejected | { "type": "phoneOrPasswordMismatch" } | { "type": "sendCodeRejected" } & SendCodeRejected | { "type": "smsCodeThrottled" } | { "type": "phoneCodeLoginRejected" } & PhoneCodeLoginRejected | { "type": "sessionInvalidated" } | { "type": "permissionDenied" } | { "type": "authNetworkFailure" } & AuthNetworkFailure | { "type": "authServiceUnavailable" } & AuthServiceUnavailable | { "type": "unexpectedRejection" } & UnexpectedRejection | { "type": "authResponseInvalid" } & AuthResponseInvalid | { "type": "clientSessionPersistFailed" } & ClientSessionPersistFailed | { "type": "runtimeSessionInstallFailed" } & RuntimeSessionInstallFailed | { "type": "authClientInitFailed" } & AuthClientInitFailed;
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@
|
||||
/**
|
||||
* 本机凭据文件读写的原始错误明细。
|
||||
*/
|
||||
export type ClientSessionPersistFailed = { detail: string };
|
||||
export type ClientSessionPersistFailed = { detail: string, };
|
||||
|
||||
+5
-6
@@ -3,9 +3,8 @@
|
||||
/**
|
||||
* `/api/auth/entry` 返回 400 时服务端给的原文。
|
||||
*/
|
||||
export type PasswordLoginRejected = {
|
||||
/**
|
||||
* 服务端原文可能缺失:缺失是 `null`,Rust 不编造兜底文案。
|
||||
*/
|
||||
serverMessage: string | null;
|
||||
};
|
||||
export type PasswordLoginRejected = {
|
||||
/**
|
||||
* 服务端原文可能缺失:缺失是 `null`,Rust 不编造兜底文案。
|
||||
*/
|
||||
serverMessage: string | null, };
|
||||
|
||||
+5
-6
@@ -3,9 +3,8 @@
|
||||
/**
|
||||
* `/api/auth/phone/login` 返回 400 时服务端给的原文。
|
||||
*/
|
||||
export type PhoneCodeLoginRejected = {
|
||||
/**
|
||||
* 服务端原文可能缺失:缺失是 `null`,Rust 不编造兜底文案。
|
||||
*/
|
||||
serverMessage: string | null;
|
||||
};
|
||||
export type PhoneCodeLoginRejected = {
|
||||
/**
|
||||
* 服务端原文可能缺失:缺失是 `null`,Rust 不编造兜底文案。
|
||||
*/
|
||||
serverMessage: string | null, };
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@
|
||||
/**
|
||||
* 本机运行时会话安装 / 清理的原始错误明细。
|
||||
*/
|
||||
export type RuntimeSessionInstallFailed = { detail: string };
|
||||
export type RuntimeSessionInstallFailed = { detail: string, };
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
/**
|
||||
* `/api/auth/phone/send-code` 返回 400 时服务端给的原文。
|
||||
*/
|
||||
export type SendCodeRejected = {
|
||||
/**
|
||||
* 服务端原文可能缺失:缺失是 `null`,Rust 不编造兜底文案。
|
||||
*/
|
||||
serverMessage: string | null;
|
||||
};
|
||||
export type SendCodeRejected = {
|
||||
/**
|
||||
* 服务端原文可能缺失:缺失是 `null`,Rust 不编造兜底文案。
|
||||
*/
|
||||
serverMessage: string | null, };
|
||||
|
||||
@@ -3,11 +3,4 @@
|
||||
/**
|
||||
* 服务地址校验失败的具体原因。
|
||||
*/
|
||||
export type ServerAddressReason =
|
||||
| 'emptyOrTooLong'
|
||||
| 'notAUrl'
|
||||
| 'hasCredentials'
|
||||
| 'hasPathOrQueryOrFragment'
|
||||
| 'notHttps'
|
||||
| 'unsupportedScheme'
|
||||
| 'outsideChannel';
|
||||
export type ServerAddressReason = "emptyOrTooLong" | "notAUrl" | "hasCredentials" | "hasPathOrQueryOrFragment" | "notHttps" | "unsupportedScheme" | "outsideChannel";
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { ServerAddressReason } from './ServerAddressReason';
|
||||
import type { ServerAddressReason } from "./ServerAddressReason";
|
||||
|
||||
/**
|
||||
* 服务地址被拒的具体原因。
|
||||
*/
|
||||
export type ServerAddressRejected = { reason: ServerAddressReason };
|
||||
export type ServerAddressRejected = { reason: ServerAddressReason, };
|
||||
|
||||
@@ -3,7 +3,4 @@
|
||||
/**
|
||||
* 其它未识别拒绝的状态码与服务端原文。
|
||||
*/
|
||||
export type UnexpectedRejection = {
|
||||
status: number;
|
||||
serverMessage: string | null;
|
||||
};
|
||||
export type UnexpectedRejection = { status: number, serverMessage: string | null, };
|
||||
|
||||
Generated
+1
-1
@@ -3,4 +3,4 @@
|
||||
/**
|
||||
* `clientTurnId` 的长度约束:上下限随载荷带出去,界面不自己数一份。
|
||||
*/
|
||||
export type ClientTurnIdMalformed = { minChars: number; maxChars: number };
|
||||
export type ClientTurnIdMalformed = { minChars: number, maxChars: number, };
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { ThreadEvent } from './ThreadEvent';
|
||||
import type { ThreadEvent } from "./ThreadEvent";
|
||||
|
||||
export type ConsumeResult = { events: Array<ThreadEvent> };
|
||||
export type ConsumeResult = { events: Array<ThreadEvent>, };
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@
|
||||
*
|
||||
* 跟着入队失败 / 回合失败载荷一起给前端,界面不靠文案区分这两条。
|
||||
*/
|
||||
export type Deadline = 'response-idle' | 'turn-hard-limit';
|
||||
export type Deadline = "response-idle" | "turn-hard-limit";
|
||||
|
||||
+7
-16
@@ -1,10 +1,10 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { ClientTurnIdMalformed } from './ClientTurnIdMalformed';
|
||||
import type { EnvironmentNotReady } from './EnvironmentNotReady';
|
||||
import type { HostStateUnavailable } from './HostStateUnavailable';
|
||||
import type { InputRejected } from './InputRejected';
|
||||
import type { PermissionRejected } from './PermissionRejected';
|
||||
import type { QueueFull } from './QueueFull';
|
||||
import type { ClientTurnIdMalformed } from "./ClientTurnIdMalformed";
|
||||
import type { EnvironmentNotReady } from "./EnvironmentNotReady";
|
||||
import type { HostStateUnavailable } from "./HostStateUnavailable";
|
||||
import type { InputRejected } from "./InputRejected";
|
||||
import type { PermissionRejected } from "./PermissionRejected";
|
||||
import type { QueueFull } from "./QueueFull";
|
||||
|
||||
/**
|
||||
* 命令边界的 typed 入队失败:变体名就是线上的分流键(`type`),前端只按它选通道,不解析文案。
|
||||
@@ -13,13 +13,4 @@ import type { QueueFull } from './QueueFull';
|
||||
* `clientTurnId` 校验 → 工作流恢复 → 用户条目冻结 → 前置条件 → 容量预判 → 工程准备 → 入队。
|
||||
* 放行之后发生的失败不在这张表里(见 [`TurnError`])。
|
||||
*/
|
||||
export type EnqueueError =
|
||||
| { type: 'clientTurnIdMissing' }
|
||||
| ({ type: 'clientTurnIdMalformed' } & ClientTurnIdMalformed)
|
||||
| ({ type: 'queueFull' } & QueueFull)
|
||||
| { type: 'projectRootUnusable' }
|
||||
| ({ type: 'permissionRejected' } & PermissionRejected)
|
||||
| ({ type: 'inputRejected' } & InputRejected)
|
||||
| { type: 'contentEmpty' }
|
||||
| ({ type: 'environmentNotReady' } & EnvironmentNotReady)
|
||||
| ({ type: 'hostStateUnavailable' } & HostStateUnavailable);
|
||||
export type EnqueueError = { "type": "clientTurnIdMissing" } | { "type": "clientTurnIdMalformed" } & ClientTurnIdMalformed | { "type": "queueFull" } & QueueFull | { "type": "projectRootUnusable" } | { "type": "permissionRejected" } & PermissionRejected | { "type": "inputRejected" } & InputRejected | { "type": "contentEmpty" } | { "type": "environmentNotReady" } & EnvironmentNotReady | { "type": "hostStateUnavailable" } & HostStateUnavailable;
|
||||
|
||||
Generated
+1
-1
@@ -5,4 +5,4 @@
|
||||
*
|
||||
* **两张表共用**:入队侧是入队失败,回合侧是回合失败。
|
||||
*/
|
||||
export type EnvironmentNotReady = { detail: string };
|
||||
export type EnvironmentNotReady = { detail: string, };
|
||||
|
||||
+1
-5
@@ -5,8 +5,4 @@
|
||||
*
|
||||
* 线上取值跟着入队失败 / 回合失败载荷一起给前端(`art-preparation` 这类),所以也要导出。
|
||||
*/
|
||||
export type FailureStage =
|
||||
| 'art-preparation'
|
||||
| 'code-generation'
|
||||
| 'browser-validation'
|
||||
| 'version-registration';
|
||||
export type FailureStage = "art-preparation" | "code-generation" | "browser-validation" | "version-registration";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user