Loading codegen/__snapshots__/class.test.ts.snap +794 −66 File changed.Preview size limit exceeded, changes collapsed. Show changes codegen/inspector.ts +20 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,11 @@ export async function* generateInspector( inspect: typeof Deno.inspect, options: Deno.InspectOptions, ): string => "URL " + inspect(this.id!.href, options), [Symbol.for("nodejs.util.inspect.custom")]: ( _depth: number, options: unknown, inspect: (value: unknown, options: unknown) => string, ): string => "URL " + inspect(this.id!.href, options), }; } `; Loading @@ -37,7 +42,12 @@ export async function* generateInspector( [Symbol.for("Deno.customInspect")]: ( inspect: typeof Deno.inspect, options: Deno.InspectOptions, ): string => "URL " + inspect(v.href, options) ): string => "URL " + inspect(v.href, options), [Symbol.for("nodejs.util.inspect.custom")]: ( _depth: number, options: unknown, inspect: (value: unknown, options: unknown) => string, ): string => "URL " + inspect(v.href, options), } : v); `; Loading Loading @@ -70,5 +80,14 @@ export async function* generateInspector( const proxy = this._getCustomInspectProxy(); return ${JSON.stringify(type.name + " ")} + inspect(proxy, options); } [Symbol.for("nodejs.util.inspect.custom")]( _depth: number, options: unknown, inspect: (value: unknown, options: unknown) => string, ): string { const proxy = this._getCustomInspectProxy(); return ${JSON.stringify(type.name + " ")} + inspect(proxy, options); } `; } codegen/schema.ts +8 −2 Original line number Diff line number Diff line Loading @@ -174,8 +174,14 @@ export class SchemaError extends Error { async function loadSchemaValidator(): Promise<Validator> { const thisFile = new URL(import.meta.url); const response = await fetch(url.join(url.dirname(thisFile), "schema.yaml")); const content = await response.text(); const schemaFile = url.join(url.dirname(thisFile), "schema.yaml"); let content: string; if (schemaFile.protocol !== "file:") { const response = await fetch(schemaFile); content = await response.text(); } else { content = await Deno.readTextFile(schemaFile); } const schemaObject = parse(content); return new Validator(schemaObject as JsonSchema); } Loading deno.json +3 −1 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ }, "imports": { "@cfworker/json-schema": "npm:@cfworker/json-schema@^1.12.8", "@david/which-runtime": "jsr:@david/which-runtime@^0.2.0", "@deno/dnt": "jsr:@deno/dnt@^0.41.1", "@fedify/fedify": "./mod.ts", "@fedify/fedify/federation": "./federation/mod.ts", Loading Loading @@ -62,7 +63,8 @@ "test": "deno task codegen && deno task test-without-codegen", "coverage": "rm -rf coverage/ && deno task test --coverage && deno coverage --html coverage", "apidoc": "deno task codegen && deno doc --html --name=Fedify --output=apidoc/ mod.ts", "publish": "deno task codegen && deno publish" "publish": "deno task codegen && deno publish", "dnt": "deno task codegen && deno run -A dnt.ts" }, "unstable": [ "kv" Loading dnt.ts +5 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,11 @@ await build({ "npm/esm/testing/fixtures", { overwrite: true }, ); for await (const entry of Deno.readDir("vocab")) { if (!entry.isFile || !entry.name.endsWith(".yaml")) continue; await Deno.copyFile(`vocab/${entry.name}`, `npm/esm/vocab/${entry.name}`); } await Deno.copyFile("codegen/schema.yaml", "npm/esm/codegen/schema.yaml"); await Deno.copyFile("CHANGES.md", "npm/CHANGES.md"); await Deno.copyFile("LICENSE", "npm/LICENSE"); await Deno.copyFile("logo.svg", "npm/logo.svg"); Loading Loading
codegen/__snapshots__/class.test.ts.snap +794 −66 File changed.Preview size limit exceeded, changes collapsed. Show changes
codegen/inspector.ts +20 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,11 @@ export async function* generateInspector( inspect: typeof Deno.inspect, options: Deno.InspectOptions, ): string => "URL " + inspect(this.id!.href, options), [Symbol.for("nodejs.util.inspect.custom")]: ( _depth: number, options: unknown, inspect: (value: unknown, options: unknown) => string, ): string => "URL " + inspect(this.id!.href, options), }; } `; Loading @@ -37,7 +42,12 @@ export async function* generateInspector( [Symbol.for("Deno.customInspect")]: ( inspect: typeof Deno.inspect, options: Deno.InspectOptions, ): string => "URL " + inspect(v.href, options) ): string => "URL " + inspect(v.href, options), [Symbol.for("nodejs.util.inspect.custom")]: ( _depth: number, options: unknown, inspect: (value: unknown, options: unknown) => string, ): string => "URL " + inspect(v.href, options), } : v); `; Loading Loading @@ -70,5 +80,14 @@ export async function* generateInspector( const proxy = this._getCustomInspectProxy(); return ${JSON.stringify(type.name + " ")} + inspect(proxy, options); } [Symbol.for("nodejs.util.inspect.custom")]( _depth: number, options: unknown, inspect: (value: unknown, options: unknown) => string, ): string { const proxy = this._getCustomInspectProxy(); return ${JSON.stringify(type.name + " ")} + inspect(proxy, options); } `; }
codegen/schema.ts +8 −2 Original line number Diff line number Diff line Loading @@ -174,8 +174,14 @@ export class SchemaError extends Error { async function loadSchemaValidator(): Promise<Validator> { const thisFile = new URL(import.meta.url); const response = await fetch(url.join(url.dirname(thisFile), "schema.yaml")); const content = await response.text(); const schemaFile = url.join(url.dirname(thisFile), "schema.yaml"); let content: string; if (schemaFile.protocol !== "file:") { const response = await fetch(schemaFile); content = await response.text(); } else { content = await Deno.readTextFile(schemaFile); } const schemaObject = parse(content); return new Validator(schemaObject as JsonSchema); } Loading
deno.json +3 −1 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ }, "imports": { "@cfworker/json-schema": "npm:@cfworker/json-schema@^1.12.8", "@david/which-runtime": "jsr:@david/which-runtime@^0.2.0", "@deno/dnt": "jsr:@deno/dnt@^0.41.1", "@fedify/fedify": "./mod.ts", "@fedify/fedify/federation": "./federation/mod.ts", Loading Loading @@ -62,7 +63,8 @@ "test": "deno task codegen && deno task test-without-codegen", "coverage": "rm -rf coverage/ && deno task test --coverage && deno coverage --html coverage", "apidoc": "deno task codegen && deno doc --html --name=Fedify --output=apidoc/ mod.ts", "publish": "deno task codegen && deno publish" "publish": "deno task codegen && deno publish", "dnt": "deno task codegen && deno run -A dnt.ts" }, "unstable": [ "kv" Loading
dnt.ts +5 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,11 @@ await build({ "npm/esm/testing/fixtures", { overwrite: true }, ); for await (const entry of Deno.readDir("vocab")) { if (!entry.isFile || !entry.name.endsWith(".yaml")) continue; await Deno.copyFile(`vocab/${entry.name}`, `npm/esm/vocab/${entry.name}`); } await Deno.copyFile("codegen/schema.yaml", "npm/esm/codegen/schema.yaml"); await Deno.copyFile("CHANGES.md", "npm/CHANGES.md"); await Deno.copyFile("LICENSE", "npm/LICENSE"); await Deno.copyFile("logo.svg", "npm/logo.svg"); Loading