Unverified Commit 8c72cd91 authored by Hong Minhee's avatar Hong Minhee
Browse files

Some docs

parent b264f154
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
    "docloader",
    "fedify",
    "fediverse",
    "httpsig",
    "jsonld",
    "langstr",
    "Lemmy",
@@ -42,6 +43,7 @@
    "rels",
    "subproperty",
    "superproperty",
    "unfollow",
    "webfinger"
  ]
}
+7 −0
Original line number Diff line number Diff line
@@ -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],
@@ -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
+168 −84

File changed.

Preview size limit exceeded, changes collapsed.

+6 −3
Original line number Diff line number Diff line
@@ -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> {
@@ -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 {
@@ -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[] {
@@ -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);
  }
}
+2 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
  ],
  "exclude": [
    ".git/",
    "docs/",
    "examples/"
  ],
  "tasks": {
@@ -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