@lmzhen/dsh-evolution-io-node 0.1.0-rc.5 → 0.1.0-rc.50

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/lib/index.js CHANGED
@@ -1,9 +1,13 @@
1
- import { cp, mkdir, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
2
- import { dirname } from "node:path";
3
- import { randomBytes } from "node:crypto";
1
+ import { nodeEvolutionIo } from "@lmzhen/dsh-evolution-core";
4
2
  //#region lib/types/index.js
5
3
  /**
6
4
  * Local atomic node:fs IO provider.
5
+ *
6
+ * The implementation is the single `nodeEvolutionIo()` from
7
+ * `dsh-evolution-core` (no duplicate copy: the old fork once diverged in
8
+ * exists(), made directories report absent and let re-archives overwrite
9
+ * older archive folders). Only the provider's `name` is added here.
10
+ *
7
11
  * @module @lmzhen/dsh-evolution-io-node
8
12
  */
9
13
  const name = "evolution-io-node";
@@ -11,51 +15,7 @@ const inject = ["evolutionIo"];
11
15
  function apply(ctx) {
12
16
  const provider = {
13
17
  name: "node",
14
- async readText(path) {
15
- try {
16
- return await readFile(path, "utf8");
17
- } catch {
18
- return null;
19
- }
20
- },
21
- async writeText(path, content) {
22
- await mkdir(dirname(path), { recursive: true });
23
- const tmp = `${path}.${process.pid}.${randomBytes(6).toString("hex")}.tmp`;
24
- await writeFile(tmp, content, "utf8");
25
- await rename(tmp, path);
26
- },
27
- async remove(path) {
28
- await rm(path, {
29
- recursive: true,
30
- force: true
31
- });
32
- },
33
- async list(path) {
34
- try {
35
- return await readdir(path);
36
- } catch {
37
- return [];
38
- }
39
- },
40
- async exists(path) {
41
- try {
42
- await readFile(path);
43
- return true;
44
- } catch {
45
- return false;
46
- }
47
- },
48
- async rename(path, destination) {
49
- await mkdir(dirname(destination), { recursive: true });
50
- await rename(path, destination);
51
- },
52
- async copy(path, destination) {
53
- await mkdir(dirname(destination), { recursive: true });
54
- await cp(path, destination, {
55
- recursive: true,
56
- force: true
57
- });
58
- }
18
+ ...nodeEvolutionIo()
59
19
  };
60
20
  ctx.effect(() => ctx.evolutionIo.registerProvider(provider), "evolution-io-node.provider");
61
21
  }
@@ -1,5 +1,11 @@
1
1
  /**
2
2
  * Local atomic node:fs IO provider.
3
+ *
4
+ * The implementation is the single `nodeEvolutionIo()` from
5
+ * `dsh-evolution-core` (no duplicate copy: the old fork once diverged in
6
+ * exists(), made directories report absent and let re-archives overwrite
7
+ * older archive folders). Only the provider's `name` is added here.
8
+ *
3
9
  * @module @deepseek-ai/dsh-evolution-io-node
4
10
  */
5
11
  import type { Context } from '@deepseek-ai/cordis';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-io-node",
3
3
  "description": "Local atomic node:fs IO provider (community build)",
4
- "version": "0.1.0-rc.5",
4
+ "version": "0.1.0-rc.50",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -32,15 +32,16 @@
32
32
  ],
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
- "@deepseek-ai/schemastery": "^3.18.1"
35
+ "@deepseek-ai/schemastery": "^3.18.1",
36
+ "@lmzhen/dsh-evolution-core": "^0.1.0-rc.50"
36
37
  },
37
38
  "peerDependencies": {
38
39
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
39
40
  "@deepseek-ai/cordis": "^4.0.1",
40
- "@lmzhen/dsh-evolution-io": "^0.1.0-rc.5"
41
+ "@lmzhen/dsh-evolution-io": "^0.1.0-rc.50"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
44
- "@lmzhen/dsh-evolution-io": "^0.1.0-rc.5"
45
+ "@lmzhen/dsh-evolution-io": "^0.1.0-rc.50"
45
46
  }
46
47
  }