Giter Site home page Giter Site logo

ember-tools's Introduction

Ember Tools

NOTICE: ember-tools is not currently maintained. If you want to maintain the project, contact @fivetanley or @rpflorence, if there is any interest. If you're starting a new project, using Ember CLI is recommended instead.

Build Status

demo

Installation

npm install -g ember-tools

Don't have node or npm? Visit http://nodejs.org.

Features

  • prescribed file organization for sanity
  • scaffolding for learning curve mitigation
  • template precompilation for performance
  • single file application build for convenience
  • generators for faster application development
  • commonjs (node-style) modules

Version Information

Current Version: 0.2.7

Package versions:

  • ember v1.0.0
  • ember-data v0.13
  • handlebars v1.0.0
  • jQuery 1.9.1

Quickstart

npm install -g ember-tools
ember create my-app
cd my-app
ember generate --scaffold person name:string age:number
ember build
open index.html # Mac OS
xdg-open index.html # Linux
start index.html # Windows
# visit #/people

The first place to get started is configuring a route in config/routes.js and then adding a template for the route.

Usage

You can always run ember --help or ember [command] --help to get usage information.

  Usage: ember [command] [options]

  Command-Specific Help

    ember [command] --help

  Commands:

    create [options]       creates a new ember application at [dir]
    build [options]        compiles templates and builds the app
    generate [options]     generates application files
    precompile [options]   precompile templates from src dir to target dir
    update [version]       Update ember.js from ember's s3 build service to [version].
             Versions are latest(built from master, bleeding edge) and stable.
             Default version is stable.
  Options:

    -h, --help     output usage information
    -V, --version  output the version number

Guide

Creating Stand-Alone Browser Apps

If you are creating a stand-alone browser application (no server, or communication is through some api service) then use:

ember create my-app

  • javascript assets created in my-app/js
  • ember commands run from my-app root

Or if you already have the my-app directory, cd into it and call ember create bare:

ember create

  • javascript assets created in ./js
  • ember commands run from ./ root

There is nothing magical about the index.html file. Feel free to replace it with your own (you probably should). Just make sure you include a script tag pointing to js/application.js

Creating Browser Apps as Part of Express or Rails (etc.)

If you are creating an ember app as part of a server-side framework like express or ruby on rails use the --js-path option.

cd my-server-app
ember create --js-path public/javascripts
  • javascript assets created in my-server-app/public/javascripts
  • ember commands run from my-server-app root

Running ember build will create a file at public/javascripts/application.js. Require that in your server-app's template, no other files are required.

Building Your App

The build command pre-compiles all the templates to simple functions, assigns all your modules to the App object based on their file names, and then creates a single, concatenated file to be included in your app.

ember build

This build step makes adding new modules to your app as simple as creating a file with the generate command. It will convert the file path to an object, ie: controllers/recipe -> App.RecipeController, routes/recipes/index -> App.RecipesIndexRoute.

To build when files in your app change, use the --watch option:

ember build -w

If you want to inspect the objects being assigned to the App object you can build without cleanup using the --no-cleanup, -c option and then opening up the index.js file it creates:

ember build -c

You can also specify the path of the resulting application file to save it somewhere other than the default path.

ember build --out-file public/whatever.js

Of course, you can combine any of these options:

ember build -wc --out-file public/whatever.js

Scaffolding

I am not super proud of the scaffolding, but it gets your feet wet with ember really quickly, so use it for fun, not profit :P

ember generate --scaffold time_sheet description:string minutes:number

Generators

Ember tools provides generators for the different ember objects your app will use. Basic usage is:

ember generate [options] [name]

So creating a recipe route would look like:

ember generate --route recipe

Or the shorter version:

ember generate -r recipe

If you have a route, you probably want a template too; you can combine generator options:

ember generate -rt recipe

Below is a list of all generator commands the the files and objects they create.

Generator Examples

options object name file
--model, -m burrito Burrito models/burrito.js
--view, -v burrito BurritoView views/burrito_view.js
--controller, -c post/comments PostCommentsController controllers/post/comments_controller.js
--template, -t post/comments n/a templates/post/comments.handlebars
--route, -r taco_cart TacoCartRoute routes/taco_cart_route.js
--mixin, -x tacoable Tacoable mixins/tacoable.js
--helper, -l all_caps allCaps helpers/all_caps.js
--component, -p my-widget MyWidgetComponent components/my_widget_component.js
templates/components/my-widget.hbs
-mvcrt tacos Taco
TacosView
TacosController
TacosRoute
models/taco.js
views/tacos_view
controllers/tacos_controller.js
routes/taco_route.js
templates/tacos.handlebars

Notes:

  • Models will always be singular.
  • Sub-directories will be created for you if they don't exist.
  • Components must have a dash per web component standards.

Precompiling Handlebars Templates for Ember

The build command already pre-compiles your templates, but you can use the precompile command outside of the rest of ember-tools. To precompile a bunch of templates found at views/jst to assets/javascripts/templates.js run this command:

ember precompile -d views/jst -f assets/javascripts/templates.js

This will register each template on Ember.TEMPLATES with file paths for keys.

Upgrading from 0.1.x to 0.2.x

  1. Rename .ember to ember.json
  2. Edit ember.json to point to the right jsPath, should look something like:
    {
      "jsPath": "js",
      "modules": "cjs"
    }
  3. Move routes.js, app.js, and store.js to config/<filename>.js
  4. Add dependencies to config/app.js, it should look something like this:
    require('../vendor/jquery');
    require('../vendor/handlebars');
    require('../vendor/ember');
    require('../vendor/ember-data');
    
    var App = Ember.Application.create();
    App.Store = require('./store');
    
    module.exports = App;

That should do it.

License and Copyright

MIT Style License

Copyright © 2013 Ryan Florence

Contributing

Run tests with:

npm test

and the browser sanity tests:

npm run-script browser

Its usually easiest to create a branch and send a pull request against that branch instead of master. Single commits are preferred (no big deal though, I can squash and cherry-pick).

Thanks for using ember-tools!

ember-tools's People

Contributors

achalaggarwal avatar bengt avatar charlesdemers avatar eskimoblood avatar fabriciotav avatar fivetanley avatar jergason avatar karlguillotte avatar kevincolyar avatar lukfugl avatar miguelmadero avatar rauhryan avatar ryanflorence avatar stabbylambda avatar thomasboyt avatar thomasvm avatar

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

ember-tools's Issues

error when run command "ember build "

I have this error when run command "ember build "

/usr/local/lib/node_modules/ember-tools/node_modules/jsdom/lib/jsdom.js:178
features = JSON.parse(JSON.stringify(window.document.implementation._fea
^
TypeError: Cannot read property 'implementation' of undefined
at exports.env.exports.jsdom.env.processHTML (/usr/local/lib/node_modules/em
ber-tools/node_modules/jsdom/lib/jsdom.js:178:59)
at Object.exports.env.exports.jsdom.env (/usr/local/lib/node_modules/ember-t
ools/node_modules/jsdom/lib/jsdom.js:269:5)
at precompile (/usr/local/lib/node_modules/ember-tools/src/commands/precompi
le.js:22:9)
at module.exports (/usr/local/lib/node_modules/ember-tools/src/commands/prec
ompile.js:9:5)
at Walker. (/usr/local/lib/node_modules/ember-tools/src/commands/
precompile.js:54:5)
at Walker.EventEmitter.emit (events.js:93:17)
at Walker._wNext (/usr/local/lib/node_modules/ember-tools/node_modules/walk/
walk.js:212:8)
at Walker._wNext (/usr/local/lib/node_modules/ember-tools/node_modules/walk/
walk.js:210:19)
at Walker._wOnEmitDone (/usr/local/lib/node_modules/ember-tools/node_modules
/walk/walk.js:109:8)
at nextWhenReady (/usr/local/lib/node_modules/ember-tools/node_modules/walk/
node-type-emitter.js:69:29)

Include Parse.com Parse SDK

Hi ,
I guess it not a very generic question as in useful for many people but I did find any answer so asking.
I am unable to include parse.com sdk. No matter where I require it (example app.js) I get "parse is not defined"
ex: require('./vendor/parse1.2-7')
I tried couple of other things but didn't work.
I am trying to implement something like neptuneJS ( https://github.com/bwship/neptunejs)
Thanks

_UPDATED_**
I am sorry not an ember tool issue.
I split the parse sdk into 2 part underscore and parse.
Add this line in each file respectively
module.exports = Parse;
module.exports = _;
and used require(). now working. close

WAY BETTER README.MD

Need to explain things better, like "first configure routes".

Maybe make a video.

[INSTALL] bash: ember: command not found

Unsure as to whether you want to address this as an issue; it was more of a sys config problem on my machine, but I thought I would share in case you want to guard for this out-of-the-box.

I did these two steps of the instructions:

npm install -g ember-tools
mkdir my-app && cd my-app

and then, after step three:

ember create js

I got:

-bash: ember: command not found

System deets:

OSX 10.8.2
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)
node: v0.8.16
npm: 1.1.69

I noticed that ember-tools was installed to:

/usr/local/share/npm/lib/node_modules/ember-tools

Opened a new tab (and hoping PATH would be set appropriately) - did not work.

Added /usr/local/share/npm/lib/node_modules/ember-tools/bin to my PATH. Worked.

(I hate to post an issue without a Pull Request for the fix, but for the time being, I just want to kick-the-tires of the project before diving in to fixing anything yet.)

From Middleman to Ember Tools

I'm currently using Middleman, but would like to make the switch to Ember Tools. There are a few things that are preventing me from doing so. I'm not sure if these are already available and the README just needs an update or if they are not currently possible. I don't know if these are things that should be part of Ember Tools or if its possible to use Ember Tools in combination with Middleman.


  1. Environment configuration - I use foreman to run Middleman with a .env file. I also use it for building. For example I run a command like:

foreman run -e .env,environments/staging.env middleman build

This allows me to have separate configuration files for each environement.


  1. Support for CoffeeScript and SCSS - Middleman watches my JS and CSS folders for updates to any .coffee or .scss files and automatically compiles them into JavaScript and CSS.

  1. Web server - Middleman runs an actual webserver on a port instead of just viewing the .html file in a browser. This is useful for a number of reasons, one of them being I can hit my local dev server from other computers on my network (good for testing on a Windows machine).

Make it so it's not mandatory to use -g

I'm trying to use ember-tools on a non-admin machine. I have an alias to the ember-tools/bin files on my .zshrc file. Whenever i try to do anything i get this:

Desktop|⇒ ember create app          
-> Creating application files and directories

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: Object #<Object> has no method 'exists'
    at Object.exists (/Users/brunol/node_modules/ember-tools/src/util/fs-promised.js:22:6)
    at Object.write (/Users/brunol/node_modules/ember-tools/src/util/template.js:15:14)
    at makeEmberFile (/Users/brunol/node_modules/ember-tools/src/commands/create.js:75:19)
    at /Users/brunol/node_modules/ember-tools/src/commands/create.js:21:10
    at Object.<anonymous> (/Users/brunol/node_modules/ember-tools/bin/ember:11:3)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)
Desktop|⇒ 

this is awesome

this is not a legitimate issue, but I would just like to point out the fact that this is awesome.

Create an upgrade option

I think it would be a good idea to create an upgrade option. This is for people to upgrade from version 0.1.* to 0.2.0. Since the folder structure changed and there were updates to both handelbars and ember it would be nice. It breaks if you upgrade to version 2.0 on a project that was created with 1.*

Items to consider

  • folder structure changes
  • upgrading versions of handelbars/ember
  • ember.json

ember precompile seems not to work

I just installed ember tools for the sole purpose of precompiling handlebars templates, but that option seems not tho work here is what I get (and if I prod):

ember precompile -d dir -f out.handlebars

/usr/local/lib/node_modules/ember-tools/bin/ember:42
  .action(function() { precompile(program); })
                       ^
ReferenceError: precompile is not defined
    at Command. (/usr/local/lib/node_modules/ember-tools/bin/ember:42:24)
    at Command. (/usr/local/lib/node_modules/ember-tools/node_modules/commander/index.js:254:8)
    at Command.EventEmitter.emit (events.js:97:17)
    at Command.parseArgs (/usr/local/lib/node_modules/ember-tools/node_modules/commander/index.js:471:12)
    at Command.parse (/usr/local/lib/node_modules/ember-tools/node_modules/commander/index.js:378:15)
    at Object. (/usr/local/lib/node_modules/ember-tools/bin/ember:47:9)
    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)

errors in 0.1.2 scaffolding

Hello!
i'm run in iTerm2 commands:

ember create app
ember generate -s car brand:string model:string year:number
ember build
open app/index.html

and go to index.html#/cars in my browser
and see in browser console (Pay attention to the last line):

DEBUG: ------------------------------- application.js:8496
DEBUG: Ember.VERSION : 1.0.0-rc.2 application.js:8496
DEBUG: Handlebars.VERSION : 1.0.0-rc.3 application.js:8496
DEBUG: jQuery.VERSION : 1.9.1 application.js:8496
DEBUG: ------------------------------- application.js:8496
DEPRECATION: register("store", "main") is now deprecated in-favour of register("store:main");
at Object.Container.register (file://localhost/Users/karudo/Work/ember/app/application.js:14650:17)
at Application.initializer.initialize (file://localhost/Users/karudo/Work/ember/app/application.js:5394:19)
at file://localhost/Users/karudo/Work/ember/app/application.js:34323:7
at visit (file://localhost/Users/karudo/Work/ember/app/application.js:33546:3)
at DAG.topsort (file://localhost/Users/karudo/Work/ember/app/application.js:33600:7)
at Ember.Application.Ember.Namespace.extend.runInitializers (file://localhost/Users/karudo/Work/ember/app/application.js:34320:11)
at Ember.Application.Ember.Namespace.extend._initialize (file://localhost/Users/karudo/Work/ember/app/application.js:34283:10)
at file://localhost/Users/karudo/Work/ember/app/application.js:12507:19
at Object.Ember.handleErrors (file://localhost/Users/karudo/Work/ember/app/application.js:8558:17) application.js:8496
Uncaught Error: assertion failed: an Ember.CollectionView's content must implement Ember.Array. You passed <(generated cars controller):ember282> application.js:8199

Is there a way to support remote storage?

'localstorage_adapter.js' just local commit and store.

So. I cann't found that local storage to remote storage.

I want to store in remote server using REST API.

How can I do?

Installation on Windows

Hey guys,

I wanted to install this on Windows 8 64 but in the middle of the installation I get some errors like in this screen http://grab.by/osE4
Then it continues and at the end I get

npm ERR! not ok code 0

Is there a fix for this?

Many thanks

  • Dani Z

ember create example puts .ember in current directory, not in example/

% ember create example
-> Creating application files and directories into 'example'
   created: .ember
   created: example
   created: example/controllers
   created: example/helpers
   created: example/models
   created: example/templates
   created: example/routes
   created: example/views
   created: example/mixins
   created: example/app.js
   created: example/index.html
   created: example/store.js
   created: example/routes.js
   created: example/templates/application.handlebars
   created: example/templates/index.handlebars
   created: example/vendor
   created: example/vendor/localstorage_adapter.js
   created: example/vendor/handlebars.js
   created: example/vendor/jquery.js
   created: example/vendor/ember.js
   created: example/vendor/ember-data.js

Should be created: example/.ember.

`ember build` is not working

Edit: ember build is working the problem is the file .ember which looks like:

{
  "modules": "cjs",
  "appDir": "[object Object]"
}
$ ember build
   created:     [object Object]/templates.js
   created:     [object Object]/index.js
   created:     [object Object]/application.js

find: `[object': No such file or directory
find: `Object]': No such file or directory

fs.js:670
  return binding.stat(pathModule._makeLong(path));
                 ^
Error: ENOENT, no such file or directory 'Object]/'
    at Object.fs.statSync (fs.js:670:18)

...

  at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

    at /home/alejandro/.npm-modules/lib/node_modules/ember-tools/src/commands/bu
ild.js:55:22
    at ChildProcess.exithandler (child_process.js:606:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:700:16)
    at Process.ChildProcess._handle.onexit (child_process.js:767:5)

Calling `ember create` with no directory name doesn't create an application

Steps to reproduce

npm install -g ember-tools
mkdir hurp && cd hurp
ember create
less .ember

Notice the .ember file looks like this:

{
  "modules": "cjs",
  "appDir": "[object Object]"
}

Also notice no application files are created.

What I expected

I would expect ember-tools to create an application inside my current directory, or at least warn me that a directory name to create the application inside of is required.

Uncaught ReferenceError: DS is not defined

What i have done:

$ ember generate
$ ember generate -s Flow title:string category:numeric options:string
$ ember build

What i get in the browser console
Uncaught ReferenceError: DS is not defined

did i do something wrong ?

Error thrown on build with 0.1.3

I got this persistent error on Windows8-64 with node.js v0.10.5 and ember-tools 0.1.3. And I just followed the simple example on your site here.:

C:\xxx\AppData\Roaming\npm\node_modules\ember-tools\src\commands\build.js:62
if (error) throw new Error(error);
^
Error: Error: Command failed: 'C:\xxx\AppData\Roaming\npm\node_modules\ember-tools\src\commands/../
../node_modules/browserbuild/bin/browserbuild' is not recognized as an internal or external command,
operable program or batch file.

at C:\xxx\AppData\Roaming\npm\node_modules\ember-tools\src\commands\build.js:62:22
at ChildProcess.exithandler (child_process.js:636:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:730:16)
at Socket.<anonymous> (child_process.js:943:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:451:12)

Support Less for styling

Would be nice to be able to write Less files and have them automatically compiled and minified with ember build, just the way it does with my current JS files.

Share Options (Parameters) Between Ember Watch and Ember Build Commands

ember watch is great, because you don't have to manually build after each change, but it would be nice if ember watch took the same options as ember build.

A scenario that needs this is where your source files might be in a private directory, but you want to output the application.js file to a public folder. Example usage might be:

ember watch --out-file ../assets/js/application.js

How can I include an arbitrary javascript file?

I want to pull in some legacy javascript and have the functions available. I tried dropping the file into the vendors director, that did not seem to work.

How can I get an arbitrary javascript file to be included in the build process?

Ember command still gives error for request.js

After installing latest Ember tools, any "ember" command generates an error:

MBP2:ember john$ ember create my-app

module.js:340
throw err;
^
Error: Cannot find module 'request'
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. (/usr/local/lib/node_modules/ember-tools/src/commands/update.js:2: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 Module.require (module.js:364:17)

Uninstalled ember-tools nom module, cleared cache, reinstalled still gives error.

Handlebars and Ember Data Versions

Howdy,

Just heard about your ember-tools project and i like what I see so far. Just a quick question about your versions for various "libraries"... Now that handlebars 1.0 is out and ember data has switched to releases instead of revisions are you planning to upgrade the versions? If not is it sensible to upgrade the versions ourselves?

Cheers!

migrating existing projects

This is more of a question. Is there any facility to import existing ember projects into this framework? or recommendations? I'm a bit of a newb to ember, so I basically followed the guides, and now I have a huge index.html & app.js.

handlebars precompile erro issues

Hi,
when i run ember build on my scaffolded person app, i get the error below
file:///usr/local/lib/node_modules/ember-tools/packages/handlebars.js:280
throw new Error(str);
^
Error: Parse error on line 69:
... {{/each}}
---------------------^
Expecting 'EOF', got 'OPEN_ENDBLOCK'
at Object.parseError (file:///usr/local/lib/node_modules/ember-tools/packages/handlebars.js:280:11)
at Object.parse (file:///usr/local/lib/node_modules/ember-tools/packages/handlebars.js:332:22)
at Object.Handlebars.parse (file:///usr/local/lib/node_modules/ember-tools/packages/handlebars.js:647:28)
at Object.Ember.Handlebars.precompile (file:///usr/local/lib/node_modules/ember-tools/packages/ember.js:17509:24)
at /usr/local/lib/node_modules/ember-tools/src/commands/precompile.js:31:42
at Array.forEach (native)
at /usr/local/lib/node_modules/ember-tools/src/commands/precompile.js:30:17
at exports.env.exports.jsdom.env.scriptComplete (/usr/local/lib/node_modules/ember-tools/node_modules/jsdom/lib/jsdom.js:206:39)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)

something to do with the generated table in the users list template.how do i go about fixing this.
thanks

"ember create app" fails

I installed ember-tools with npm:

sudo npm -g install ember-tools

Node.js version is:

$ node -v
v0.6.11

What node.js version is supported/recommended for ember-tools?

I got following error:

[pg-ember]$ ember create app
-> Creating application files and directories

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: Object #<Object> has no method 'exists'
    at Object.exists (/usr/local/lib/node_modules/ember-tools/src/util/fs-promised.js:22:6)
    at Object.write (/usr/local/lib/node_modules/ember-tools/src/util/template.js:15:14)
    at makeEmberFile (/usr/local/lib/node_modules/ember-tools/src/commands/create.js:75:19)
    at /usr/local/lib/node_modules/ember-tools/src/commands/create.js:21:10
    at Object.<anonymous> (/usr/local/lib/node_modules/ember-tools/bin/ember:11:3)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)
[pg-ember]$ 
[pg-ember]$ sudo ember create app
-> Creating application files and directories

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: Object #<Object> has no method 'exists'
    at Object.exists (/usr/local/lib/node_modules/ember-tools/src/util/fs-promised.js:22:6)
    at Object.write (/usr/local/lib/node_modules/ember-tools/src/util/template.js:15:14)
    at makeEmberFile (/usr/local/lib/node_modules/ember-tools/src/commands/create.js:75:19)
    at /usr/local/lib/node_modules/ember-tools/src/commands/create.js:21:10
    at Object.<anonymous> (/usr/local/lib/node_modules/ember-tools/bin/ember:11:3)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)
[pg-ember]$ 
[pg-ember]$ ember --help

  Usage: ember [options]

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

[pg-ember]$ ember create app
-> Creating application files and directories

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: Object #<Object> has no method 'exists'
    at Object.exists (/usr/local/lib/node_modules/ember-tools/src/util/fs-promised.js:22:6)
    at Object.write (/usr/local/lib/node_modules/ember-tools/src/util/template.js:15:14)
    at makeEmberFile (/usr/local/lib/node_modules/ember-tools/src/commands/create.js:75:19)
    at /usr/local/lib/node_modules/ember-tools/src/commands/create.js:21:10
    at Object.<anonymous> (/usr/local/lib/node_modules/ember-tools/bin/ember:11:3)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)
[pg-ember]$ ember create --help
-> Creating application files and directories

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: Object #<Object> has no method 'exists'
    at Object.exists (/usr/local/lib/node_modules/ember-tools/src/util/fs-promised.js:22:6)
    at Object.write (/usr/local/lib/node_modules/ember-tools/src/util/template.js:15:14)
    at makeEmberFile (/usr/local/lib/node_modules/ember-tools/src/commands/create.js:75:19)
    at /usr/local/lib/node_modules/ember-tools/src/commands/create.js:21:10
    at Object.<anonymous> (/usr/local/lib/node_modules/ember-tools/bin/ember:11:3)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)
[pg-ember]$ 

.DS_Store causing parse error for ember-precompile

When running ember-precompile I received the following error:

file:///usr/local/lib/node_modules/ember-tools/packages/handlebars.js:280
    throw new Error(str);
          ^
Error: Lexical error on line 1. Unrecognized text.

I determined that handlebars was trying to parse the .DS_Store file on my Mac. I have deleted the file, but sometimes the OS will generate a new one.

Is it possible for ember-precompile to ignore .DS_Store files when pre-compiling a directory?

Force overwrite when precompiling templates?

Sorry if I just missed this in the docs somewhere, but is there an option to force overwriting of the output file when precompiling templates? If not, it would be a nice addition. Use case: I'd like to set up a file watcher in IntelliJ IDEA to launch the precompiler whenever I edit a template, but the overwrite prompt is breaking it.

Thanks.

One of the commands in Quickstart in project README.md doesn't work

Actual

Followed Quickstart instructions including the line

    ember create -d js

and received error message:

  error: unknown option `-d'

Expected

Instructions should match current application options. I'm guessing that it would be easiest to edit to match the nifty GIF instructions so that the mkdir & cd lines along with the create command are combined into a single 'ember create app' line.

Let me know if I misunderstood the quickstart instructions.

ember build with Handlebars 1.0.0-rc.3 throws an error.

The Handlebars 1.0.0-rc.3 that I submitted in the pull request assigns itself to this.Handlebars, not window.Handlebars. This breaks inside of Handlebars, since this version looks for it on window.Handlebars.

I tried building handlebars from master, which fixes the first problem but breaks inside of Ember, since Ember expects Handlebars to be on window.Handlebars.

I was able to fix the problem by hacking handlebars.js line 26 from var Handlebars = {} to window.Handlebars = {}, but obviously this is the Devil.

ember build doesnt work on windows

i get this error everytime i run:

PS F:\tmp\embertest> ember build
   created:     apmui/templates.js
   created:     apmui/index.js
   created:     apmui/application.js

'C:\Users\P\AppData\Roaming\npm\node_modules\ember-tools\src\commands/../../node_modules/browserbuild/bin/browserbuild'
is not recognized as an internal or external command,
operable program or batch file.


C:\Users\P\AppData\Roaming\npm\node_modules\ember-tools\src\commands\build.js:62
    if (error) throw new Error(error);
                     ^
Error: Error: Command failed: 'C:\Users\P\AppData\Roaming\npm\node_modules\ember-tools\src\commands/../../node_modules/b
rowserbuild/bin/browserbuild' is not recognized as an internal or external command,
operable program or batch file.

    at C:\Users\P\AppData\Roaming\npm\node_modules\ember-tools\src\commands\build.js:62:22
    at ChildProcess.exithandler (child_process.js:636:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:730:16)
    at Socket.<anonymous> (child_process.js:943:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:451:12)
PS F:\tmp\embertest>

Problem with ember build

Following the commands from the readme works fine, until i get to the build command:

joe$ ember build

/usr/local/lib/node_modules/ember-tools/node_modules/jsdom/lib/jsdom.js:178
    features   = JSON.parse(JSON.stringify(window.document.implementation._fea
                                                          ^
TypeError: Cannot read property 'implementation' of undefined
    at processHTML (/usr/local/lib/node_modules/ember-tools/node_modules/jsdom/lib/jsdom.js:178:59)
    at Object.exports.env.exports.jsdom.env (/usr/local/lib/node_modules/ember-tools/node_modules/jsdom/lib/jsdom.js:269:5)
    at precompile (/usr/local/lib/node_modules/ember-tools/src/util/precompile.js:23:9)
    at /usr/local/lib/node_modules/ember-tools/src/util/precompile.js:10:5
    at Walker.<anonymous> (/usr/local/lib/node_modules/ember-tools/src/util/precompile.js:57:5)
    at Walker.EventEmitter.emit (events.js:92:17)
    at Walker._wNext (/usr/local/lib/node_modules/ember-tools/node_modules/walk/walk.js:212:8)
    at Walker._wNext (/usr/local/lib/node_modules/ember-tools/node_modules/walk/walk.js:210:19)
    at Walker._wOnEmitDone (/usr/local/lib/node_modules/ember-tools/node_modules/walk/walk.js:109:8)
    at nextWhenReady (/usr/local/lib/node_modules/ember-tools/node_modules/walk/node-type-emitter.js:69:29)

After a bit of googling (http://stackoverflow.com/questions/10143288/node-js-jsdom-error and jsdom/jsdom#436), it seems that jsdom has a dependency on contextify which can cause this problem. I noticed that ember-tools installs an older version of jsdom as a dependency without contextify, so I'm not sure if that's where the problem is.

It could be something wrong with my own environment, though I'm a bit lost at where to start. :/ Here's my full npm list for ref, though I only have ember-tools + dependencies installed:

└─┬ [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]
  │ └─┬ [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]

Cheers.

Allow Custom Variable or Namespace for Ember.Application.create()

While App is the usual name used for the Ember.Application instance, it would be nice if the developer could specify a different name and/or namespace for the Ember.Application.

Usage could be something like ...

ember create --ns MyApp
ember create --ns MyNamespace.MyApp

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.