@deepseek-ai/dsh-atomic-write 0.1.6-alpha.2 → 0.1.7-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +4 -4
- package/README.zh.md +4 -4
- package/package.json +3 -3
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/util/atomic-write/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: fa2a77c8ba11e1dd80fecef6da09fa32a608b523
|
|
6
|
+
README.zh.md: 020d379c876733d5de11c63887de8d3168eac3b3
|
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ Use `writeFileAtomic` when a file-backed store must replace one already-rendered
|
|
|
33
33
|
import { writeFileAtomic } from '@deepseek-ai/dsh-atomic-write'
|
|
34
34
|
|
|
35
35
|
declare const text: string
|
|
36
|
-
await writeFileAtomic('/home/u/.dsh/
|
|
36
|
+
await writeFileAtomic('/home/u/.dsh/cordis.patch.yml', text, { mode: 0o600 })
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
Parent directories are created as needed, and readers observe either the old or the new complete content. On Windows, transient replacement interference reported as `EACCES`, `EBUSY`, or `EPERM` is retried for a bounded interval; any remaining failure removes the temporary file and leaves the target untouched.
|
|
@@ -48,9 +48,9 @@ import { withFileLock, writeFileAtomic } from '@deepseek-ai/dsh-atomic-write'
|
|
|
48
48
|
declare const render: (previous: string) => string
|
|
49
49
|
declare const readCurrent: () => Promise<string>
|
|
50
50
|
|
|
51
|
-
await withFileLock('/home/u/.dsh/
|
|
51
|
+
await withFileLock('/home/u/.dsh/cordis.patch.yml', async () => {
|
|
52
52
|
const previous = await readCurrent()
|
|
53
|
-
await writeFileAtomic('/home/u/.dsh/
|
|
53
|
+
await writeFileAtomic('/home/u/.dsh/cordis.patch.yml', render(previous), { mode: 0o600 })
|
|
54
54
|
})
|
|
55
55
|
```
|
|
56
56
|
|
|
@@ -100,7 +100,7 @@ The package is built on one separation: the atomic commit owns the swap, and the
|
|
|
100
100
|
|
|
101
101
|
Read these pages when you need the consuming stores or the family this primitive belongs to.
|
|
102
102
|
|
|
103
|
-
- [
|
|
103
|
+
- [Profile configuration editor](../../boot/config-editor/README.md) — the profile patch every edit replaces through this package.
|
|
104
104
|
- [Credentials store](../../credentials/credentials-local/README.md) — the credentials file this package locks and replaces.
|
|
105
105
|
- [util group map](../README.md) — the zero-dependency utility family this package belongs to.
|
|
106
106
|
|
package/README.zh.md
CHANGED
|
@@ -33,7 +33,7 @@ kind: "package-library"
|
|
|
33
33
|
import { writeFileAtomic } from '@deepseek-ai/dsh-atomic-write'
|
|
34
34
|
|
|
35
35
|
declare const text: string
|
|
36
|
-
await writeFileAtomic('/home/u/.dsh/
|
|
36
|
+
await writeFileAtomic('/home/u/.dsh/cordis.patch.yml', text, { mode: 0o600 })
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
父目录会按需创建,读取方只会观察到旧内容或完整的新内容。在 Windows 上,报告为 `EACCES`、`EBUSY` 或 `EPERM` 的瞬时替换干扰会在有界时间内重试;任何剩余失败都会移除临时文件,并保持目标文件不变。
|
|
@@ -48,9 +48,9 @@ import { withFileLock, writeFileAtomic } from '@deepseek-ai/dsh-atomic-write'
|
|
|
48
48
|
declare const render: (previous: string) => string
|
|
49
49
|
declare const readCurrent: () => Promise<string>
|
|
50
50
|
|
|
51
|
-
await withFileLock('/home/u/.dsh/
|
|
51
|
+
await withFileLock('/home/u/.dsh/cordis.patch.yml', async () => {
|
|
52
52
|
const previous = await readCurrent()
|
|
53
|
-
await writeFileAtomic('/home/u/.dsh/
|
|
53
|
+
await writeFileAtomic('/home/u/.dsh/cordis.patch.yml', render(previous), { mode: 0o600 })
|
|
54
54
|
})
|
|
55
55
|
```
|
|
56
56
|
|
|
@@ -100,7 +100,7 @@ Windows 在无法观察到锁时会对 `EPERM` 重试一次,因为持锁方可
|
|
|
100
100
|
|
|
101
101
|
当你需要了解使用本原语的存储或它所属的工具家族时,阅读以下页面。
|
|
102
102
|
|
|
103
|
-
- [用户设置文件存储](../../
|
|
103
|
+
- [用户设置文件存储](../../boot/config-editor/README.zh.md)——每次写入都通过本包替换的设置文档。
|
|
104
104
|
- [凭据存储](../../credentials/credentials-local/README.zh.md)——本包加锁并替换的凭据文件。
|
|
105
105
|
- [util 组映射](../README.zh.md)——本包所属的零依赖工具家族。
|
|
106
106
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-atomic-write",
|
|
3
3
|
"description": "Zero-dependency atomic file replacement: exclusive-create random-suffix temp + rename carrying the caller-stated permissions (writeFileAtomic)",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.7-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@deepseek-ai/cordis": "
|
|
30
|
+
"@deepseek-ai/cordis": "~4.0.4"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@deepseek-ai/cordis": "
|
|
33
|
+
"@deepseek-ai/cordis": "~4.0.4"
|
|
34
34
|
}
|
|
35
35
|
}
|