dougong 0.0.3 → 0.1.0
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.md +14 -14
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ npm install dougong
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
|
-
import {
|
|
18
|
+
import { createHost, definePlugin, service } from "dougong"
|
|
19
19
|
|
|
20
20
|
const CLOCK = service<Clock>("app/clock")
|
|
21
21
|
|
|
@@ -33,19 +33,19 @@ const greeter = definePlugin({
|
|
|
33
33
|
},
|
|
34
34
|
})
|
|
35
35
|
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
await
|
|
36
|
+
const host = createHost({ name: "hello" })
|
|
37
|
+
host.install(greeter) // 安装顺序不决定启动顺序
|
|
38
|
+
host.install(clock)
|
|
39
|
+
await host.start() // 从声明推导拓扑,同层并发启动
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
六个原子:**Service**(稳定的一对一能力)、**
|
|
42
|
+
六个原子:**Service**(稳定的一对一能力)、**ExtensionPoint**(开放贡献集合)、**Event**(瞬时事实)、**Lifetime**(结构化所有权)、**Plugin**、**Host**。
|
|
43
43
|
|
|
44
44
|
三条核心保证:依赖与所有权**显式**写在声明里;每个语义只有**一条**正式路径;事务只暴露**已提交**状态。
|
|
45
45
|
|
|
46
46
|
### 环境要求
|
|
47
47
|
|
|
48
|
-
Node.js ≥ 22 或等价的 ES2024
|
|
48
|
+
Node.js ≥ 22 或等价的 ES2024 运行时。TypeScript 消费者需要:
|
|
49
49
|
|
|
50
50
|
```json
|
|
51
51
|
"lib": ["ES2024", "DOM", "DOM.Iterable", "ESNext.Disposable"]
|
|
@@ -64,7 +64,7 @@ npm install dougong
|
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
```ts
|
|
67
|
-
import {
|
|
67
|
+
import { createHost, definePlugin, service } from "dougong"
|
|
68
68
|
|
|
69
69
|
const CLOCK = service<Clock>("app/clock")
|
|
70
70
|
|
|
@@ -82,19 +82,19 @@ const greeter = definePlugin({
|
|
|
82
82
|
},
|
|
83
83
|
})
|
|
84
84
|
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
await
|
|
85
|
+
const host = createHost({ name: "hello" })
|
|
86
|
+
host.install(greeter) // install order does not decide start order
|
|
87
|
+
host.install(clock)
|
|
88
|
+
await host.start() // topology derived from declarations, layers start concurrently
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
Six atoms: **Service** (a stable one-to-one capability), **
|
|
91
|
+
Six atoms: **Service** (a stable one-to-one capability), **ExtensionPoint** (an open contribution set), **Event** (a transient fact), **Lifetime** (structured ownership), **Plugin**, **Host**.
|
|
92
92
|
|
|
93
93
|
Three core guarantees: dependencies and ownership are written **explicitly** in declarations; every semantic has exactly **one** canonical path; transactions expose only **committed** state.
|
|
94
94
|
|
|
95
95
|
### Requirements
|
|
96
96
|
|
|
97
|
-
Node.js ≥ 22 or an equivalent ES2024
|
|
97
|
+
Node.js ≥ 22 or an equivalent ES2024 runtime. TypeScript consumers need:
|
|
98
98
|
|
|
99
99
|
```json
|
|
100
100
|
"lib": ["ES2024", "DOM", "DOM.Iterable", "ESNext.Disposable"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dougong",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22"
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dougongjs/
|
|
22
|
-
"@dougongjs/
|
|
23
|
-
"@dougongjs/
|
|
21
|
+
"@dougongjs/platform": "0.1.0",
|
|
22
|
+
"@dougongjs/core": "0.1.0",
|
|
23
|
+
"@dougongjs/reactive": "0.1.0"
|
|
24
24
|
},
|
|
25
25
|
"description": "Capability composition and structured lifetime kernel, plus its plugin distribution layer.",
|
|
26
26
|
"license": "MIT",
|