@kubb/core 1.15.0-canary.20231023T140655 → 1.15.0-canary.20231024T104207

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/globals.d.ts CHANGED
@@ -1,17 +1,6 @@
1
1
  /// <reference no-default-lib="true" />
2
2
  /// <reference lib="esnext" />
3
3
 
4
- type KubbObjectPlugins = {
5
- ['@kubb/swagger']: import('@kubb/swagger').PluginOptions
6
- ['@kubb/swagger-client']: import('@kubb/swagger-client').PluginOptions
7
- ['@kubb/swagger-faker']: import('@kubb/swagger-faker').PluginOptions
8
- ['@kubb/swagger-swr']: import('@kubb/swagger-swr').PluginOptions
9
- ['@kubb/swagger-tanstack-query']: import('@kubb/swagger-tanstack-query').PluginOptions
10
- ['@kubb/swagger-ts']: import('@kubb/swagger-ts').PluginOptions
11
- ['@kubb/swagger-zod']: import('@kubb/swagger-zod').PluginOptions
12
- ['@kubb/swagger-zodios']: import('@kubb/swagger-zodios').PluginOptions
13
- ['@kubb/swagger-msw']: import('@kubb/swagger-msw').PluginOptions
14
- }
15
4
  /**
16
5
  * `tsconfig.json`
17
6
  * @example
@@ -24,11 +13,39 @@ const swaggerPlugin: SwaggerPlugin={
24
13
  ___ validate: true
25
14
  }
26
15
  */
27
- declare module Kubb {
28
- type Plugins = _Register
29
- type OptionsPlugins = { [K in keyof KubbObjectPlugins]: KubbObjectPlugins[K]['options'] }
16
+ declare namespace Kubb {
17
+ namespace Helpers {
18
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never
19
+ type LastOf<T> = UnionToIntersection<T extends any ? () => T : never> extends () => infer R ? R : never
20
+
21
+ // TS4.0+
22
+ type Push<T extends any[], V> = [...T, V]
23
+
24
+ // TS4.1+
25
+ type TuplifyUnion<T, L = LastOf<T>, N = [T] extends [never] ? true : false> = true extends N ? [] : Push<TuplifyUnion<Exclude<T, L>>, L>
26
+
27
+ type ObjValueTuple<T, KS extends any[] = TuplifyUnion<keyof T>, R extends any[] = []> = KS extends [infer K, ...infer KT]
28
+ ? ObjValueTuple<T, KT, [...R, [name: K & keyof T, options: T[K & keyof T]]]>
29
+ : R
30
+
31
+ type TupleToUnion<T> = T extends Array<infer ITEMS> ? ITEMS : never
32
+ }
33
+ type Plugins = {
34
+ ['@kubb/swagger']: import('@kubb/swagger').PluginOptions
35
+ ['@kubb/swagger-client']: import('@kubb/swagger-client').PluginOptions
36
+ ['@kubb/swagger-faker']: import('@kubb/swagger-faker').PluginOptions
37
+ ['@kubb/swagger-swr']: import('@kubb/swagger-swr').PluginOptions
38
+ ['@kubb/swagger-tanstack-query']: import('@kubb/swagger-tanstack-query').PluginOptions
39
+ ['@kubb/swagger-ts']: import('@kubb/swagger-ts').PluginOptions
40
+ ['@kubb/swagger-zod']: import('@kubb/swagger-zod').PluginOptions
41
+ ['@kubb/swagger-zodios']: import('@kubb/swagger-zodios').PluginOptions
42
+ ['@kubb/swagger-msw']: import('@kubb/swagger-msw').PluginOptions
43
+ }
44
+ type OptionsPlugins = { [K in keyof Plugins]: Plugins[K]['options'] }
45
+
46
+ type OptionsOfPlugin<K extends keyof Plugins> = Plugins[K]['options']
30
47
 
31
- type OptionsOfPlugin<K extends keyof KubbObjectPlugins> = KubbObjectPlugins[K]['options']
48
+ type PluginUnion = Helpers.TupleToUnion<Helpers.ObjValueTuple<OptionsPlugins>>
32
49
 
33
- type Plugin = keyof KubbObjectPlugins
50
+ type Plugin = keyof Plugins
34
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/core",
3
- "version": "1.15.0-canary.20231023T140655",
3
+ "version": "1.15.0-canary.20231024T104207",
4
4
  "description": "Generator core",
5
5
  "keywords": [
6
6
  "typescript",
@@ -51,7 +51,7 @@
51
51
  "picocolors": "^1.0.0",
52
52
  "seedrandom": "^3.0.5",
53
53
  "semver": "^7.5.4",
54
- "@kubb/parser": "1.14.0"
54
+ "@kubb/parser": "1.15.0-canary.20231024T104143"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/fs-extra": "^11.0.3",
@@ -64,8 +64,8 @@
64
64
  "tsup": "^7.2.0",
65
65
  "typescript": "^5.2.2",
66
66
  "@kubb/eslint-config": "1.1.8",
67
- "@kubb/ts-config": "0.1.0",
68
- "@kubb/tsup-config": "1.1.8"
67
+ "@kubb/tsup-config": "1.1.8",
68
+ "@kubb/ts-config": "0.1.0"
69
69
  },
70
70
  "packageManager": "pnpm@8.3.0",
71
71
  "engines": {