Détail du package

ember-cli-coffeescript

kimroen588MIT1.16.1

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

ember-addon, coffeescript, blueprints

readme

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

changelog

master

1.16.1

  • Change all blueprints to use direct exports (instead of storing to variable and then exporting). #137 and #139
  • Change files exporting things from addons to be JavaScript files so they can be consumed by applications without requiring ember-cli-coffeescript to be installed. #136

1.16.0

This release updates CoffeeScript to version 1.12.1, which contains support for a lot of ES2016 features that were unavailable or impractical to use in CoffeeScript. The main ones for Ember apps are modules and tagged template literals. See the official CoffeeScript changelog for the full list of changes.

This means you can now write your imports and exports without backticks, and all generated code will also now be without these. Rejoice!

Thanks to @jakesjews for championing this update.

In other news, there are now tests for the blueprints and the install size is slightly smaller.

  • Reduce install size by depending on specific lodash modules directly. #123
  • Update to CoffeeScript version 1.12.1, which includes support for import and export without backticks 🎉 #124
  • Add basic tests for the supported blueprints. #124 and #129

1.15.0

  • Fix a bunch of issues with blueprints in ember-cli versions 2.6.0 and above. #114, #118, and #119
  • Handle unexpected blueprint behavior when running in a path containing the string ember-cli-coffeescript at any point. #120

1.14.0

  • Upgrade broccoli-coffee to 0.6, which now uses broccoli-persistent-filter #104
  • Upgrade node-ignore, which makes parsing .coffeelintignore more spec-compliant in general and makes it work on Windows. #105
  • Upgrade the project structure
  • Fix problem with generating helper tests and initializer tests #108

1.13.2

Makes rebuilds faster when linting your CoffeeScript by using broccoli-persistent-filter. Many thanks to @johnnyshields and @stefanpenner for making this happen.

  • Upgrade CoffeeScriptLinter to broccoli-persistent-filter #95

1.13.1

Updates CoffeeScript to version 1.10.0. See their changelog.

  • Upgrade broccoli-coffee to 0.5.0 #90

1.13.0

Note: The generated tests from components require you to have ember-cli-htmlbars-inline-precompile installed with at least version 0.2.0.

  • Updated all blueprints to match the ember-cli 1.13-range #89. Some highlights:
    • Generated helpers use Ember.Helper.helper instead of Ember.HTMLBars.makeBoundHelper
    • Generated component-tests are now integration tests by default. See note above
    • This fixes some issues when using this combined with pods in various configurations
    • All generators should generally work in addons now
  • Updated depended-on ember-cli version which gets rid of some warnings #85
  • Fix exceptions when using ember destroy route or ember generate route #88

0.11.0

  • Generating components in addons now works #67
  • If both coffeescript and babel is used, now coffee runs first #74
  • Blueprint-tweaks:

0.10.0

  • Blueprint improvements for ember-cli 0.2.0
  • Update broccoli-coffee to ~0.4.0
  • Fix filtering to use CoffeeScript extensions #64
  • Update chalk to ^1.0.0 #63

0.9.1

  • Add compatibility with upcoming changes in ember-cli 0.2.0 #60

0.9.0

  • Update blueprints for ember-cli 0.1.13
    • Removed classifiedModuleName from moduleFor. They are optional now. #57
    • Made all the changes necessary for qunit 2.0 compatibility #54

0.8.1

  • Fix a problem in the acceptance-test blueprint to not hang by default #51
  • Fix a problem with config not being respected in test #55

0.8.0

  • Update blueprints for ember-cli 0.1.12
  • Fix the resources blueprint #50

0.7.0

  • Update blueprints for ember-cli 0.1.5
    • Check presence of needs in model-test blueprints before emitting ember-cli#2829
    • Reference app instance as application in generated acceptance-tests ember-cli#2659
    • Add aliases -resource and -route to the route blueprint ember-cli#2565
  • Add support for .coffeelintignore-files #45

0.6.0

  • Make blueprints optional (defaults to include).
  • Move coffeeOptions from Brocfile.js to config/environment.js. See README for more details on how to use.

0.5.0

  • Update blueprints for ember-cli 0.1.4
    • Use the Ember.Applications container for initializer tests. ember-cli#2582
    • Use project.root instead of process.cwd() in route blueprints. ember-cli#2604

0.4.0

  • Support pod-structure for
    • adapters
    • serializers
    • transforms
  • Support pod-structure for tests. Added:
    • component-test
    • controller-test
    • model-test
    • route-test
    • serializer-test
    • transform-test
    • view-test
  • Remove blueprints for controller types. See original commit in ember-cli
  • Make generated relationships in models use dasherized names. Ref issue ember-cli

0.3.2

  • Fix some issues with the generated component tests #29
  • Update broccoli-coffeescript to 0.3.0, enabling support for literate CoffeeScript.

0.3.1

  • Add missing dependency #27

0.3.0

  • Add support for linting CoffeeScript #25

0.2.0

  • Add support for the pod-structure for generated files

0.1.2

  • Fix problem with export in generated initializer #18
  • Make a workaround for error when generating a controller without specifying a type
  • Fix said horrible workaround
  • Update dependencies
  • Create a changelog

0.1.1

Do not use this version.

0.1.0

  • Add descriptions and help to all the blueprints
  • Move tests to separate blueprints to be in line with ember-cli
  • Add test for generated adapters and initializers
  • Use lookupBlueprint for duplicated code where possible
  • Make default model test more robust
  • Use EOL instead of \n where applicable
  • Support destroying blueprints
  • Change default generated serializer from ActiveModelSerializer to RESTSerializer
  • Update readme with new type-syntax for generating controllers

0.0.7

  • Fix a naming-problem with generating components

0.0.6

  • Update dependencies to fix a problem with installing ember-cli-coffeescript with beta versions of node 2.0

0.0.5

  • Generating a helper also generates a test
  • The generated initializer for services is more explicit about being for a service
  • Generating a route called 'basic' doesn't add it to router.coffee
  • Generated services are no longer broken

0.0.4

  • Check for updates before adding a new route/resource to the route
  • Basic support for older versions of ember-cli

0.0.2

  • Add precompilation of coffeescript

0.0.1

  • Initial release (generators only)