@toa.io/boot 1.0.0-alpha.300 → 1.0.0-alpha.302

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.302](https://github.com/toa-io/toa/compare/v1.0.0-alpha.301...v1.0.0-alpha.302) (2026-09-11)
7
+
8
+ ### Features
9
+
10
+ * **boot:** a run command may wait until the component is served ([0f66bed](https://github.com/toa-io/toa/commit/0f66bedf7b54dc9c1397f7f32bbccbffde7288ca))
11
+
12
+
13
+ # [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)
14
+
15
+ **Note:** Version bump only for package @toa.io/boot
16
+
17
+
18
+
19
+
20
+
6
21
  # [1.0.0-alpha.300](https://github.com/toa-io/toa/compare/v1.0.0-alpha.299...v1.0.0-alpha.300) (2026-09-11)
7
22
 
8
23
  * feat(boot)!: a process is a thing, and an extension may keep something in one ([528d6cd](https://github.com/toa-io/toa/commit/528d6cdd307b45a6c30b6a184d7e06b3328cecf8))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/boot",
3
- "version": "1.0.0-alpha.300",
3
+ "version": "1.0.0-alpha.302",
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.300",
25
- "@toa.io/core": "1.0.0-alpha.300",
26
- "@toa.io/definitions": "1.0.0-alpha.300",
27
- "@toa.io/generic": "1.0.0-alpha.292",
28
- "@toa.io/norm": "1.0.0-alpha.300",
29
- "@toa.io/schemas": "1.0.0-alpha.299",
24
+ "@toa.io/atomicity": "1.0.0-alpha.302",
25
+ "@toa.io/core": "1.0.0-alpha.302",
26
+ "@toa.io/definitions": "1.0.0-alpha.302",
27
+ "@toa.io/generic": "1.0.0-alpha.301",
28
+ "@toa.io/norm": "1.0.0-alpha.302",
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.293"
32
+ "openspan": "1.0.0-alpha.301"
33
33
  },
34
- "gitHead": "f91131a9aeb29aa271f177c4055ddcf0cda8c75e"
34
+ "gitHead": "3cbbca55a61711db78f98b13e50cf4d1afaf5c08"
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
  )
package/src/index.js CHANGED
@@ -1,56 +1,29 @@
1
1
  // the environment is read at module scope elsewhere, so it is loaded first
2
- import { load as env } from './env.js'
2
+ export { load as env } from './env.js'
3
3
 
4
- import * as bindings from './bindings/index.js'
5
- import * as bridge from './bridge.js'
6
- import * as contract from './contract.js'
7
- import * as discovery from './discovery.js'
8
- import * as extensions from './extensions/index.js'
4
+ export * as bindings from './bindings/index.js'
5
+ export * as bridge from './bridge.js'
6
+ export * as contract from './contract.js'
7
+ export * as discovery from './discovery.js'
8
+ export * as extensions from './extensions/index.js'
9
9
 
10
- import { call } from './call.js'
11
- import { cascade } from './cascade.js'
12
- import { component } from './component.js'
13
- import { composition } from './composition.js'
14
- import { context } from './context.js'
15
- import { emission } from './emission.js'
16
- import { events } from './events.js'
17
- import { inbox } from './inbox.js'
18
- import { outbox } from './outbox.js'
19
- import { atomicity } from './atomicity.js'
20
- import { atom } from './atom.js'
21
- import { manifest } from './manifest.js'
22
- import { operation } from './operation.js'
23
- import { receivers, receive } from './receivers.js'
24
- import { remote } from './remote.js'
25
- import { storage } from './storage.js'
26
- import { guards } from './guards.js'
27
- import { host } from './host.js'
28
- import { rc } from './rc.js'
29
- import { Workload } from './workload.js'
30
-
31
- export {
32
- call,
33
- env,
34
- cascade,
35
- component,
36
- composition,
37
- context,
38
- emission,
39
- events,
40
- inbox,
41
- outbox,
42
- atomicity,
43
- atom,
44
- host,
45
- manifest,
46
- operation,
47
- receivers,
48
- receive,
49
- remote,
50
- storage,
51
- guards,
52
- rc,
53
- Workload
54
- }
55
-
56
- export { bindings, bridge, contract, discovery, extensions }
10
+ export { call } from './call.js'
11
+ export { cascade } from './cascade.js'
12
+ export { component } from './component.js'
13
+ export { composition } from './composition.js'
14
+ export { context } from './context.js'
15
+ export { emission } from './emission.js'
16
+ export { events } from './events.js'
17
+ export { inbox } from './inbox.js'
18
+ export { outbox } from './outbox.js'
19
+ export { atomicity } from './atomicity.js'
20
+ export { atom } from './atom.js'
21
+ export { manifest } from './manifest.js'
22
+ export { operation } from './operation.js'
23
+ export { receivers, receive } from './receivers.js'
24
+ export { remote } from './remote.js'
25
+ export { storage } from './storage.js'
26
+ export { guards } from './guards.js'
27
+ export { host } from './host.js'
28
+ export { rc } from './rc.js'
29
+ export { Workload } from './workload.js'
package/types/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import type * as core from '@toa.io/core'
2
2
  import type * as types from '@toa.io/core/types'
3
- import * as composition from './composition.js'
3
+ import * as composition from './composition.d.ts'
4
4
 
5
- export * as bindings from './bindings.js'
5
+ export * as bindings from './bindings.d.ts'
6
6
 
7
7
  export async function composition(
8
8
  paths: string[],
@@ -1,5 +1,5 @@
1
1
  import * as _norm from '@toa.io/norm/types'
2
- import * as _composition from './composition.js'
2
+ import * as _composition from './composition.d.ts'
3
3
 
4
4
  declare namespace toa.boot {
5
5
  type Manifest = (