@toa.io/operations 1.0.0-alpha.278 → 1.0.0-alpha.280

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,13 @@
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.280](https://github.com/toa-io/toa/compare/v1.0.0-alpha.279...v1.0.0-alpha.280) (2026-09-03)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **operations:** call execa, not the module it lives in ([9fe87d5](https://github.com/toa-io/toa/commit/9fe87d54cc02f7ec18e325c85882ff174acbe8ab))
11
+
12
+
6
13
  # [1.0.0-alpha.278](https://github.com/toa-io/toa/compare/v1.0.0-alpha.277...v1.0.0-alpha.278) (2026-09-03)
7
14
 
8
15
  **Note:** Version bump only for package @toa.io/operations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/operations",
3
- "version": "1.0.0-alpha.278",
3
+ "version": "1.0.0-alpha.280",
4
4
  "type": "module",
5
5
  "description": "Toa Deployment",
6
6
  "homepage": "https://toa.io",
@@ -34,5 +34,5 @@
34
34
  "fs-extra": "11.4.0",
35
35
  "js-yaml": "5.4.1"
36
36
  },
37
- "gitHead": "5872815748eed8021ea99d7beca1602f4fc5c958"
37
+ "gitHead": "2cf23f576c46efbe56c21427d877cef3e7ed98d4"
38
38
  }
package/src/process.js CHANGED
@@ -1,4 +1,4 @@
1
- import * as execa from 'execa'
1
+ import { execa } from 'execa'
2
2
 
3
3
  /**
4
4
  * @implements {toa.operations.Process}
@@ -7,7 +7,6 @@ export class Process {
7
7
  async execute (cmd, args, options = {}) {
8
8
  console.log('toa>', cmd, args.join(' '))
9
9
 
10
- /** @type {execa.ExecaReturnValue<import('stream').Stream>} */
11
10
  const command = execa(cmd, args)
12
11
 
13
12
  if (options.silently !== true) {
@@ -15,7 +14,6 @@ export class Process {
15
14
  command.stderr.pipe(process.stderr)
16
15
  }
17
16
 
18
- /** @type {execa.ExecaReturnValue<string>} */
19
17
  const result = await command
20
18
 
21
19
  return result.stdout
@@ -0,0 +1,20 @@
1
+ import { it, describe } from 'node:test'
2
+ import assert from 'node:assert/strict'
3
+
4
+ import { Process } from './process.js'
5
+
6
+ describe('execute', () => {
7
+ it('should answer what the command wrote', async () => {
8
+ // `execa` is a named export, and calling the module namespace instead answers
9
+ // `execa is not a function` — where only a deployment would have found out
10
+ const output = await new Process().execute('node', ['-e', 'process.stdout.write("ok")'],
11
+ { silently: true })
12
+
13
+ assert.strictEqual(output, 'ok')
14
+ })
15
+
16
+ it('should reject what the command failed at', async () => {
17
+ await assert.rejects(new Process().execute('node', ['-e', 'process.exit(1)'],
18
+ { silently: true }))
19
+ })
20
+ })