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-package

v0.0.2

Published

Package your ember-addons to be consumer by non Ember CLI Apps or consume ember-addons from your non ember-cli app

Downloads

3

Readme

Ember-package

Disclaimer: This is just an experiment for now. Something we extracted from one of our internal add-ons, that is consumed by one of our non EmberCLI Apps. Please send us your feedback. The rest of the README explains the intention behind this, but most of it is not implented yet.

Ember Package helps add-on authors and add-on consumers by removing the need to use EmberCLI from non Ember CLI Applications. I think it's better to migrate the application to use Ember CLI, but this can help as an interim step. This is designed for add-ons consumed at runtime, not for add-ons that extend the build pipeline, add blueprints or commands.

NOTE: for an alternative, with a slightly different approach, check giftwrap. Giftwrap, builds multiple addons into a single set of JS and CSS files. It also let's you GiftWrap.install the wrapped addons into your App, which ember-package doesn't do. However it offers no support for package authors.

For consumers

Start by installing and initializing ember-package

npm install -g ember-package
ember-package init

Simply add the ember add-ons you want to consume to your non Ember CLI Application.

npm install ember-lgtm --save-dev

Running that, ember-package will detect the add-ons installed and will build static assets under ./ember-packages/. From there, you can simply reference them from your application as needed. For example, we have an application using Ember EAK, so we simply add it to the index. In this case, ember-lgtm only has a Javascript file, so that's all we need to reference.

<script src="ember-packages/ember-lgtm/ember-lgtm.js"></script>

How does it work

ember-package init adds a postinstall hook to your package json to run ember-package after installing node modules.

ember-package will inspect your package.json for ember-addons. For all of the add-ons it finds, it will package them, leaving the output under ember-packages/package-name. It will generate .js, .css.

What it doesn't do for you

It won't concatenate the dependencies of your add-on, since it doesn't know which of those are you referrering to already and it doesn't have a way of adding them dynamically to your current build pipeline. We could potentially add a warning if we identify bower.json dependencie if the app is using bower.

Development workflow

TODO: Describe how to npm link an addon and run ember package --serve to keep rebuilding as the addon code changes.

For authors

Start by installing ember-package as an add-on.

ember install ember-package

Run ember package to build static assets for your add-on. You could then publish this assets for others to consume via bower or another package manager. This is similar to what ember does with components/ember

Limitations

  • It won't work for add-ons that extend the build pipeline, add commands to ember-cli or have blueprints.
  • It won't add your add-ons dependencies automatically, but it will warn you if you're missing them.
  • It won't publish or version your add-on's dist assets. That's out of scope.