New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation clarification #2778

Closed
toranb opened this Issue Dec 18, 2014 · 11 comments

Comments

Projects
None yet
4 participants
@toranb
Contributor

toranb commented Dec 18, 2014

As I'm working through the "create a new addon" documentation I think I'm missing something/and or the docs aren't something you can read top to bottom.

The first step goes like this (using the name my-x-button)

ember addon my-x-button

Next you show the index.js w/ the name "my-addon" (diff from step 1)

module.exports = {
  name: 'my-addon'
};

Then later when you say to create a component ...you show this import for the file

// app/components/x-button.js
import XButton from 'ember-x-button/components/x-button';

Does all this match up correctly or was this several parts/different starts ?

I've gone through this tutorial a few times over the past week but no matter what I do I can't seem to get beyond the error

Handlebars error: Could not find property 'x-button'

...when used like so in my ember-cli app after a simple npm install

{{x-button focus=false}}

I'd like to ensure others (new to ember) don't hit the site and have the same issues I did so I'd PR in a change if/when I get this working (not the state I'm in today sadly).

Any clarification around this (the addon component example in particular) would be helpful! thank you!

here is the full addon (single commit to show what I've changed since the init commit)

https://github.com/toranb/ember-wat

@knownasilya

This comment has been minimized.

Show comment
Hide comment
@knownasilya

knownasilya Dec 18, 2014

Contributor

Does your repo work, or is that a broken version?

Contributor

knownasilya commented Dec 18, 2014

Does your repo work, or is that a broken version?

@toranb

This comment has been minimized.

Show comment
Hide comment
@toranb

toranb Dec 19, 2014

Contributor

At this time I get an error as-is - that's in part why I opened this issue. I still can't get a working component that I can install

Here are the steps I took to install this/use it with ember-cli

  1. rm -rf node_modules && npm cache clean
  2. ember new foobar (using ember-cli 0.1.4)
  3. cd foobar
  4. npm install ember-wat

then add the below to the app.hbs

{{x-button focus=false}}

then run ember server and verify the output (throws error today)

Contributor

toranb commented Dec 19, 2014

At this time I get an error as-is - that's in part why I opened this issue. I still can't get a working component that I can install

Here are the steps I took to install this/use it with ember-cli

  1. rm -rf node_modules && npm cache clean
  2. ember new foobar (using ember-cli 0.1.4)
  3. cd foobar
  4. npm install ember-wat

then add the below to the app.hbs

{{x-button focus=false}}

then run ember server and verify the output (throws error today)

@jakecraige

This comment has been minimized.

Show comment
Hide comment
@jakecraige

jakecraige Dec 19, 2014

Member

@toranb You need to npm install --save-dev ember-wat. The addon's need to be in the package.json of the consuming project as that's what it checks to find the addons.

I was able to follow those same steps with the --save-dev and it works for me.

Also, you can use the dummy app in your addon to serve it up too. You can run ember s in your addon to start the server and it'll serve the dummy app which already has your addon included. So adding the component to the application.hbs there works as well.

Member

jakecraige commented Dec 19, 2014

@toranb You need to npm install --save-dev ember-wat. The addon's need to be in the package.json of the consuming project as that's what it checks to find the addons.

I was able to follow those same steps with the --save-dev and it works for me.

Also, you can use the dummy app in your addon to serve it up too. You can run ember s in your addon to start the server and it'll serve the dummy app which already has your addon included. So adding the component to the application.hbs there works as well.

@knownasilya

This comment has been minimized.

Show comment
Hide comment
@knownasilya

knownasilya Dec 19, 2014

Contributor

Yeah what @jakecraige said. 🍰

Contributor

knownasilya commented Dec 19, 2014

Yeah what @jakecraige said. 🍰

@toranb

This comment has been minimized.

Show comment
Hide comment
@toranb

toranb Dec 20, 2014

Contributor

BOOM that was exactly it :)

thank you, thank you, thank you

About the original issue where I asked about "one voice/ flow" through the addon documentation for ember-cli ... am I correct to voice the inconsistency or is this something I misunderstood ? I honestly felt like the docs where a mix of several addons (names mismatch/ etc).

Contributor

toranb commented Dec 20, 2014

BOOM that was exactly it :)

thank you, thank you, thank you

About the original issue where I asked about "one voice/ flow" through the addon documentation for ember-cli ... am I correct to voice the inconsistency or is this something I misunderstood ? I honestly felt like the docs where a mix of several addons (names mismatch/ etc).

@knownasilya

This comment has been minimized.

Show comment
Hide comment
@knownasilya

knownasilya Dec 20, 2014

Contributor

Agreed, seems less of a guide and more of a patch work of examples.
On Dec 19, 2014 9:28 PM, "Toran Billups" notifications@github.com wrote:

BOOM that was exactly it :)

thank you, thank you, thank you

About the original issue where I asked about "one voice/ flow" through the
addon documentation for ember-cli ... am I correct to voice the
inconsistency or is this something I misunderstood ? I honestly felt like
the docs where a mix of several addons (names mismatch/ etc).


Reply to this email directly or view it on GitHub
#2778 (comment)
.

Contributor

knownasilya commented Dec 20, 2014

Agreed, seems less of a guide and more of a patch work of examples.
On Dec 19, 2014 9:28 PM, "Toran Billups" notifications@github.com wrote:

BOOM that was exactly it :)

thank you, thank you, thank you

About the original issue where I asked about "one voice/ flow" through the
addon documentation for ember-cli ... am I correct to voice the
inconsistency or is this something I misunderstood ? I honestly felt like
the docs where a mix of several addons (names mismatch/ etc).


Reply to this email directly or view it on GitHub
#2778 (comment)
.

@stefanpenner

This comment has been minimized.

Show comment
Hide comment
@stefanpenner

stefanpenner Dec 20, 2014

Contributor

I actually think this is a bug, we should just glob the top-level of node_modules and read all the package jsons.

Contributor

stefanpenner commented Dec 20, 2014

I actually think this is a bug, we should just glob the top-level of node_modules and read all the package jsons.

@stefanpenner stefanpenner added the Bug label Dec 20, 2014

@stefanpenner stefanpenner added this to the v0.2.0 milestone Dec 20, 2014

@toranb

This comment has been minimized.

Show comment
Hide comment
@toranb

toranb Dec 20, 2014

Contributor

@stefanpenner you rock - it felt like a bug to me :)

Contributor

toranb commented Dec 20, 2014

@stefanpenner you rock - it felt like a bug to me :)

@jakecraige

This comment has been minimized.

Show comment
Hide comment
@jakecraige

jakecraige Dec 20, 2014

Member

Just want to chime in that that potentially causes the reverse of this. If you remove from package.json and don't prune, then you have addons included that aren't in the package.json.

Maybe we should have dependency checker check for this instead? An addon being in node_modules but not package.json?

Member

jakecraige commented Dec 20, 2014

Just want to chime in that that potentially causes the reverse of this. If you remove from package.json and don't prune, then you have addons included that aren't in the package.json.

Maybe we should have dependency checker check for this instead? An addon being in node_modules but not package.json?

@stefanpenner

This comment has been minimized.

Show comment
Hide comment
@stefanpenner

stefanpenner Dec 20, 2014

Contributor

I believe yes. But likely only top level node_modules should be considered

Contributor

stefanpenner commented Dec 20, 2014

I believe yes. But likely only top level node_modules should be considered

@stefanpenner

This comment has been minimized.

Show comment
Hide comment
@stefanpenner

stefanpenner Mar 24, 2015

Contributor

we should only consider what is both in package.json and in node_modules, or else we will self-troll .

Contributor

stefanpenner commented Mar 24, 2015

we should only consider what is both in package.json and in node_modules, or else we will self-troll .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment