# ── 换行符治理（v2.0.26）──────────────────────────────────────────────
#
# 背景：开发机 core.autocrlf=true（git 默认在 Windows 上如此），
#       而本仓库此前**没有任何 .gitattributes**，换行符完全靠运气。
#
# 后果（已实测复现）：`git checkout-index` 模拟一次全新检出后，
#       site/install.sh 从 0 个 CRLF 变成 **542 个 CRLF**，首行成了 `#!/bin/bash\r`。
#       而 site/install.sh 会被 pack-release.ps1 打进 tarball 分发给 Linux 用户 ——
#       CRLF 的 shell 脚本在 Linux 上直接 "bad interpreter: /bin/bash^M" 或语法错误，
#       等于安装器全盘失效。macOS 同样中招。
#
# 处理：显式钉死关键文件的换行符，不再依赖使用者本地的 git 配置。

# ── POSIX shell：必须 LF（跨平台分发，错误会直接让安装器失效）──
*.sh            text eol=lf
*.bash          text eol=lf

# ── Windows 侧：保持 CRLF ──
*.ps1           text eol=crlf
*.bat           text eol=crlf
*.cmd           text eol=crlf

# ── 源码：统一 LF（v2.0.27 补充）────────────────────────────────────
# 为什么要补：src/ 下的 .ts 文件此前没有任何 .gitattributes 覆盖，
#   换行符取决于「谁在哪台机器上改的」。src/storage/db.ts 一度显示
#   **4446 行变更**（其中 4403 行是纯行尾符差异，真实改动只有 54 行）
#   —— 假 diff 会淹没真实改动，review 形同虚设。
src/**/*.ts     text eol=lf
src/**/*.tsx    text eol=lf
src/**/*.js     text eol=lf
src/**/*.mjs    text eol=lf
src/**/*.cjs    text eol=lf
src/**/*.mts    text eol=lf
src/**/*.json   text eol=lf
scripts/**      text eol=lf
index.ts        text eol=lf
README.md       text eol=lf
*.md            text eol=lf

# ── 历史遗留 CRLF 文件：显式豁免（v2.0.27）──────────────────────────
# 这些文件在入库时就是 CRLF，git 一度把它们当作 binary（-text）而不做
# 规范化。若不豁免，新规则会触发一次性全文件重写，产生上萬行纯行尾符
# 假 diff（web/js/i18n.js 一个文件就是 10224 行），完全淹没真实改动。
#
# 策略：**豁免现状，但从下一次真正修改起自动收敛为 LF**。
# 等这些文件因为业务需要被改动时，规则会把新内容写成 LF，
# 届时再单独做一次规范化提交即可。
src/routes/lan.ts      -text
src/routes/subagents.ts -text
web/js/i18n.js         -text

# ── 二进制：不做行尾符转换 ──
*.png           binary
*.jpg           binary
*.jpeg          binary
*.gif           binary
*.ico           binary
*.zip           binary
*.gz            binary
*.tar           binary
*.pdf           binary
*.db            binary
*.wasm          binary

# [FEATURE_MARKET] exclude marketplace from generated archives / tarballs
src/routes/market.ts            export-ignore
src/routes/mvp-market.ts        export-ignore
src/routes/wallet.ts            export-ignore
src/core/mvp-market/**          export-ignore
src/storage/migrations/mvp-market-schema.ts export-ignore
src/tests/mvp-*.test.ts         export-ignore
web/market.html                 export-ignore
web/market.js                   export-ignore
web/market.css                  export-ignore
web/js/market.js                export-ignore
web/css/market.css              export-ignore
skills/ai-market-integration.json   export-ignore
skills/existing-repo-mvp-execution.json export-ignore
skills/marketplace-payment-*.json    export-ignore
src/skills/ai-market-integration.json export-ignore
