@hey-api/openapi-ts 0.60.1 → 0.61.0

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <div align="center">
2
- <img width="150" height="150" src="https://heyapi.dev/logo.png" alt="Logo">
2
+ <img alt="Hey API logo" height="150" src="https://heyapi.dev/images/logo-300w.png" width="150">
3
3
  <h1 align="center"><b>OpenAPI TypeScript</b></h1>
4
4
  <p align="center">🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.</p>
5
5
  </div>
package/bin/index.cjs CHANGED
@@ -34,6 +34,10 @@ const params = program
34
34
  'DEPRECATED. Manually set base in OpenAPI config instead of inferring from server value',
35
35
  )
36
36
  .option('-s, --silent', 'Set log level to silent')
37
+ .option(
38
+ '-w, --watch [value]',
39
+ 'Regenerate the client when the input file changes?',
40
+ )
37
41
  .option('--exportCore [value]', 'DEPRECATED. Write core files to disk')
38
42
  .option('--name <value>', 'DEPRECATED. Custom client class name')
39
43
  .option('--request <value>', 'DEPRECATED. Path to custom request file')
@@ -102,8 +106,14 @@ async function start() {
102
106
  userConfig.logs.level = 'silent';
103
107
  }
104
108
 
105
- await createClient(userConfig);
106
- process.exit(0);
109
+ if (typeof params.watch === 'string') {
110
+ userConfig.watch = Number.parseInt(params.watch, 10);
111
+ }
112
+
113
+ const context = await createClient(userConfig);
114
+ if (!context[0] || !context[0].config.watch) {
115
+ process.exit(0);
116
+ }
107
117
  } catch (error) {
108
118
  process.exit(1);
109
119
  }