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

ember-cli-addon-docs-yuidoc

v1.1.0

Published

YUIDoc plugin for ember-cli-addon-docs

Downloads

34,017

Readme

This project uses GitHub Actions for continuous integration.

ember-cli-addon-docs-yuidoc

YUIDoc plugin for Ember CLI Addon Docs. This plugin adds automatic API documentation to your addon through a modified version of YUIDoc with support for:

  • Modules
  • Plain, non-class functions and constants
  • Classes
    • Added support for accessors and fields
  • Components (including arguments and yields)
  • Helper functions
  • Markdown in comments

Compatibility

  • Ember.js v3.16 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Installation

ember install ember-cli-addon-docs-yuidoc

Usage

Documenting a Class

You can document classes using standard YUIDoc syntax with a few modifications

  • You can use @field as an alias for @property
  • You can use @accessor to reference a native getter/setter, or @computed for an Ember computed. These document the same, but @computed assumes a setter exists, whereas @accessor requires you to add the @set tag.
  • You can add @static, @async, and @generator modifiers to methods
/**
  A foo class

  @class Foo
  @anArbitraryTag
  @public
*/
export default class Foo {
  /**
    A field named foo

    @field foo
    @type number
  */
  foo = 123;

  /**
    An accessor named baz

    @accessor baz
    @type any
    @set
  */
  get bar() {
    return this._baz;
  }

  set bar(val) {
    this._baz = val;
  }

  /**
    A static async method named grault

    @method grault
    @static
    @async
  */
  static async baz() {
    // ...
  }
}

Documenting Components

Components can be documented the same as classes, and will be automatically detected based on folder structure. They also have two extra types of properties:

  • @yield which must be applied to the class itself
  • @argument which is meant to represent an argument passed into the component
/**
  A foo-bar component. Usage:

  ```hbs
    {{#foo-bar baz=123 as |hash|}}

    {{/foo-bar}}
  ```

  @class FooBarComponent
  @yield {Hash} hash
  @yield {number} hash.foo
*/
export default Ember.Component.extend({
  /**
    @argument baz
    @type {number}
  */
  baz: -1
});

Documenting Modules

Modules will automatically be detected - no need to use @module. You can use the following tags:

  • @function documents plain functions
  • @variable, @const, or @constant documents variable values
  • @export [named|default] specifies the export type
    • Classes are considered the default export unless specified otherwise, functions and variables are considered named unless specified otherwwise.
/**
  @class Foo
  @export named
*/
export class Foo {}

/**
  @function bar
  @export default
*/
export default function bar() {}

/**
  @const baz
  @type {number}
*/
export const baz = 123;

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.