Skip to content

Commit

Permalink
Revert "Use local prettier settings for generated code (#30888)" (#31…
Browse files Browse the repository at this point in the history
…726)

This reverts commit 35261af24f1bd489f2f1f78f902375b4d8410a07.

In some situations this appears to remove type parameters from convex/_generated/api.d.ts.

GitOrigin-RevId: b1ab1349b42a5e47200470b834e7598450e3fca3
  • Loading branch information
thomasballinger authored and Convex, Inc. committed Nov 22, 2024
1 parent 9dc7e84 commit 6f07478
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions npm-packages/convex/src/cli/lib/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ async function doReadmeCodegen(
readmeCodegen(),
"markdown",
readmePath,
{ ignoreLocalConfig: true, ...opts },
opts,
);
}

Expand All @@ -331,7 +331,7 @@ async function doTsconfigCodegen(
tsconfigCodegen(),
"json",
tsconfigPath,
{ ignoreLocalConfig: true, ...opts },
opts,
);
}

Expand Down Expand Up @@ -547,17 +547,15 @@ async function writeFormattedFile(
options?: {
dryRun?: boolean;
debug?: boolean;
ignoreLocalConfig?: boolean;
},
) {
// Run prettier so we don't have to think about formatting!
// If we can find them, use the developer's Prettier configuration.
const config = options?.ignoreLocalConfig
? null
: await prettier.resolveConfig(destination);
//
// This is a little sketchy because we are using the default prettier config
// (not our user's one) but it's better than nothing.
const formattedContents = await prettier.format(contents, {
parser: filetype,
...config,
pluginSearchDirs: false,
});
if (options?.debug) {
// NB: The `test_codegen_projects_are_up_to_date` smoke test depends
Expand Down

0 comments on commit 6f07478

Please sign in to comment.