@kubb/plugin-fetch 5.5.1 → 5.5.2
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/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/templates/fetch.ts +24 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
-
import { Resolver, Url, ast, createResolver, defineGenerator, definePlugin, macroSimplifyUnion } from "kubb/kit";
|
|
2
|
+
import { Diagnostics, Resolver, Url, ast, createResolver, defineGenerator, definePlugin, macroSimplifyUnion } from "kubb/kit";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createFunctionParameter, createFunctionParameters, functionPrinter, pluginTsName } from "@kubb/plugin-ts";
|
|
5
5
|
import { File, Function, jsxRenderer } from "kubb/jsx";
|
|
@@ -1223,6 +1223,14 @@ function createSdkGenerator() {
|
|
|
1223
1223
|
const { config, resolver, root } = ctx;
|
|
1224
1224
|
const { output, group, validator, returnType, throwOnErrorDefault, sdk } = ctx.options;
|
|
1225
1225
|
if (!sdk) return null;
|
|
1226
|
+
if (sdk.mode === "tag" && output.mode === "file") throw new Diagnostics.Error({
|
|
1227
|
+
code: Diagnostics.code.invalidPluginOptions,
|
|
1228
|
+
severity: "error",
|
|
1229
|
+
message: `Plugin "${ctx.plugin.name}" resolves \`output.mode\` to 'file' but also configures \`sdk.mode: 'tag'\`.`,
|
|
1230
|
+
help: "A single-file output has nothing to split tag classes into. Set `sdk.mode: 'flat'` to emit one class into that file, or give `output.path` an extensionless directory name (or set `output.mode: 'directory'` explicitly) so each tag gets its own file.",
|
|
1231
|
+
location: { kind: "config" },
|
|
1232
|
+
plugin: ctx.plugin.name
|
|
1233
|
+
});
|
|
1226
1234
|
const types = resolveOperationTypes(ctx.driver);
|
|
1227
1235
|
if (!types) {
|
|
1228
1236
|
ctx.warn(MISSING_OPERATION_TYPES_WARNING);
|