@kubb/plugin-fetch 5.5.0 → 5.5.1
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 +1 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -23
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/plugin.ts +2 -3
package/dist/index.cjs
CHANGED
|
@@ -31,7 +31,6 @@ let _kubb_plugin_ts = require("@kubb/plugin-ts");
|
|
|
31
31
|
let kubb_jsx = require("kubb/jsx");
|
|
32
32
|
let kubb_jsx_jsx_runtime = require("kubb/jsx/jsx-runtime");
|
|
33
33
|
let _kubb_plugin_zod = require("@kubb/plugin-zod");
|
|
34
|
-
let node_fs = require("node:fs");
|
|
35
34
|
let node_url = require("node:url");
|
|
36
35
|
//#region ../../internals/shared/src/params.ts
|
|
37
36
|
/**
|
|
@@ -1421,27 +1420,6 @@ const resolverClient = (0, kubb_kit.createResolver)({
|
|
|
1421
1420
|
}
|
|
1422
1421
|
});
|
|
1423
1422
|
//#endregion
|
|
1424
|
-
//#region ../../internals/client/src/runtimeTemplate.ts
|
|
1425
|
-
/** Apply the active TypeScript parser's import extension to a copied client runtime. */
|
|
1426
|
-
function runtimeTemplate(path, config) {
|
|
1427
|
-
const parser = config.parsers.find((item) => item.extNames?.includes(".ts"));
|
|
1428
|
-
const probe = kubb_kit.ast.factory.createFile({
|
|
1429
|
-
baseName: "probe.ts",
|
|
1430
|
-
path: "probe.ts",
|
|
1431
|
-
imports: [kubb_kit.ast.factory.createImport({
|
|
1432
|
-
name: ["KubbRuntimeImport"],
|
|
1433
|
-
path: "/probeDependency.ts",
|
|
1434
|
-
root: "/"
|
|
1435
|
-
})],
|
|
1436
|
-
sources: [kubb_kit.ast.factory.createSource({
|
|
1437
|
-
name: "probe",
|
|
1438
|
-
nodes: [kubb_kit.ast.factory.createText("KubbRuntimeImport")]
|
|
1439
|
-
})]
|
|
1440
|
-
});
|
|
1441
|
-
const extension = parser?.parse(probe).match(/from ['"]\.\/probeDependency(\.[^'"]+)?['"]/)?.[1] ?? "";
|
|
1442
|
-
return (0, node_fs.readFileSync)(path, "utf8").replace(/(from ['"]\.\/(?:serializers|standardSchema))(?:\.ts|\.js)?(['"])/g, `$1${extension}$2`);
|
|
1443
|
-
}
|
|
1444
|
-
//#endregion
|
|
1445
1423
|
//#region src/generators/clientGenerator.tsx
|
|
1446
1424
|
/**
|
|
1447
1425
|
* Built-in operation generator for `@kubb/plugin-fetch`. Emits one async function per OpenAPI
|
|
@@ -1530,7 +1508,7 @@ const pluginFetch = (0, kubb_kit.definePlugin)((options) => {
|
|
|
1530
1508
|
ctx.injectFile({
|
|
1531
1509
|
baseName: "client.ts",
|
|
1532
1510
|
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
1533
|
-
|
|
1511
|
+
copy: fetchClientTemplatePath,
|
|
1534
1512
|
footer: baseURLExpression ? `client.setConfig({ baseURL: ${baseURLExpression} })` : void 0
|
|
1535
1513
|
});
|
|
1536
1514
|
ctx.injectFile({
|