Skip to content

Commit 2227686

Browse files
committed
ci: fix checks
1 parent c80f833 commit 2227686

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

.changeset/fix-runtime-config-path.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
### Changed `runtimeConfigPath` behavior
88

9-
This was a known, long-standing issue confusing first-time users. Before, defining client `runtimeConfigPath` value would paste it verbatim to the generated output. This release changes the behavior to resolve relative to the output folder.
9+
This was a known, long-standing issue confusing first-time users. Before, defining client `runtimeConfigPath` value would paste it verbatim to the generated output. This release changes the behavior to resolve relative to the current working directory the same way output path works.
1010

examples/openapi-ts-next/openapi-ts.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineConfig({
1313
plugins: [
1414
{
1515
name: '@hey-api/client-next',
16-
runtimeConfigPath: '../hey-api',
16+
runtimeConfigPath: './src/hey-api',
1717
},
1818
'@hey-api/sdk',
1919
{

packages/openapi-ts/src/plugins/@hey-api/client-core/client.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ export function resolveRuntimeConfigPath({
1616
runtimeConfigPath: string;
1717
}): string {
1818
const isAbsolutePath = path.isAbsolute(runtimeConfigPath);
19-
20-
const isFileSystemPath =
21-
isAbsolutePath || runtimeConfigPath.startsWith('./') || runtimeConfigPath.startsWith('../');
19+
// Use a single regex to match './' or '../' at the start
20+
const isFileSystemPath = isAbsolutePath || /^\.\.?\//.test(runtimeConfigPath);
2221
if (!isFileSystemPath) {
2322
return runtimeConfigPath;
2423
}

0 commit comments

Comments
 (0)