Loading .vscode/settings.json +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ "docloader", "fedify", "fediverse", "httpsig", "jsonld", "langstr", "Lemmy", Loading @@ -42,6 +43,7 @@ "rels", "subproperty", "superproperty", "unfollow", "webfinger" ] } README.md +7 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,9 @@ Fedify: a fediverse server framework ==================================== [![JSR][JSR badge]][JSR] [![GitHub Actions][GitHub Actions badge]][GitHub Actions] Fedify is a [Deno]/TypeScript library for building federated server apps powered by [ActivityPub] and other standards, which is so-called [fediverse]. You may already know some of the networks in the fediverse, such as [Mastodon], Loading @@ -27,6 +30,10 @@ The rough roadmap is to implement the following features out of the box: Currently this project is not well documented, but you can find some examples in the *examples/* directory. [JSR]: https://jsr.io/@fedify/fedify [JSR badge]: https://jsr-badge.deno.dev/@fedify/fedify/unstable.svg [GitHub Actions]: https://github.com/dahlia/fedify/actions/workflows/build.yaml [GitHub Actions badge]: https://github.com/dahlia/fedify/actions/workflows/build.yaml/badge.svg [Deno]: https://deno.com/ [ActivityPub]: https://www.w3.org/TR/activitypub/ [fediverse]: https://en.wikipedia.org/wiki/Fediverse Loading codegen/__snapshots__/class.test.ts.snap +168 −84 File changed.Preview size limit exceeded, changes collapsed. Show changes codegen/property.ts +6 −3 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import { PropertySchema, TypeSchema } from "./schema.ts"; import { areAllScalarTypes, getTypeNames } from "./type.ts"; async function* generateProperty( type: TypeSchema, property: PropertySchema, types: Record<string, TypeSchema>, ): AsyncIterable<string> { Loading Loading @@ -62,7 +63,8 @@ async function* generateProperty( if (property.functional || property.singularAccessor) { yield ` /** * Similar to {@link get${toPascalCase(property.singularName)}()}, * Similar to * {@link ${type.name}.get${toPascalCase(property.singularName)}}, * but returns its \`@id\` URL instead of the object itself. */ get ${property.singularName}Id(): URL | null { Loading Loading @@ -98,7 +100,8 @@ async function* generateProperty( if (!property.functional) { yield ` /** * Similar to {@link get${toPascalCase(property.pluralName)}()}, * Similar to * {@link ${type.name}.get${toPascalCase(property.pluralName)}}, * but returns their \`@id\`s instead of the objects themselves. */ get ${property.singularName}Ids(): URL[] { Loading Loading @@ -143,6 +146,6 @@ export async function* generateProperties( ): AsyncIterable<string> { const type = types[typeUri]; for (const property of type.properties) { yield* generateProperty(property, types); yield* generateProperty(type, property, types); } } deno.json +2 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ ], "exclude": [ ".git/", "docs/", "examples/" ], "tasks": { Loading @@ -22,6 +23,7 @@ "test-without-codegen": "deno test --check --doc --allow-read --allow-write --unstable-kv --trace-leaks", "test": "deno task codegen && deno task test-without-codegen", "coverage": "rm -rf coverage/ && deno task test --coverage && deno coverage --html coverage", "doc": "deno task codegen && deno doc --html --name=Fedify mod.ts", "publish": "deno task codegen && deno publish" }, "unstable": [ Loading Loading
.vscode/settings.json +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ "docloader", "fedify", "fediverse", "httpsig", "jsonld", "langstr", "Lemmy", Loading @@ -42,6 +43,7 @@ "rels", "subproperty", "superproperty", "unfollow", "webfinger" ] }
README.md +7 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,9 @@ Fedify: a fediverse server framework ==================================== [![JSR][JSR badge]][JSR] [![GitHub Actions][GitHub Actions badge]][GitHub Actions] Fedify is a [Deno]/TypeScript library for building federated server apps powered by [ActivityPub] and other standards, which is so-called [fediverse]. You may already know some of the networks in the fediverse, such as [Mastodon], Loading @@ -27,6 +30,10 @@ The rough roadmap is to implement the following features out of the box: Currently this project is not well documented, but you can find some examples in the *examples/* directory. [JSR]: https://jsr.io/@fedify/fedify [JSR badge]: https://jsr-badge.deno.dev/@fedify/fedify/unstable.svg [GitHub Actions]: https://github.com/dahlia/fedify/actions/workflows/build.yaml [GitHub Actions badge]: https://github.com/dahlia/fedify/actions/workflows/build.yaml/badge.svg [Deno]: https://deno.com/ [ActivityPub]: https://www.w3.org/TR/activitypub/ [fediverse]: https://en.wikipedia.org/wiki/Fediverse Loading
codegen/__snapshots__/class.test.ts.snap +168 −84 File changed.Preview size limit exceeded, changes collapsed. Show changes
codegen/property.ts +6 −3 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import { PropertySchema, TypeSchema } from "./schema.ts"; import { areAllScalarTypes, getTypeNames } from "./type.ts"; async function* generateProperty( type: TypeSchema, property: PropertySchema, types: Record<string, TypeSchema>, ): AsyncIterable<string> { Loading Loading @@ -62,7 +63,8 @@ async function* generateProperty( if (property.functional || property.singularAccessor) { yield ` /** * Similar to {@link get${toPascalCase(property.singularName)}()}, * Similar to * {@link ${type.name}.get${toPascalCase(property.singularName)}}, * but returns its \`@id\` URL instead of the object itself. */ get ${property.singularName}Id(): URL | null { Loading Loading @@ -98,7 +100,8 @@ async function* generateProperty( if (!property.functional) { yield ` /** * Similar to {@link get${toPascalCase(property.pluralName)}()}, * Similar to * {@link ${type.name}.get${toPascalCase(property.pluralName)}}, * but returns their \`@id\`s instead of the objects themselves. */ get ${property.singularName}Ids(): URL[] { Loading Loading @@ -143,6 +146,6 @@ export async function* generateProperties( ): AsyncIterable<string> { const type = types[typeUri]; for (const property of type.properties) { yield* generateProperty(property, types); yield* generateProperty(type, property, types); } }
deno.json +2 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ ], "exclude": [ ".git/", "docs/", "examples/" ], "tasks": { Loading @@ -22,6 +23,7 @@ "test-without-codegen": "deno test --check --doc --allow-read --allow-write --unstable-kv --trace-leaks", "test": "deno task codegen && deno task test-without-codegen", "coverage": "rm -rf coverage/ && deno task test --coverage && deno coverage --html coverage", "doc": "deno task codegen && deno doc --html --name=Fedify mod.ts", "publish": "deno task codegen && deno publish" }, "unstable": [ Loading