@toa.io/boot 1.0.0-alpha.282 → 1.0.0-alpha.284
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 +16 -0
- package/package.json +7 -7
- package/src/contract.js +4 -1
- package/src/env.js +11 -10
- package/src/operation.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.284](https://github.com/toa-io/toa/compare/v1.0.0-alpha.283...v1.0.0-alpha.284) (2026-09-05)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @toa.io/boot
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.0.0-alpha.283](https://github.com/toa-io/toa/compare/v1.0.0-alpha.282...v1.0.0-alpha.283) (2026-09-04)
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **core:** an operation returns the errors it declares, and nothing else ([1c2b819](https://github.com/toa-io/toa/commit/1c2b8193ae7fbe86bc1a25053a6044ee4dd16a4a))
|
|
19
|
+
* **exposition:** declare the errors the built-in components return ([27200c3](https://github.com/toa-io/toa/commit/27200c348ab09068d58c52c3e83208cb29cd7290))
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [1.0.0-alpha.282](https://github.com/toa-io/toa/compare/v1.0.0-alpha.281...v1.0.0-alpha.282) (2026-09-03)
|
|
7
23
|
|
|
8
24
|
### Bug Fixes
|
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.284",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Toa Boot",
|
|
6
6
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@toa.io/atomicity": "1.0.0-alpha.
|
|
25
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
26
|
-
"@toa.io/generic": "1.0.0-alpha.
|
|
27
|
-
"@toa.io/norm": "1.0.0-alpha.
|
|
28
|
-
"@toa.io/schemas": "1.0.0-alpha.
|
|
24
|
+
"@toa.io/atomicity": "1.0.0-alpha.284",
|
|
25
|
+
"@toa.io/core": "1.0.0-alpha.284",
|
|
26
|
+
"@toa.io/generic": "1.0.0-alpha.283",
|
|
27
|
+
"@toa.io/norm": "1.0.0-alpha.284",
|
|
28
|
+
"@toa.io/schemas": "1.0.0-alpha.283",
|
|
29
29
|
"clone-deep": "4.0.1",
|
|
30
30
|
"dotenv": "17.4.2",
|
|
31
31
|
"openspan": "1.0.0-alpha.277"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "006755556879e91e8d68fa86753aa3b475bdf4bf"
|
|
34
34
|
}
|
package/src/contract.js
CHANGED
|
@@ -12,7 +12,10 @@ export const request = (definition, entity) => {
|
|
|
12
12
|
|
|
13
13
|
export const reply = (output, errors) => {
|
|
14
14
|
const reply = Reply.schema(output, errors)
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
// a reply is read, not shaped: what the operation returned is what the caller gets,
|
|
17
|
+
// and a value that only fits once coerced does not fit
|
|
18
|
+
const schema = schemas.schema(reply, { coerceTypes: false, useDefaults: false })
|
|
16
19
|
|
|
17
20
|
return new Reply(schema)
|
|
18
21
|
}
|
package/src/env.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import dotenv from 'dotenv'
|
|
2
2
|
import { findUp } from '@toa.io/generic'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/*
|
|
5
|
+
* A local run reads what `toa env` wrote. `dotenv` leaves a variable that is already set
|
|
6
|
+
* alone, so what the environment says still wins and reading the file costs nothing where
|
|
7
|
+
* there is none — a deployment has no `.env` to find.
|
|
8
|
+
*
|
|
9
|
+
* It used to be read only where `TOA_ENV` was unset, taking that one variable as proof the
|
|
10
|
+
* environment had been injected. Setting it for any other reason then dropped the file
|
|
11
|
+
* whole, and every variable in it with it.
|
|
12
|
+
*/
|
|
13
|
+
const path = findUp('.env')
|
|
6
14
|
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
if (!('TOA_ENV' in process.env)) {
|
|
11
|
-
(async () => {
|
|
12
|
-
await setup()
|
|
13
|
-
})()
|
|
14
|
-
}
|
|
15
|
+
if (path !== undefined) dotenv.config({ path })
|
package/src/operation.js
CHANGED
|
@@ -4,7 +4,7 @@ import * as boot from './index.js'
|
|
|
4
4
|
|
|
5
5
|
export async function operation (manifest, endpoint, definition, context, scope, preflight) {
|
|
6
6
|
const cascade = await boot.cascade(manifest, endpoint, definition, context, preflight)
|
|
7
|
-
const reply = boot.contract.reply(definition.output, definition.
|
|
7
|
+
const reply = boot.contract.reply(definition.output, definition.errors)
|
|
8
8
|
const input = definition.input
|
|
9
9
|
const request = boot.contract.request({ input }, manifest.entity)
|
|
10
10
|
const contracts = { reply, request }
|