@travetto/openapi 5.0.15 → 5.0.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/openapi",
3
- "version": "5.0.15",
3
+ "version": "5.0.17",
4
4
  "description": "OpenAPI integration support for the Travetto framework",
5
5
  "keywords": [
6
6
  "rest",
@@ -26,22 +26,18 @@
26
26
  "directory": "module/openapi"
27
27
  },
28
28
  "dependencies": {
29
- "@travetto/config": "^5.0.11",
30
- "@travetto/rest": "^5.0.14",
31
- "@travetto/schema": "^5.0.11",
29
+ "@travetto/config": "^5.0.12",
30
+ "@travetto/rest": "^5.0.16",
31
+ "@travetto/schema": "^5.0.12",
32
32
  "openapi3-ts": "^4.4.0",
33
33
  "yaml": "^2.6.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "@travetto/cli": "^5.0.11",
37
- "@travetto/command": "^5.0.11"
36
+ "@travetto/cli": "^5.0.15"
38
37
  },
39
38
  "peerDependenciesMeta": {
40
39
  "@travetto/cli": {
41
40
  "optional": true
42
- },
43
- "@travetto/command": {
44
- "optional": true
45
41
  }
46
42
  },
47
43
  "travetto": {
@@ -1,4 +1,5 @@
1
1
  import path from 'node:path';
2
+ import cp from 'node:child_process';
2
3
 
3
4
  import { CliCommandShape, CliCommand, CliFlag } from '@travetto/cli';
4
5
  import { ExecUtil } from '@travetto/runtime';
@@ -29,18 +30,15 @@ export class OpenApiClientCommand implements CliCommandShape {
29
30
  this.output = path.resolve(this.output);
30
31
  this.input = path.resolve(this.input);
31
32
 
32
- // Peer dependency
33
- const { DockerContainer } = await import('@travetto/command');
34
-
35
- const cmd = new DockerContainer(this.dockerImage)
36
- .setUser(process.geteuid?.() ?? 0, process.getgid?.() ?? 0)
37
- .addVolume(this.output, '/workspace')
38
- .addVolume(path.dirname(this.input), '/input')
39
- .setInteractive(true)
40
- .setTTY(false)
41
- .setDeleteOnFinish(true);
42
-
43
- const proc = await cmd.run([
33
+ const proc = cp.spawn('docker', [
34
+ 'run',
35
+ '--rm',
36
+ '-i',
37
+ '-v', `${this.output}:/workspace`,
38
+ '-v', `${path.dirname(this.input)}:/input`,
39
+ '--user', `${process.geteuid?.() ?? 0}:${process.getgid?.() ?? 0}`,
40
+ this.dockerImage,
41
+ // Parameters
44
42
  'generate',
45
43
  '--skip-validate-spec',
46
44
  '--remove-operation-id-prefix',
@@ -48,9 +46,12 @@ export class OpenApiClientCommand implements CliCommandShape {
48
46
  '-o', '/workspace',
49
47
  '-i', `/input/${path.basename(this.input)}`,
50
48
  ...(this.props.length ? ['--additional-properties', this.props.join(',')] : [])
51
- ]);
49
+ ], {
50
+ stdio: 'inherit'
51
+ });
52
52
 
53
53
  const result = await ExecUtil.getResult(proc);
54
+
54
55
  if (!result.valid) {
55
56
  process.exitCode = 1;
56
57
  }