Skip to content

Commit

Permalink
test codegen on components projects (#29433)
Browse files Browse the repository at this point in the history
run codegen wherever we see a `convex/_generated` folder, which indicates an app that can be codegened.

in particular, since we'll be iterating a lot on these and should make sure the codegen is correct, we should run codegen on the `components-poc` project and all example apps in the `npm-packages/components` directory. Since the example apps will be using the components directly instead of their packaged forms, we can use `just regenerate-codegen` to keep the `component/_generated` folders up-to-date.

to enable the test, fix a small issue from #29394 where we started running codegen on packaged components.

GitOrigin-RevId: d5f18125c69f551013b83a7d623e140872edf3ff
  • Loading branch information
ldanilek authored and Convex, Inc. committed Sep 2, 2024
1 parent 0cced63 commit 4e4e416
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/cli/lib/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,13 @@ export async function doInitialComponentCodegen(
const isPublishedPackage =
componentDirectory.definitionPath.endsWith(".js") &&
!componentDirectory.isRoot;
if (isPublishedPackage && opts?.verbose) {
logMessage(
ctx,
`skipping initial codegen for installed package ${componentDirectory.path}`,
);
if (isPublishedPackage) {
if (opts?.verbose) {
logMessage(
ctx,
`skipping initial codegen for installed package ${componentDirectory.path}`,
);
}
return;
}

Expand Down

0 comments on commit 4e4e416

Please sign in to comment.