@oasis-gen/darwin-x64 0.1.1 → 0.2.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.
Files changed (3) hide show
  1. package/README.md +16 -32
  2. package/bin/oasis-gen +0 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,15 +1,18 @@
1
- <img src="https://raw.githubusercontent.com/22mb/oasis/main/site/public/logo-512.png" alt="" width="96" height="96">
2
-
3
- # oasis-gen
4
-
5
- A minimal API client generator for **OpenAPI 3.2**.
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/22mb/oasis/main/site/public/logo-512.png" alt="" width="96" height="96">
3
+ <h1>oasis-gen</h1>
4
+ <p>A minimal API client generator for <b>OpenAPI 3.2</b>.</p>
5
+ <p>
6
+ <a href="https://22mb.github.io/oasis/"><b>Documentation</b></a> ·
7
+ <a href="https://22mb.github.io/oasis/playground"><b>Playground</b></a> ·
8
+ <a href="https://22mb.github.io/oasis/ja/">日本語</a>
9
+ </p>
10
+ </div>
6
11
 
7
12
  oasis-gen reads an OpenAPI document and writes one dependency-free TypeScript
8
13
  file, with types for every operation and a small `fetch`-based runtime.
9
14
 
10
- **[Documentation](https://22mb.github.io/oasis/)** ·
11
- **[Playground](https://22mb.github.io/oasis/playground)** ·
12
- [日本語](https://22mb.github.io/oasis/ja/)
15
+ <img src="https://raw.githubusercontent.com/22mb/oasis/main/site/public/strict-types.png" alt="In the generated client, res.data has the type $Pet when res.status is 200, $Error when it is 404, and unknown for any other status">
13
16
 
14
17
  - **OpenAPI 3.2**: `QUERY` operations, sequential media types (JSON Lines,
15
18
  server-sent events), multi-file documents, and JSON Schema 2020-12.
@@ -45,8 +48,8 @@ if (res.status === 200) {
45
48
  npm install --save-dev oasis-gen
46
49
  ```
47
50
 
48
- The CLI and the generated client need Node.js 24 or later. The client also
49
- runs in browsers, Deno, and Bun, and type-checks with TypeScript 5.0 or later.
51
+ The CLI and the generated client need Node.js 22 or later. The client also
52
+ runs in browsers and Bun, and type-checks with TypeScript 5.0 or later.
50
53
 
51
54
  The package ships prebuilt binaries for macOS, Linux, and Windows, on arm64
52
55
  and x64. npm installs only the one for your platform. Archives are also
@@ -74,29 +77,10 @@ cargo install --git https://github.com/22mb/oasis
74
77
 
75
78
  Changes in each release are listed in [CHANGELOG.md](CHANGELOG.md).
76
79
 
77
- ## Design
78
-
79
- ```
80
- JSON/YAML files ──Documents──▶ serde_json::Value per file ──parse──▶ ir::Api ──emit──▶ TypeScript
81
- ```
80
+ ## Contributing
82
81
 
83
- `src/documents.rs` loads the entry document and every local file it references,
84
- and resolves URI references (base URIs from `$self` and `$id`). `src/parse.rs`
85
- handles everything about the OpenAPI document (`$ref` resolution, version
86
- check, validation) and produces a language-neutral IR (`src/ir.rs`). Schemas
87
- behind `$ref`s outside `components.schemas` are hoisted into named schemas
88
- once, so references stay references and recursion is cheap. Emitters only
89
- translate the IR. Adding a target language means adding one emitter next to
90
- `src/typescript.rs`. The IR is public but not yet stable.
91
-
92
- ## Development
93
-
94
- ```sh
95
- cargo test # unit tests and golden files
96
- UPDATE_GOLDEN=1 cargo test # regenerate tests/golden after an intended change
97
- cd tests/ts && npm ci && npm test # type-check and run the generated client against a test server
98
- cd site && npm ci && npm run dev # the documentation site
99
- ```
82
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the development setup and the
83
+ design of the generator.
100
84
 
101
85
  ## License
102
86
 
package/bin/oasis-gen CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oasis-gen/darwin-x64",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "The oasis-gen binary for darwin-x64",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "repository": {