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-module-migrator

v0.8.0

Published

Migration script for ember-cli apps.

Downloads

115

Readme

ember-module-migrator

Migrates ember-cli projects to the newly proposed module format.

This migrator does not leave an application in a bootable state. See "Usage" for instructions on how to manually update a migrated app to a bootable setup.

See emberjs/rfcs#143 for details on the design of this app layout.

Examples

These are examples of the migrator output on various apps:

Usage

To run the migrator on your app:

npm install -g ember-module-migrator jscodeshift
cd your/project/path
ember-module-migrator

After running the migrator itself, you will need to update several files to boot an application in order to boot it.

Booting a migrated app

The best path forward is to run the ember-module-unification-blueprint on the converted app:

# This command will run the blueprint, but it requires Ember-CLI 2.14.
#
# You may want to manually update the following packages before running the
# `ember init` command:
#
#   npm i ember-resolver@^4.3.0 ember-cli@github:ember-cli/ember-cli --save-dev
#   npm uninstall ember-source --save
#   bower install --save components/ember#canary
#
# If you are already running 2.14, you can jump right to the command:
ember init -b ember-module-unification-blueprint

Additionally any component names not in a template are not recognized by the migrator. For example if you have a computed property that returns the string "widget/some-thing" using that string with the {{component helper will now cause an error. You must convert these component named to not have / characters in their strings.

Running module unification with fallback to classic app layout

If an application cannot be converted all at once, or if your application is dependent upon addons that use app/ to add files, you may want to use a setup that falls back to app/ after checking src and honors the app/ directory for some files like initializers.

To do this use a fallback resolver in src/resolver.js:

import Resolver from 'ember-resolver/resolvers/fallback';
import buildResolverConfig from 'ember-resolver/ember-config';
import config from '../config/environment';

let moduleConfig = buildResolverConfig(config.modulePrefix);
/*
 * If your application has custom types and collections, modify moduleConfig here
 * to add support for them.
 */

export default Resolver.extend({
  config: moduleConfig
});

In src/main.js be sure to load initializers in the app/ directory (possibly added by an addon) via:

/*
 * This line should be added by the blueprint
 */
loadInitializers(App, config.modulePrefix+'/src/init');

/*
 * This line should be added to support `app/` directories
 */
loadInitializers(App, config.modulePrefix);

Finally, in tests/test-helper.js, load the app from ../src/main

import Application from '../src/main';

Important Notes

Known caveats:

  • Migrates only "classic" structured ember-cli apps at this point. We are actively working on pods support.