unplugin-kubb 5.10.2 → 5.10.3
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/dist/astro.cjs +7 -2
- package/dist/astro.cjs.map +1 -1
- package/dist/astro.d.cts +16 -0
- package/dist/astro.d.ts +0 -1
- package/dist/esbuild.d.cts +5 -0
- package/dist/esbuild.d.ts +0 -1
- package/dist/farm.d.cts +5 -0
- package/dist/farm.d.ts +0 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +0 -1
- package/dist/nuxt.cjs +0 -1
- package/dist/nuxt.cjs.map +1 -1
- package/dist/nuxt.d.cts +8 -0
- package/dist/nuxt.d.ts +0 -1
- package/dist/rolldown.d.cts +5 -0
- package/dist/rolldown.d.ts +0 -1
- package/dist/rollup.d.cts +5 -0
- package/dist/rollup.d.ts +0 -1
- package/dist/rspack.d.cts +5 -0
- package/dist/rspack.d.ts +0 -1
- package/dist/unpluginFactory.cjs +0 -1
- package/dist/unpluginFactory.cjs.map +1 -1
- package/dist/unpluginFactory.d.cts +31 -0
- package/dist/unpluginFactory.d.ts +1 -2
- package/dist/vite.d.cts +5 -0
- package/dist/vite.d.ts +0 -1
- package/dist/webpack.d.cts +5 -0
- package/dist/webpack.d.ts +0 -1
- package/package.json +87 -37
package/dist/astro.cjs
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-ClG-MNz_.cjs");
|
|
2
1
|
const require_vite = require("./vite.cjs");
|
|
3
2
|
//#region src/astro.ts
|
|
4
|
-
var astro_default =
|
|
3
|
+
var astro_default = (options) => ({
|
|
5
4
|
name: "unplugin-kubb",
|
|
6
5
|
hooks: { "astro:config:setup": (astro) => {
|
|
7
6
|
astro.config.vite.plugins ||= [];
|
|
8
7
|
astro.config.vite.plugins.push(require_vite(options));
|
|
9
8
|
} }
|
|
9
|
+
});
|
|
10
|
+
//#endregion
|
|
11
|
+
module.exports = astro_default;
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=astro.cjs.maplugins.push(require_vite(options));
|
|
14
|
+
} }
|
|
10
15
|
}), "default");
|
|
11
16
|
//#endregion
|
|
12
17
|
module.exports = astro_default;
|
package/dist/astro.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro.cjs","names":["vitePlugin"],"sources":["../src/astro.ts"],"sourcesContent":["import type { Options } from './unpluginFactory.ts'\nimport vitePlugin from './vite.ts'\n\nexport default (options: Options) => ({\n name: 'unplugin-kubb',\n hooks: {\n // Only the slice of Astro's `astro:config:setup` params the integration touches, so `astro` is not a dependency.\n 'astro:config:setup': (astro: { config: { vite: { plugins?: Array<unknown> } } }) => {\n astro.config.vite.plugins ||= []\n astro.config.vite.plugins.push(vitePlugin(options))\n },\n },\n})\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"astro.cjs","names":["vitePlugin"],"sources":["../src/astro.ts"],"sourcesContent":["import type { Options } from './unpluginFactory.ts'\nimport vitePlugin from './vite.ts'\n\nexport default (options: Options) => ({\n name: 'unplugin-kubb',\n hooks: {\n // Only the slice of Astro's `astro:config:setup` params the integration touches, so `astro` is not a dependency.\n 'astro:config:setup': (astro: { config: { vite: { plugins?: Array<unknown> } } }) => {\n astro.config.vite.plugins ||= []\n astro.config.vite.plugins.push(vitePlugin(options))\n },\n },\n})\n"],"mappings":";;AAGA,IAAA,iBAAgB,aAAsB;CACpC,MAAM;CACN,OAAO,EAEL,uBAAuB,UAA8D;EACnF,MAAM,OAAO,KAAK,YAAY,CAAC;EAC/B,MAAM,OAAO,KAAK,QAAQ,KAAKA,aAAW,OAAO,CAAC;CACpD,EACF;AACF"}
|
package/dist/astro.d.cts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Options } from "./unpluginFactory.cjs";
|
|
2
|
+
//#region src/astro.d.ts
|
|
3
|
+
declare const _default: (options: Options) => {
|
|
4
|
+
name: string;
|
|
5
|
+
hooks: {
|
|
6
|
+
'astro:config:setup': (astro: {
|
|
7
|
+
config: {
|
|
8
|
+
vite: {
|
|
9
|
+
plugins?: Array<unknown>;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}) => void;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export = _default;
|
|
16
|
+
//# sourceMappingURL=astro.d.cts.map
|
package/dist/astro.d.ts
CHANGED
package/dist/esbuild.d.ts
CHANGED
package/dist/farm.d.cts
ADDED
package/dist/farm.d.ts
CHANGED
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Options, applyDefaults, unpluginFactory } from "./unpluginFactory.cjs";
|
|
2
|
+
//#region src/index.d.ts
|
|
3
|
+
declare const plugin: import("unplugin").UnpluginInstance<Options | undefined, boolean>;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { type Options, applyDefaults, plugin as default, plugin as unplugin, unpluginFactory };
|
|
6
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
package/dist/nuxt.cjs
CHANGED
package/dist/nuxt.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuxt.cjs","names":["defineNuxtModule","vite","webpack","rspack"],"sources":["../src/nuxt.ts"],"sourcesContent":["import { addRspackPlugin, addVitePlugin, addWebpackPlugin, defineNuxtModule } from '@nuxt/kit'\nimport '@nuxt/schema'\n\nimport rspack from './rspack.ts'\nimport type { Options } from './unpluginFactory.ts'\nimport vite from './vite.ts'\nimport webpack from './webpack.ts'\n\nexport type ModuleOptions = Options\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: 'nuxt-unplugin-kubb',\n configKey: 'unpluginKubb',\n },\n defaults: undefined,\n setup(options, _nuxt) {\n // Nuxt builds the client before the server, so generating in the client build alone gives\n // the server build the files too. Skip the dev server, as the Vite integration does.\n const buildOptions = { dev: false, server: false }\n\n addVitePlugin(() => vite(options), buildOptions)\n addWebpackPlugin(() => webpack(options), buildOptions)\n addRspackPlugin(() => rspack(options), buildOptions)\n },\n})\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"nuxt.cjs","names":["defineNuxtModule","vite","webpack","rspack"],"sources":["../src/nuxt.ts"],"sourcesContent":["import { addRspackPlugin, addVitePlugin, addWebpackPlugin, defineNuxtModule } from '@nuxt/kit'\nimport '@nuxt/schema'\n\nimport rspack from './rspack.ts'\nimport type { Options } from './unpluginFactory.ts'\nimport vite from './vite.ts'\nimport webpack from './webpack.ts'\n\nexport type ModuleOptions = Options\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: 'nuxt-unplugin-kubb',\n configKey: 'unpluginKubb',\n },\n defaults: undefined,\n setup(options, _nuxt) {\n // Nuxt builds the client before the server, so generating in the client build alone gives\n // the server build the files too. Skip the dev server, as the Vite integration does.\n const buildOptions = { dev: false, server: false }\n\n addVitePlugin(() => vite(options), buildOptions)\n addWebpackPlugin(() => webpack(options), buildOptions)\n addRspackPlugin(() => rspack(options), buildOptions)\n },\n})\n"],"mappings":";;;;;;AAUA,IAAA,gBAAA,GAAeA,UAAAA,iBAAAA,CAAgC;CAC7C,MAAM;EACJ,MAAM;EACN,WAAW;CACb;CACA,UAAU,KAAA;CACV,MAAM,SAAS,OAAO;EAGpB,MAAM,eAAe;GAAE,KAAK;GAAO,QAAQ;EAAM;EAEjD,CAAA,GAAA,UAAA,cAAA,OAAoBC,aAAK,OAAO,GAAG,YAAY;EAC/C,CAAA,GAAA,UAAA,iBAAA,OAAuBC,gBAAQ,OAAO,GAAG,YAAY;EACrD,CAAA,GAAA,UAAA,gBAAA,OAAsBC,eAAO,OAAO,GAAG,YAAY;CACrD;AACF,CAAC"}
|
package/dist/nuxt.d.cts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Options } from "./unpluginFactory.cjs";
|
|
2
|
+
import "@nuxt/schema";
|
|
3
|
+
//#region src/nuxt.d.ts
|
|
4
|
+
export type ModuleOptions = Options;
|
|
5
|
+
declare const _default: import("@nuxt/schema").NuxtModule<Options, Options, false>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
|
8
|
+
//# sourceMappingURL=nuxt.d.cts.map
|
package/dist/nuxt.d.ts
CHANGED
package/dist/rolldown.d.ts
CHANGED
package/dist/rollup.d.ts
CHANGED
package/dist/rspack.d.ts
CHANGED
package/dist/unpluginFactory.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unpluginFactory.cjs","names":["adapterOas","parserTs","parserTsx","parserMd","cliReporter","jsonReporter","fileReporter","htmlReporter","pluginBarrelName","pluginBarrel","Hookable","createCliReporter","logLevel","Diagnostics","createKubb"],"sources":["../src/unpluginFactory.ts"],"sourcesContent":["import { adapterOas } from '@kubb/adapter-oas'\nimport {\n cliReporter,\n type Config,\n createCliReporter,\n createKubb,\n Diagnostics,\n fileReporter,\n Hookable,\n htmlReporter,\n jsonReporter,\n type KubbHooks,\n logLevel,\n type UserConfig,\n} from '@kubb/core'\nimport { parserMd } from '@kubb/parser-md'\nimport { parserTs, parserTsx } from '@kubb/parser-ts'\nimport { pluginBarrel, pluginBarrelName } from '@kubb/plugin-barrel'\nimport type { UnpluginFactory } from 'unplugin'\n\nexport type Options = {\n /**\n * Kubb config passed to the unplugin entry point.\n */\n config?: UserConfig\n}\n\n/**\n * Applies the defaults `defineConfig` and the unplugin share to a single user config when not set.\n *\n * - `root` defaults to `process.cwd()`\n * - `adapter` defaults to `adapterOas()`\n * - `parsers` defaults to `[parserTs(), parserTsx(), parserMd()]`\n * - `reporters` defaults to `[cliReporter, jsonReporter, fileReporter, htmlReporter]`\n * - `plugins` gets `pluginBarrel()` appended when none is already present\n * - `output.barrel` defaults to `false` when not set (`pluginBarrel` is always present after the step above, but generates nothing until configured)\n * - `output.format` and `output.lint` default to `false`\n */\nexport function applyDefaults<TInput>(config: UserConfig<TInput>): UserConfig<TInput> {\n const plugins = config.plugins ?? []\n\n return {\n ...config,\n root: config.root || process.cwd(),\n adapter: config.adapter ?? adapterOas(),\n parsers: config.parsers?.length ? config.parsers : [parserTs(), parserTsx(), parserMd()],\n reporters: config.reporters?.length ? config.reporters : [cliReporter, jsonReporter, fileReporter, htmlReporter],\n plugins: plugins.some((plugin) => plugin.name === pluginBarrelName) ? plugins : [...plugins, pluginBarrel()],\n output: { barrel: false, format: false, lint: false, ...config.output },\n }\n}\n\n/**\n * Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).\n *\n * Runs the Kubb build during the first `buildStart` with {@link applyDefaults} applied to the\n * config and prints the same summary `kubb generate` does. Under Vite it only applies during\n * `build`. A missing config or a failed generation fails the host build.\n */\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (options, meta) => {\n const name = 'unplugin-kubb' as const\n const hooks = new Hookable<KubbHooks>()\n const reporter = createCliReporter()\n\n hooks.hook('kubb:generation:end', ({ config, diagnostics = [], filesCreated = 0, status = 'success', hrStart = process.hrtime() }) =>\n reporter.report({ config, diagnostics, filesCreated, status, hrStart }, { logLevel: logLevel.info }),\n )\n\n // Throw: webpack, Rspack, esbuild, and Farm contexts have no `this.error`.\n async function runBuild() {\n if (!options?.config) {\n throw new Diagnostics.Error({\n code: Diagnostics.code.inputRequired,\n severity: 'error',\n message: `[${name}] Config is not set`,\n help: 'Pass your Kubb config as the `config` option of the plugin.',\n location: { kind: 'config' },\n })\n }\n\n const kubb = createKubb(applyDefaults(options.config) as Config, { hooks })\n const result = await kubb.generate()\n\n if (!result.success) {\n const failedCount = Diagnostics.failedPlugins(result.diagnostics).length\n const firstError = result.diagnostics.filter(Diagnostics.isProblem).find((diagnostic) => diagnostic.severity === 'error')\n const message = failedCount > 0 ? `Build Error with ${failedCount} failed plugins` : (firstError?.message ?? 'Build failed')\n\n // Keep the first error's code, help, and location, so the bundler shows the same diagnostic.\n throw new Diagnostics.Error({\n ...(firstError ?? { code: Diagnostics.code.unknown, severity: 'error' }),\n message: `[${name}] ${message}`,\n })\n }\n }\n\n // A rerun with `output.clean` loops webpack and Rspack watchers, so generate once per instance.\n let generation: Promise<void> | undefined\n\n return {\n name,\n enforce: 'pre',\n apply: meta.framework === 'vite' ? 'build' : undefined,\n async buildStart() {\n generation ??= runBuild().catch((error: unknown) => {\n generation = undefined\n throw error\n })\n await generation\n },\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"unpluginFactory.cjs","names":["adapterOas","parserTs","parserTsx","parserMd","cliReporter","jsonReporter","fileReporter","htmlReporter","pluginBarrelName","pluginBarrel","Hookable","createCliReporter","logLevel","Diagnostics","createKubb"],"sources":["../src/unpluginFactory.ts"],"sourcesContent":["import { adapterOas } from '@kubb/adapter-oas'\nimport {\n cliReporter,\n type Config,\n createCliReporter,\n createKubb,\n Diagnostics,\n fileReporter,\n Hookable,\n htmlReporter,\n jsonReporter,\n type KubbHooks,\n logLevel,\n type UserConfig,\n} from '@kubb/core'\nimport { parserMd } from '@kubb/parser-md'\nimport { parserTs, parserTsx } from '@kubb/parser-ts'\nimport { pluginBarrel, pluginBarrelName } from '@kubb/plugin-barrel'\nimport type { UnpluginFactory } from 'unplugin'\n\nexport type Options = {\n /**\n * Kubb config passed to the unplugin entry point.\n */\n config?: UserConfig\n}\n\n/**\n * Applies the defaults `defineConfig` and the unplugin share to a single user config when not set.\n *\n * - `root` defaults to `process.cwd()`\n * - `adapter` defaults to `adapterOas()`\n * - `parsers` defaults to `[parserTs(), parserTsx(), parserMd()]`\n * - `reporters` defaults to `[cliReporter, jsonReporter, fileReporter, htmlReporter]`\n * - `plugins` gets `pluginBarrel()` appended when none is already present\n * - `output.barrel` defaults to `false` when not set (`pluginBarrel` is always present after the step above, but generates nothing until configured)\n * - `output.format` and `output.lint` default to `false`\n */\nexport function applyDefaults<TInput>(config: UserConfig<TInput>): UserConfig<TInput> {\n const plugins = config.plugins ?? []\n\n return {\n ...config,\n root: config.root || process.cwd(),\n adapter: config.adapter ?? adapterOas(),\n parsers: config.parsers?.length ? config.parsers : [parserTs(), parserTsx(), parserMd()],\n reporters: config.reporters?.length ? config.reporters : [cliReporter, jsonReporter, fileReporter, htmlReporter],\n plugins: plugins.some((plugin) => plugin.name === pluginBarrelName) ? plugins : [...plugins, pluginBarrel()],\n output: { barrel: false, format: false, lint: false, ...config.output },\n }\n}\n\n/**\n * Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).\n *\n * Runs the Kubb build during the first `buildStart` with {@link applyDefaults} applied to the\n * config and prints the same summary `kubb generate` does. Under Vite it only applies during\n * `build`. A missing config or a failed generation fails the host build.\n */\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (options, meta) => {\n const name = 'unplugin-kubb' as const\n const hooks = new Hookable<KubbHooks>()\n const reporter = createCliReporter()\n\n hooks.hook('kubb:generation:end', ({ config, diagnostics = [], filesCreated = 0, status = 'success', hrStart = process.hrtime() }) =>\n reporter.report({ config, diagnostics, filesCreated, status, hrStart }, { logLevel: logLevel.info }),\n )\n\n // Throw: webpack, Rspack, esbuild, and Farm contexts have no `this.error`.\n async function runBuild() {\n if (!options?.config) {\n throw new Diagnostics.Error({\n code: Diagnostics.code.inputRequired,\n severity: 'error',\n message: `[${name}] Config is not set`,\n help: 'Pass your Kubb config as the `config` option of the plugin.',\n location: { kind: 'config' },\n })\n }\n\n const kubb = createKubb(applyDefaults(options.config) as Config, { hooks })\n const result = await kubb.generate()\n\n if (!result.success) {\n const failedCount = Diagnostics.failedPlugins(result.diagnostics).length\n const firstError = result.diagnostics.filter(Diagnostics.isProblem).find((diagnostic) => diagnostic.severity === 'error')\n const message = failedCount > 0 ? `Build Error with ${failedCount} failed plugins` : (firstError?.message ?? 'Build failed')\n\n // Keep the first error's code, help, and location, so the bundler shows the same diagnostic.\n throw new Diagnostics.Error({\n ...(firstError ?? { code: Diagnostics.code.unknown, severity: 'error' }),\n message: `[${name}] ${message}`,\n })\n }\n }\n\n // A rerun with `output.clean` loops webpack and Rspack watchers, so generate once per instance.\n let generation: Promise<void> | undefined\n\n return {\n name,\n enforce: 'pre',\n apply: meta.framework === 'vite' ? 'build' : undefined,\n async buildStart() {\n generation ??= runBuild().catch((error: unknown) => {\n generation = undefined\n throw error\n })\n await generation\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsCA,SAAgB,cAAsB,QAAgD;CACpF,MAAM,UAAU,OAAO,WAAW,CAAC;CAEnC,OAAO;EACL,GAAG;EACH,MAAM,OAAO,QAAQ,QAAQ,IAAI;EACjC,SAAS,OAAO,YAAA,GAAWA,kBAAAA,WAAAA,CAAW;EACtC,SAAS,OAAO,SAAS,SAAS,OAAO,UAAU;IAACC,GAAAA,gBAAAA,SAAAA,CAAS;IAAGC,GAAAA,gBAAAA,UAAAA,CAAU;IAAGC,GAAAA,gBAAAA,SAAAA,CAAS;EAAC;EACvF,WAAW,OAAO,WAAW,SAAS,OAAO,YAAY;GAACC,WAAAA;GAAaC,WAAAA;GAAcC,WAAAA;GAAcC,WAAAA;EAAY;EAC/G,SAAS,QAAQ,MAAM,WAAW,OAAO,SAASC,oBAAAA,gBAAgB,IAAI,UAAU,CAAC,GAAG,UAAA,GAASC,oBAAAA,aAAAA,CAAa,CAAC;EAC3G,QAAQ;GAAE,QAAQ;GAAO,QAAQ;GAAO,MAAM;GAAO,GAAG,OAAO;EAAO;CACxE;AACF;;;;;;;;AASA,MAAa,mBAAyD,SAAS,SAAS;CACtF,MAAM,OAAO;CACb,MAAM,QAAQ,IAAIC,WAAAA,SAAoB;CACtC,MAAM,YAAA,GAAWC,WAAAA,kBAAAA,CAAkB;CAEnC,MAAM,KAAK,wBAAwB,EAAE,QAAQ,cAAc,CAAC,GAAG,eAAe,GAAG,SAAS,WAAW,UAAU,QAAQ,OAAO,QAC5H,SAAS,OAAO;EAAE;EAAQ;EAAa;EAAc;EAAQ;CAAQ,GAAG,EAAE,UAAUC,WAAAA,SAAS,KAAK,CAAC,CACrG;CAGA,eAAe,WAAW;EACxB,IAAI,CAAC,SAAS,QACZ,MAAM,IAAIC,WAAAA,YAAY,MAAM;GAC1B,MAAMA,WAAAA,YAAY,KAAK;GACvB,UAAU;GACV,SAAS,IAAI,KAAK;GAClB,MAAM;GACN,UAAU,EAAE,MAAM,SAAS;EAC7B,CAAC;EAIH,MAAM,SAAS,OAAA,GADFC,WAAAA,WAAAA,CAAW,cAAc,QAAQ,MAAM,GAAa,EAAE,MAAM,CACjD,CAAC,CAAC,SAAS;EAEnC,IAAI,CAAC,OAAO,SAAS;GACnB,MAAM,cAAcD,WAAAA,YAAY,cAAc,OAAO,WAAW,CAAC,CAAC;GAClE,MAAM,aAAa,OAAO,YAAY,OAAOA,WAAAA,YAAY,SAAS,CAAC,CAAC,MAAM,eAAe,WAAW,aAAa,OAAO;GACxH,MAAM,UAAU,cAAc,IAAI,oBAAoB,YAAY,mBAAoB,YAAY,WAAW;GAG7G,MAAM,IAAIA,WAAAA,YAAY,MAAM;IAC1B,GAAI,cAAc;KAAE,MAAMA,WAAAA,YAAY,KAAK;KAAS,UAAU;IAAQ;IACtE,SAAS,IAAI,KAAK,IAAI;GACxB,CAAC;EACH;CACF;CAGA,IAAI;CAEJ,OAAO;EACL;EACA,SAAS;EACT,OAAO,KAAK,cAAc,SAAS,UAAU,KAAA;EAC7C,MAAM,aAAa;GACjB,eAAe,SAAS,CAAC,CAAC,OAAO,UAAmB;IAClD,aAAa,KAAA;IACb,MAAM;GACR,CAAC;GACD,MAAM;EACR;CACF;AACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { UserConfig } from "@kubb/core";
|
|
2
|
+
import { UnpluginFactory } from "unplugin";
|
|
3
|
+
//#region src/unpluginFactory.d.ts
|
|
4
|
+
export type Options = {
|
|
5
|
+
/**
|
|
6
|
+
* Kubb config passed to the unplugin entry point.
|
|
7
|
+
*/
|
|
8
|
+
config?: UserConfig;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Applies the defaults `defineConfig` and the unplugin share to a single user config when not set.
|
|
12
|
+
*
|
|
13
|
+
* - `root` defaults to `process.cwd()`
|
|
14
|
+
* - `adapter` defaults to `adapterOas()`
|
|
15
|
+
* - `parsers` defaults to `[parserTs(), parserTsx(), parserMd()]`
|
|
16
|
+
* - `reporters` defaults to `[cliReporter, jsonReporter, fileReporter, htmlReporter]`
|
|
17
|
+
* - `plugins` gets `pluginBarrel()` appended when none is already present
|
|
18
|
+
* - `output.barrel` defaults to `false` when not set (`pluginBarrel` is always present after the step above, but generates nothing until configured)
|
|
19
|
+
* - `output.format` and `output.lint` default to `false`
|
|
20
|
+
*/
|
|
21
|
+
export declare function applyDefaults<TInput>(config: UserConfig<TInput>): UserConfig<TInput>;
|
|
22
|
+
/**
|
|
23
|
+
* Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).
|
|
24
|
+
*
|
|
25
|
+
* Runs the Kubb build during the first `buildStart` with {@link applyDefaults} applied to the
|
|
26
|
+
* config and prints the same summary `kubb generate` does. Under Vite it only applies during
|
|
27
|
+
* `build`. A missing config or a failed generation fails the host build.
|
|
28
|
+
*/
|
|
29
|
+
export declare const unpluginFactory: UnpluginFactory<Options | undefined>;
|
|
30
|
+
//#endregion
|
|
31
|
+
//# sourceMappingURL=unpluginFactory.d.cts.map
|
package/dist/vite.d.cts
ADDED
package/dist/vite.d.ts
CHANGED
package/dist/webpack.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-kubb",
|
|
3
|
-
"version": "5.10.
|
|
3
|
+
"version": "5.10.3",
|
|
4
4
|
"description": "Integration of Kubb for Vite, webpack, Rollup, Rolldown, Rspack, esbuild, Farm, Nuxt, and Astro.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro",
|
|
@@ -60,54 +60,104 @@
|
|
|
60
60
|
},
|
|
61
61
|
"exports": {
|
|
62
62
|
".": {
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
"import": {
|
|
64
|
+
"types": "./dist/index.d.ts",
|
|
65
|
+
"default": "./dist/index.js"
|
|
66
|
+
},
|
|
67
|
+
"require": {
|
|
68
|
+
"types": "./dist/index.d.cts",
|
|
69
|
+
"default": "./dist/index.cjs"
|
|
70
|
+
}
|
|
66
71
|
},
|
|
67
72
|
"./astro": {
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
"import": {
|
|
74
|
+
"types": "./dist/astro.d.ts",
|
|
75
|
+
"default": "./dist/astro.js"
|
|
76
|
+
},
|
|
77
|
+
"require": {
|
|
78
|
+
"types": "./dist/astro.d.cts",
|
|
79
|
+
"default": "./dist/astro.cjs"
|
|
80
|
+
}
|
|
71
81
|
},
|
|
72
82
|
"./esbuild": {
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
83
|
+
"import": {
|
|
84
|
+
"types": "./dist/esbuild.d.ts",
|
|
85
|
+
"default": "./dist/esbuild.js"
|
|
86
|
+
},
|
|
87
|
+
"require": {
|
|
88
|
+
"types": "./dist/esbuild.d.cts",
|
|
89
|
+
"default": "./dist/esbuild.cjs"
|
|
90
|
+
}
|
|
76
91
|
},
|
|
77
92
|
"./farm": {
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
93
|
+
"import": {
|
|
94
|
+
"types": "./dist/farm.d.ts",
|
|
95
|
+
"default": "./dist/farm.js"
|
|
96
|
+
},
|
|
97
|
+
"require": {
|
|
98
|
+
"types": "./dist/farm.d.cts",
|
|
99
|
+
"default": "./dist/farm.cjs"
|
|
100
|
+
}
|
|
81
101
|
},
|
|
82
102
|
"./nuxt": {
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
103
|
+
"import": {
|
|
104
|
+
"types": "./dist/nuxt.d.ts",
|
|
105
|
+
"default": "./dist/nuxt.js"
|
|
106
|
+
},
|
|
107
|
+
"require": {
|
|
108
|
+
"types": "./dist/nuxt.d.cts",
|
|
109
|
+
"default": "./dist/nuxt.cjs"
|
|
110
|
+
}
|
|
86
111
|
},
|
|
87
112
|
"./rolldown": {
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
113
|
+
"import": {
|
|
114
|
+
"types": "./dist/rolldown.d.ts",
|
|
115
|
+
"default": "./dist/rolldown.js"
|
|
116
|
+
},
|
|
117
|
+
"require": {
|
|
118
|
+
"types": "./dist/rolldown.d.cts",
|
|
119
|
+
"default": "./dist/rolldown.cjs"
|
|
120
|
+
}
|
|
91
121
|
},
|
|
92
122
|
"./rollup": {
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
123
|
+
"import": {
|
|
124
|
+
"types": "./dist/rollup.d.ts",
|
|
125
|
+
"default": "./dist/rollup.js"
|
|
126
|
+
},
|
|
127
|
+
"require": {
|
|
128
|
+
"types": "./dist/rollup.d.cts",
|
|
129
|
+
"default": "./dist/rollup.cjs"
|
|
130
|
+
}
|
|
96
131
|
},
|
|
97
132
|
"./rspack": {
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
133
|
+
"import": {
|
|
134
|
+
"types": "./dist/rspack.d.ts",
|
|
135
|
+
"default": "./dist/rspack.js"
|
|
136
|
+
},
|
|
137
|
+
"require": {
|
|
138
|
+
"types": "./dist/rspack.d.cts",
|
|
139
|
+
"default": "./dist/rspack.cjs"
|
|
140
|
+
}
|
|
101
141
|
},
|
|
102
142
|
"./vite": {
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
|
|
143
|
+
"import": {
|
|
144
|
+
"types": "./dist/vite.d.ts",
|
|
145
|
+
"default": "./dist/vite.js"
|
|
146
|
+
},
|
|
147
|
+
"require": {
|
|
148
|
+
"types": "./dist/vite.d.cts",
|
|
149
|
+
"default": "./dist/vite.cjs"
|
|
150
|
+
}
|
|
106
151
|
},
|
|
107
152
|
"./webpack": {
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
|
|
153
|
+
"import": {
|
|
154
|
+
"types": "./dist/webpack.d.ts",
|
|
155
|
+
"default": "./dist/webpack.js"
|
|
156
|
+
},
|
|
157
|
+
"require": {
|
|
158
|
+
"types": "./dist/webpack.d.cts",
|
|
159
|
+
"default": "./dist/webpack.cjs"
|
|
160
|
+
}
|
|
111
161
|
},
|
|
112
162
|
"./package.json": "./package.json"
|
|
113
163
|
},
|
|
@@ -116,16 +166,16 @@
|
|
|
116
166
|
"registry": "https://registry.npmjs.org/"
|
|
117
167
|
},
|
|
118
168
|
"dependencies": {
|
|
119
|
-
"@kubb/adapter-oas": "5.10.
|
|
120
|
-
"@kubb/core": "5.10.
|
|
121
|
-
"@kubb/parser-md": "5.10.
|
|
122
|
-
"@kubb/parser-ts": "5.10.
|
|
123
|
-
"@kubb/plugin-barrel": "5.10.
|
|
169
|
+
"@kubb/adapter-oas": "5.10.3",
|
|
170
|
+
"@kubb/core": "5.10.3",
|
|
171
|
+
"@kubb/parser-md": "5.10.3",
|
|
172
|
+
"@kubb/parser-ts": "5.10.3",
|
|
173
|
+
"@kubb/plugin-barrel": "5.10.3",
|
|
124
174
|
"unplugin": "^3.4.0"
|
|
125
175
|
},
|
|
126
176
|
"devDependencies": {
|
|
127
177
|
"@farmfe/core": "^1.7.11",
|
|
128
|
-
"@kubb/ast": "5.10.
|
|
178
|
+
"@kubb/ast": "5.10.3",
|
|
129
179
|
"@nuxt/kit": "^4.6.1",
|
|
130
180
|
"@nuxt/schema": "^4.6.1",
|
|
131
181
|
"@rspack/core": "^2.2.8",
|