@sdk-it/vite 0.47.2 → 0.47.4
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 +2 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -27,6 +27,8 @@ const pet = await store.request('GET /pets/{petId}', { petId: 'p1' });
|
|
|
27
27
|
|
|
28
28
|
It handles imports that end with `.openapi.yaml`, and `.openapi` for a JSON document. `@sdk-it/content-mapper` renders the module, the same way it gives the import its types in `tsc` and the editor (see its README for the tsconfig `contentMappers` entry), so the types and the running code come from one render. The module's id is the document's path with `.ts` added, so Vite strips its types, in dev and in a build. An edit to the document, or to a file it references through `$ref`, reloads the module. A document referenced over http(s) is read each time the module loads, and is not watched. A document that does not render fails the import with its first diagnostic, at its line and column.
|
|
29
29
|
|
|
30
|
+
On App Store Connect (1,300 operations, a 3.5 MB module) a dev reload takes about 2 to 4 s. Vite 8.3's dev server holds about 30 MB more after each server-side (`ssrLoadModule`) reload of that module, as it does for a plain `.ts` file of the same size. [Import an OpenAPI document as a module](../../docs/recipes/import-openapi-document.md) sets up the types and Node too.
|
|
31
|
+
|
|
30
32
|
## Use an OpenAPI file
|
|
31
33
|
|
|
32
34
|
```typescript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdk-it/vite",
|
|
3
|
-
"version": "0.47.
|
|
3
|
+
"version": "0.47.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/JanuaryLabs/sdk-it",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"!**/*.test.*"
|
|
37
37
|
],
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@sdk-it/core": "0.47.
|
|
39
|
+
"@sdk-it/core": "0.47.4",
|
|
40
40
|
"@sdk-it/testing": "*",
|
|
41
41
|
"@zukhruf/fs": "^0.8.33"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@sdk-it/cli": "0.47.
|
|
45
|
-
"@sdk-it/content-mapper": "0.47.
|
|
46
|
-
"@sdk-it/spec": "0.47.
|
|
47
|
-
"@sdk-it/typescript": "0.47.
|
|
44
|
+
"@sdk-it/cli": "0.47.4",
|
|
45
|
+
"@sdk-it/content-mapper": "0.47.4",
|
|
46
|
+
"@sdk-it/spec": "0.47.4",
|
|
47
|
+
"@sdk-it/typescript": "0.47.4",
|
|
48
48
|
"openapi3-ts": "4.6.2",
|
|
49
49
|
"vite": "^7.0.0 || ^8.0.0"
|
|
50
50
|
},
|