Code Monkey home page Code Monkey logo

ember-cli-migrator's Introduction

ember-cli-migratorBuild Status

Important: As of 0.5.0 Node JS v0.10 is no longer supported. Please use Node v0.12 or IOJS instead.

Installation

npm install -g ember-cli-migrator

About

Migrate your files to the standard ember-cli structure, preserving git history.

You can run the command line tool by running the ember-cli-migrator script from within your existing ember project.

The goal of the project is to convert global variables to ES6 Modules. For example:

App.Post = DS.Model.extend({

});

becomes

import DS from "ember-data";

var Post = DS.Model.extend({

});

export default Post;

Features

  • The following known module types are currently handled:
    • Components
    • Controllers
    • Routes
    • Views
    • Models
    • Mixins
    • Transforms
    • Adapters
    • Serializers
    • Services
  • Converts file names for you and puts them into the canonical ember CLI folders.
  • Multiple modules in your current file will be split into their own export module and potentially into different folders. For example if you had a model and serializer defined in the same file, the migrator would split the serializer into a file in the serializers folder and the model module would exist in the models folder.
  • Unknown types, e.g., a utility function defined on your app namespace, is exported in a module that is left in the location it was found.
  • Non JS files, e.g., handlebars, erb, are moved to a nonJS folder with the same subdirectory hierarchy so they are easy for you to isolate and handle manually.

Command Line Options

-h, --help                              output usage information
-V, --version                           output the version number
-g, --global [name]                     Global namespace of Ember application, eg: "MyApplication = Ember.Application.."
-a, --ember-cli-app-name [name],        Name of application namespace/modulePrefix. This is the name of the app you would pass to `ember new <ember-cli-app-name>`
-s, --source [source_directory]         Directory to perform migration on
-t, --target [target_directory]         Directory to output result of migration
-f, --force                             Migrate even if output files exist
--keep-source                           Keep source files. (Target does not replicate git history.)
--ignore-subdirs [comma_separated_dirs] Sub-directories in source to ignore

Example

To convert an Ember App Kit-like project and put it back in the same parent directory, you can use the following

ember-cli-migrator -g App -t . -s . -a appkit

Testing

You can run the tests by running npm test in the root folder.

Running the CLI locally

You can run bin/ember-cli-migrator from the root of this project and use the command line arguments above.

Dependencies

The project uses recast (which uses Esprima) to walk the JavaScript AST to accurately identify exports and move the file.

Necessary Manual Steps

  • App.Router = Ember.Router.extend(); placed at beginning of router file
  • import ./config/environment in router
  • move injectors & registers to initializers rather than on App
  • have to merge app.js code, imports etc.
  • move ENV stuff to config/environments.js
  • var ObjectTransform = var ArrayTransform = Ember.Transform.extend

TODOS

  • helpers
  • Smarter Router migrations
  • Handleabars

ember-cli-migrator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-cli-migrator's Issues

error installing

I get these errors while installing:

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo

but I am running as sudo.

Can not find moule ../ember-migrator

» node_modules/ember-cli-migrator/bin/ember-cli-migrator

module.js:340
    throw err;
          ^
Error: Cannot find module '../ember-migrator'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (XXX/node_modules/ember-cli-migrator/bin/ember-cli-migrator:8:21)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)

should be:

var EmberMigrator = require('../lib/ember-migrator');

why does the migrator flatten the folder structures?

After migrating an old ember-rails project all my nicely nested routes ended up at the top level app/routes folder, but with dasherized names from the old file paths. What's the purpose of that? I've been using folders to keep my other ember-cli apps nicely organized, seems to work just fine. Is there a way to turn this feature off and keep my folder structure?

Error processing hbs files.

Running on this repo. Maybe I'm doing something wrong?

ember-cli-migrator -g App -t . -s test -d test/fixtures/vanilla

On this repo errors when the migrator tries to process move .hbs files.

It looks related to output path.

Git Move Moving fixtures/vanilla/input/templates/atemplate.handlebars to app/templates/fixtures/vanilla/input/templates/atemplate.handlebars

/usr/local/lib/node_modules/ember-cli-migrator/node_modules/exec-sync/bin/index.js:68
        throw new Error(error);
              ^
Error: fatal: renaming 'test/fixtures/vanilla/input/templates/atemplate.handlebars' failed: No such file or directory
    at module.exports (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/exec-sync/bin/index.js:68:15)
    at null.<anonymous> (/usr/local/lib/node_modules/ember-cli-migrator/lib/ember-migrator.js:116:7)
    at Array.forEach (native)
    at EmberMigrator_run [as run] (/usr/local/lib/node_modules/ember-cli-migrator/lib/ember-migrator.js:97:12)
    at Object.<anonymous> (/usr/local/lib/node_modules/ember-cli-migrator/bin/ember-cli-migrator:30:10)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)

FYI the test pass just fine.

Add reporting about module being refactored

I get the following error:

require("recast").Visitor deprecated Please use require("recast").visit instead of require("recast").Visitor node_modules/ember-cli-migrator/lib/ember-migrator.js:42:31
require("recast").Visitor deprecated Please use require("recast").visit instead of require("recast").Visitor node_modules/ember-cli-migrator/node_modules/recast/node_modules/cls/main.js:91:71
preprocess

Error: Line 1: Unexpected token ILLEGAL
    at throwError (/home/gonvaled-data/projects/frontend-app/node_modules/ember-cli-migrator/node_modules/recast/node_modules/esprima-fb/esprima.js:2422:21)
    at scanPunctuator (/home/gonvaled-data/projects/frontend-app/node_modules/ember-cli-migrator/node_modules/recast/node_modules/esprima-fb/esprima.js:849:9)
    at advance (/home/gonvaled-data/projects/frontend-app/node_modules/ember-cli-migrator/node_modules/recast/node_modules/esprima-fb/esprima.js:1541:16)
    at peek (/home/gonvaled-data/projects/frontend-app/node_modules/ember-cli-migrator/node_modules/recast/node_modules/esprima-fb/esprima.js:1567:21)
    at parseProgram (/home/gonvaled-data/projects/frontend-app/node_modules/ember-cli-migrator/node_modules/recast/node_modules/esprima-fb/esprima.js:5543:9)
    at Object.parse (/home/gonvaled-data/projects/frontend-app/node_modules/ember-cli-migrator/node_modules/recast/node_modules/esprima-fb/esprima.js:6706:23)
    at Object.parse (/home/gonvaled-data/projects/frontend-app/node_modules/ember-cli-migrator/node_modules/recast/lib/parser.js:25:32)
    at EmberMigrator.splitFile (/home/gonvaled-data/projects/frontend-app/node_modules/ember-cli-migrator/lib/ember-migrator.js:159:20)
    at Array.forEach (native)
    at EmberMigrator_run [as run] (/home/gonvaled-data/projects/frontend-app/node_modules/ember-cli-migrator/lib/ember-migrator.js:121:11)

But I have not enough context to know what is going on. Where does it fail? Which file? Which line? Which token?

Is it possible to have a command-line flag to increase logging?

error installing

ryanrauh ~/lecode/huboard-rails/ember-migration $ npm install -g ember-cli-migrator
npm WARN engine [email protected]: wanted: {"node":"0.6.x"} (current: {"node":"0.12.0","npm":"2.5.1"})
npm WARN engine [email protected]: wanted: {"node":"0.6.x"} (current: {"node":"0.12.0","npm":"2.5.1"})
/Users/ryanrauh/.nodenv/versions/0.12.0/bin/ember-cli-migrator -> /Users/ryanrauh/.nodenv/versions/0.12.0/lib/node_modules/ember-cli-migrator/bin/ember-cli
-migrator
npm WARN unmet dependency /Users/ryanrauh/.nodenv/versions/0.12.0/lib/node_modules/ember-cli-migrator/node_modules/ember-cli/node_modules/broccoli-es6modul
es/node_modules/esperanto requires chalk@'^1.0.0' but will load
npm WARN unmet dependency /Users/ryanrauh/.nodenv/versions/0.12.0/lib/node_modules/ember-cli-migrator/node_modules/ember-cli/node_modules/chalk,
npm WARN unmet dependency which is version 0.5.1
[email protected] /Users/ryanrauh/.nodenv/versions/0.12.0/lib/node_modules/ember-cli-migrator
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], marked@0.$.3, [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected].$, [email protected], [email protected], [email protected])

node: 0.12.0
npm: 2.5.1

ryanrauh ~/lecode/huboard-rails/ember-migration $ ember-cli-migrator -g App -t dest -s source -d huboard
require("recast").Visitor deprecated Please use require("recast").visit instead of require("recast").Visitor ../../../.nodenv/versions/0.12.0/lib/node_modu
les/ember-cli-migrator/lib/helper-visitor.js:26:28
require("recast").Visitor deprecated Please use require("recast").visit instead of require("recast").Visitor ../../../.nodenv/versions/0.12.0/lib/node_modu
les/ember-cli-migrator/node_modules/recast/node_modules/cls/main.js:91:71
require("recast").Visitor deprecated Please use require("recast").visit instead of require("recast").Visitor ../../../.nodenv/versions/0.12.0/lib/node_modu
les/ember-cli-migrator/lib/migrator-visitor.js:8:30
module.js:338
    throw err;
          ^
Error: Cannot find module 'lodash'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/ryanrauh/.nodenv/versions/0.12.0/lib/node_modules/ember-cli-migrator/lib/ember-migrator.js:15:14)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

ember-cli-migrator “Do not know how to import App” error

0
down vote
favorite
I'm migrating a custom made Ember project (I do not use a build system, but actually created my own grunt script). When I run ember-cli-migrate but I'm getting the following error:

Git Move Moving templates/users.hbs to app\templates\users.hbs
Do not know how to import App
Do not know how to import App
Do not know how to import App
Do not know how to import App
Do not know how to import App
Do not know how to import App
Do not know how to import App
Do not know how to import App

assert.js:86
throw new assert.AssertionError({
^
AssertionError: {kind: var, declarations: [object Object], loc: null, type: Vari
ableDeclaration, comments: null} does not match field "init": Expression | null
of type VariableDeclarator
at add (c:\Users\DoryZ\AppData\Roaming\npm\node_modules\ember-cli-migrator\n
ode_modules\recast\node_modules\ast-types\lib\types.js:525:28)
at c:\Users\DoryZ\AppData\Roaming\npm\node_modules\ember-cli-migrator\node_m
odules\recast\node_modules\ast-types\lib\types.js:539:17
at Array.forEach (native)
at Object.defineProperty.value [as variableDeclarator](c:UsersDoryZAppDa
taRoamingnpmnode_modulesember-cli-migratornode_modulesrecastnode_modules
ast-typeslibtypes.js:538:30)
at Context.MigratorVisitorPrototype.visitAssignmentExpression (c:\Users\Dory
Z\AppData\Roaming\npm\node_modules\ember-cli-migrator\lib\migrator-visitor.js:71
:67)
at Context.invokeVisitorMethod (c:\Users\DoryZ\AppData\Roaming\npm\node_modu
les\ember-cli-migrator\node_modules\recast\node_modules\ast-types\lib\path-visit
or.js:306:43)
at Visitor.PVp.visitWithoutReset (c:\Users\DoryZ\AppData\Roaming\npm\node_mo
dules\ember-cli-migrator\node_modules\recast\node_modules\ast-types\lib\path-vis
itor.js:180:28)
at NodePath.each (c:\Users\DoryZ\AppData\Roaming\npm\node_modules\ember-cli-
migrator\node_modules\recast\node_modules\ast-types\lib\path.js:96:22)
at visitChildren (c:\Users\DoryZ\AppData\Roaming\npm\node_modules\ember-cli-
migrator\node_modules\recast\node_modules\ast-types\lib\path-visitor.js:199:14)
at Visitor.PVp.visitWithoutReset (c:\Users\DoryZ\AppData\Roaming\npm\node_mo
dules\ember-cli-migrator\node_modules\recast\node_modules\ast-types\lib\path-vis
itor.js:188:16)
any help would be appreciated..

and this is what user.hbs looks like:

    <h2 class="internal-page-header">
        <ul class="nav nav-pills projects-nav">
            {{#nav-view}} {{#link-to 'users.index'}}Active{{/link-to}} {{/na

v-view}}
{{#nav-view}} {{#link-to 'users.available'}}Available{{/link-to}
} {{/nav-view}}
{{#nav-view}} {{#link-to 'users.recruiting'}}Recruiting{{/link-t
o}} {{/nav-view}}
{{#nav-view}} {{#link-to 'users.disabled'}}Disabled{{/link-to}}
{{/nav-view}}

        </ul>
        <ul class="nav nav-pills projects-nav pull-right">
            {{#if controllers.application.isAdmin}}
              {{#if showSearch}}
                {{#nav-view}}
                    {{#link-to 'users.new'}}
                        <div class="min-width-100"><span class="entypo-plus-

circled"> Add Person


{{/link-to}}
{{/nav-view}}
{{/if}}
{{/if}}
  • {{search-box action="handleSearch" id="searchBox" showSearch
    =showSearch}}

  •     </h2>
    
        <div class="projects-body-container">
            {{outlet}}
        </div>
    </div> <!-- end col div -->
    

    I've also opend this on stackoverflow:

    http://stackoverflow.com/questions/30999440/ember-cli-migrator-do-not-know-how-to-import-app-error

    Preverse comments/'use strict'/variable assignments on top of file

    Hiya!

    When I run the migrator, files that are in the format of

    'use strict';
    
    // Code comment
    
    const SOME_DEFINE = 10;
    
    var WhateverController = Ember.Controller.extend({});

    End up in the form:

    import Ember from 'ember';
    var WhateverController = Ember.Controller.extend({});
    
    'use strict';
    
    // Code comment
    
    const SOME_DEFINE = 10;
    
    export default FlagAndRefundModalController;

    The ideal I believe is:

    'use strict';
    
    import Ember from 'ember';
    
    // Code comment
    
    const SOME_DEFINE = 10;
    
    var WhateverController = Ember.Controller.extend({});
    export default FlagAndRefundModalController;

    The 'use strict' must end up at the top of a file I believe, and it'd be nice having the code that was on top there also.

    Stability of the tool

    Related to emberjs/website#1994

    I haven't used this migrator yet, but it came up during our initial documentation meeting. What are your feelings on the stability of the tool and maintenance of it going forward? We may document its use within new Ember docs as a tool for migrating to Ember-CLI.

    Support migrating "basic" classes eg. "App.Route" to "app/routes/basic"

    We have a fairly large app (50+ routes) where we have added a App.Route to encapsulate common functionality. Currently, the migrator will migrate Route.js to -.js, and all other routes will try and import app\routes\-.

    According to http://www.ember-cli.com/#using-modules it should be migrated to app/routes/basic

    We also do the same with views/components/controllers, but I think (hope) that this is a general clause in the resolver rather than something route specific.

    Happy to work on a PR, is there anyone I can bounce ideas and questions off?

    Shouldn't walk into `node_modules`

    When running ember-cli-migrator I don't expect it to perform work on my node_modules directory but it does, I believe this is because it simply looks for any JS files and walks. One way of avoiding this would be to have a whitelist or blacklist of folders to work on (or not).

    Preserve Comments:

    Right now the a comment is preserved inside a global function but removes any comments before and after the global function.

    // This comment is removed
    /* global moment */ will be removed too
    App.DavesComponent = Ember.Component.extend({
    
       // this comment is retained
       somethingCool: function(){
       }.on('didInsertElement')
    
    })
    // Also this comment is removed

    If you point me in the right direction I try and write a fix.

    Cheers

    .gitkeep files

    Should .gitkeep files crash the process? Also on a mac .DS.Store would also crash the process.

    When I used the migrator on the past I thought it ignored .dotfiles was I mistaken.

    No Change or Move javascripts/components/.gitkeep
    
    /usr/local/lib/node_modules/ember-cli-migrator/node_modules/exec-sync/bin/index.js:68
            throw new Error(error);
                  ^
    Error: fatal: renaming 'javascripts/components/.gitkeep' failed: No such file or directory
        at module.exports (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/exec-sync/bin/index.js:68:15)
        at null.<anonymous> (/usr/local/lib/node_modules/ember-cli-migrator/lib/ember-migrator.js:131:9)
        at Array.forEach (native)
        at EmberMigrator_run [as run] (/usr/local/lib/node_modules/ember-cli-migrator/lib/ember-migrator.js:123:14)
        at Object.<anonymous> (/usr/local/lib/node_modules/ember-cli-migrator/bin/ember-cli-migrator:30:10)
        at Module._compile (module.js:456:26)
        at Object.Module._extensions..js (module.js:474:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
        at Function.Module.runMain (module.js:497:10)

    Cheers

    Copying Unknown File

    When i run the migrator i get Copying Unknown File for all my files and nothing is changed

    handling Global calls within an object

    looks like as of right now the migrator just parses the JS for any declaration of the global namespace declared and removes it.

    if it could change the global declaration to its correct instance call.
    ie:

    MyApp.ApplicationController = Ember.ObjectController.extend({
      updateCurrentPath: (function() {
        MyApp.set("currentPath", this.get("currentPath"));
      }).observes("currentPath")
    });
    

    should get changed to :

    ApplicationController = Ember.ObjectController.extend({
      updateCurrentPath: (function() {
        this.container.lookup('application:main').set("currentPath", this.get("currentPath"));
      }).observes("currentPath")
    });
    

    why git is necessary to migrate? I use svn.

    When run ember-cli-migrator in a environment without git installed, it will just fail.

    D:\work\client\kiford-front\app>ember-cli-migrator
    Preprocessing files
    Git Move Moving adapter.js to tmp\app\adapter.js
    fatal: Not a git repository (or any of the parent directories): .git
    child_process.js:1389
    throw err;
    ^
    Error: Command failed: git mv adapter.js tmp\app\adapter.js
    fatal: Not a git repository (or any of the parent directories): .git

    at checkExecSyncError (child_process.js:1346:13)
    at execSync (child_process.js:1386:13)
    at null.<anonymous> (C:\Users\dengshaodong\AppData\Roaming\npm\node_modules\
    

    ember-cli-migrator\lib\ember-migrator.js:93:9)
    at Array.forEach (native)
    at EmberMigrator_run [as run](C:UsersdengshaodongAppDataRoamingnpmnod
    e_modulesember-cli-migratorlibember-migrator.js:84:32)
    at Object. (C:\Users\dengshaodong\AppData\Roaming\npm\node_module
    s\ember-cli-migrator\bin\ember-cli-migrator:30:10)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)

    Migrator error - process out of memory

    Security context: 0x10360e6e3ac1
    1: copy [/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/lib/parser.js:~63] [pc=0xe855beaec8a](this=0x354318ba1749 <a TreeCopier with map 0x30e89ab23b59>,node=0xa0bf0964d39 <an Object with map 0x30e89ab254c9)
    2: copy [/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/lib/parser.js:~63] [pc=0xe855beaec78] (this=0x354318ba1749 <a TreeCopier with map 0...

    FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
    Abort trap: 6

    option to move one folder at a time

    I'm migrating a huge project and would love to just move one folder at a time, like my models and then get their unit tests passing before moving controllers etc...

    Issues in 0.8

    Hi all, first off, this project is amazing and a massive timesaver, thanks a lot to all involved.

    I tried to use 0.8 on a project this morning I'm having issues.

    /usr/local/lib/node_modules/ember-cli-migrator/lib/migrator-visitor.js:82
          var __namespace__ = leftNode.object.object && leftNode.object.object.nam
                                             ^
    TypeError: Cannot read property 'object' of undefined
        at Context.MigratorVisitorPrototype.visitAssignmentExpression (/usr/local/lib/node_modules/ember-cli-migrator/lib/migrator-visitor.js:82:42)
        at Context.invokeVisitorMethod (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:306:43)
        at Visitor.PVp.visitWithoutReset (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:180:28)
        at visitChildren (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:226:21)
        at Visitor.PVp.visitWithoutReset (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:188:16)
        at NodePath.each (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path.js:96:22)
        at visitChildren (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:199:14)
        at Visitor.PVp.visitWithoutReset (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:188:16)
        at Visitor.PVp.visit (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:124:25)
        at Object.visit (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:92:51)
    

    I logged the value of leftNode:

    { type: 'Identifier',
      name: 'App',
      typeAnnotation: undefined,
      optional: undefined,
      loc: 
       { start: { line: 7, column: 0 },
         end: { line: 7, column: 3 },
         lines: {},
         indent: 0 } }
    

    and here is the file:

    /*****************************************************************************
     * APPLICATION
     *****************************************************************************/
    
    Ember.MODEL_FACTORY_INJECTIONS = true;
    Ember.FEATURES.HTMLBars = true;
    App = Ember.Application.create({
        LOG_TRANSITIONS_INTERNAL: false,
        ENVIRONMENT: $('meta[name="environment"]').attr('content'),
        CLIENTID: $('meta[name="client-id"]').attr('content')
    });
    

    On another note, are there any plans for migrating components?

    Error while running migrator/recast

    After files are moved/copied, I am seeing these errors output to console and it is unclear what steps need to be taken in order to resolve the problem.

    Do not know how to import QC
    Do not know how to import QC
    Do not know how to import QC
    
    assert.js:86
      throw new assert.AssertionError({
            ^
    AssertionError: {kind: var, declarations: [object Object], loc: null, type: VariableDeclaration, comments: null} does not match field "init": Expression | null of type VariableDeclarator
        at add (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/types.js:525:28)
        at /usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/types.js:539:17
        at Array.forEach (native)
        at Object.defineProperty.value [as variableDeclarator] (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/types.js:538:30)
        at Context.MigratorVisitorPrototype.visitAssignmentExpression (/usr/local/lib/node_modules/ember-cli-migrator/lib/migrator-visitor.js:71:67)
        at Context.invokeVisitorMethod (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:306:43)
        at Visitor.PVp.visitWithoutReset (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:180:28)
        at visitChildren (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:226:21)
        at Visitor.PVp.visitWithoutReset (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:188:16)
        at NodePath.each (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path.js:96:22)```
    

    Error running migrator

    I tried to migrate an ember app but ran into the following issue:

    Preprocessing files
    Failed to parse app.js
    Note that you probably don't want to run the migrator against your npm or bower dependencies. Make sure that the directory you've specified in the '--source' flag only contains your application code.
    Error: Line 12: Unexpected token ILLEGAL
    /usr/local/lib/node_modules/ember-cli-migrator/lib/ember-migrator.js:189
      var astBody = ast.program.body;
                       ^
    TypeError: Cannot read property 'program' of undefined
        at EmberMigrator.splitFile (/usr/local/lib/node_modules/ember-cli-migrator/lib/ember-migrator.js:189:20)
        at Array.forEach (native)
        at EmberMigrator_run [as run] (/usr/local/lib/node_modules/ember-cli-migrator/lib/ember-migrator.js:82:11)
        at Object.<anonymous> (/usr/local/lib/node_modules/ember-cli-migrator/bin/ember-cli-migrator:30:10)
        at Module._compile (module.js:460:26)
        at Object.Module._extensions..js (module.js:478:10)
        at Module.load (module.js:355:32)
        at Function.Module._load (module.js:310:12)
        at Function.Module.runMain (module.js:501:10)
        at startup (node.js:129:16)
    

    I am using Ember-Rails gem. Any help would be appreciated.

    Error during recast

    I make an attempt of migrating the frontend part of my rails app to ember-cli.
    I encounter this error after the files were copied in the target directory.

    v0.12.1/lib/node_modules/ember-cli-migrator/node_modules/recast/lib/printer.js:1097
                    var afterEnd = lines.skipSpaces(trueLoc.end);
                                         ^
    TypeError: undefined is not a function
        at .nvm/versions/node/v0.12.1/lib/node_modules/ember-cli-migrator/node_modules/recast/lib/printer.js:1097:38
        at Array.forEach (native)
        at printStatementSequence (.nvm/versions/node/v0.12.1/lib/node_modules/ember-cli-migrator/node_modules/recast/lib/printer.js:1055:14)
        at .nvm/versions/node/v0.12.1/lib/node_modules/ember-cli-migrator/node_modules/recast/lib/printer.js:399:20
        at FastPath.call (.nvm/versions/node/v0.12.1/lib/node_modules/ember-cli-migrator/node_modules/recast/lib/fast-path.js:119:18)
        at genericPrintNoParens (.nvm/versions/node/v0.12.1/lib/node_modules/ember-cli-migrator/node_modules/recast/lib/printer.js:398:26)
        at genericPrint (.nvm/versions/node/v0.12.1/lib/node_modules/ember-cli-migrator/node_modules/recast/lib/printer.js:146:33)
        at printRootGenerically (.nvm/versions/node/v0.12.1/lib/node_modules/ember-cli-migrator/node_modules/recast/lib/printer.js:94:16)
        at maybeReprint (.nvm/versions/node/v0.12.1/lib/node_modules/ember-cli-migrator/node_modules/recast/lib/printer.js:88:16)
        at print (.nvm/versions/node/v0.12.1/lib/node_modules/ember-cli-migrator/node_modules/recast/lib/printer.js:81:16)
    

    I don't know where to start with to debug, all ideas are welcome :)

    Yeoman ember generator migrate with ember-cli-migrator error

    The migration starts off good, but after multiple Copying Unknown File I get the folowing error:

    usr/local/lib/node_modules/ember-cli-migrator/lib/migrator-visitor.js:81       
       var __namespace__ = leftNode.object.object && leftNode.object.object.nam
                                              ^ 
    TypeError: Cannot read property 'object' of undefined
         at Context.MigratorVisitorPrototype.visitAssignmentExpression (/usr/local/lib/node_modules/ember-cli-migrator/lib/migrator-visitor.js:81:42)
         at Context.invokeVisitorMethod (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:306:43)
         at Visitor.PVp.visitWithoutReset (/usr/local/lib/node_modules/ember-cli-migrator/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:180:28)
    

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.