unplugin-kubb 5.0.30 → 5.0.32
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 +35 -49
- package/dist/astro.cjs +1 -1
- package/dist/astro.cjs.map +1 -1
- package/dist/astro.d.ts +19 -3
- package/dist/astro.js +1 -1
- package/dist/astro.js.map +1 -1
- package/dist/esbuild.cjs +1 -1
- package/dist/esbuild.cjs.map +1 -1
- package/dist/esbuild.d.ts +2 -4
- package/dist/esbuild.js +1 -1
- package/dist/esbuild.js.map +1 -1
- package/dist/farm.cjs +1 -1
- package/dist/farm.cjs.map +1 -1
- package/dist/farm.d.ts +2 -4
- package/dist/farm.js +1 -1
- package/dist/farm.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/nuxt.cjs +1 -1
- package/dist/nuxt.cjs.map +1 -1
- package/dist/nuxt.d.ts +3 -4
- package/dist/nuxt.js +1 -1
- package/dist/nuxt.js.map +1 -1
- package/dist/rolldown.cjs +1 -1
- package/dist/rolldown.cjs.map +1 -1
- package/dist/rolldown.d.ts +2 -4
- package/dist/rolldown.js +1 -1
- package/dist/rolldown.js.map +1 -1
- package/dist/rollup.cjs +1 -1
- package/dist/rollup.cjs.map +1 -1
- package/dist/rollup.d.ts +2 -4
- package/dist/rollup.js +1 -1
- package/dist/rollup.js.map +1 -1
- package/dist/rspack.cjs +1 -1
- package/dist/rspack.cjs.map +1 -1
- package/dist/rspack.d.ts +1 -2
- package/dist/rspack.js +1 -1
- package/dist/rspack.js.map +1 -1
- package/dist/types.d.ts +3 -4
- package/dist/unpluginFactory-D57wWAtn.js +105 -0
- package/dist/unpluginFactory-D57wWAtn.js.map +1 -0
- package/dist/unpluginFactory-jIOUNWEj.cjs +122 -0
- package/dist/unpluginFactory-jIOUNWEj.cjs.map +1 -0
- package/dist/unpluginFactory.cjs +1 -1
- package/dist/unpluginFactory.d.ts +8 -2
- package/dist/unpluginFactory.js +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.ts +2 -4
- package/dist/vite.js +1 -1
- package/dist/vite.js.map +1 -1
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.cjs.map +1 -1
- package/dist/webpack.d.ts +2 -5
- package/dist/webpack.js +1 -1
- package/dist/webpack.js.map +1 -1
- package/package.json +64 -56
- package/dist/unpluginFactory-D-fiKclT.js +0 -157
- package/dist/unpluginFactory-D-fiKclT.js.map +0 -1
- package/dist/unpluginFactory-DlqGRU_J.cjs +0 -200
- package/dist/unpluginFactory-DlqGRU_J.cjs.map +0 -1
- package/src/astro.ts +0 -12
- package/src/esbuild.ts +0 -5
- package/src/farm.ts +0 -5
- package/src/index.ts +0 -9
- package/src/nuxt.ts +0 -22
- package/src/rolldown.ts +0 -5
- package/src/rollup.ts +0 -5
- package/src/rspack.ts +0 -5
- package/src/types.ts +0 -8
- package/src/unpluginFactory.ts +0 -132
- package/src/vite.ts +0 -5
- package/src/webpack.ts +0 -7
- /package/dist/{chunk--u3MIqq1.js → rolldown-runtime-C0LytTxp.js} +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
+
import { adapterOas } from "@kubb/adapter-oas";
|
|
3
|
+
import { Diagnostics, Hookable, applyConfigDefaults, createKubb } from "@kubb/core";
|
|
4
|
+
import { pluginBarrel, pluginBarrelName } from "@kubb/plugin-barrel";
|
|
5
|
+
import { parserTs, parserTsx } from "@kubb/parser-ts";
|
|
6
|
+
//#region package.json
|
|
7
|
+
var version = "5.0.32";
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/unpluginFactory.ts
|
|
10
|
+
/**
|
|
11
|
+
* Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).
|
|
12
|
+
*
|
|
13
|
+
* Registers hook handlers that log lifecycle, diagnostics, and a per-plugin summary, then runs
|
|
14
|
+
* the Kubb build during `buildStart`. When the config omits them, it fills in defaults: the OAS
|
|
15
|
+
* adapter, the TS and TSX parsers, and a barrel plugin. Under Vite it only applies during `build`.
|
|
16
|
+
*/
|
|
17
|
+
const unpluginFactory = (options, meta) => {
|
|
18
|
+
const name = "unplugin-kubb";
|
|
19
|
+
const hooks = new Hookable();
|
|
20
|
+
const isVite = meta.framework === "vite";
|
|
21
|
+
hooks.hook("kubb:lifecycle:start", ({ version }) => {
|
|
22
|
+
console.log(`Kubb Unplugin ${version} 🧩`);
|
|
23
|
+
});
|
|
24
|
+
hooks.hook("kubb:error", ({ error }) => {
|
|
25
|
+
console.error(`✗ ${error?.message || "failed"}`);
|
|
26
|
+
});
|
|
27
|
+
hooks.hook("kubb:warn", ({ message }) => {
|
|
28
|
+
console.warn(`⚠ ${message}`);
|
|
29
|
+
});
|
|
30
|
+
hooks.hook("kubb:info", ({ message }) => {
|
|
31
|
+
console.info(`ℹ ${message}`);
|
|
32
|
+
});
|
|
33
|
+
hooks.hook("kubb:diagnostic", ({ diagnostic }) => {
|
|
34
|
+
if (diagnostic.severity === "error") return hooks.callHook("kubb:error", { error: diagnostic.cause ?? new Error(diagnostic.message) });
|
|
35
|
+
if (diagnostic.severity === "warning") return hooks.callHook("kubb:warn", { message: diagnostic.message });
|
|
36
|
+
return hooks.callHook("kubb:info", { message: diagnostic.message });
|
|
37
|
+
});
|
|
38
|
+
hooks.hook("kubb:success", ({ message }) => {
|
|
39
|
+
console.log(`✓ ${message}`);
|
|
40
|
+
});
|
|
41
|
+
hooks.hook("kubb:plugin:end", ({ plugin, duration }) => {
|
|
42
|
+
const durationStr = duration >= 1e3 ? `${(duration / 1e3).toFixed(2)}s` : `${duration}ms`;
|
|
43
|
+
console.log(`✓ ${plugin.name} completed in ${durationStr}`);
|
|
44
|
+
});
|
|
45
|
+
hooks.hook("kubb:files:processing:end", () => {
|
|
46
|
+
console.log("✓ Files written successfully");
|
|
47
|
+
});
|
|
48
|
+
hooks.hook("kubb:generation:end", ({ config, status, diagnostics }) => {
|
|
49
|
+
console.log(config.name ? `✓ Generation completed for ${config.name}` : "✓ Generation completed");
|
|
50
|
+
if (!diagnostics || !status) return;
|
|
51
|
+
const failedCount = Diagnostics.failedPlugins(diagnostics).length;
|
|
52
|
+
const pluginsCount = config.plugins.length;
|
|
53
|
+
const successCount = pluginsCount - failedCount;
|
|
54
|
+
console.log(status === "success" ? `Kubb Summary: ✓ ${successCount} successful, ${pluginsCount} total` : `Kubb Summary: ✓ ${successCount} successful, ✗ ${failedCount} failed, ${pluginsCount} total`);
|
|
55
|
+
});
|
|
56
|
+
async function runBuild(ctx) {
|
|
57
|
+
if (!options?.config) {
|
|
58
|
+
(ctx.error ?? console.error)(`[${name}] Config is not set`);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const { adapter, output, plugins } = applyConfigDefaults(options.config, {
|
|
62
|
+
defaultAdapter: adapterOas(),
|
|
63
|
+
barrelPlugin: pluginBarrel(),
|
|
64
|
+
barrelPluginName: pluginBarrelName,
|
|
65
|
+
defaultOutput: {
|
|
66
|
+
barrel: false,
|
|
67
|
+
format: false,
|
|
68
|
+
lint: false
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const userConfig = {
|
|
72
|
+
...options.config,
|
|
73
|
+
adapter,
|
|
74
|
+
parsers: options.config.parsers?.length ? options.config.parsers : [parserTs(), parserTsx()],
|
|
75
|
+
plugins,
|
|
76
|
+
output
|
|
77
|
+
};
|
|
78
|
+
await hooks.callHook("kubb:lifecycle:start", { version });
|
|
79
|
+
const result = await createKubb(userConfig, { hooks }).generate();
|
|
80
|
+
await hooks.callHook("kubb:lifecycle:end");
|
|
81
|
+
if (!result.success) {
|
|
82
|
+
const failedCount = Diagnostics.failedPlugins(result.diagnostics).length;
|
|
83
|
+
const firstError = result.diagnostics.filter(Diagnostics.isProblem).find((diagnostic) => diagnostic.severity === "error");
|
|
84
|
+
const message = failedCount > 0 ? `Build Error with ${failedCount} failed plugins` : firstError?.message ?? "Build failed";
|
|
85
|
+
if (ctx.error) {
|
|
86
|
+
ctx.error(`[${name}] ${message}`);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
throw new Error(`[${name}] ${message}`, { cause: firstError?.cause });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
name,
|
|
94
|
+
enforce: "pre",
|
|
95
|
+
apply: isVite ? "build" : void 0,
|
|
96
|
+
async buildStart() {
|
|
97
|
+
await runBuild(this);
|
|
98
|
+
},
|
|
99
|
+
vite: {}
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
export { unpluginFactory as t };
|
|
104
|
+
|
|
105
|
+
//# sourceMappingURL=unpluginFactory-D57wWAtn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unpluginFactory-D57wWAtn.js","names":["unpluginVersion"],"sources":["../package.json","../src/unpluginFactory.ts"],"sourcesContent":["","import { adapterOas } from '@kubb/adapter-oas'\nimport { applyConfigDefaults, type Config, createKubb, Diagnostics, type KubbHooks, Hookable } from '@kubb/core'\nimport { pluginBarrel, pluginBarrelName } from '@kubb/plugin-barrel'\nimport { parserTs, parserTsx } from '@kubb/parser-ts'\nimport type { UnpluginFactory } from 'unplugin'\nimport { version as unpluginVersion } from '../package.json'\nimport type { Options } from './types.ts'\n\ntype RollupContext = {\n info?: (message: string) => void\n warn?: (message: string) => void\n error?: (message: string) => void\n}\n\n/**\n * Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).\n *\n * Registers hook handlers that log lifecycle, diagnostics, and a per-plugin summary, then runs\n * the Kubb build during `buildStart`. When the config omits them, it fills in defaults: the OAS\n * adapter, the TS and TSX parsers, and a barrel plugin. Under Vite it only applies during `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 isVite = meta.framework === 'vite'\n\n hooks.hook('kubb:lifecycle:start', ({ version }) => {\n console.log(`Kubb Unplugin ${version} 🧩`)\n })\n\n hooks.hook('kubb:error', ({ error }) => {\n console.error(`✗ ${error?.message || 'failed'}`)\n })\n\n hooks.hook('kubb:warn', ({ message }) => {\n console.warn(`⚠ ${message}`)\n })\n\n hooks.hook('kubb:info', ({ message }) => {\n console.info(`ℹ ${message}`)\n })\n\n // Unplugin has no diagnostic renderer, so route each problem by severity to a channel it logs on.\n hooks.hook('kubb:diagnostic', ({ diagnostic }) => {\n if (diagnostic.severity === 'error') return hooks.callHook('kubb:error', { error: diagnostic.cause ?? new Error(diagnostic.message) })\n if (diagnostic.severity === 'warning') return hooks.callHook('kubb:warn', { message: diagnostic.message })\n return hooks.callHook('kubb:info', { message: diagnostic.message })\n })\n\n hooks.hook('kubb:success', ({ message }) => {\n console.log(`✓ ${message}`)\n })\n\n hooks.hook('kubb:plugin:end', ({ plugin, duration }) => {\n const durationStr = duration >= 1000 ? `${(duration / 1000).toFixed(2)}s` : `${duration}ms`\n\n console.log(`✓ ${plugin.name} completed in ${durationStr}`)\n })\n\n hooks.hook('kubb:files:processing:end', () => {\n const text = '✓ Files written successfully'\n\n console.log(text)\n })\n\n hooks.hook('kubb:generation:end', ({ config, status, diagnostics }) => {\n console.log(config.name ? `✓ Generation completed for ${config.name}` : '✓ Generation completed')\n\n if (!diagnostics || !status) return\n\n const failedCount = Diagnostics.failedPlugins(diagnostics).length\n const pluginsCount = config.plugins.length\n const successCount = pluginsCount - failedCount\n\n console.log(\n status === 'success'\n ? `Kubb Summary: ✓ ${successCount} successful, ${pluginsCount} total`\n : `Kubb Summary: ✓ ${successCount} successful, ✗ ${failedCount} failed, ${pluginsCount} total`,\n )\n })\n\n async function runBuild(ctx: RollupContext) {\n if (!options?.config) {\n ;(ctx.error ?? console.error)(`[${name}] Config is not set`)\n return\n }\n\n const { adapter, output, plugins } = applyConfigDefaults(options.config, {\n defaultAdapter: adapterOas(),\n barrelPlugin: pluginBarrel(),\n barrelPluginName: pluginBarrelName,\n defaultOutput: { barrel: false, format: false, lint: false },\n })\n\n const config = {\n ...options.config,\n adapter,\n parsers: options.config.parsers?.length ? options.config.parsers : [parserTs(), parserTsx()],\n plugins,\n output,\n }\n const userConfig = config as Config\n\n await hooks.callHook('kubb:lifecycle:start', { version: unpluginVersion })\n\n const kubb = createKubb(userConfig, { hooks })\n const result = await kubb.generate()\n\n await hooks.callHook('kubb:lifecycle:end')\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 if (ctx.error) {\n ctx.error(`[${name}] ${message}`)\n return\n }\n\n throw new Error(`[${name}] ${message}`, { cause: firstError?.cause })\n }\n }\n\n return {\n name,\n enforce: 'pre',\n apply: isVite ? 'build' : undefined,\n async buildStart() {\n await runBuild(this as unknown as RollupContext)\n },\n vite: {},\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
4
|
+
value,
|
|
5
|
+
configurable: true
|
|
6
|
+
});
|
|
7
|
+
//#endregion
|
|
8
|
+
let _kubb_adapter_oas = require("@kubb/adapter-oas");
|
|
9
|
+
let _kubb_core = require("@kubb/core");
|
|
10
|
+
let _kubb_plugin_barrel = require("@kubb/plugin-barrel");
|
|
11
|
+
let _kubb_parser_ts = require("@kubb/parser-ts");
|
|
12
|
+
//#region package.json
|
|
13
|
+
var version = "5.0.32";
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/unpluginFactory.ts
|
|
16
|
+
/**
|
|
17
|
+
* Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).
|
|
18
|
+
*
|
|
19
|
+
* Registers hook handlers that log lifecycle, diagnostics, and a per-plugin summary, then runs
|
|
20
|
+
* the Kubb build during `buildStart`. When the config omits them, it fills in defaults: the OAS
|
|
21
|
+
* adapter, the TS and TSX parsers, and a barrel plugin. Under Vite it only applies during `build`.
|
|
22
|
+
*/
|
|
23
|
+
const unpluginFactory = (options, meta) => {
|
|
24
|
+
const name = "unplugin-kubb";
|
|
25
|
+
const hooks = new _kubb_core.Hookable();
|
|
26
|
+
const isVite = meta.framework === "vite";
|
|
27
|
+
hooks.hook("kubb:lifecycle:start", ({ version }) => {
|
|
28
|
+
console.log(`Kubb Unplugin ${version} 🧩`);
|
|
29
|
+
});
|
|
30
|
+
hooks.hook("kubb:error", ({ error }) => {
|
|
31
|
+
console.error(`✗ ${error?.message || "failed"}`);
|
|
32
|
+
});
|
|
33
|
+
hooks.hook("kubb:warn", ({ message }) => {
|
|
34
|
+
console.warn(`⚠ ${message}`);
|
|
35
|
+
});
|
|
36
|
+
hooks.hook("kubb:info", ({ message }) => {
|
|
37
|
+
console.info(`ℹ ${message}`);
|
|
38
|
+
});
|
|
39
|
+
hooks.hook("kubb:diagnostic", ({ diagnostic }) => {
|
|
40
|
+
if (diagnostic.severity === "error") return hooks.callHook("kubb:error", { error: diagnostic.cause ?? new Error(diagnostic.message) });
|
|
41
|
+
if (diagnostic.severity === "warning") return hooks.callHook("kubb:warn", { message: diagnostic.message });
|
|
42
|
+
return hooks.callHook("kubb:info", { message: diagnostic.message });
|
|
43
|
+
});
|
|
44
|
+
hooks.hook("kubb:success", ({ message }) => {
|
|
45
|
+
console.log(`✓ ${message}`);
|
|
46
|
+
});
|
|
47
|
+
hooks.hook("kubb:plugin:end", ({ plugin, duration }) => {
|
|
48
|
+
const durationStr = duration >= 1e3 ? `${(duration / 1e3).toFixed(2)}s` : `${duration}ms`;
|
|
49
|
+
console.log(`✓ ${plugin.name} completed in ${durationStr}`);
|
|
50
|
+
});
|
|
51
|
+
hooks.hook("kubb:files:processing:end", () => {
|
|
52
|
+
console.log("✓ Files written successfully");
|
|
53
|
+
});
|
|
54
|
+
hooks.hook("kubb:generation:end", ({ config, status, diagnostics }) => {
|
|
55
|
+
console.log(config.name ? `✓ Generation completed for ${config.name}` : "✓ Generation completed");
|
|
56
|
+
if (!diagnostics || !status) return;
|
|
57
|
+
const failedCount = _kubb_core.Diagnostics.failedPlugins(diagnostics).length;
|
|
58
|
+
const pluginsCount = config.plugins.length;
|
|
59
|
+
const successCount = pluginsCount - failedCount;
|
|
60
|
+
console.log(status === "success" ? `Kubb Summary: ✓ ${successCount} successful, ${pluginsCount} total` : `Kubb Summary: ✓ ${successCount} successful, ✗ ${failedCount} failed, ${pluginsCount} total`);
|
|
61
|
+
});
|
|
62
|
+
async function runBuild(ctx) {
|
|
63
|
+
if (!options?.config) {
|
|
64
|
+
(ctx.error ?? console.error)(`[${name}] Config is not set`);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const { adapter, output, plugins } = (0, _kubb_core.applyConfigDefaults)(options.config, {
|
|
68
|
+
defaultAdapter: (0, _kubb_adapter_oas.adapterOas)(),
|
|
69
|
+
barrelPlugin: (0, _kubb_plugin_barrel.pluginBarrel)(),
|
|
70
|
+
barrelPluginName: _kubb_plugin_barrel.pluginBarrelName,
|
|
71
|
+
defaultOutput: {
|
|
72
|
+
barrel: false,
|
|
73
|
+
format: false,
|
|
74
|
+
lint: false
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
const userConfig = {
|
|
78
|
+
...options.config,
|
|
79
|
+
adapter,
|
|
80
|
+
parsers: options.config.parsers?.length ? options.config.parsers : [(0, _kubb_parser_ts.parserTs)(), (0, _kubb_parser_ts.parserTsx)()],
|
|
81
|
+
plugins,
|
|
82
|
+
output
|
|
83
|
+
};
|
|
84
|
+
await hooks.callHook("kubb:lifecycle:start", { version });
|
|
85
|
+
const result = await (0, _kubb_core.createKubb)(userConfig, { hooks }).generate();
|
|
86
|
+
await hooks.callHook("kubb:lifecycle:end");
|
|
87
|
+
if (!result.success) {
|
|
88
|
+
const failedCount = _kubb_core.Diagnostics.failedPlugins(result.diagnostics).length;
|
|
89
|
+
const firstError = result.diagnostics.filter(_kubb_core.Diagnostics.isProblem).find((diagnostic) => diagnostic.severity === "error");
|
|
90
|
+
const message = failedCount > 0 ? `Build Error with ${failedCount} failed plugins` : firstError?.message ?? "Build failed";
|
|
91
|
+
if (ctx.error) {
|
|
92
|
+
ctx.error(`[${name}] ${message}`);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
throw new Error(`[${name}] ${message}`, { cause: firstError?.cause });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
name,
|
|
100
|
+
enforce: "pre",
|
|
101
|
+
apply: isVite ? "build" : void 0,
|
|
102
|
+
async buildStart() {
|
|
103
|
+
await runBuild(this);
|
|
104
|
+
},
|
|
105
|
+
vite: {}
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
//#endregion
|
|
109
|
+
Object.defineProperty(exports, "__name", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function() {
|
|
112
|
+
return __name;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
Object.defineProperty(exports, "unpluginFactory", {
|
|
116
|
+
enumerable: true,
|
|
117
|
+
get: function() {
|
|
118
|
+
return unpluginFactory;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
//# sourceMappingURL=unpluginFactory-jIOUNWEj.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unpluginFactory-jIOUNWEj.cjs","names":["Hookable","Diagnostics","applyConfigDefaults","adapterOas","pluginBarrel","pluginBarrelName","parserTs","parserTsx","unpluginVersion","createKubb"],"sources":["../package.json","../src/unpluginFactory.ts"],"sourcesContent":["","import { adapterOas } from '@kubb/adapter-oas'\nimport { applyConfigDefaults, type Config, createKubb, Diagnostics, type KubbHooks, Hookable } from '@kubb/core'\nimport { pluginBarrel, pluginBarrelName } from '@kubb/plugin-barrel'\nimport { parserTs, parserTsx } from '@kubb/parser-ts'\nimport type { UnpluginFactory } from 'unplugin'\nimport { version as unpluginVersion } from '../package.json'\nimport type { Options } from './types.ts'\n\ntype RollupContext = {\n info?: (message: string) => void\n warn?: (message: string) => void\n error?: (message: string) => void\n}\n\n/**\n * Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).\n *\n * Registers hook handlers that log lifecycle, diagnostics, and a per-plugin summary, then runs\n * the Kubb build during `buildStart`. When the config omits them, it fills in defaults: the OAS\n * adapter, the TS and TSX parsers, and a barrel plugin. Under Vite it only applies during `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 isVite = meta.framework === 'vite'\n\n hooks.hook('kubb:lifecycle:start', ({ version }) => {\n console.log(`Kubb Unplugin ${version} 🧩`)\n })\n\n hooks.hook('kubb:error', ({ error }) => {\n console.error(`✗ ${error?.message || 'failed'}`)\n })\n\n hooks.hook('kubb:warn', ({ message }) => {\n console.warn(`⚠ ${message}`)\n })\n\n hooks.hook('kubb:info', ({ message }) => {\n console.info(`ℹ ${message}`)\n })\n\n // Unplugin has no diagnostic renderer, so route each problem by severity to a channel it logs on.\n hooks.hook('kubb:diagnostic', ({ diagnostic }) => {\n if (diagnostic.severity === 'error') return hooks.callHook('kubb:error', { error: diagnostic.cause ?? new Error(diagnostic.message) })\n if (diagnostic.severity === 'warning') return hooks.callHook('kubb:warn', { message: diagnostic.message })\n return hooks.callHook('kubb:info', { message: diagnostic.message })\n })\n\n hooks.hook('kubb:success', ({ message }) => {\n console.log(`✓ ${message}`)\n })\n\n hooks.hook('kubb:plugin:end', ({ plugin, duration }) => {\n const durationStr = duration >= 1000 ? `${(duration / 1000).toFixed(2)}s` : `${duration}ms`\n\n console.log(`✓ ${plugin.name} completed in ${durationStr}`)\n })\n\n hooks.hook('kubb:files:processing:end', () => {\n const text = '✓ Files written successfully'\n\n console.log(text)\n })\n\n hooks.hook('kubb:generation:end', ({ config, status, diagnostics }) => {\n console.log(config.name ? `✓ Generation completed for ${config.name}` : '✓ Generation completed')\n\n if (!diagnostics || !status) return\n\n const failedCount = Diagnostics.failedPlugins(diagnostics).length\n const pluginsCount = config.plugins.length\n const successCount = pluginsCount - failedCount\n\n console.log(\n status === 'success'\n ? `Kubb Summary: ✓ ${successCount} successful, ${pluginsCount} total`\n : `Kubb Summary: ✓ ${successCount} successful, ✗ ${failedCount} failed, ${pluginsCount} total`,\n )\n })\n\n async function runBuild(ctx: RollupContext) {\n if (!options?.config) {\n ;(ctx.error ?? console.error)(`[${name}] Config is not set`)\n return\n }\n\n const { adapter, output, plugins } = applyConfigDefaults(options.config, {\n defaultAdapter: adapterOas(),\n barrelPlugin: pluginBarrel(),\n barrelPluginName: pluginBarrelName,\n defaultOutput: { barrel: false, format: false, lint: false },\n })\n\n const config = {\n ...options.config,\n adapter,\n parsers: options.config.parsers?.length ? options.config.parsers : [parserTs(), parserTsx()],\n plugins,\n output,\n }\n const userConfig = config as Config\n\n await hooks.callHook('kubb:lifecycle:start', { version: unpluginVersion })\n\n const kubb = createKubb(userConfig, { hooks })\n const result = await kubb.generate()\n\n await hooks.callHook('kubb:lifecycle:end')\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 if (ctx.error) {\n ctx.error(`[${name}] ${message}`)\n return\n }\n\n throw new Error(`[${name}] ${message}`, { cause: firstError?.cause })\n }\n }\n\n return {\n name,\n enforce: 'pre',\n apply: isVite ? 'build' : undefined,\n async buildStart() {\n await runBuild(this as unknown as RollupContext)\n },\n vite: {},\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;ACqBA,MAAa,mBAAyD,SAAS,SAAS;CACtF,MAAM,OAAO;CACb,MAAM,QAAQ,IAAIA,WAAAA,SAAoB;CACtC,MAAM,SAAS,KAAK,cAAc;CAElC,MAAM,KAAK,yBAAyB,EAAE,cAAc;EAClD,QAAQ,IAAI,iBAAiB,QAAQ,IAAI;CAC3C,CAAC;CAED,MAAM,KAAK,eAAe,EAAE,YAAY;EACtC,QAAQ,MAAM,KAAK,OAAO,WAAW,UAAU;CACjD,CAAC;CAED,MAAM,KAAK,cAAc,EAAE,cAAc;EACvC,QAAQ,KAAK,KAAK,SAAS;CAC7B,CAAC;CAED,MAAM,KAAK,cAAc,EAAE,cAAc;EACvC,QAAQ,KAAK,KAAK,SAAS;CAC7B,CAAC;CAGD,MAAM,KAAK,oBAAoB,EAAE,iBAAiB;EAChD,IAAI,WAAW,aAAa,SAAS,OAAO,MAAM,SAAS,cAAc,EAAE,OAAO,WAAW,SAAS,IAAI,MAAM,WAAW,OAAO,EAAE,CAAC;EACrI,IAAI,WAAW,aAAa,WAAW,OAAO,MAAM,SAAS,aAAa,EAAE,SAAS,WAAW,QAAQ,CAAC;EACzG,OAAO,MAAM,SAAS,aAAa,EAAE,SAAS,WAAW,QAAQ,CAAC;CACpE,CAAC;CAED,MAAM,KAAK,iBAAiB,EAAE,cAAc;EAC1C,QAAQ,IAAI,KAAK,SAAS;CAC5B,CAAC;CAED,MAAM,KAAK,oBAAoB,EAAE,QAAQ,eAAe;EACtD,MAAM,cAAc,YAAY,MAAO,IAAI,WAAW,IAAA,CAAM,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS;EAExF,QAAQ,IAAI,KAAK,OAAO,KAAK,gBAAgB,aAAa;CAC5D,CAAC;CAED,MAAM,KAAK,mCAAmC;EAG5C,QAAQ,IAAI,8BAAI;CAClB,CAAC;CAED,MAAM,KAAK,wBAAwB,EAAE,QAAQ,QAAQ,kBAAkB;EACrE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,OAAO,SAAS,wBAAwB;EAEhG,IAAI,CAAC,eAAe,CAAC,QAAQ;EAE7B,MAAM,cAAcC,WAAAA,YAAY,cAAc,WAAW,CAAC,CAAC;EAC3D,MAAM,eAAe,OAAO,QAAQ;EACpC,MAAM,eAAe,eAAe;EAEpC,QAAQ,IACN,WAAW,YACP,mBAAmB,aAAa,eAAe,aAAa,UAC5D,mBAAmB,aAAa,iBAAiB,YAAY,WAAW,aAAa,OAC3F;CACF,CAAC;CAED,eAAe,SAAS,KAAoB;EAC1C,IAAI,CAAC,SAAS,QAAQ;GACnB,CAAC,IAAI,SAAS,QAAQ,MAAA,CAAO,IAAI,KAAK,oBAAoB;GAC3D;EACF;EAEA,MAAM,EAAE,SAAS,QAAQ,aAAA,GAAYC,WAAAA,oBAAAA,CAAoB,QAAQ,QAAQ;GACvE,iBAAA,GAAgBC,kBAAAA,WAAAA,CAAW;GAC3B,eAAA,GAAcC,oBAAAA,aAAAA,CAAa;GAC3B,kBAAkBC,oBAAAA;GAClB,eAAe;IAAE,QAAQ;IAAO,QAAQ;IAAO,MAAM;GAAM;EAC7D,CAAC;EASD,MAAM,aAAa;GANjB,GAAG,QAAQ;GACX;GACA,SAAS,QAAQ,OAAO,SAAS,SAAS,QAAQ,OAAO,UAAU,EAAA,GAACC,gBAAAA,SAAAA,CAAS,IAAA,GAAGC,gBAAAA,UAAAA,CAAU,CAAC;GAC3F;GACA;EAEsB;EAExB,MAAM,MAAM,SAAS,wBAAwB,EAAWC,QAAgB,CAAC;EAGzE,MAAM,SAAS,OAAA,GADFC,WAAAA,WAAAA,CAAW,YAAY,EAAE,MAAM,CACpB,CAAC,CAAC,SAAS;EAEnC,MAAM,MAAM,SAAS,oBAAoB;EAEzC,IAAI,CAAC,OAAO,SAAS;GACnB,MAAM,cAAcR,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;GAC7G,IAAI,IAAI,OAAO;IACb,IAAI,MAAM,IAAI,KAAK,IAAI,SAAS;IAChC;GACF;GAEA,MAAM,IAAI,MAAM,IAAI,KAAK,IAAI,WAAW,EAAE,OAAO,YAAY,MAAM,CAAC;EACtE;CACF;CAEA,OAAO;EACL;EACA,SAAS;EACT,OAAO,SAAS,UAAU,KAAA;EAC1B,MAAM,aAAa;GACjB,MAAM,SAAS,IAAgC;EACjD;EACA,MAAM,CAAC;CACT;AACF"}
|
package/dist/unpluginFactory.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_unpluginFactory = require("./unpluginFactory-
|
|
2
|
+
const require_unpluginFactory = require("./unpluginFactory-jIOUNWEj.cjs");
|
|
3
3
|
exports.unpluginFactory = require_unpluginFactory.unpluginFactory;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { t as __name } from "./
|
|
1
|
+
import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
|
|
2
2
|
import { Options } from "./types.js";
|
|
3
3
|
import { UnpluginFactory } from "unplugin";
|
|
4
|
-
|
|
5
4
|
//#region src/unpluginFactory.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).
|
|
7
|
+
*
|
|
8
|
+
* Registers hook handlers that log lifecycle, diagnostics, and a per-plugin summary, then runs
|
|
9
|
+
* the Kubb build during `buildStart`. When the config omits them, it fills in defaults: the OAS
|
|
10
|
+
* adapter, the TS and TSX parsers, and a barrel plugin. Under Vite it only applies during `build`.
|
|
11
|
+
*/
|
|
6
12
|
declare const unpluginFactory: UnpluginFactory<Options | undefined>;
|
|
7
13
|
//#endregion
|
|
8
14
|
export { unpluginFactory };
|
package/dist/unpluginFactory.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as unpluginFactory } from "./unpluginFactory-
|
|
1
|
+
import { t as unpluginFactory } from "./unpluginFactory-D57wWAtn.js";
|
|
2
2
|
export { unpluginFactory };
|
package/dist/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_unpluginFactory = require("./unpluginFactory-
|
|
1
|
+
const require_unpluginFactory = require("./unpluginFactory-jIOUNWEj.cjs");
|
|
2
2
|
//#region src/vite.ts
|
|
3
3
|
var vite_default = (0, require("unplugin").createVitePlugin)(require_unpluginFactory.unpluginFactory);
|
|
4
4
|
//#endregion
|
package/dist/vite.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.cjs","names":["unpluginFactory"],"sources":["../src/vite.ts"],"sourcesContent":["import { createVitePlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createVitePlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,gBAAA,
|
|
1
|
+
{"version":3,"file":"vite.cjs","names":["createVitePlugin","unpluginFactory"],"sources":["../src/vite.ts"],"sourcesContent":["import { createVitePlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createVitePlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,gBAAA,qBAAeA,CAAAA,CAAAA,iBAAAA,CAAiBC,wBAAAA,eAAe"}
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { t as __name } from "./
|
|
1
|
+
import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
|
|
2
2
|
import { Options } from "./types.js";
|
|
3
|
-
import * as vite from "vite";
|
|
4
|
-
|
|
5
3
|
//#region src/vite.d.ts
|
|
6
|
-
declare const _default: (options?: Options | undefined) => vite.Plugin<any> | vite.Plugin<any>[];
|
|
4
|
+
declare const _default: (options?: Options | undefined) => import("vite").Plugin<any> | import("vite").Plugin<any>[];
|
|
7
5
|
//#endregion
|
|
8
6
|
export { _default as default };
|
|
9
7
|
//# sourceMappingURL=vite.d.ts.map
|
package/dist/vite.js
CHANGED
package/dist/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","names":[],"sources":["../src/vite.ts"],"sourcesContent":["import { createVitePlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createVitePlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,eAAe,iBAAiB,
|
|
1
|
+
{"version":3,"file":"vite.js","names":[],"sources":["../src/vite.ts"],"sourcesContent":["import { createVitePlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createVitePlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,eAAe,iBAAiB,eAAe"}
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_unpluginFactory = require("./unpluginFactory-
|
|
1
|
+
const require_unpluginFactory = require("./unpluginFactory-jIOUNWEj.cjs");
|
|
2
2
|
//#region src/webpack.ts
|
|
3
3
|
var webpack_default = (0, require("unplugin").createWebpackPlugin)(require_unpluginFactory.unpluginFactory);
|
|
4
4
|
//#endregion
|
package/dist/webpack.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.cjs","names":["unpluginFactory"],"sources":["../src/webpack.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"webpack.cjs","names":["createWebpackPlugin","unpluginFactory"],"sources":["../src/webpack.ts"],"sourcesContent":["import { createWebpackPlugin } from 'unplugin'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createWebpackPlugin(unpluginFactory)\n"],"mappings":";;AAGA,IAAA,mBAAA,qBAAeA,CAAAA,CAAAA,oBAAAA,CAAoBC,wBAAAA,eAAe"}
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { t as __name } from "./
|
|
1
|
+
import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
|
|
2
2
|
import { Options } from "./types.js";
|
|
3
|
-
import { UnpluginFactoryOutput } from "unplugin";
|
|
4
|
-
import { WebpackPluginInstance } from "webpack";
|
|
5
|
-
|
|
6
3
|
//#region src/webpack.d.ts
|
|
7
|
-
declare const _default:
|
|
4
|
+
declare const _default: (options?: Options | undefined) => import("webpack").WebpackPluginInstance;
|
|
8
5
|
//#endregion
|
|
9
6
|
export { _default as default };
|
|
10
7
|
//# sourceMappingURL=webpack.d.ts.map
|
package/dist/webpack.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as unpluginFactory } from "./unpluginFactory-
|
|
1
|
+
import { t as unpluginFactory } from "./unpluginFactory-D57wWAtn.js";
|
|
2
2
|
import { createWebpackPlugin } from "unplugin";
|
|
3
3
|
//#region src/webpack.ts
|
|
4
4
|
var webpack_default = createWebpackPlugin(unpluginFactory);
|
package/dist/webpack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.js","names":[],"sources":["../src/webpack.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"webpack.js","names":[],"sources":["../src/webpack.ts"],"sourcesContent":["import { createWebpackPlugin } from 'unplugin'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createWebpackPlugin(unpluginFactory)\n"],"mappings":";;;AAGA,IAAA,kBAAe,oBAAoB,eAAe"}
|
package/package.json
CHANGED
|
@@ -1,34 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-kubb",
|
|
3
|
-
"version": "5.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "5.0.32",
|
|
4
|
+
"description": "Integration of Kubb for Vite, Webpack, Rollup, esbuild, Rspack, Nuxt, and Astro.",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"webpack",
|
|
9
|
-
"rollup",
|
|
6
|
+
"astro",
|
|
7
|
+
"codegen",
|
|
10
8
|
"esbuild",
|
|
11
|
-
"
|
|
9
|
+
"farm",
|
|
10
|
+
"kubb",
|
|
11
|
+
"meta-framework",
|
|
12
12
|
"nuxt",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"bundler",
|
|
16
|
-
"transform",
|
|
17
|
-
"openapi",
|
|
18
|
-
"swagger",
|
|
19
|
-
"code-generator",
|
|
13
|
+
"rollup",
|
|
14
|
+
"rspack",
|
|
20
15
|
"typescript",
|
|
21
|
-
"
|
|
16
|
+
"unplugin",
|
|
17
|
+
"vite",
|
|
18
|
+
"webpack"
|
|
22
19
|
],
|
|
20
|
+
"homepage": "https://kubb.dev",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"author": "stijnvanhulle",
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
25
25
|
"url": "git+https://github.com/kubb-labs/kubb.git",
|
|
26
|
-
"directory": "packages/unplugin"
|
|
26
|
+
"directory": "packages/unplugin-kubb"
|
|
27
27
|
},
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
"funding": [
|
|
29
|
+
{
|
|
30
|
+
"type": "github",
|
|
31
|
+
"url": "https://github.com/sponsors/stijnvanhulle"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "opencollective",
|
|
35
|
+
"url": "https://opencollective.com/kubb"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"!/**/**.test.**",
|
|
41
|
+
"!/**/__tests__/**",
|
|
42
|
+
"!/**/__snapshots__/**"
|
|
43
|
+
],
|
|
31
44
|
"type": "module",
|
|
45
|
+
"sideEffects": false,
|
|
46
|
+
"main": "./dist/index.cjs",
|
|
47
|
+
"module": "./dist/index.js",
|
|
48
|
+
"types": "./dist/index.d.ts",
|
|
49
|
+
"typesVersions": {
|
|
50
|
+
"*": {
|
|
51
|
+
"*": [
|
|
52
|
+
"./dist/*",
|
|
53
|
+
"./*"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
},
|
|
32
57
|
"exports": {
|
|
33
58
|
".": {
|
|
34
59
|
"import": "./dist/index.js",
|
|
@@ -80,40 +105,31 @@
|
|
|
80
105
|
},
|
|
81
106
|
"./package.json": "./package.json"
|
|
82
107
|
},
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
"*": [
|
|
87
|
-
"./dist/*",
|
|
88
|
-
"./*"
|
|
89
|
-
]
|
|
90
|
-
}
|
|
108
|
+
"publishConfig": {
|
|
109
|
+
"access": "public",
|
|
110
|
+
"registry": "https://registry.npmjs.org/"
|
|
91
111
|
},
|
|
92
|
-
"files": [
|
|
93
|
-
"src",
|
|
94
|
-
"dist",
|
|
95
|
-
"!/**/**.test.**",
|
|
96
|
-
"!/**/__tests__/**",
|
|
97
|
-
"!/**/__snapshots__/**"
|
|
98
|
-
],
|
|
99
112
|
"dependencies": {
|
|
100
|
-
"
|
|
101
|
-
"@kubb/core": "
|
|
113
|
+
"@kubb/adapter-oas": "5.0.4",
|
|
114
|
+
"@kubb/core": "5.0.4",
|
|
115
|
+
"@kubb/parser-ts": "5.0.4",
|
|
116
|
+
"@kubb/plugin-barrel": "5.0.4",
|
|
117
|
+
"unplugin": "^3.3.0"
|
|
102
118
|
},
|
|
103
119
|
"devDependencies": {
|
|
104
120
|
"@farmfe/core": "^1.7.11",
|
|
105
|
-
"@
|
|
106
|
-
"@nuxt/
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
121
|
+
"@kubb/ast": "5.0.4",
|
|
122
|
+
"@nuxt/kit": "^4.5.2",
|
|
123
|
+
"@nuxt/schema": "^4.5.2",
|
|
124
|
+
"esbuild": "^0.28.2",
|
|
125
|
+
"rolldown": "^1.2.5",
|
|
126
|
+
"rollup": "^4.62.5",
|
|
127
|
+
"vite": "^8.2.2",
|
|
128
|
+
"webpack": "^5.109.2"
|
|
113
129
|
},
|
|
114
130
|
"peerDependencies": {
|
|
115
131
|
"@farmfe/core": "^1.7.0",
|
|
116
|
-
"@kubb/core": "^
|
|
132
|
+
"@kubb/core": "^5.0.0-alpha.0",
|
|
117
133
|
"@nuxt/kit": "^3 || ^4",
|
|
118
134
|
"@nuxt/schema": "^3 || ^4",
|
|
119
135
|
"esbuild": "*",
|
|
@@ -149,21 +165,13 @@
|
|
|
149
165
|
}
|
|
150
166
|
},
|
|
151
167
|
"engines": {
|
|
152
|
-
"node": ">=
|
|
168
|
+
"node": ">=22"
|
|
153
169
|
},
|
|
154
|
-
"publishConfig": {
|
|
155
|
-
"access": "public",
|
|
156
|
-
"registry": "https://registry.npmjs.org/"
|
|
157
|
-
},
|
|
158
|
-
"main": "./dist/index.cjs",
|
|
159
|
-
"module": "./dist/index.js",
|
|
160
170
|
"scripts": {
|
|
161
171
|
"build": "tsdown",
|
|
162
172
|
"clean": "node -e \"require('node:fs').rmSync('./dist', {recursive:true,force:true})\"",
|
|
163
|
-
"lint": "
|
|
164
|
-
"lint:fix": "
|
|
165
|
-
"release": "pnpm publish --no-git-check",
|
|
166
|
-
"release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check",
|
|
173
|
+
"lint": "oxlint .",
|
|
174
|
+
"lint:fix": "oxlint --fix .",
|
|
167
175
|
"start": "tsdown --watch",
|
|
168
176
|
"test": "vitest --passWithNoTests",
|
|
169
177
|
"typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false"
|