@toa.io/boot 1.0.0-alpha.301 → 1.0.0-alpha.303

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/CHANGELOG.md CHANGED
@@ -3,6 +3,21 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-alpha.303](https://github.com/toa-io/toa/compare/v1.0.0-alpha.302...v1.0.0-alpha.303) (2026-09-12)
7
+
8
+ **Note:** Version bump only for package @toa.io/boot
9
+
10
+
11
+
12
+
13
+
14
+ # [1.0.0-alpha.302](https://github.com/toa-io/toa/compare/v1.0.0-alpha.301...v1.0.0-alpha.302) (2026-09-11)
15
+
16
+ ### Features
17
+
18
+ * **boot:** a run command may wait until the component is served ([0f66bed](https://github.com/toa-io/toa/commit/0f66bedf7b54dc9c1397f7f32bbccbffde7288ca))
19
+
20
+
6
21
  # [1.0.0-alpha.301](https://github.com/toa-io/toa/compare/v1.0.0-alpha.300...v1.0.0-alpha.301) (2026-09-11)
7
22
 
8
23
  **Note:** Version bump only for package @toa.io/boot
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/boot",
3
- "version": "1.0.0-alpha.301",
3
+ "version": "1.0.0-alpha.303",
4
4
  "type": "module",
5
5
  "description": "Toa Boot",
6
6
  "author": "temich <tema.gurtovoy@gmail.com>",
@@ -21,15 +21,15 @@
21
21
  "test": "echo \"Error: run tests from root\" && exit 1"
22
22
  },
23
23
  "dependencies": {
24
- "@toa.io/atomicity": "1.0.0-alpha.301",
25
- "@toa.io/core": "1.0.0-alpha.301",
26
- "@toa.io/definitions": "1.0.0-alpha.301",
24
+ "@toa.io/atomicity": "1.0.0-alpha.303",
25
+ "@toa.io/core": "1.0.0-alpha.303",
26
+ "@toa.io/definitions": "1.0.0-alpha.303",
27
27
  "@toa.io/generic": "1.0.0-alpha.301",
28
- "@toa.io/norm": "1.0.0-alpha.301",
28
+ "@toa.io/norm": "1.0.0-alpha.303",
29
29
  "@toa.io/schemas": "1.0.0-alpha.301",
30
30
  "clone-deep": "4.0.1",
31
31
  "dotenv": "17.4.2",
32
- "openspan": "1.0.0-alpha.301"
32
+ "openspan": "1.0.0-alpha.303"
33
33
  },
34
- "gitHead": "cc49bc90efd35464b2ad7803246786c607a44685"
34
+ "gitHead": "b8e9dd89f6d49756944687a95dfc786f12947286"
35
35
  }
package/src/component.js CHANGED
@@ -68,6 +68,8 @@ const create = async (manifest, locator) => {
68
68
 
69
69
  if (phases?.settle !== undefined) decorated.settle = phases.settle
70
70
 
71
+ if (phases?.ready !== undefined) decorated.ready = phases.ready
72
+
71
73
  // a dependency closes after its dependant, so the component is already closed
72
74
  // when the RC releases what it opened
73
75
  if (phases?.dispose !== undefined) decorated.depends(phases.dispose)
@@ -59,10 +59,11 @@ export async function composition(paths, options) {
59
59
 
60
60
  const producers = []
61
61
  const settles = []
62
+ const readies = []
62
63
 
63
64
  for (let i = 0; i < components.length; i++) {
64
65
  const { local, other } = groups[i]
65
- const settle = components[i].settle
66
+ const { settle, ready } = components[i]
66
67
  const serving = [...local, ...other]
67
68
 
68
69
  producers.push(...serving)
@@ -78,6 +79,19 @@ export async function composition(paths, options) {
78
79
  for (const receiver of receivers[i])
79
80
  for (const producer of serving) receiver.depends(producer)
80
81
 
82
+ /*
83
+ * The broker producers serve the stateful endpoints under the process's name, and the
84
+ * name is held once they are open — before then a call to it is refused. `ready` is where
85
+ * a component hands the name out, so it waits for every producer and receiver of its own.
86
+ */
87
+ if (ready !== undefined) {
88
+ for (const producer of serving) ready.depends(producer)
89
+
90
+ for (const receiver of receivers[i]) ready.depends(receiver)
91
+
92
+ readies.push(ready)
93
+ }
94
+
81
95
  if (settle === undefined) continue
82
96
 
83
97
  if (local.length > 0) settle.depends(local)
@@ -91,7 +105,7 @@ export async function composition(paths, options) {
91
105
 
92
106
  const composition = new Composition(
93
107
  expositions.flat(),
94
- producers.concat(settles),
108
+ producers.concat(settles, readies),
95
109
  receivers.flat(),
96
110
  tenants.flat()
97
111
  )