Loading fedify/codegen/schema.ts +2 −1 Original line number Diff line number Diff line Loading @@ -241,11 +241,12 @@ async function loadSchemaValidator(): Promise<Validator> { return new Validator(schemaObject as JsonSchema); } const schemaValidator: Validator = await loadSchemaValidator(); let schemaValidator: Validator | undefined = undefined; async function loadSchema(path: string): Promise<TypeSchema> { const content = await readFile(path, { encoding: "utf-8" }); const schema = parse(content); if (schemaValidator == null) schemaValidator = await loadSchemaValidator(); const result = schemaValidator.validate(schema); const errors: SchemaError[] = []; if (result.valid) return schema as TypeSchema; Loading fedify/scripts/discover_tests.ts +0 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ for await (const file of files) { path = path.slice(baseDir.length + SEPARATOR.length); } if (path.startsWith(`codegen${SEPARATOR}`)) continue; else if (path.endsWith(`${SEPARATOR}vocab.test.js`)) continue; const relPath = `./${path.replaceAll(SEPARATOR, "/")}`; console.log(`import "${relPath}";`); } fedify/vocab/vocab.test.ts +7 −2 Original line number Diff line number Diff line Loading @@ -857,7 +857,10 @@ const sampleValues: Record<string, any> = { "fedify:units": "m", }; const types = await loadSchemaFiles(import.meta.dirname!); const types: Record<string, TypeSchema> = navigator?.userAgent === "Cloudflare-Workers" ? {} // FIXME: Cloudflare Workers does not support async I/O within global scope : await loadSchemaFiles(import.meta.dirname!); for (const typeUri in types) { const type = types[typeUri]; // @ts-ignore: classes are all different Loading Loading @@ -1252,7 +1255,9 @@ for (const typeUri in types) { }); if ("Deno" in globalThis) { const { assertSnapshot } = await import("@std/testing/snapshot"); const { assertSnapshot } = await import("@std/testing/snapshot").catch( () => ({ assertSnapshot: () => Promise.resolve() }), ); test(`Deno.inspect(${type.name}) [auto]`, async (t) => { const empty = new cls({}); Loading Loading
fedify/codegen/schema.ts +2 −1 Original line number Diff line number Diff line Loading @@ -241,11 +241,12 @@ async function loadSchemaValidator(): Promise<Validator> { return new Validator(schemaObject as JsonSchema); } const schemaValidator: Validator = await loadSchemaValidator(); let schemaValidator: Validator | undefined = undefined; async function loadSchema(path: string): Promise<TypeSchema> { const content = await readFile(path, { encoding: "utf-8" }); const schema = parse(content); if (schemaValidator == null) schemaValidator = await loadSchemaValidator(); const result = schemaValidator.validate(schema); const errors: SchemaError[] = []; if (result.valid) return schema as TypeSchema; Loading
fedify/scripts/discover_tests.ts +0 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ for await (const file of files) { path = path.slice(baseDir.length + SEPARATOR.length); } if (path.startsWith(`codegen${SEPARATOR}`)) continue; else if (path.endsWith(`${SEPARATOR}vocab.test.js`)) continue; const relPath = `./${path.replaceAll(SEPARATOR, "/")}`; console.log(`import "${relPath}";`); }
fedify/vocab/vocab.test.ts +7 −2 Original line number Diff line number Diff line Loading @@ -857,7 +857,10 @@ const sampleValues: Record<string, any> = { "fedify:units": "m", }; const types = await loadSchemaFiles(import.meta.dirname!); const types: Record<string, TypeSchema> = navigator?.userAgent === "Cloudflare-Workers" ? {} // FIXME: Cloudflare Workers does not support async I/O within global scope : await loadSchemaFiles(import.meta.dirname!); for (const typeUri in types) { const type = types[typeUri]; // @ts-ignore: classes are all different Loading Loading @@ -1252,7 +1255,9 @@ for (const typeUri in types) { }); if ("Deno" in globalThis) { const { assertSnapshot } = await import("@std/testing/snapshot"); const { assertSnapshot } = await import("@std/testing/snapshot").catch( () => ({ assertSnapshot: () => Promise.resolve() }), ); test(`Deno.inspect(${type.name}) [auto]`, async (t) => { const empty = new cls({}); Loading