@toa.io/boot 1.0.0-alpha.266 → 1.0.0-alpha.270
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 +12 -0
- package/package.json +6 -6
- package/src/component.js +8 -2
- package/src/span.js +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.270](https://github.com/toa-io/toa/compare/v1.0.0-alpha.269...v1.0.0-alpha.270) (2026-08-31)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Performance Improvements
|
|
10
|
+
|
|
11
|
+
* **boot:** stop paying for what a composition does not need to start ([1619c27](https://github.com/toa-io/toa/commit/1619c2743072f4706939ce72f3074e615d26a91e))
|
|
12
|
+
* **openspan:** create a span only when something records it ([a6efb0e](https://github.com/toa-io/toa/commit/a6efb0eed38393f4c169b067f23d7447f0169bca))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
# [1.0.0-alpha.266](https://github.com/toa-io/toa/compare/v1.0.0-alpha.265...v1.0.0-alpha.266) (2026-08-29)
|
|
7
19
|
|
|
8
20
|
**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.
|
|
3
|
+
"version": "1.0.0-alpha.270",
|
|
4
4
|
"description": "Toa Boot",
|
|
5
5
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/toa-io/toa#readme",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
23
|
+
"@toa.io/core": "1.0.0-alpha.270",
|
|
24
24
|
"@toa.io/filesystem": "1.0.0-alpha.254",
|
|
25
25
|
"@toa.io/generic": "1.0.0-alpha.254",
|
|
26
|
-
"@toa.io/norm": "1.0.0-alpha.
|
|
27
|
-
"@toa.io/schemas": "1.0.0-alpha.
|
|
26
|
+
"@toa.io/norm": "1.0.0-alpha.270",
|
|
27
|
+
"@toa.io/schemas": "1.0.0-alpha.270",
|
|
28
28
|
"clone-deep": "4.0.1",
|
|
29
29
|
"dotenv": "16.1.1",
|
|
30
|
-
"openspan": "1.0.0-alpha.
|
|
30
|
+
"openspan": "1.0.0-alpha.270"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "94400bdd411b4c25074ffcf58184580ddd060268"
|
|
33
33
|
}
|
package/src/component.js
CHANGED
|
@@ -52,10 +52,16 @@ async function bootOperations (manifest, context, state, preflight) {
|
|
|
52
52
|
if (manifest.operations === undefined)
|
|
53
53
|
return {}
|
|
54
54
|
|
|
55
|
+
const entries = Object.entries(manifest.operations)
|
|
56
|
+
|
|
57
|
+
// each one loads its algorithm from disk and compiles its contracts
|
|
58
|
+
const booted = await Promise.all(entries.map(([endpoint, definition]) =>
|
|
59
|
+
boot.operation(manifest, endpoint, definition, context, state, preflight)))
|
|
60
|
+
|
|
55
61
|
const operations = {}
|
|
56
62
|
|
|
57
|
-
for (
|
|
58
|
-
operations[
|
|
63
|
+
for (let i = 0; i < entries.length; i++)
|
|
64
|
+
operations[entries[i][0]] = booted[i]
|
|
59
65
|
|
|
60
66
|
return operations
|
|
61
67
|
}
|
package/src/span.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const { console } = require('openspan')
|
|
3
|
+
const { console, traces } = require('openspan')
|
|
4
4
|
|
|
5
5
|
const enabled = process.env.TOA_BOOT_TRACE === '1'
|
|
6
6
|
|
|
7
|
+
// Tracing is off until an exporter is configured, and the CLI opens its own span before
|
|
8
|
+
// any extension gets to configure one — so asking for a boot trace turns the console
|
|
9
|
+
// exporter on here. Extensions keep it: see `development()` in the telemetry factory.
|
|
10
|
+
if (enabled) traces({ exporters: { console: {} } })
|
|
11
|
+
|
|
7
12
|
/**
|
|
8
13
|
* Creates a span if boot tracing is enabled (TOA_BOOT_TRACE=1), otherwise just runs the task
|
|
9
14
|
*
|