Skip to content

Commit 82429fe

Browse files
jordanhunt22Convex, Inc.
authored andcommitted
[Components] Add new component.ts file to codegen (#42479)
Removes `Mounts` and instead codegens a static API inside of `component.ts` that exposes what the component API looks like to external callers. GitOrigin-RevId: f79d9ee77d7877651fd933c58cba4b4366d31fc5
1 parent f5facb2 commit 82429fe

File tree

3 files changed

+128
-192
lines changed

3 files changed

+128
-192
lines changed

src/cli/codegen_templates/common.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,18 @@ export function header(oneLineDescription: string) {
1010
*/
1111
`;
1212
}
13+
14+
export function apiComment(
15+
apiName: string,
16+
type: "public" | "internal" | undefined,
17+
) {
18+
return `
19+
/**
20+
* A utility for referencing Convex functions in your app's${type ? ` ${type}` : ""} API.
21+
*
22+
* Usage:
23+
* \`\`\`js
24+
* const myFunctionReference = ${apiName}.myModule.myFunction;
25+
* \`\`\`
26+
*/`;
27+
}

0 commit comments

Comments
 (0)