Skip to content

Commit

Permalink
Expose types for jsonschema/index.ts (#69)
Browse files Browse the repository at this point in the history
Expose types for jsonschemas in case users want to use data from them in
typescript
Fixes #68
  • Loading branch information
snosenzo committed Oct 28, 2022
1 parent 0dcb417 commit b36014a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
70 changes: 35 additions & 35 deletions schemas/jsonschema/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/updateGeneratedFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function main({ outDir, rosOutDir }: { outDir: string; rosOutDir: string }
for (const schema of Object.values(foxgloveMessageSchemas)) {
const json = JSON.stringify(generateJsonSchema(schema), undefined, 2);
await fs.writeFile(path.join(outDir, "jsonschema", `${schema.name}.json`), json + "\n");
indexTS += `export const ${schema.name}: unknown = ${json};\n\n`;
indexTS += `export const ${schema.name} = ${json};\n\n`;
}
await fs.writeFile(path.join(outDir, "jsonschema", `index.ts`), indexTS);
});
Expand Down

0 comments on commit b36014a

Please sign in to comment.