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

app-to-addon-migrator

v2.2.2

Published

An opinionated cli tool to migrate Ember components from app to addons within a Yarn workspace.

Downloads

33

Readme

app-to-addon-migrator

Build and Deploy Coverage Status semantic-release npm version

An opinionated cli tool to migrate Ember components from app to addons within a Yarn workspace.

NOTE: This cli tool works only with the following conventional folder structure for your Ember app.

|-app
|-packages
| |-addons
| |-engines
| | |-dashboards-engine
| | |-tickets-engine

Assumptions made by this tool

  • Your Ember app lives in the root of your project folder.
  • Engines live under packages/engines folder.
  • Addons live under packages/addons folder.
  • You are using Yarn workspaces.
  • You are using POD structure for your components.

Install

npm i -g app-to-addon-migrator

Usage

1. ateam (wizard UI)

ateam

ateam demo

2. atam (classic CLI)

atam [entity] [entity-name] [dest-folder]
atam route default packages/engines/dashboards-engine

After running the above command, the route default from app/routes/default.js will be moved to packages/engines/dashboards-engine/addon/routes/default.js

Dry-run

If you just want to see/verify the movement use the --dry-run or -d option.

atam route default packages/engines/dashboards-engine -d

This will print something like (without actually copying the files):

Moving route.js
---------------
app/routes/helpdesk/default.js
packages/engines/dashboards-engine/addon/routes/default.js


Moving route template.hbs
-------------------------
app/templates/helpdeskdefault.hbs
packages/engines/dashboards-engine/addon/templates/default.hbs

...

Folder namespace

If your source entities are namespaced within a folder you can use the -f option to specify the same before copying. Say for example you want to move a component called widget from app/components/dashboards

atam component widget packages/engines/dashboards-engine -f dashboards

Commands:

  atam adapter [adapter-name]               Copy an adapter from app to addon
  [destination]
  atam component [component-name]           Copy a component from app to addon
  [destination]
  atam constant [constant-name]             Copy a constant from app to addon
  [destination]
  atam helper [helper-name] [destination]   Copy a helper from app to addon
  atam mixin [mixin-name] [destination]     Copy a mixin from app to addon
  atam model [model-name] [destination]     Copy a model from app to addon
  atam route [route-name] [destination]     Copy a route with controller from
                                            app to addon
  atam routex [route-name] [destination]    Copy a route and its dependent
                                            components from app to addon
  atam service [storage-name]               Copy a storage from app to addon
  [destination]
  atam storage [storage-name]               Copy a storage from app to addon
  [destination]
  atam util [util-name] [destination]       Copy a util from app to addon
  atam validator [validator-name]           Copy a validator from app to addon
  [destination]

Options:
  --version      Show version number                                   [boolean]
  --help         Show help                                             [boolean]
  --dry-run, -d  Dry Run: Verify the movement without executing        [boolean]
  --pods, -p     Specify that the source components use PODS structure
                                                       [boolean] [default: true]

References

  • http://ember-engines.com/
  • https://developer.squareup.com/blog/ember-and-yarn-workspaces/
  • https://medium.com/@lukedeniston/how-to-write-a-really-really-ambitious-spa-in-2019-60fc38de89db
  • https://github.com/lennyburdette/ember-monorepo-demo
  • https://discuss.emberjs.com/t/yarn-workspaces-and-ember/15672/13
  • https://github.com/habdelra/yarn-workface