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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mimosa-ember-module-import

v1.3.0

Published

A Mimosa module builder solution for Ember apps

Readme

mimosa-ember-module-import

Overview

This module will aid in your Ember application development by automatically building module manifest files. As Mimosa processes your assets, it keeps track of your Controllers/Views/Routers etc, and builds either an AMD or CommonJS compliant manifest for each namedspaced app in your project.

To see this module in action, check out the MimosaEmberSkeleton project.

Note: this module requires mimosa-require 2.2.3 (bundled with mimosa 2.3.14) to function properly.

Usage

Add 'ember-module-import' to your list of modules. That's all! Mimosa will install the module for you when you start mimosa watch or mimosa build.

Functionality

This module makes using module systems together with Ember easier. Ember doesn't work with async module loaders. Ideally, when Ember is fired up it wants to have all of the various Ember object types (Controllers, Views, Routers, etc) already attached/registered.

This module helps attach modules to Ember, and makes using your favorite module loaders, async or otherwise, easier. It can create module manifests for multiple namespaces in your application.

This uses an array of default folders (see emberDirs below), and namespace configurations to generate manifest files. Those files contain a list of requires for files containing Ember objects. Then, in the manifest, an object is created using the exported values from the required files as values, and the file names as the keys. If a file name is search_results_controller.js, then the key would be SearchResultController, which matches what Ember would like to see.

See some example outputs below.

MimosaEmberSkeleton showcases this module and its use in a require.js application.

Default Config

emberModuleImport: {
  cacheDir: ".mimosa/emberModuleImport",
  amd: true,
  fileSep: "_"
  apps: [{
    namespace: null,
    additional: ["router"],
    exclude: [],
    manifestFile: "modules"
  }],
  emberDirs: [
    "adapters",
    "components",
    "controllers",
    "helpers",
    "initializers",
    "mixins",
    "models",
    "routes",
    "serializers",
    "transforms",
    "utils",
    "views"
  ]
}
  • cacheDir - location this module will place its cache information.
  • amd - whether the output is in AMD or CommonJS format. If set to false, the output will be CommonJS style.
  • fileSep - Character/String used for separating portions of file name. Ex: tag_editor_controller.js
  • apps - an array of the different apps in the project. Each app results in an output module file. This allows you to create multiple module manifests, thereby eventually letting you bundled together multiple sub-apps from the same project.
  • apps.namespace - the namespace of the app. namespace is the root folder relative to watch.javascriptDir. Everything in that namespace will be bundled together into a single module import file. When the namespace is null, the default, the entire application is used.
  • apps.additional - additional files, whether ember files outside of the namespace (like common components), or non-ember files inside or outside the namespace, to include in the namespace manifest file. Paths are relative to the namespace. Use ../ paths to include files/folders outside the namespace. In the default config, router is an additional file. This would pick up a router.js sitting in the root of your namespace.
  • apps.exclude - array of strings or regexes that match files to not include in this manifest. Strings are paths that can be relative to the namespace or absolute.
  • apps.manifestFile - The name of the manifest file to output. .js is assumed. Path is relative to namespace.
  • emberDirs - Ember directories that contain files to include in a manifest file. Any files in these directories or in subdirectories of these directories within a namespace will be required in the manifest file.

Example Config

emberModuleImport: {
  apps: [
    {
      namespace: "user-app",
      additional: ["../common/components"],
      manifestFile: "user-modules"
    },
    {
      namespace: "search-app",
      additional: ["../common/components"],
      manifestFile: "search-modules"
    }
  ]
}

In this config two applications, namespaced at user-app and search-app, exist in the same project, and they both share some common components at ../common/components. Each has a manifest file (required) that will be deposited at the root of the namespace. Give the above config, the expected project layout would resemble the below.

/assets
  /javascripts
    /common
      /components
    /user-app
      /components
      /views
      ...
    /search-app
      /components
      /views
      ...

And the output file structure would resemble the following:

/public
  /javascripts
    /common
      /components
    /user-app
      /components
      /views
      ...
      user-modules.js
    /search-app
      /components
      /views
      ...
      search-modules.js

Example Manifest File

AMD

define( function( require ) {
  var _0 = require('./controllers/post_controller');
  var _1 = require('./helpers/helpers');
  var _2 = require('./routes/post_route');
  var _3 = require('./routes/posts_route');

  var modules = {
    PostController: _0 && (_0['default'] || _0),
    Helpers: _1 && (_1['default'] || _1),
    PostRoute: _2 && (_2['default'] || _2),
    PostsRoute: _3 && (_3['default'] || _3)
  };
  return modules;
});

CommonJS

var _0 = require('./controllers/post_controller');
var _1 = require('./helpers/helpers');
var _2 = require('./routes/post_route');
var _3 = require('./routes/posts_route');

var modules = {
  PostController: _0 && (_0['default'] || _0),
  Helpers: _1 && (_1['default'] || _1),
  PostRoute: _2 && (_2['default'] || _2),
  PostsRoute: _3 && (_3['default'] || _3)
};

module.exports = modules;

To run tests

  • git clone the repo
  • cd mimosa-ember-module-import
  • Run npm install
  • Run mimosa mod:install
  • npm test

You may get a Error: ENOTEMPTY, directory not empty error with some of the test project directories. Haven't yet been able to track that down, but if that is the only error you get, you are in good shape. But you should run the tests until you get an all clear.