MCPcopy Create free account
hub / github.com/hey-api/hey-api / getClientBundlePaths

Function getClientBundlePaths

packages/openapi-python/src/generate/client.ts:19–39  ·  view source on GitHub ↗

* Returns paths to client bundle files based on execution context

(pluginName: string)

Source from the content-addressed store, hash-verified

17 * Returns paths to client bundle files based on execution context
18 */
19function getClientBundlePaths(pluginName: string): {
20 clientPath: string;
21 corePath: string;
22} {
23 const clientName = pluginName.slice('@hey-api/client-'.length);
24
25 if (isEnvironment('development')) {
26 // Dev: source bundle folders at src/plugins/@hey-api/{client}/bundle
27 const pluginsDir = path.resolve(__dirname, '..', 'plugins', '@hey-api');
28 return {
29 clientPath: path.resolve(pluginsDir, `client-${clientName}`, 'bundle'),
30 corePath: path.resolve(pluginsDir, 'client-core', 'bundle'),
31 };
32 }
33
34 // Prod: copied to dist/clients/{clientName}
35 return {
36 clientPath: path.resolve(__dirname, 'clients', clientName),
37 corePath: path.resolve(__dirname, 'clients', 'core'),
38 };
39}
40
41/**
42 * Returns absolute path to the client folder. This is hard-coded for now.

Callers 1

generateClientBundleFunction · 0.70

Calls 3

isEnvironmentFunction · 0.90
sliceMethod · 0.80
resolveMethod · 0.45

Tested by

no test coverage detected