npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

webframe-docs

v0.0.2

Published

Automatic Documentation Generator for React Components

Downloads

3

Readme

Automatic Docs Generator for React Components (WIP)

:warning: this package is under development! (pending @webframer/compiler release)

Webframe Docs is a CLI tool for generating documentation of React components, with automatic:

  1. PropTypes parsing of code comments into descriptions with <PropsTable>
  2. Source code generation for component examples wrapped inside <CodeExample>.

Demo & Examples

These documentation sites were built using webframe-docs CLI:

Key Benefits

Webframe Docs compiler is:

  • An alternative to Docz (partially inspired by Docz concepts)
  • Package and project agnostic (works for any setup, without reliance on Webpack)
  • Extendable beyond basic React PropTypes with custom type system

Setup & Usage

  1. Optionally create a webframe.docs.json config file in your project. Directory paths use glob patterns, which are relative to the location of the config file, and can be outside the project root directory. This is the default config when no config file exists:
{
  "projects": [
    {
      // Directory containing React Components to document
      "inputComponents": [
        "!**/node_modules",
        "./components/**/*.{js,jsx}"
      ],
      // Directory containing source .mdx files to compile (or glob pattern)
      "inputDocs": "./docs",
      // Directory path where to save compiled doc files
      "outputDocs": "./pages/docs",
      // Where to save parsed React Component PropTypes
      "outputPropTypes": "./src/propTypes.json",
    },
  ],
}
  1. Run the docs compiler command in Terminal (with optional --watch mode)
# Runs this command inside project root, 
# or where there is webframe.docs.json config file.
npx webframe-docs compile --watch

How It Works

Currently, webframe-docs supports documentation generated with Nextra using Next.js.

It watches for changes in the input directories and compiles files with .mdx extension into output directories ( ex. pages/docs). Other files in the inputDocs directory also sync with the outputDocs directory.

Then it's up to Nextra (ex. using nextra-theme-docs package) to build the files for production bundle.