@hey-api/openapi-ts 0.60.0 → 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>
@@ -19,13 +19,13 @@
19
19
 
20
20
  Please visit our [website](https://heyapi.dev/) for documentation, guides, migrating, and more.
21
21
 
22
- ## Sponsoring
22
+ ## Sponsors
23
23
 
24
24
  Love Hey API? Become our [sponsor](https://github.com/sponsors/hey-api).
25
25
 
26
26
  <p>
27
27
  <a href="https://kutt.it/pkEZyc" target="_blank">
28
- <img alt="Stainless logo" height="50" src="https://heyapi.dev/images/stainless-logo-wordmark-480w.png" />
28
+ <img alt="Stainless logo" height="50" src="https://heyapi.dev/images/stainless-logo-wordmark-480w.jpeg" />
29
29
  </a>
30
30
  </p>
31
31
 
@@ -35,4 +35,4 @@ Automatically update your code when the APIs it depends on change. [Find out mor
35
35
 
36
36
  ## Migration Guides
37
37
 
38
- [OpenAPI Typescript Codegen](https://heyapi.dev/openapi-ts/migrating.html#openapi-typescript-codegen).
38
+ [OpenAPI Typescript Codegen](https://heyapi.dev/openapi-ts/migrating.html#openapi-typescript-codegen)
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
  }