Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
62d2c57
feat: 添加递归合并功能和判断普通对象的方法
VirgilClyne Feb 1, 2026
5f4a7f2
fix: 使用 lodash 的 merge 方法合并数据库设置
VirgilClyne Feb 1, 2026
c06ad64
feat: 更新测试脚本并添加合并功能的单元测试
VirgilClyne Feb 1, 2026
4d10660
feat: 添加空数组处理逻辑,确保不覆盖已有值并更新相关单元测试
VirgilClyne Feb 1, 2026
7ac356a
feat: 添加对 Map 和 Set 的合并处理逻辑,确保空 Map/Set 不覆盖已有值并更新相关单元测试
VirgilClyne Feb 1, 2026
130c4d6
feat: 更新合并测试文件,添加 Lodash.merge 的完整测试用例
VirgilClyne Feb 1, 2026
8958491
feat: 更新 NPM 发布工作流,调整 Node.js 版本并优化构建步骤
VirgilClyne Feb 1, 2026
ec16fe7
feat: 优化 getStorage 函数,使用 _.merge 替代对象展开以合并设置和缓存
VirgilClyne Feb 1, 2026
10b38fc
feat: 移动 Argument 处理逻辑到 getStorage 函数的末尾
VirgilClyne Feb 1, 2026
c3232b1
feat: 优化 getStorage 函数,重构参数处理和合并逻辑,增强代码可读性
VirgilClyne Feb 1, 2026
096204e
feat: 添加 LogLevel 支持,允许从参数和 BoxJs 中设置日志级别
VirgilClyne Feb 1, 2026
c358f1e
fiX: 修复 getStorage 函数的 names 参数处理逻辑
VirgilClyne Feb 1, 2026
70123a3
feat: 在 getStorage 函数中添加对 LogLevel 的支持,确保日志级别正确设置
VirgilClyne Feb 1, 2026
ec7b4b8
feat: 更新 package.json,添加 deprecate 脚本并修正 repository URL 格式
VirgilClyne Feb 2, 2026
3d23ec0
chore: plan argument module extraction
Copilot Feb 12, 2026
538ba68
refactor: extract argument handler
Copilot Feb 12, 2026
96f6dd1
test: cover argument edge cases
Copilot Feb 12, 2026
fa54b09
refactor: make argument a computed property
Copilot Feb 12, 2026
15ee911
test: stabilize argument parsing
Copilot Feb 12, 2026
76b5abc
chore: simplify argument parsing
Copilot Feb 12, 2026
17848c7
test: harden argument imports
Copilot Feb 12, 2026
6e6da14
test: clarify argument helper
Copilot Feb 12, 2026
925b12d
style: fix argument indentation
Copilot Feb 12, 2026
66298d4
test: assert argument side effects
Copilot Feb 12, 2026
75f5768
test: clarify argument handling
Copilot Feb 12, 2026
cabaff8
test: cover object argument path
Copilot Feb 12, 2026
ca52bda
test: cover quoted argument values
Copilot Feb 12, 2026
241f653
refactor: mutate $argument in parser
Copilot Feb 12, 2026
f859d29
chore: align $argument logging
Copilot Feb 12, 2026
48429a5
chore: simplify $argument logging
Copilot Feb 12, 2026
200441e
refactor: auto-run argument parsing
Copilot Feb 12, 2026
28f6c61
refactor: restore switch parsing for $argument
Copilot Feb 13, 2026
99ec58b
style: clarify switch fallthrough
Copilot Feb 13, 2026
b6574bc
style: streamline switch comments
Copilot Feb 13, 2026
31b2135
style: clarify switch fallthrough intent
Copilot Feb 13, 2026
83d757c
style: restore undefined case in switch
Copilot Feb 13, 2026
e7e2c03
refactor: align switch with argument object
Copilot Feb 13, 2026
407741f
fix: build argument from source object
Copilot Feb 13, 2026
87c68c5
refactor: build argument via switch flow
Copilot Feb 13, 2026
f75a672
fix: avoid mutating $argument in string case
Copilot Feb 13, 2026
fb93ead
chore: guard argument log level
Copilot Feb 13, 2026
4cc019f
fix: use parsed source for argument build
Copilot Feb 13, 2026
30056d5
style: make undefined handling explicit
Copilot Feb 13, 2026
fd05869
refactor: derive source from argument
Copilot Feb 13, 2026
a492b18
refactor: simplify argument source selection
Copilot Feb 13, 2026
98d0ef7
refactor: track string argument fallthrough
Copilot Feb 13, 2026
6782341
refactor: remove string flag from argument parsing
Copilot Feb 13, 2026
ea9971a
style: match switch comment format
Copilot Feb 13, 2026
37c4780
refactor: match switch snippet behavior
Copilot Feb 13, 2026
89c9cfc
fix(argument): 修复对象参数处理逻辑
VirgilClyne Feb 13, 2026
5c5f1f3
docs: 完善 README 与 JSDoc 注释说明
VirgilClyne Feb 13, 2026
b817c07
docs: 完善 polyfill 文档说明与引用链接
VirgilClyne Feb 13, 2026
ce7c81a
docs: 优化安装与更新指引面向新手
VirgilClyne Feb 13, 2026
b0a1bd9
feat: 从入口导出 并更新文档与测试
VirgilClyne Feb 13, 2026
4105cf2
refactor: 移除 getStorage 默认导出并补充使用边界说明
VirgilClyne Feb 13, 2026
0ee3081
docs(lodash): 补充 README 与 JSDoc 的中英文档链接说明
VirgilClyne Feb 14, 2026
c475e76
fix(argument): normalize globalThis.$argument and guard null
VirgilClyne Feb 19, 2026
3a1c8bb
fix(getStorage): 修复合并逻辑以包含 $argument 并添加条件检查
VirgilClyne Feb 19, 2026
570a75c
refactor(getStorage): 重命名变量 Store 为 Root 并更新调试信息
VirgilClyne Feb 19, 2026
8a59892
fix(getStorage): 根据 $argument.Storage 的值调整合并逻辑以支持不同的配置来源
VirgilClyne Feb 19, 2026
5fa69e4
fix(getStorage): 更新合并逻辑以使用 PersistentStore 替代 BoxJs
VirgilClyne Feb 19, 2026
23ebecb
fix(Storage): 在 Surge 平台中添加对 null 值的写入支持
VirgilClyne Feb 19, 2026
76a3dc1
docs(changelog): add bilingual changelog for v2.1.2
VirgilClyne Feb 19, 2026
6bccb00
docs(getStorage): clarify Settings/Configs/Caches merge; update JSDoc…
VirgilClyne Feb 19, 2026
99869a0
fix(getStorage): treat undefined .Storage as PersistentStore; update …
VirgilClyne Feb 19, 2026
45f5cd8
fix(getStorage): accept lowercase 'boxjs' alias; docs
VirgilClyne Feb 20, 2026
5a5994a
docs: update changelog order and reflect export change
VirgilClyne Feb 20, 2026
d0c2997
chore(types): add local declarations for @nsnanocat/util
VirgilClyne Feb 20, 2026
47de721
fix(Storage): 完善 Node.js 环境下 emoveItem 和 clear 方法
Yuheng0101 Feb 24, 2026
ccd91f3
feat(getStorage): export helper helpers with types and docs
VirgilClyne Feb 24, 2026
4628920
refactor(getStorage): rename value2array and switch-based parsing
VirgilClyne Feb 24, 2026
0a865d7
docs(changelog): add 2.1.6 release notes
VirgilClyne Feb 24, 2026
baaad00
fix(fetch): 优化 Node.js 环境下的 fetch 处理逻辑
001ProMax Mar 4, 2026
a8e246b
fix(fetch): 兼容 Workers 和 Vercel
001ProMax Mar 4, 2026
1c4fa1c
fix(fetch): 添加 fetch 存在性检查以避免错误
001ProMax Mar 4, 2026
5103305
fix(fetch): 优化fetch
001ProMax Mar 4, 2026
b974c7a
refactor(app): 重构平台识别并同步类型文档与测试
VirgilClyne Mar 5, 2026
03f9a19
fix(fetch): 在 Node.js 环境中优化 fetch 实现并添加 Cookie 支持
VirgilClyne Mar 5, 2026
f305091
fix(fetch): 使用 globalThis.fetch 替代 fetch 以确保兼容性
VirgilClyne Mar 5, 2026
93508a0
fix(fetch): 为 Quantumult X 添加超时参数转换支持
VirgilClyne Mar 5, 2026
3283f2d
fix(fetch): 使用 globalThis 访问 $httpClient 和 $task 以确保兼容性
VirgilClyne Mar 5, 2026
779a1c1
fix(fetch): 在 Node.js 环境中根据 auto-cookie 选项动态添加 Cookie 支持
VirgilClyne Mar 5, 2026
c56dc65
fix(fetch): 修复 fetch-cookie 的导入方式以确保兼容性
VirgilClyne Mar 6, 2026
3433b58
fix(fetch): 默认请求超时时间为 5 秒并智能矫正用户输入的秒或毫秒
VirgilClyne Mar 6, 2026
e774cd8
docs: 更新 2.2.0 版本日志与文档说明
VirgilClyne Mar 6, 2026
4a395b7
fix(deps): 添加 @biomejs/biome 依赖并更新 pnpm 锁定文件
VirgilClyne Mar 7, 2026
01e8422
fix(biome): 更新 schema 版本并调整文件包含规则
VirgilClyne Mar 7, 2026
d34cb5e
fix(fetch): 增加对特定平台的超时参数处理,确保毫秒级超时兼容性
VirgilClyne Mar 7, 2026
461829b
docs(changelog): add 2.2.1 entry
VirgilClyne Mar 7, 2026
4a55c1f
fix(deps): 更新 @biomejs/biome 和 typescript 依赖版本,移除 pnpm-lock.yaml 文件
VirgilClyne Mar 8, 2026
0248eb9
feat(ci): 添加 npm 发布流程,支持根据版本标签发布
VirgilClyne Mar 9, 2026
c4935d2
feat(runtime): 增加 Worker 运行时支持并同步 2.2.4 文档
VirgilClyne Mar 13, 2026
53ef5a7
fix(fetch): 简化 Node.js 中对 fetch 的条件判断
VirgilClyne Mar 13, 2026
ae4fe35
feat(kv): 新增 Cloudflare Workers KV 异步适配器
VirgilClyne Mar 13, 2026
c7a240d
refactor(types): 拆分声明文件结构
VirgilClyne Mar 13, 2026
61c223b
refactor(kv): 简化 namespace 调用逻辑
VirgilClyne Mar 13, 2026
f947ef5
feat(qs): 新增查询字符串 polyfill 并迁移 argument 解析
VirgilClyne Mar 13, 2026
412f5db
feat(ci): 对齐发布工作流 Node 版本并拆分 npm 发布流程
VirgilClyne Mar 14, 2026
72e7e34
feat(kv): 将 KV 升级为 TypeScript 并完善 Node.js Cloudflare REST 支持
VirgilClyne Mar 16, 2026
428c75f
chore: 移除 KV 相关文件与说明
VirgilClyne Mar 18, 2026
5fed0b6
docs(changelog): 恢复 KV 历史日志并补充 3.5.0 说明
VirgilClyne Mar 18, 2026
f98909d
chore(fetch): 补充 fetch 的 mts 与 d.ts 并更新 2.5.1 变更日志
VirgilClyne Mar 19, 2026
176978c
refactor(types): 统一 polyfill 类型来源并更新 2.5.2 变更日志
VirgilClyne Mar 19, 2026
a4148b9
chore(package): 移除 package.json 中的 module 类型声明
VirgilClyne Mar 19, 2026
af73419
chore: 重构项目结构,移除旧的 index.js,新增 index.mjs 和 lib/index.mjs
VirgilClyne Mar 19, 2026
bedf819
chore: 更新 packageEntryModule 的路径为 index.mjs
VirgilClyne Mar 19, 2026
d3c52fc
chore(fetch): 重构 fetch 适配层,移除旧的 fetch.mjs 和 fetch.mts,新增 fetch.js
VirgilClyne Mar 19, 2026
fd34f9b
fix(polyfill): 修复 fetch 模块文件命名与导出
VirgilClyne Mar 19, 2026
9ca208a
refactor(polyfill): 将非测试 index.js 迁移为 index.mjs
VirgilClyne Mar 19, 2026
b1c3ee0
refactor: 切换入口文件到 JS 并更新测试引用
VirgilClyne Mar 19, 2026
04c819a
chore: 移除 package.json 中的 type 字段
VirgilClyne Mar 19, 2026
d54d44d
refactor: 将入口文件从 index.js 切换到 index.mjs,并更新相关测试引用
VirgilClyne Mar 19, 2026
587dfa4
refactor: replace fetch.mjs with fetch.js and implement cross-platfor…
VirgilClyne Mar 19, 2026
ced54cd
refactor: 将 Storage.mjs 替换为 Storage.js
VirgilClyne Mar 19, 2026
92b41da
refactor(Storage): 对齐 Node.js 数据读写实现
VirgilClyne Mar 19, 2026
12671ae
refactor(Storage): 修改 Node.js 模块导入方式以兼容性优化
VirgilClyne Mar 19, 2026
f6e7c04
refactor(Storage): 优化 Node.js 环境下的模块加载逻辑
VirgilClyne Mar 19, 2026
f1d8c21
revert: 撤销自 v2.5.3 以来的所有更改
VirgilClyne Mar 20, 2026
4c725af
新增:添加协作协议文档,规范项目开发流程与提交要求
VirgilClyne Apr 7, 2026
8b0fc60
refactor: 更新 fetch 相关模块,修改文件扩展名并移除不再使用的文件
VirgilClyne Apr 7, 2026
df8a966
refactor: 更新 Storage 模块,修改文件扩展名并移除不再使用的文件
VirgilClyne Apr 7, 2026
ae163da
refactor(Storage): 更新 Node.js 模块加载逻辑,移除前缀 'node:' 的文件路径
VirgilClyne Apr 7, 2026
38e250b
refactor: 更新 Storage 模块导入路径,使用 .js 扩展名
VirgilClyne Apr 7, 2026
61b3cf5
feat(fetch): 拆分 ESM/CJS 实现并强化路径语义测试
VirgilClyne Apr 7, 2026
4915162
feat(storage): 拆分 ESM/CJS 实现并同步导出与文档
VirgilClyne Apr 7, 2026
f70d19c
feat(fetch): 增强跨平台 fetch 适配层,支持 auto-cookie 选项并优化请求处理
VirgilClyne Apr 7, 2026
0237de8
feat(Storage): 增加对 Node.js 的支持,添加数据加载和持久化功能
VirgilClyne Apr 7, 2026
071b323
test(fetch): 修正 ESM 路径断言以匹配当前实现
VirgilClyne Apr 7, 2026
cf203e2
feat(qs): 增强 URL 编解码并补充文档与测试
VirgilClyne Apr 8, 2026
f69afce
test(qs): 补充方括号与点路径边界测试
VirgilClyne Apr 8, 2026
b3e697a
fix: 支持 Console 日志数组展开与通知正文分行
VirgilClyne Apr 9, 2026
9123545
fix: 调整 Console 多行字符串分行语义
VirgilClyne Apr 9, 2026
3e0b038
fix(environment): 修正环境对象的引用方式,确保全局访问
VirgilClyne Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## Working agreements

### 公共规范
- 任何新增的(不含参考实现已有的)非必要的辅助属性和函数或中间件都需要说明必要性,并得到我的批准。
- 禁止新增仅有一处调用的辅助函数,除非该函数逻辑足够复杂且抽离能显著提升可读性与可维护性。
- 必须使用标准文档注释签名,且必须包含 JSDoc 与参数、返回值签名。
- 所有注释必须使用中英双语:内容介绍使用双行,先写一行中文,再写一行英文;参数与返回值使用单行,中文/英文。
- 有疑问、歧义或存在多种可行实施方案时,必须先停下来向用户确认,不得想当然地自行决定并直接修改。

#### 提交规范
- 未经用户明确要求,不主动创建 commit。
- 进行 git 提交前,必须确认本次提交只包含目标变更,不混入无关修改。
- 进行 git 提交时,提交信息必须遵守 Conventional Commits 规范。
- 提交文本需要用中文书写,对于专有名词,可以在括号中注明英文。

### iOS/macOS 项目规范

#### 技术栈与框架
- 本项目使用 Swift 6.2 开发,代码应始终采用当前推荐的最新写法。
- 本项目使用 SwiftData,禁止使用 Core Data 语法。
- 本项目使用 SwiftUI,未经明确要求不得引入 UIKit 或 AppKit 组件。

#### MVVM 架构约束
- 项目遵循 MVVM 架构,并使用 `@Observable` 宏进行数据绑定;禁止使用 `@Published` 与 `@StateObject`。
- `Model` 可根据场景选择 `class` 或 `struct`。
- `View` 必须使用 `struct`,禁止使用 `class`。
- `ViewModel` 必须使用 `@Observable class`,禁止使用 `struct`。
- `@Observable` 仅可用于 `class`,不可用于 `struct`。
- `@Environment` 仅可用于 `struct`,不可用于 `class`。
- `@Model`中不可以使用 `didSet`。

#### SwiftData 模型约束
- 模型必须使用 `@Model` 宏标记,并且必须是 `class`,禁止使用 `struct`。
- 不准将 `@Model` 对象直接传递到其他线程或标记为 `@Sendable`,只允许传递 `PersistentIdentifier`。
- 如需跨线程读写,需要创建对应的 `@ModelActor public actor DataHandler` 或 `extension DataHandler` 将 `@Model` 对象的操作封装在 actor 内部。
- 通过 `DataHandler` 提供的接口传递 `PersistentIdentifier` 来访问同一个 `@Model` 对象。
- 在 `DataHandler` 中优先使用 `modelContext.transaction` 来执行对 `@Model` 对象的读写操作,确保数据一致性和线程安全。
- `modelContext.transaction` 在 `extension DataHandler` 中正常可用,无需额外传递 `modelContext`,Xcode 会自动识别。
- `Cannot find 'modelContext' in scope` 错误是误判,实际无此问题,忽略即可。
- SwiftData 模型字段改名或别名映射必须使用 `@Attribute(originalName: "旧字段名")` 绑定历史存储列名;禁止用计算属性充当可查询别名。
- 计算属性不能作为谓词条件(Predicate)使用;谓词只使用持久化存储字段。

#### 文件组织规范
- 代码文件需按类型放入以下目录之一:`Views`、`ViewModels`、`Models`、`Extensions`、`Builders`、`Components`、`Examples`、`Protocols`。
- `extension` 必须单独成文件,并放在项目的 `Extensions` 文件夹;命名规则:`原对象名称+扩展功能名称`。
- `enum` 必须单独成文件,并放在项目的 `Model` 文件夹;`enum` 类型名需以 `Type` 结尾,文件名同样以 `Type` 结尾。

### JavaScript/TypeScript 项目规范

#### 技术栈与模块
- 当前 js/ts 项目使用 Node.js ES Modules,需遵循 `package.json` 中的 `type: "module"`,不得无故回退到 CommonJS 写法。
- 对外公开接口以 `package.json` 的 `exports` 与 `README.md` 中已记录的导入方式为准,未经明确要求不得随意扩大、重命名或破坏公开导出面。
- 变更已公开模块时,必须同步维护 `.mjs`、`.mts`、`.d.ts` 之间的运行时实现、类型定义与导出结构一致性。

#### 代码风格与组织
- js/ts 代码需遵循当前仓库的 Biome 配置与既有代码风格,包括统一 2 空格缩进、双引号、LF 行尾与现有 import 组织方式。
- js/ts 对外接口与非直观实现必须提供完整 JSDoc 与签名信息,确保参数、返回值和行为语义可读。
- 优先沿用当前仓库的平铺模块组织方式;未经明确要求,不新增与现有导出结构不匹配的目录层级、封装层或中间适配层。
- 对现有公共 API 的行为调整应优先修复根因,避免只在 README 或类型声明层做表面补丁。

#### 测试与文档
- 测试优先沿用 `node --test` 与 `test/*.js` 的现有模式;新增或变更公开行为时,应同步补充或更新对应测试。
- 对外 API、导入方式、导出结构或行为语义发生变化时,应同步更新 `README.md` 中的示例与说明,确保文档与实现一致。
7 changes: 5 additions & 2 deletions .github/workflows/release-package-to-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: "24"
- run: npm ci
- run: npm run build --if-present
- run: npm test

publish-gpr:
Expand All @@ -33,8 +34,10 @@ jobs:
ignore-semver-check: "false" # If set to "true", will not check if the version number is a valid semver version.
- uses: actions/setup-node@v4
with:
registry-url: 'https://npm.pkg.github.com'
node-version: "24"
registry-url: "https://npm.pkg.github.com"
- run: npm ci
- run: npm run build --if-present
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 34 additions & 10 deletions .github/workflows/release-package-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,31 @@ on:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10

permissions:
id-token: write # Required for OIDC
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update local package.json version from release tag
uses: BellCubeDev/update-package-version-by-release-tag@v2
with:
version: ${{ github.ref_name }}
keep-v: "false" # If set to "true", will not remove any 'v' prefix from the version number.
ignore-semver-check: "false" # If set to "true", will not check if the version number is a valid semver version.
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: "24"
- run: npm ci
- run: npm run build --if-present
- run: npm test

publish-gpr:
publish:
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Update local package.json version from release tag
Expand All @@ -33,9 +41,25 @@ jobs:
ignore-semver-check: "false" # If set to "true", will not check if the version number is a valid semver version.
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
node-version: "24"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm run build --if-present
- name: Resolve npm dist-tag
id: npm_tag
run: |
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" == *-* ]]; then
PRERELEASE=${VERSION#*-}
TAG=${PRERELEASE%%.*}
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
else
echo "tag=latest" >> "$GITHUB_OUTPUT"
fi
- name: Publish to npm
run: |
if [[ "${{ steps.npm_tag.outputs.tag }}" == "latest" ]]; then
npm publish --access public
else
npm publish --access public --tag "${{ steps.npm_tag.outputs.tag }}"
fi
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/*
173 changes: 173 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# 变更日志

项目中的所有重要变更都会记录在此文件中。

格式参考 [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)。

## [2.5.2] - 2026-03-19

### 变更
- `refactor(types)`: 统一 `polyfill` 类型声明为单一来源,`types/modules` 改为引用 `polyfill/*.d.ts` 进行根入口适配,避免重复维护。
- `refactor(types)`: 拆分 `types/modules/Lodash.d.ts` 与 `types/modules/qs.d.ts`,并保留 `polyfills` 聚合入口以兼容既有导入方式。

### 文档
- `docs(types)`: 为 `polyfill/Console.d.ts`、`polyfill/Lodash.d.ts`、`polyfill/qs.d.ts`、`polyfill/StatusTexts.d.ts`、`polyfill/Storage.d.ts` 补充中英双语 JSDoc。

## [2.5.1] - 2026-03-19

### 变更
- `chore(fetch)`: 补充 `polyfill/fetch.mts` 与 `polyfill/fetch.d.ts`,完善 `fetch` 子路径导入的类型支持。

## [2.5.0] - 2026-03-18

### 变更
- `chore(KV)`: 移除 `KV` 相关实现、测试、类型和文档说明。

### 文档
- `docs(KV)`: 保留历史日志,仅删除 `KV` 新增内容;如有需求请改用 [Auraflare/shared](https://github.com/Auraflare/shared)。

## [2.4.0] - 2026-03-13

### 新增
- `feat(qs)`: 新增 `polyfill/qs.mjs`,提供 `qs.parse()` 与 `qs.stringify()` 查询字符串工具。
- `test(qs)`: 增加 `qs` 回归测试,覆盖字符串、对象、空值与序列化路径场景。

### 变更
- `refactor(argument)`: 将 `$argument` 标准化逻辑迁移到 `qs.parse()`,`lib/argument.mjs` 改为统一委托 `qs.parse(globalThis.$argument)`。
- `refactor(index)`: 从主入口与 `polyfill/index.js` 导出 `qs`。

### 文档
- `docs(qs)`: 更新 README 与变更日志,补充 `qs` 模块导出、依赖关系与 API 说明。

## [2.3.1] - 2026-03-13

### 变更
- `refactor(KV)`: 移除 `KV` 内部的 `#getNamespace()` 私有方法,Worker 分支直接调用实例上的 namespace binding,不再做额外检测。

### 文档
- `docs(KV)`: 补充本次 `KV` 内部实现调整的版本记录。

## [2.3.0] - 2026-03-13

### 新增
- `feat(app)`: 为 `$app` 增加 `Worker` 运行时类型,并以 `Cloudflare` 全局标记识别 Worker。
- `feat(environment)`: 为 `environment()` 增加 `Worker` 环境对象输出。
- `feat(KV)`: 新增基于 Cloudflare Workers KV namespace binding 的异步 `KV` 适配器,并从主入口导出。
- `feat(KV)`: 为 `KV` 补充 `list()` 方法,并对齐 Cloudflare Workers KV 的原生列举返回结构。
- `test(app)`: 增加 Worker 运行时识别回归测试。
- `test(KV)`: 增加 `KV` 在 Worker 与非 Worker 平台下的行为回归测试。

### 变更
- `refactor(done)`: 为 Worker 增加独立结束分支,仅记录日志,不调用 `$done` 或退出进程。
- `refactor(fetch)`: 为 Worker 接入与 Node.js 并列的 `fetch` 分支,并同步超时与返回结构说明。
- `refactor(Storage)`: 为 Worker 增加基于内存缓存的 `getItem` / `setItem` / `removeItem` / `clear` 支持。
- `refactor(Console)`: 将 Worker 纳入 `Console.error` 的栈输出分支。
- `refactor(notification)`: 将 Worker 纳入非 iOS 通知日志分支。
- `refactor(types)`: 将 `types/nsnanocat-util.d.ts` 拆分为单入口加多模块声明文件,保持现有 `types` 入口不变。

### 文档
- `docs`: 同步 README、JSDoc、类型声明与变更日志,反映 Worker 运行时支持、`KV` 适配器与版本号更新。

## [2.2.3] - 2026-03-08

### 修复
- `fix(fetch)`: 增加对特定平台的超时参数处理,确保毫秒级超时兼容性(`9a13625`)。
- `fix(biome)`: 更新 Biome schema 版本并调整文件包含规则(`01e8422`)。

### 变更
- `fix(deps)`: 添加 `@biomejs/biome` 依赖并更新 `pnpm-lock.yaml`(`4a395b7`)。

## [2.2.0] - 2026-03-06

### 修复
- `fix(fetch)`: 统一 `fetch` 默认超时为 5 秒,兼容秒/毫秒输入,并为 Quantumult X / Loon / Node.js 正确转换超时单位(`5103305`, `93508a0`, `3433b58`)。
- `fix(fetch)`: 通过 `globalThis` 访问 `$httpClient` / `$task` / `fetch`,修复 `fetch-cookie` 导入并完善 Node.js 回退逻辑,提升跨运行时兼容性(`1c4fa1c`, `f305091`, `3283f2d`, `c56dc65`)。
- `fix(fetch)`: Node.js 分支默认启用 Cookie 支持,并允许通过 `auto-cookie` 显式关闭(`03f9a19`, `779a1c1`)。

### 变更
- `refactor(app)`: 调整 `$app` 识别顺序,优先脚本平台标记并改用 `process.versions.node` 判断 Node.js,避免在 Workers / Vercel 风格运行时误判(`a8e246b`, `b974c7a`)。
- `fix(done)`: 未识别平台不再默认 `process.exit(1)`,仅 Node.js 分支显式退出进程(`b974c7a`)。

### 新增
- `test(app)`: 新增 Node.js 平台识别回归测试,覆盖 Cloudflare 风格与类 Web API 全局变量场景(`b974c7a`)。

### 文档
- 同步 README、声明注释与变更日志,反映最新的 `$app` 与 `fetch` 行为。

## [2.1.6] - 2026-02-24

### 修复
- `fix(Storage)`: 完善 Node.js 环境下 `removeItem` / `clear` 方法(`47de721`)。

### 新增
- `feat(getStorage)`: 导出 `getStorage` 辅助函数并同步类型定义与文档(`ccd91f3`)。

### 变更
- `refactor(getStorage)`: 重命名 `string2array` 为 `value2array`,并将解析逻辑调整为 `switch` 语法(`4628920`)。

## [2.1.5] - 2026-02-21

### 变更
- `chore(types)`: 新增本地类型声明并发布类型入口(`3071c12`)。

### 文档
- `docs`: 更新 changelog 顺序并反映导出变更(`5a5994a`)。

## [2.1.4] - 2026-02-20

### 修复
- `fix(getStorage)`: 支持小写别名 `boxjs`(`45f5cd8`)。
- `fix(getStorage)`: 将未定义的 `$argument.Storage` 视为 `PersistentStore` 并同步文档(`99869a0`)。

### 文档
- `docs(getStorage)`: 在 README/JSDoc 中说明 `$argument.Storage` 未定义时视为 `PersistentStore`,并修正导入示例。

## [2.1.3] - 2026-02-20

### 文档
- `docs(getStorage)`: 说明 `Settings` / `Configs` / `Caches` 的合并逻辑,并同步 README、JSDoc 与 CHANGELOG(`6bccb00`)。

## [2.1.2] - 2026-02-20

### 修复
- `fix(argument)`: 标准化 `globalThis.$argument` 并处理 `null` 场景(`c475e76`)。
- `fix(getStorage)`: 修复合并流程以包含 `$argument` 并增加条件控制(`3a1c8bb`)。
- `fix(getStorage)`: 支持通过 `$argument.Storage` 控制合并来源(`8a59892`)。
- `fix(getStorage)`: 将合并来源命名与实现统一为 `PersistentStore`(`5fa69e4`)。
- `fix(Storage)`: 为 Surge 增加 `removeItem` 删除支持(`23ebecb`)。

### 变更
- `refactor(getStorage)`: 重命名 `Store` 为 `Root` 并同步调试输出字段(`570a75c`)。
- `refactor(getStorage)`: 将 `Settings` 合并逻辑统一交由 `$argument.Storage` 控制,并确保 `Configs` / `Caches` 按配置名(`names`)合并(`17747ae`)。
- `refactor(getStorage)`: 改用默认导出(`export default`)。

### 文档
- 同步 `argument` / `getStorage` / `Storage` 的 README 与 JSDoc 说明(`2b13601`)。
- `docs(getStorage)`: 为 `$argument.Storage` 增加别名说明,并修正 README/JSDoc 中的合并顺序说明。
- `docs(getStorage)`: 更新导入示例及 JSDoc 以反映默认导出变更。

## [2.1.1] - 2026-02-20

### 变更
- `refactor(getStorage)`: 移除 `getStorage` 默认导出并补充使用边界说明(`4105cf2`)。
- `feat(index)`: 从入口导出 `getStorage` 并同步文档与测试(`b0a1bd9`)。

### 文档
- `docs`: 面向新手优化安装与更新指引(`ce7c81a`)。
- `docs`: 完善 polyfill 文档说明与引用链接(`b817c07`)。
- `docs`: 补充 README 与 JSDoc 注释说明(`5c5f1f3`)。

[2.5.2]: https://github.com/NSNanoCat/util/compare/v2.5.1...HEAD
[2.5.1]: https://github.com/NSNanoCat/util/compare/v2.5.0...v2.5.1
[2.5.0]: https://github.com/NSNanoCat/util/compare/v2.4.0...v2.5.0
[2.4.0]: https://github.com/NSNanoCat/util/compare/v2.3.1...v2.4.0
[2.3.1]: https://github.com/NSNanoCat/util/compare/v2.3.0...v2.3.1
[2.3.0]: https://github.com/NSNanoCat/util/compare/v2.2.3...v2.3.0
[2.2.3]: https://github.com/NSNanoCat/util/compare/v2.2.0...v2.2.3
[2.2.0]: https://github.com/NSNanoCat/util/compare/v2.1.7...v2.2.0
[2.1.6]: https://github.com/NSNanoCat/util/compare/v2.1.5...v2.1.6
[2.1.5]: https://github.com/NSNanoCat/util/compare/v2.1.4...v2.1.5
[2.1.4]: https://github.com/NSNanoCat/util/compare/v2.1.3...v2.1.4
[2.1.3]: https://github.com/NSNanoCat/util/compare/v2.1.2...v2.1.3
[2.1.2]: https://github.com/NSNanoCat/util/compare/v2.1.1...v2.1.2
[2.1.1]: https://github.com/NSNanoCat/util/compare/v2.1.0...v2.1.1
Loading