Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 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
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
28 changes: 9 additions & 19 deletions .github/workflows/release-package-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,13 @@ on:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- run: npm ci
- run: npm test
permissions:
id-token: write # Required for OIDC
contents: read

publish-gpr:
needs: build
jobs:
publish:
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 +23,9 @@ 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 run build --if-present
- run: npm test
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
86 changes: 86 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Changelog

变更日志

All notable changes to this project will be documented in this file.

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

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

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

## [2.1.6] - 2026-02-24

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

### Added / 新增
- `feat(getStorage)`: export helper functions with type definitions and docs updates; 导出 `getStorage` 辅助函数并同步类型定义与文档(`ccd91f3`)。

### Changed / 变更
- `refactor(getStorage)`: rename `string2array` to `value2array` and switch parsing logic to `switch`; 重命名 `string2array` 为 `value2array`,并将解析逻辑调整为 `switch` 语法(`4628920`)。

## [2.1.5] - 2026-02-21

### Changed / 变更
- `chore(types)`: add local declarations for `@nsnanocat/util`; 新增本地类型声明并发布类型入口(`3071c12`)。

### Docs / 文档
- `docs`: update changelog order and reflect export change; 更新 changelog 顺序并反映导出变更(`5a5994a`)。

## [2.1.4] - 2026-02-20

### Fixed / 修复
- `fix(getStorage)`: Accept lowercase `boxjs` as alias for `BoxJs`; 支持小写别名 `boxjs`。(`45f5cd8`)
- `fix(getStorage)`: Treat undefined `$argument.Storage` the same as `PersistentStore`; 将未定义的 `.Storage` 视为 `PersistentStore` 并更新文档。(`99869a0`)

### Docs / 文档
- `docs(getStorage)`: Update README/JSDoc to mention undefined `.Storage` defaulting and adjust import example; 在 README/JSDoc 中说明当 `$argument.Storage` 未定义时视为 `PersistentStore`,并修正导入示例。

## [2.1.3] - 2026-02-20

### Docs / 文档
- `docs(getStorage)`: clarify Settings/Configs/Caches merge; update JSDoc/README/CHANGELOG (commit 6bccb00)。

## [2.1.2] - 2026-02-20

### Fixed / 修复
- `fix(argument)`: Normalize `globalThis.$argument` and guard `null`; 标准化 `globalThis.$argument` 并处理 `null` 场景(`c475e76`)。
- `fix(getStorage)`: Include `$argument` in merge flow with conditional handling; 修复合并流程以包含 `$argument` 并增加条件控制(`3a1c8bb`)。
- `fix(getStorage)`: Add merge source control by `$argument.Storage`; 支持通过 `$argument.Storage` 控制合并来源(`8a59892`)。
- `fix(getStorage)`: Replace `BoxJs` merge source naming/usage with `PersistentStore`; 将合并来源命名/实现统一为 `PersistentStore`(`5fa69e4`)。
- `fix(Storage)`: Add Surge `removeItem` support via `$persistentStore.write(null, keyName)`; 为 Surge 增加 `removeItem` 删除支持(`23ebecb`)。

### Changed / 变更
- `refactor(getStorage)`: Rename `Store` to `Root` and align debug output; 重命名 `Store` 为 `Root` 并同步调试输出字段(`570a75c`)。
- `refactor(getStorage)`: Centralize `Settings` merge controlled by `$argument.Storage`; ensure `Configs`/`Caches` are merged per-profile (`names`)(`17747ae`)。
- `refactor(getStorage)`: switch to a default export instead of named; 改用默认导出(`export default`)。

### Docs / 文档
- Sync README/JSDoc with recent behavior changes for `argument` / `getStorage` / `Storage`; 同步 `argument` / `getStorage` / `Storage` 的 README 与 JSDoc 说明(`2b13601`)。
- `docs(getStorage)`: Document aliases for `$argument.Storage` (`Argument` / `$argument`, `PersistentStore` / `BoxJs` / `$persistentStore`) and correct merge-order in README/JSDoc; 为 `$argument.Storage` 增加别名说明并修正 README 中的合并顺序说明。
- `docs(getStorage)`: Update import example and JSDoc to reflect default export; 更新导入示例及 JSDoc 以反映默认导出变更。

## [2.1.1] - 2026-02-20

### Changed / 变更
- `refactor(getStorage)`: remove default export and clarify usage boundaries; 改为无默认导出并补充使用边界说明(`4105cf2`)。
- `feat(index)`: re-export `getStorage` from entry point and update docs/tests; 从入口导出并更新文档/测试(`b0a1bd9`)。

### Docs / 文档
- `docs`: improve installation/update guidance for newcomers; 优化安装与更新指引面向新手(`ce7c81a`)。
- `docs`: enhance polyfill descriptions and links; 完善 polyfill 文档说明与引用链接(`b817c07`)。
- `docs`: fill out README and JSDoc comments; 补充 README 与 JSDoc 注释说明(`5c5f1f3`)。





[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