This commit is contained in:
Morten Olsen
2024-03-30 20:53:01 +01:00
commit 98e39a54cc
94 changed files with 11654 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import { fileURLToPath} from 'url';
import { resolve, dirname } from 'path';
import { writeFile, mkdir } from 'fs/promises';
import { compile } from 'json-schema-to-typescript';
const root = fileURLToPath(new URL('..', import.meta.url));
const response = await fetch('https://raw.githubusercontent.com/jsonresume/resume-schema/master/schema.json');
const schema = await response.json();
const types = await compile(schema, 'ResumeSchema', { bannerComment: '' });
const location = resolve(root, 'src/types/resume-schema.ts');
console.log(`Writing to ${location}`);
await mkdir(dirname(location), { recursive: true });
await writeFile(location, types);