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-component-showcase

v0.12.0

Published

The default blueprint for ember-cli addons.

Downloads

133

Readme

ember-component-showcase

Need to demonstrate how to configure your ember component? Want some easy to setup front-end documentation for its usage? Ember component showcase will let you easily exhibit your amazing ember addons with automatically generated HBS and HTML snippets, and support for component API documentation via JSDocs.

Installation

  • Install the ember addon: ember install ember-component-showcase
  • Add ember-cli-htmlbars-inline-precompile and ember-cli-htmlbars to the dependencies section of your application. Adding them to devDependencies will not work.

Configuration

Provide a custom showcaseConfig to your environment.js or ember-cli-build.js:

showcaseConfig: {
    enabled: true,
    'yuidocjs': {
      'enabled': true,
      'writeJSON': false,
      'paths': ['addon'],
      'githubRepo': 'https://github.com/user/foo-bar',
      'githubTag': 'v1.0.0',
      'linkNatives': true,
      'quiet': true,
      'parseOnly': false,
      'lint': false
    }
  }

<<<<<<< HEAD

Styling

The component and sub-components elements are prefixed with .showcase for ease of styling. If you wish to use an icon font set such as Font-Awesome, the easiest option is to simply extend the styles with the appropriate icon font selectors.

.showcase-icon {
  @extend .fa;
}
=======
* Ember.js v3.4 or above
* Ember CLI v2.13 or above
* Node.js v8 or above
>>>>>>> 905252c... v3.10.1...v3.12.0

.showcase-icon-code {
  @extend .fa-code;
}

.showcase-icon-link {
  @extend .fa-link;
}

Simple Usage Examples

If you just want to see your HBS source code, simply wrap a component with the component-showcase block.

{{#component-showcase "My Component" as |s|}}
    {{my-component "hello world" api=true onchange=(action "foobar") }}
{{/component-showcase}}

Usually you will want a little more documentation along with your samples. Configure these with docs example and source sub-components.

{{#component-showcase "My Component" as |s|}}
  {{s.docs "A simple explanation of what my component does."}}
  {{#s.example}}
    {{my-component "hello world" api=true onchange=(action "foobar") }}
  {{/s.example}}
  {{s.source}}
{{/component-showcase}}

Usage with nested addons

The setupPreprocessorRegistry hook will only act on its direct parent's content.
So to traverse for example a 'dummy' app's templates, you must manually import it into ShowcaseBroccoli by adding your own hook to index.js:

  setupPreprocessorRegistry: function(type, registry) {
    ShowcaseBroccoli.import(registry);
  },

How does it work?

  • HBS = Ember-CLI hooks + Regex + Glimmer AST traversal
  • HTML = Ember Component hooks + jQuery selectors

License

This project is licensed under the MIT License.