Initial commit: site monorepo with API, web, and infra.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
rules: {
|
||||
"no-console": "warn"
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "@compton/eslint-config",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"main": "index.js"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "@compton/shared-types",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"generate": "node scripts/generate.mjs"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
|
||||
const input = resolve(process.cwd(), "../../apps/api/openapi.json");
|
||||
const outputDir = resolve(process.cwd(), "src");
|
||||
mkdirSync(outputDir, { recursive: true });
|
||||
|
||||
let raw = "{}";
|
||||
try {
|
||||
raw = readFileSync(input, "utf8");
|
||||
} catch {
|
||||
raw = "{}";
|
||||
}
|
||||
|
||||
writeFileSync(
|
||||
resolve(outputDir, "index.ts"),
|
||||
`export const openApiSchema = ${raw} as const;\n`,
|
||||
"utf8"
|
||||
);
|
||||
Reference in New Issue
Block a user