kimroen / ember-cli-coffeescript

Adds precompilation of CoffeeScript files and all the basic generation types to the ember generate command.
MIT License
72 stars 49 forks source link

Fix blueprints: dependencyDepth is not defined #108

Closed mriska closed 8 years ago

mriska commented 8 years ago

When using the generators for helpers-test or initializers-test I was getting the following error:

➜  cs-test git:(master) ✗ ember generate initializer-test foo
version: 2.3.0
installing initializer-test
  create tests/unit/initializers/foo-test.coffee
dependencyDepth is not defined (Error in blueprint template: /Users/mriska/work/ember-cli-coffeescript/blueprints/initializer-test/files/tests/unit/initializers/__name__-test.coffee)
ReferenceError: dependencyDepth is not defined (Error in blueprint template: /Users/mriska/work/ember-cli-coffeescript/blueprints/initializer-test/files/tests/unit/initializers/__name__-test.coffee)
  at eval (<anonymous>:8:11)
  at processTemplate (/Users/mriska/work/cs-test/node_modules/ember-cli/lib/models/file-info.js:19:36)
  at /Users/mriska/work/cs-test/node_modules/ember-cli/lib/models/file-info.js:100:20
  at lib$rsvp$$internal$$tryCatch (/Users/mriska/work/cs-test/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
  at lib$rsvp$$internal$$invokeCallback (/Users/mriska/work/cs-test/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
  at lib$rsvp$$internal$$publish (/Users/mriska/work/cs-test/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1019:11)
  at lib$rsvp$asap$$flush (/Users/mriska/work/cs-test/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
  at _combinedTickCallback (internal/process/next_tick.js:67:7)
  at process._tickCallback (internal/process/next_tick.js:98:9)

The following changes to the blueprint seems to fix that error. dasherizedModulePrefix is what is being used in the standard ember-cli blueprints.

mriska commented 8 years ago

@kimroen Have you had a chance to look at this?

kimroen commented 8 years ago

Unfortunately not. Thanks for submitting and following up though!

Taking a look now - starting with trying to figure out where this change came and see if I need to account for older version behavior.

kimroen commented 8 years ago

This was introduced in this PR: https://github.com/ember-cli/ember-cli/pull/5418

This change only works for ember-cli 2.3.0 and up. It will break for people using older versions, but I'm leaning towards saying that that's okay.

This change was also introduced for instance-initializer-test, which is yet to be added to this project.

kimroen commented 8 years ago

Released as 1.14.0. Thanks again!