-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cb6b92
commit d228b9d
Showing
3 changed files
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ import { findUp } from "find-up"; | |
import { pathToFileURL } from "node:url"; | ||
import { DocumentName, type File } from "./types.js"; | ||
|
||
type Config = { | ||
export type Config = { | ||
hooks?: { | ||
postGenerate?: (info: { | ||
documentName: DocumentName; | ||
|
@@ -31,8 +31,10 @@ export async function getConfig(cwd: string): Promise<Config> { | |
|
||
try { | ||
config = (await import(pathToFileURL(path).toString())).default; | ||
} catch { | ||
throw new Error(`Could not import gember config file at "${path}".`); | ||
} catch (cause) { | ||
throw new Error(`Could not import gember config file at "${path}".`, { | ||
Check failure on line 35 in src/config.ts GitHub Actions / test (node-version: latest, os: windows-latest)test/config.test.ts > supports a `gember.config.js` file
Check failure on line 35 in src/config.ts GitHub Actions / test (node-version: latest, os: windows-latest)test/config.test.ts > supports a `gember.config.cjs` file
Check failure on line 35 in src/config.ts GitHub Actions / test (node-version: latest, os: windows-latest)test/config.test.ts > supports a `gember.config.mjs` file
|
||
cause, | ||
}); | ||
} | ||
|
||
if (config === undefined) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters