Skip to content

Commit

Permalink
Fix Codegen config resolution (#2293)
Browse files Browse the repository at this point in the history
* Fix codegen config resolution

* Changesets
  • Loading branch information
frandiox authored Jul 5, 2024
1 parent b3026d0 commit 426bb39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-falcons-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/cli-hydrogen': patch
---

Fix Codegen config resolution when project directory contains dots.
5 changes: 2 additions & 3 deletions packages/cli/src/lib/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {spawn} from 'node:child_process';
import {fileURLToPath} from 'node:url';
import {formatCode, getCodeFormatOptions} from './format-code.js';
import {renderFatalError, renderWarning} from '@shopify/cli-kit/node/ui';
import {renderWarning} from '@shopify/cli-kit/node/ui';
import {
joinPath,
relativePath,
Expand Down Expand Up @@ -173,8 +173,7 @@ async function generateTypes({
const {config: codegenConfig} =
// Load <root>/codegen.ts if available
(await loadCodegenConfig({
configFilePath,
searchPlaces: [dirs.rootDirectory],
configFilePath: configFilePath ?? dirs.rootDirectory,
})) ||
// Fall back to default config
(await generateDefaultConfig(dirs, forceSfapiVersion));
Expand Down

0 comments on commit 426bb39

Please sign in to comment.