···11---
22-'@hey-api/client-custom': minor
32'@hey-api/client-axios': minor
44-'@hey-api/client-fetch': minor
53'@hey-api/client-core': minor
44+'@hey-api/client-custom': minor
55+'@hey-api/client-fetch': minor
66'@hey-api/client-next': minor
77-'@hey-api/client-nuxt': minor
87---
981010-feat: export buildClientParams function
99+feat: export `buildClientParams` function
+5
.changeset/warm-lemons-count.md
···11+---
22+'@hey-api/openapi-ts': patch
33+---
44+55+fix(typescript): handle nested inline objects with write/read only fields
···101101102102 if (!result.organization) {
103103 throw new Error(
104104- '🚫 missing organization - from which Hey API platform organization do you want to generate your output?',
104104+ 'missing organization - from which Hey API platform organization do you want to generate your output?',
105105 );
106106 }
107107108108 if (!result.project) {
109109 throw new Error(
110110- '🚫 missing project - from which Hey API platform project do you want to generate your output?',
110110+ 'missing project - from which Hey API platform project do you want to generate your output?',
111111 );
112112 }
113113
···11-import fs from 'node:fs';
22-import path from 'node:path';
33-41import colors from 'ansi-colors';
52// @ts-expect-error
63import colorSupport from 'color-support';
7485import { createClient as pCreateClient } from './createClient';
99-import { ensureDirSync } from './generate/utils';
66+import {
77+ logCrashReport,
88+ openGitHubIssueWithCrashReport,
99+ printCrashReport,
1010+ shouldReportCrash,
1111+} from './error';
1012import { getLogs } from './getLogs';
1113import { initConfigs } from './initConfigs';
1214import type { IR } from './ir/types';
···7375 } catch (error) {
7476 const config = configs[0] as Config | undefined;
7577 const dryRun = config ? config.dryRun : resolvedConfig?.dryRun;
7878+ const logs = config?.logs ?? getLogs(resolvedConfig);
76797777- // TODO: add setting for log output
7878- if (!dryRun) {
7979- const logs = config?.logs ?? getLogs(resolvedConfig);
8080- if (logs.level !== 'silent' && logs.file) {
8181- const logName = `openapi-ts-error-${Date.now()}.log`;
8282- const logsDir = path.resolve(process.cwd(), logs.path ?? '');
8383- ensureDirSync(logsDir);
8484- const logPath = path.resolve(logsDir, logName);
8585- fs.writeFileSync(logPath, `${error.message}\n${error.stack}`);
8686- console.error(`🔥 Unexpected error occurred. Log saved to ${logPath}`);
8080+ let logPath: string | undefined;
8181+8282+ if (logs.level !== 'silent' && logs.file && !dryRun) {
8383+ logPath = logCrashReport(error, logs.path ?? '');
8484+ }
8585+8686+ if (logs.level !== 'silent') {
8787+ printCrashReport({ error, logPath });
8888+ if (await shouldReportCrash()) {
8989+ await openGitHubIssueWithCrashReport(error);
8790 }
8891 }
8989- console.error(`🔥 Unexpected error occurred. ${error.message}`);
9292+9093 throw error;
9194 }
9295};
+7-8
packages/openapi-ts/src/initConfigs.ts
···3838 input.path = userConfig.input;
3939 } else if (
4040 userConfig.input &&
4141- (userConfig.input.path || userConfig.input.organization)
4141+ (userConfig.input.path !== undefined ||
4242+ userConfig.input.organization !== undefined)
4243 ) {
4344 // @ts-expect-error
4445 input = {
···102103 const pluginConfig = pluginConfigs[name as PluginNames];
103104 if (!pluginConfig) {
104105 throw new Error(
105105- `🚫 unknown plugin dependency "${name}" - do you need to register a custom plugin with this name?`,
106106+ `unknown plugin dependency "${name}" - do you need to register a custom plugin with this name?`,
106107 );
107108 }
108109···114115 );
115116 if (nativePluginOption) {
116117 throw new Error(
117117- `🚫 cannot register plugin "${name}" - attempting to override a native plugin option "${nativePluginOption}"`,
118118+ `cannot register plugin "${name}" - attempting to override a native plugin option "${nativePluginOption}"`,
118119 );
119120 }
120121 }
···151152152153 throw new Error(
153154 errorMessage ||
154154- `🚫 missing plugin - no plugin with tag "${tag}" found`,
155155+ `missing plugin - no plugin with tag "${tag}" found`,
155156 );
156157 },
157158 };
···359360360361 if (!input.path) {
361362 throw new Error(
362362- '🚫 missing input - which OpenAPI specification should we use to generate your output?',
363363+ 'missing input - which OpenAPI specification should we use to generate your output?',
363364 );
364365 }
365366366367 if (!output.path) {
367367- throw new Error(
368368- '🚫 missing output - where should we generate your output?',
369369- );
368368+ throw new Error('missing output - where should we generate your output?');
370369 }
371370372371 if (!useOptions) {
···678678 const config = getConfig();
679679680680 if (isLegacyClient(config)) {
681681- throw new Error('🚫 TanStack Query plugin does not support legacy clients');
681681+ throw new Error('TanStack Query plugin does not support legacy clients');
682682 }
683683684684 const file = files[plugin.name]!;