Git Product home page Git Product logo

ember-cli-coffeescript's Introduction

CoffeeScript support for ember-cli Build Status

Adds precompilation of CoffeeScript files and all the basic generation types to the ember generate command, as well as linting.

Includes

  • Generating files in CoffeeScript with ember generate
  • Preprocessing CoffeeScript-files in your app, including tests
  • Linting your CoffeeScript-files.

Install

ember install ember-cli-coffeescript

NB: ember-cli-coffeescript is tested using ember-cli version 2.3.0 and up. Some of it probably works on earlier versions, but I wouldn't know.

How to use

Blueprints

Run ember help generate to get a list of available blueprints. Use them by running ember g <blueprint> <args>. For instance, to generate a component:

ember g component my-component

ember-cli-coffeescript comes with pod-support for the same blueprints as ember-cli does. Check out the ember-cli docs for pods for instructions on how to use it.

If you'd like to use ember-cli-coffeescript without the blueprints, you can add the following to your config/environment.js:

ENV.coffeeOptions = {
  blueprints: false
}

This will make it fall back to the next blueprints in line (probably the ones from ember-cli).

Precompiling

This will happen automatically - no work necessary.

Linting

If you have a coffeelint.json file in the root of you project we will automatically pick up on it and start running linting on files when using the ember build and ember serve commands. If you do not want linting to run despite having a coffeelint.json file, use the following configuration in your config/environment.js.

ENV.coffeeOptions = {
  lint: false
}

You can set lint to true to enable linting with the default configurations even without a custom coffeelint.json file.

You can find all the available options on the website for coffeelint.

If you want to specify a different path for your coffeelint.json file you can specify the path (relative to the project directory or absolute)

ENV.coffeeOptions = {
  lint: {
    configPath: "configurations/coffeelint.json"
  }
}

If you want to change the way we format the linting output you can specify custom error output and stats output functions:

ENV.coffeeOptions = {
  lint: {
    formatter: function(filePath, lintResults) {  },
    statsFormatter: function(stats) { console.log('Files: ', stats.fileCount, "Errors: ", stats.errorCount) }
  }
}

NOTE: The lint results will show up twice when you build and run your app; once for the app files, and then once for the test files. On rebuild, only the changed files are linted.

Lintignore

To avoid linting specific files or folders, you can put a file named .coffeelintignore in the root of your project containing ignore-rules, one per line. This is just like a .gitignore-file, and it will follow the same rules.

Developing

  • git clone this repository
  • npm install
  • bower install
  • npm link

Because of the nature of this project, it needs to be consumed by an ember-cli project to be properly developed.

  • Add "ember-cli-coffeescript": "*" to your consuming project's package.json
  • From your project root run npm link ember-cli-coffeescript

Running Tests

  • ember test
  • npm run embertest
  • npm run nodetest

To run all the tests:

  • npm test

ember-cli-coffeescript's People

Contributors

davewasmer avatar fivetanley avatar foxnewsnetwork avatar igorsantos07 avatar jakesjews avatar johnnyshields avatar kbullaughey avatar kenips avatar kimroen avatar mriska avatar myztiq avatar nruth avatar ohcibi avatar olleolleolle avatar perlun avatar rpieciorak avatar rwjblue avatar taddeimania 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ember-cli-coffeescript's Issues

Detect and warn about `app.js` and `router.js` if you also have coffee-equivalents

This is a common thing to run in to after updating ember-cli.

What happens is this:

You have an app.coffee file, and you also have an app.js file. This can happen when you update ember-cli, for example.

broccoli-coffee tries to generate an app.js file from the app.coffee file, but that file is already present, so you get an error.

What this issue is about is detecting these files (app.js and router.js) specificically and giving the user a warning, because they probably didn't mean to have both a js and cs version of them, it just happened accidentally. A specific error is better than the one you get now, which is kind of cryptic.

http-mock/http-proxy

Is there a reason that there are no http-mock/http-proxy blueprints or are they just not implemented yet?

Support Router.map with parenthesis around the function

ember g route and ember g resource adds entries to the router.
Currently routes and resources will be correctly added with maps like this:

Router.map ->
  @route 'post'

But not like this:

Router.map (->
  @route 'post'
)

Both are valid and should work.

support .litcoffee

It would be great if you could target ".litcoffee" as well. Litcoffee is the main reason I'm not switching to es6.

Pod support for generators

We're using ember-cli-coffescript in a workflow that makes heavy use of ember g ...

Things are working really well in that the files that are generated are very useful and the coffeescript is being generated very nicely.

However, we've run into an issue that we can't use the --pod flag as yet. So we're pulling our files into a pods file structure manually.

Is this something that can be incorporated into the coffee generators? I wish my understanding of the problem domain were greater and I could offer some assistance in this matter.

Error when generating a controller without type option

Referencing closed issue: ember-cli/ember-cli#2134 (comment)

❯ ember --version
version: 0.1.1
node: 0.11.14
npm: 2.1.2
coffee -v
1.7.1
❯ ember generate controller login
version: 0.1.1
installing
Cannot read property 'writeLine' of undefined
TypeError: Cannot read property 'writeLine' of undefined
  at Class.module.exports.beforeInstall (/Users/rocky/pastoral-acts/node_modules/ember-cli/blueprints/controller/index.js:25:14)
  at Class.module.exports.beforeInstall (/Users/rocky/pastoral-acts/node_modules/ember-cli-coffeescript/blueprints/controller/index.js:9:40)
  at Class.module.exports.beforeInstall (/Users/rocky/pastoral-acts/node_modules/ember-cli-coffeescript/blueprints/controller/index.js:9:40)
  at $$$internal$$tryCatch (/Users/rocky/pastoral-acts/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:470:16)
  at $$$internal$$invokeCallback (/Users/rocky/pastoral-acts/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:482:17)
  at /Users/rocky/pastoral-acts/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1066:13
  at $$rsvp$asap$$flush (/Users/rocky/pastoral-acts/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1531:9)
  at process._tickCallback (node.js:372:11)

Linting output in silent mode

ember-cli supports an argument, --silent, that should mute all output. This is useful for running tests and reading the output, for example.

ember-cli-coffeescript ignores this, and outputs the linting output either way.

Generating route tries to generate an entry in route.js

Hey

I have an issue while generating routes in my app. Every time I run:

ember g route example

I'm getting the following:

 create app/templates/example.emblem
ENOENT, ../app/router.js'
Error: ENOENT, no such file or directory '../app/router.js'

Thanks in advance

Add source maps

Not sure if this can be addressed in here or by the broccoli-coffee maintainers, but source maps would be a huge help

Generator for resource

When I run

ember generate resource ingredients.

I got an error saying

no such file or directory "path-to-app/my-app/app/router.js"

This happens only when I'm trying to generate a resource. When trying to generate a route all is working perfectly, a route is being added inside my router.coffee file and the route and template files are being generated perfectly as coffee.

Anyone else noticed this?

Issue with import/export variable name collision.

Summary: Overriding an imported variable now has unexpected results.

Steps to reproduce:
In the latest cli (0.1.11) import a module, extend it and export using the same name:

`import MyCustomComponent from 'my-custom-component/components/my-custom-component'`

MyCustomComponent = MyCustomComponent.extend ...

`export MyCustomComponent`

This was a typical workflow in addons allowing addon modules to be merged into the source tree but also remain extensible due to not being overwritten by local copies in the parent app.

This behaviour breaks now, because instead of assigning imports to the variable defined in the import statement, (i.e. MyCustomComponent) They are being assigned to MyCustomComponent['default'], ostensibly to eliminate an unnecessary variable declaration.

While this is not a problem with JS blueprints which can export directly without assigning to a similarly named var (a limitation of coffee due to the need for backticks in import/export statements), it causes terrible things to happen in coffeescript whereby the local variable clobbers the import and causes the code to stop working.

Essentially it's not really safe to import a variable and then overwrite it using coffeescript and although this is an edge case I just wanted to report the issue in the hope of establishing a best practice for dealing with this.

Error: EEXIST, file already exists

I'm using ember-cli-coffeescript in a project that has a combination of .coffee and .js files (which may or not be relevant), and whenever I edit one of the coffee files, it creates a matching .js file in the same folder, which then breaks the build:

EEXIST, file already exists '/Users/work/htdocs/onboard/client/tmp/coffee_script_filter-tmp_dest_dir-Y7vlbjlp.tmp/my-awesome-app/path/to/file.js'

Using the following versions:

ember-cli: 0.2.0-beta.1,
ember-cli-coffeescript: 0.10.0

Make a generator for a custom coffeelint.json

We have instructions in the readme and an example of how a custom coffeelint.json could look. The rule in there about allowing backticks is pretty much mandatory, so it would be nice if the user could type something like ember g coffeelint and get one.

Should be pretty straightforward - add a new blueprint to the /blueprints-folder with that name and a nice description.

We could expand upon this and ask about it when the user installs ember-cli-coffeescript, as discussed in #65

can't use .coffeelintignore

Trying to ignore some directories, and I can't find either the right place to put .coffeelintignore nor the right combination of things to put in there to do so. Using latest ember-cli-coffeescript on ember-cli 0.1.2 (works otherwise).

addon/ folder is ignored

Hi all,

I'm creating an ember-cli addon in Coffeescript, and it seems that Coffeescript files in the addon/ folder aren't being pre-processed. If I put .js files there, it works fine.

Has anyone successfully built an addon in Coffeescript before? Am I missing something?

All coffee files when 'ember new'

When ember-cli creates a new project, all the main files already comes in common javascript. There's a way to create an extension for ember new to create the full project in coffee? Maybe something like ember new myApp --coffeescript

ember-cli-coffeescript addons, can't import from addon folder..

This may not be an ember-cli-coffeescript issue per se, but I really want to make ember-cli addons more compatible for users of this excellent addon.

Steps to reproduce:

ember g my-crafty-addon and npm install --save-dev ember-cli-coffeescript inside the addon.

So far so good. Begin coding away.

Create (for example) a component in the addon/components folder. (Manually since components can't be generated inside addons?).

Mirror this component in app/components and import/export as described here: http://edgycircle.com/blog/2014-creating-a-datepicker-ember-addon/ (a common practice for merging into the application namespace while still allowing further subclassing)

addon/components/my-component:

`import Ember from 'ember'`

MyComponent = Ember.Component.extend( ... )

`export default MyComponent`

app/components/my-component:

`import MyComponent from 'my-crafty-component/components/my-component'`

`export default MyComponent`

my-crafty-addon no longer functions! The importing app will complain about not be able to find my-crafty-addon/components/my-component

While the above steps work great for .js files, there seems to be a globbing issue that doesn't pick up .coffee files in the same configuration.

I believe this is an issue somewhat closer to the ember-cli core but I really would like to know what steps we can take to increase compatibility?

ember g controller is broken

I'm using ember-cli-coffees6 which relies on ember-cli-coffeescript, when I run

ember generate controller <foo>

I get this error:

version: 0.1.3
Could not find watchman, falling back to NodeWatcher for file system events
installing
Cannot call method 'call' of undefined
TypeError: Cannot call method 'call' of undefined
  at Class.module.exports.beforeInstall (/Users/bmckay/Ember/rew_mobile/node_modules/ember-cli-coffees6/node_modules/ember-cli-coffeescript/blueprints/controller/index.js:9:69)
  at $$$internal$$tryCatch (/Users/bmckay/Ember/rew_mobile/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:470:16)
  at $$$internal$$invokeCallback (/Users/bmckay/Ember/rew_mobile/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:482:17)
  at /Users/bmckay/Ember/rew_mobile/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1066:13
  at $$rsvp$asap$$flush (/Users/bmckay/Ember/rew_mobile/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1531:9)
  at process._tickCallback (node.js:419:13)

Repeated CoffeeLint-results (app and test) is potentially confusing

When coffeelint is included I get output like this:

==========================================
File: vapour/components/data-map.coffee
==========================================
 Line exceeds maximum allowed length (error) 
Line:  22

 Line exceeds maximum allowed length (error) 
Line:  25

 Line exceeds maximum allowed length (error) 
Line:  50

 Operators must be spaced properly (error) 
Line:  54

 Operators must be spaced properly (error) 
Line:  54

 Line exceeds maximum allowed length (error) 
Line:  54

 Line exceeds maximum allowed length (error) 
Line:  64

 Line exceeds maximum allowed length (error) 
Line:  102

 Operators must be spaced properly (error) 
Line:  112


=======================================================
Linting completed on 1 files with  9  errors.
=======================================================



=======================================================
Linting completed on 0 files with  0  errors.
=======================================================

ember-cli 0.2.5 generator issue

Try to

ember g component users-toolbar -p -path users

and result

Arguments to path.join must be strings
TypeError: Arguments to path.join must be strings
  at Object.posix.join (path.js:488:13)
  at __path__ (/Users/kazar/Projects/medmedia/mimic-ember/node_modules/ember-cli/blueprints/component/index.js:26:23)
  at /Users/kazar/Projects/medmedia/mimic-ember/node_modules/ember-cli/lib/models/blueprint.js:628:66
  at Array.map (native)
  at Class.Blueprint.generateFileMap (/Users/kazar/Projects/medmedia/mimic-ember/node_modules/ember-cli/lib/models/blueprint.js:628:37)
  at Class.Blueprint._locals (/Users/kazar/Projects/medmedia/mimic-ember/node_modules/ember-cli/lib/models/blueprint.js:814:22)
  at Class.Blueprint._process (/Users/kazar/Projects/medmedia/mimic-ember/node_modules/ember-cli/lib/models/blueprint.js:458:22)
  at Class.Blueprint.install (/Users/kazar/Projects/medmedia/mimic-ember/node_modules/ember-cli/lib/models/blueprint.js:491:15)
  at Class.module.exports.Task.extend.run (/Users/kazar/Projects/medmedia/mimic-ember/node_modules/ember-cli/lib/tasks/generate-from-blueprint.js:52:49)
  at Class.module.exports.Command.extend.run (/Users/kazar/Projects/medmedia/mimic-ember/node_modules/ember-cli/lib/commands/generate.js:79:17)
  at Class.<anonymous> (/Users/kazar/Projects/medmedia/mimic-ember/node_modules/ember-cli/lib/models/command.js:136:17)
  at lib$rsvp$$internal$$tryCatch (/Users/kazar/Projects/medmedia/mimic-ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:489:16)
  at lib$rsvp$$internal$$invokeCallback (/Users/kazar/Projects/medmedia/mimic-ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:501:17)
  at lib$rsvp$$internal$$publish (/Users/kazar/Projects/medmedia/mimic-ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:472:11)
  at lib$rsvp$asap$$flush (/Users/kazar/Projects/medmedia/mimic-ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1290:9)
  at process._tickCallback (node.js:355:11)

After remove ember-cli-coffeescript all work fine

Generation problems when using ember-cli-coffeescript

All commands that generate test files have an issue where a tests/unit/.../name.js and a tests/unit/.../name.coffee both get generated. Example:

$ ember g route library
version: 0.0.46
installing
create app/routes/library.coffee
create app/templates/library.hbs
create tests/unit/routes/library-test.coffee
installing
create tests/unit/routes/library-test.js
Error happens when building

$ ember s
version: 0.0.46
Livereload server on port 35729
Serving on http://0.0.0.0:4200
EEXIST, file already exists '/Users/.../tmp/coffee_script_filter-tmp_dest_dir-eRLGbxWm.tmp/project/tests/unit/routes/library-test.js'
Error: EEXIST, file already exists '/Users/.../tmp/coffee_script_filter-tmp_dest_dir-eRLGbxWm.tmp/project/tests/unit/routes/library-test.js'

Generating a model-test leaves <%=placeholders%>

This is what is generated:

moduleForModel '<%= dasherizedModuleName %>', '<%= classifiedModuleName %>', {
  # Specify the other units that are required for this test.
  <%= needs %>
}

Generating a model (and therefore also its model-test) works fine

Turning off linting with config doesn't work

Using the config in config/environment.js to turn off linting is pointless, as that part is read after the first round if linting is run.

Options:

  1. Do something else
  2. Move config back to the Brocfile (which has other issues)

When does coffeelinting happen?

I feel like I'm missing something here. The README gives the impression that coffeelinting should be automatic if there is a coffeelint.json file present in the project directory. I have one:

{
  "no_backticks": {
    "level": "ignore"
  }
}

Which is fine, I can run coffeelint app/ and get the appropriate results. However I got the impression that this should just happen when the coffeescript is preprocessed:

If you have a coffeelint.json file we will automatically pick up on it and start running linting.

So my question is really just when does this happen? The code seems to suggest that there will be a linting informational message:

https://github.com/kimroen/ember-cli-coffeescript/blob/master/lib/coffee-linter.js#L42

But I do not see that happening, when I preprocess CS by, say, starting the server. What am I missing?

License

Can you add a license to this project? Preferably MIT to match most of the other ember-cli projects?

Mocha tests

When I added ember-cli-mocha, my tests don't come out in coffee. (Would seem a pain to support lots of different testers, but would seem that ember-cli in general should support dependencies and peer dependencies between add-ons -- perhaps you shouldn't be supporting test generation at all, but that should be split off into an additional dependency?)

Thought I'd raise the issue....

Could not find module appname/app

I'm getting this error because in appname.js, there is no define('appname/app' call, so when the application tries to start (require('appname/app')['default'].create({...})), it can't find the appname/app module because it was never defined. Why isn't this define call being output into assets/appname.js? I see many other modules are being defined. Presumably appname/app refers to the Ember.Application exported in appname/app/app.js, or in the case of using coffeescript, app.coffee. I see that this module hasn't been updated recently, so I'm guessing ember-cli 0.2.0 broke something and this needs to be updated.

When I use a plain app.js file generated by ember init, instead of an app.coffee file, the issue goes away.

Note: I'm actually using coffees6 but that module ultimately just passes things onto this module.

You can see the error printed in the console on my project at this commit here: https://github.com/devinrhode2/major-domo/tree/95cfed62b88c29f07c5f4f7ef1580f43d668f390

Updating to CLI 0.2.5 causes error with app.js

Things were working fine on 0.2.3, but then I upgraded ember-cli and:

$ ember build
version: 0.2.5
Building.

=======================================================
Linting completed on 23 files with  0  errors.
=======================================================

Build failed.
EEXIST: file already exists, symlink '/home/igoru/dev/js/protoboard/app/app.js' -> '/home/igoru/dev/js/protoboard/tmp/coffee_script_filter-tmp_dest_dir-oy7V5pwO.tmp/protoboard/app.js'
Error: EEXIST: file already exists, symlink '/home/igoru/dev/js/protoboard/app/app.js' -> '/home/igoru/dev/js/protoboard/tmp/coffee_script_filter-tmp_dest_dir-oy7V5pwO.tmp/protoboard/app.js'
  at Error (native)
  at Object.fs.symlinkSync (fs.js:897:18)
  at symlink (/home/igoru/dev/js/protoboard/node_modules/ember-cli-coffeescript/node_modules/broccoli-filter/node_modules/symlink-or-copy/index.js:82:14)
  at symlinkOrCopySync (/home/igoru/dev/js/protoboard/node_modules/ember-cli-coffeescript/node_modules/broccoli-filter/node_modules/symlink-or-copy/index.js:58:5)
  at /home/igoru/dev/js/protoboard/node_modules/ember-cli-coffeescript/node_modules/broccoli-filter/index.js:45:11
  at /home/igoru/dev/js/protoboard/node_modules/ember-cli-coffeescript/node_modules/broccoli-filter/node_modules/promise-map-series/index.js:11:14
  at lib$rsvp$$internal$$tryCatch (/home/igoru/dev/js/protoboard/node_modules/ember-cli-coffeescript/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:489:16)
  at lib$rsvp$$internal$$invokeCallback (/home/igoru/dev/js/protoboard/node_modules/ember-cli-coffeescript/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:501:17)
  at lib$rsvp$$internal$$publish (/home/igoru/dev/js/protoboard/node_modules/ember-cli-coffeescript/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:472:11)
  at lib$rsvp$asap$$flush (/home/igoru/dev/js/protoboard/node_modules/ember-cli-coffeescript/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:1290:9)
  at process._tickCallback (node.js:340:13)

Maybe this is related to #78?

Installation failure

I get the following issue when trying to install ember-cli-coffeescript.

Any thoughts on what I may be doing wrong?

$ npm install --save-dev ember-cli-coffeescript
npm ERR! Error: ENOENT, open '/Users/my-user/Code/my-app/client2/node_modules/ember-cli-coffeescript/node_modules/fs-extra/node_modules/mkdirp/test/race.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "--save-dev" "ember-cli-coffeescript"
npm ERR! cwd /Users/my-user/Code/my-app/client2
npm ERR! node -v v0.10.31
npm ERR! npm -v 2.0.0-beta.0
npm ERR! path /Users/my-user/Code/my-app/client2/node_modules/ember-cli-coffeescript/node_modules/fs-extra/node_modules/mkdirp/test/race.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! Error: ENOENT, lstat '/Users/my-user/Code/my-app/client2/node_modules/ember-cli-coffeescript/node_modules/fs-extra/node_modules/ncp/test/ncp-test.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "--save-dev" "ember-cli-coffeescript"
npm ERR! cwd /Users/my-user/Code/my-app/client2
npm ERR! node -v v0.10.31
npm ERR! npm -v 2.0.0-beta.0
npm ERR! path /Users/my-user/Code/my-app/client2/node_modules/ember-cli-coffeescript/node_modules/fs-extra/node_modules/ncp/test/ncp-test.js
npm ERR! fstream_path /Users/my-user/Code/my-app/client2/node_modules/ember-cli-coffeescript/node_modules/fs-extra/node_modules/ncp/test/ncp-test.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:287:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/Users/my-user/Code/my-app/client2/node_modules/ember-cli-coffeescript/node_modules/fs-extra/node_modules/rimraf'
npm ERR! error rolling back  [email protected] { [Error: ENOTEMPTY, rmdir '/Users/my-user/Code/my-app/client2/node_modules/ember-cli-coffeescript/node_modules/fs-extra/node_modules/rimraf']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/Users/my-user/Code/my-app/client2/node_modules/ember-cli-coffeescript/node_modules/fs-extra/node_modules/rimraf' }
npm ERR! Error: version not found: [email protected]
npm ERR!     at setData (/usr/local/lib/node_modules/npm/lib/cache/add-named.js:127:12)
npm ERR!     at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:167:7)
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/cmd-shim/node_modules/graceful-fs/polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "--save-dev" "ember-cli-coffeescript"
npm ERR! cwd /Users/my-user/Code/my-app/client2
npm ERR! node -v v0.10.31
npm ERR! npm -v 2.0.0-beta.0
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/my-user/Code/my-app/client2/npm-debug.log
npm ERR! not ok code 0

$ ember version --verbose
version: 0.0.42
http_parser: 1.0
node: 0.10.31
v8: 3.14.5.9
ares: 1.9.0-DEV
uv: 0.10.28
zlib: 1.2.3
modules: 11
openssl: 1.0.1i
npm: 1.4.24

using with ember cli 0.37

Hi is the first time I am using this. When I start a new project and simply do ember server (after installing this ofc npm install --save-dev ember-cli-coffeescript) i get the following error:

The `CoffeescriptAddon` addon must implement the `treeFor` hook.Error: The `CoffeescriptAddon` addon must implement the `treeFor` hook.
  at EmberApp.<anonymous> (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/broccoli/ember-app.js:122:13)
  at Array.map (native)
  at EmberApp.addonTreesFor (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/broccoli/ember-app.js:120:40)
  at EmberApp.<anonymous> (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/broccoli/ember-app.js:198:25)
  at EmberApp.memoized [as _processedAppTree] (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/node_modules/lodash-node/modern/functions/memoize.js:65:28)
  at EmberApp.<anonymous> (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/broccoli/ember-app.js:231:21)
  at EmberApp.memoized [as appAndDependencies] (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/node_modules/lodash-node/modern/functions/memoize.js:65:28)
  at EmberApp.<anonymous> (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/broccoli/ember-app.js:299:34)
  at EmberApp.memoized [as javascript] (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/node_modules/lodash-node/modern/functions/memoize.js:65:28)
  at EmberApp.toArray (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/broccoli/ember-app.js:527:10)
  at EmberApp.<anonymous> (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/broccoli/ember-app.js:541:30)
  at EmberApp.memoized [as toTree] (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/node_modules/lodash-node/modern/functions/memoize.js:65:28)
  at Object.<anonymous> (/Users/charlie/Development/pluck/node/pluckClient/Brocfile.js:20:22)
  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)
  at require (module.js:380:17)
  at Object.loadBrocfile (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/node_modules/broccoli/lib/builder.js:147:14)
  at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/models/builder.js:15:26)
  at Class.module.exports.Task.extend.init (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/models/builder.js:32:10)
  at new Class (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/models/core-object.js:18:12)
  at Class.module.exports.Task.extend.run (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/tasks/serve.js:15:19)
  at Class.module.exports.Command.extend.run (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/commands/serve.js:35:18)
  at Class.Command.validateAndRun (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/models/command.js:74:15)
  at /Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/lib/cli/cli.js:53:22
  at tryCatch (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/node_modules/rsvp/dist/commonjs/rsvp/-internal.js:163:16)
  at invokeCallback (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/node_modules/rsvp/dist/commonjs/rsvp/-internal.js:172:17)
  at /Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/node_modules/rsvp/dist/commonjs/rsvp/promise.js:186:17
  at flush (/Users/charlie/Development/pluck/node/pluckClient/node_modules/ember-cli/node_modules/rsvp/dist/commonjs/rsvp/asap.js:51:9)
  at process._tickCallback (node.js:415:13)

Allow generators to keep generating .js files

Hello,

I have a simple use case: I'd like one or two files (js objects containing i18n translations) to be in coffee-script because it's more terse. However, with my team we've agreed to not use coffee-script for application code (for various reasons).

So my question is: is there a way with this addon (or any other, by the way) to add coffee-script discovery/precompilation without having the generators outputting coffee files? If not, do you plan on adding this feature? If not, would accept a pull-request for it ?

Thanks for your time : )

Issue with temporary files after upgrade to ember-cli 0.41

Upgraded application to ember-cli 0.41 according this https://github.com/stefanpenner/ember-cli/releases/tag/v0.0.41. Now got this error on application start:

ember server --proxy http://127.0.0.1:3000
version: 0.0.41
Proxying to http://127.0.0.1:3000
Livereload server on port 35729
Serving on http://0.0.0.0:4200
EEXIST, file already exists '<path to project>/tmp/coffee_script_filter-tmp_dest_dir-rlboXtgt.tmp/<project name>/app.js'
Error: EEXIST, file already exists '<path to project>/tmp/coffee_script_filter-tmp_dest_dir-rlboXtgt.tmp/<project name>/app.js'
  at Object.fs.openSync (fs.js:427:18)
  at Object.fs.writeFileSync (fs.js:966:15)
  at Object.copyPreserveSync (<path to project>/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/broccoli-kitchen-sink-helpers/index.js:165:8)
  at <path to project>/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/index.js:42:19
  at promise.then.then.results.(anonymous function) (<path to project>/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/promise-map-series/index.js:8:27)
  at $$$internal$$tryCatch (<path to project>/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:470:16)
  at $$$internal$$invokeCallback (<path to project>/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:482:17)
  at $$$internal$$publish (<path to project>/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:453:11)
  at $$rsvp$asap$$flush (<path to project>/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:1531:9)
  at process._tickCallback (node.js:415:13)

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.