@hyper-fetch/cli 7.2.1
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/.eslintrc.json +11 -0
- package/README.md +63 -0
- package/dist/cli.cjs.js +3087 -0
- package/dist/cli.cjs.js.map +7 -0
- package/dist/index.d.ts +100 -0
- package/package.json +77 -0
- package/src/cli/index.ts +54 -0
- package/src/codegen/index.ts +1 -0
- package/src/codegen/openapi/generator.ts +338 -0
- package/src/codegen/openapi/http-methods.enum.ts +10 -0
- package/src/codegen/openapi/index.ts +3 -0
- package/src/codegen/openapi/openapi.types.ts +14 -0
- package/src/codegen/openapi/operations.ts +22 -0
- package/src/codegen/openapi/utils.ts +34 -0
- package/src/commands/add.ts +90 -0
- package/src/commands/generate.ts +104 -0
- package/src/commands/init.ts +191 -0
- package/src/config/get-config.ts +59 -0
- package/src/config/get-ts-alias.ts +25 -0
- package/src/config/schema.ts +22 -0
- package/src/index.ts +1 -0
- package/src/preflights/preflight-add.ts +43 -0
- package/src/preflights/preflight-generate.ts +46 -0
- package/src/utils/errors.ts +13 -0
- package/src/utils/handle-error.ts +35 -0
- package/src/utils/highlighter.ts +8 -0
- package/src/utils/logger.ts +20 -0
- package/src/utils/resolve-import.ts +14 -0
- package/src/utils/show-help.ts +37 -0
- package/src/utils/spinner.ts +13 -0
- package/src/utils/zod-to-table.ts +16 -0
- package/tsconfig.json +9 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["plugin:@nx/react", "../../.eslintrc.js"],
|
|
3
|
+
"parserOptions": {
|
|
4
|
+
"project": ["./tsconfig.json"]
|
|
5
|
+
},
|
|
6
|
+
"rules": {
|
|
7
|
+
"react/jsx-props-no-spreading": 0,
|
|
8
|
+
"react/require-default-props": 0
|
|
9
|
+
},
|
|
10
|
+
"ignorePatterns": ["dist/", "coverage/", "jest.config.ts", "/*.js"]
|
|
11
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# 🪄 Hyper Fetch CLI
|
|
2
|
+
|
|
3
|
+
<p>
|
|
4
|
+
<a href="https://bettertyped.com/">
|
|
5
|
+
<img src="https://custom-icon-badges.demolab.com/static/v1?label=&message=BetterTyped&color=333&logo=BT" />
|
|
6
|
+
</a>
|
|
7
|
+
<a href="https://github.com/BetterTyped/hyper-fetch">
|
|
8
|
+
<img src="https://custom-icon-badges.demolab.com/github/stars/BetterTyped/hyper-fetch?logo=star&color=118ab2" />
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://github.com/BetterTyped/hyper-fetch/blob/main/License.md">
|
|
11
|
+
<img src="https://custom-icon-badges.demolab.com/github/license/BetterTyped/hyper-fetch?logo=law&color=yellow" />
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/hyper-fetch">
|
|
14
|
+
<img src="https://custom-icon-badges.demolab.com/npm/v/hyper-fetch.svg?logo=npm&color=e76f51" />
|
|
15
|
+
</a>
|
|
16
|
+
<a href="https://api.codeclimate.com/v1/badges/eade9435e75ecea0c004/test_coverage">
|
|
17
|
+
<img src="https://api.codeclimate.com/v1/badges/eade9435e75ecea0c004/test_coverage" />
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://github.com/BetterTyped/hyper-fetch">
|
|
20
|
+
<img src="https://custom-icon-badges.demolab.com/badge/typescript-%23007ACC.svg?logo=typescript&logoColor=white" />
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://github.com/BetterTyped/hyper-fetch">
|
|
23
|
+
<img src="https://custom-icon-badges.demolab.com/badge/openapi-green.svg?logo=openapi&logoColor=fff" />
|
|
24
|
+
</a>
|
|
25
|
+
<a href="https://www.npmjs.com/package/hyper-fetch">
|
|
26
|
+
<img src="https://custom-icon-badges.demolab.com/bundlephobia/minzip/hyper-fetch?color=64BC4B&logo=package" />
|
|
27
|
+
</a>
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
## About
|
|
31
|
+
|
|
32
|
+
**`Hyper Fetch CLI`** is our command line featuring request sdk generators.
|
|
33
|
+
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
✨ **Generate code** - from **OpenApi V3** / **Swagger** schema - both types and actual requests.
|
|
37
|
+
|
|
38
|
+
✨ **Flexible** - after generation you can edit Hyper Fetch client and all related requests.
|
|
39
|
+
|
|
40
|
+
✨ **No additional boilerplate** - if you know Hyper Fetch, you don't need anything else.
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
npx @hyper-fetch/cli@latest
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
...and it works! All code generated and ready to use.
|
|
47
|
+
|
|
48
|
+
## Help us keep working on this project ❤️
|
|
49
|
+
|
|
50
|
+
- [Become a Sponsor on GitHub](https://github.com/sponsors/prc5)
|
|
51
|
+
|
|
52
|
+
## Sources
|
|
53
|
+
|
|
54
|
+
- #### [Installation](https://hyperfetch.bettertyped.com/docs/getting-started/installation)
|
|
55
|
+
- #### [Docs](https://hyperfetch.bettertyped.com/)
|
|
56
|
+
- #### [API](https://hyperfetch.bettertyped.com/api/)
|
|
57
|
+
- #### [NPM](https://www.npmjs.com/package/@hyper-fetch/cli)
|
|
58
|
+
- #### [Guides](https://hyperfetch.bettertyped.com/guides/Basic/Setup)
|
|
59
|
+
|
|
60
|
+
## Disclaimer
|
|
61
|
+
|
|
62
|
+
This package is heavily inspired by [Openapi Client Axios](https://www.npmjs.com/package/openapi-client-axios). Thanks
|
|
63
|
+
`anttiviljami` for all his hard work!
|