Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Refactor to use project's bower for deps. #13

Merged
merged 2 commits into from
Sep 5, 2014

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Sep 5, 2014

  • Updates structure and export POJO from addon.
  • Remove bower.json.
  • Add ember-cli-qunit blueprint (that installs the bower packages).
  • Bump package version to 0.1.0 (to indicate fairly large changes).

Fixes #8.
Fixes #9.
Fixes #10.

@jakecraige
Copy link
Member

How is the generate handled when generating a new app?

ember new myapp
ember g ember-cli-qunit

?

@rwjblue
Copy link
Member Author

rwjblue commented Sep 5, 2014

@jakecraige - It isn't, the generate only adds bower packages to bower.json, and I added those in ember-cli/ember-cli#1877 manually.

@rwjblue
Copy link
Member Author

rwjblue commented Sep 5, 2014

I might add an addonInit hook for addons that fires for each addon every time ember init is called, but I am still kinda on the fence about it. This will still be backwards compatible with that if we decide to do it (but will be in some future version of ember-cli).

@jakecraige
Copy link
Member

@rwjblue I see how this fixes the immediate problem but I definitely think we need to figure out how addons should handle bower/npm dependencies.

I'm thinking something similar to what you mentioned. Some way to "initialize" addons as a whole. In that they could specify things like adding bower or npm dependencies. Using blueprints seems like the wrong choice as they're going to get really confusing in that some create files and others do dependencies, some are required to run, some not.

@@ -0,0 +1,28 @@
function installPackage(packageName, version) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You aren't actually using this function anywhere

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops. Will remove.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

* Updates structure and export POJO from addon.
* Remove bower.json.
* Add `ember-cli-qunit` blueprint (that installs the bower packages).
@rwjblue
Copy link
Member Author

rwjblue commented Sep 5, 2014

We use blueprints to initialize an application, there is no reason that we should use something else (and recreate all of the functionality) to initialize an addon's use in an application.

I plan on adding:

  • an initAddon hook (that is called when the project is updated via ember init)
  • a command to make installing addons that have a default blueprint simpler (ember install-addon ember-cli-divshot which would call npm install --save-dev ember-cli-divshot && ember g ember-cli-divshot)

Either way, this PR is the correct direction for now (future changes to ember-cli simply make this even easier for us and our consumers).

@jakecraige
Copy link
Member

I could definitely see something like that command and hook being valuable. I'm for it

yeah looks good

jakecraige added a commit that referenced this pull request Sep 5, 2014
Refactor to use project's bower for deps.
@jakecraige jakecraige merged commit fb7b746 into ember-cli:master Sep 5, 2014
@rwjblue rwjblue deleted the refactor branch September 5, 2014 04:12
@stefanpenner
Copy link
Contributor

Yay

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants