Skip to content

dtinth/apiref

Repository files navigation

apiref

Automatically-generated documentation sites for npm packages, powered by TypeDoc.

Publishing documentation

Package must use trusted publishing with provenance enabled.

Source links

To make documentation pages link back to the source code correctly:

  • Include source files in the published package:

    {
      "files": [
        "dist",
        "src", // <-- include source files in published package
      ],
    }
  • Generate source maps, so that the published JavaScript file includes a source map that points to the original TypeScript source.

    // Example (Vite+)
    // See: https://viteplus.dev/guide/pack
    import { defineConfig } from "vite-plus";
    
    export default defineConfig({
      pack: {
        sourcemap: true,
      },
    });

    Alternatively, you can add a "typedoc" conditional export in package.json that points to the original TypeScript source file. For example:

    {
      "exports": {
        ".": {
          "typedoc": "./src/index.ts", // <-- point to original TypeScript source for TypeDoc
          "default": "./dist/index.mjs",
        },
      },
    }
  • For monorepos, make sure to set repository.directory in the root package.json to the subdirectory of the package, so that links point to the correct location in the repository.

    {
      "repository": {
        "type": "git",
        "url": "git+https://github.com/dtinth/visual-storyboard.git",
        "directory": "packages/core",
      },
    }

Deployments

Component Source Endpoint Platform Details
Site apps/site https://apiref-site.vercel.app/ Vercel Elysia backend; server-rendered pages + dynamic APIs
Shell packages/shell https://cdn.apiref.page/ GitHub Pages Web components for interactive doc layout (nav, outline, header)
Docs packages/renderer https://npm.apiref.page/ Linode Object Storage Static HTML generated from npm packages; one directory per package version

About

Automatically generated API reference sites for TypeScript libraries on the public npm registry.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Generated from fresh-app/fresh-remix-app