Skip to content
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

Issue with project structure on iron create #100

Open
BrooklynC opened this issue Mar 6, 2015 · 22 comments
Open

Issue with project structure on iron create #100

BrooklynC opened this issue Mar 6, 2015 · 22 comments

Comments

@BrooklynC
Copy link

To start, is iron-meter compatible with Windows?

Is the project directory and file structure listed in the readme still up-to-date? When I create a new project, my structure has several differences, including:

  • no bin directory
  • no app/client/collections directory
  • no app/client/lib directory
  • no packages, private or public directories
  • no server/collections or controllers or lib directories

There are other differences too but hopefully it's all one issue. Any thoughts? Thanks very much.

@scottmcpherson
Copy link
Contributor

Hey @BrooklynC , I'm not sure if it's compatible with Windows, but I'd be interested in finding out. Have you tried using it with Windows?

The readme needs to be updated to reflect the actual project structure that is generated. None of the files that you listed are currently being generated.

@cmather
Copy link
Contributor

cmather commented Mar 7, 2015

Or we should fix the project template to actually include those folders/files :). I'm not sure why bin isn't being generated. I see a "bin" folder in the project template folder but maybe it's not getting checked into github or deployed to npm because there's no 'gitkeep' file in it? I think that might be what's happening for the other folders too.

@BrooklynC
Copy link
Author

Scott, I had these issues when running in Windows (I don't own a Mac). Thought that might have been the reason for the missing folders.

Chris, anything I should try on my end? I'm literally learning how to write code as I build my project so I can't get too creative, I've got very limited knowledge. But this folder structure could really help me out to understand where all the Meteor code goes. Thanks.

@cmather
Copy link
Contributor

cmather commented Mar 9, 2015

This should be fixed, if it was indeed the .gitkeep issue with folders. All of the folders mentioned above are created for me on the master branch. Can someone test.

> git clone https://github.com/iron-meteor/iron-cli.git
> cd iron-cli
> npm install
> npm link
> cd ~/src/scrap
> iron create my-project

@cmather cmather added the fixed label Mar 9, 2015
@scottmcpherson
Copy link
Contributor

Yep, they're all being created.

@BrooklynC
Copy link
Author

I'm still getting a short list of directories, although I may not have followed your instructions properly. I ran the commands you listed in Git Shell, but was unclear on "cd ~/src/scrap". That directory does not exist. Am I just changing to my top level directory?

When I run iron create, it lists the directories and files but stops after the stylesheet and says "Installing the package iron-router" at that point.

@scottmcpherson
Copy link
Contributor

> cd ~/src/scrap is just a location example that Chris is giving to install your app in. You can install your app wherever you like though. You might want to do something like > cd Desktop and then run > iron create my-project instead.

I would try finding the location of where you have iron installed, and looking in package.json to check the version for 1.0.1, which is the latest.

@BrooklynC
Copy link
Author

Thanks to both of you for your assistance and patience. Everything is up and running, looking forward to using it!

@BrooklynC
Copy link
Author

Apologies, one more question - I created the project with "iron create my-project", then opened the project in WebStorm. When I try to add packages there, I get an error message saying I am not in a Meteor project directory and prompts me to create a project using "meteor create myapp".

Do I need to create using iron? Or can I create using the "meteor create" command and migrate to an iron file structure? Or is this me just missing some setting in WebStorm?

When I cd into a project directory that I created using "meteor create", the directory is followed by a line of text like [master +2 ~0 -0 !]. This does not appear for directories created using iron create. Is this relevant?

Thanks again.

@BrooklynC BrooklynC reopened this Mar 11, 2015
@scottmcpherson
Copy link
Contributor

Hmm not familiar with WebStorm but are you trying to add packages using iron command or the meteor command. All of the meteor commands are mapped to iron. So if you're in the root of the project folder, you should be able to use > iron add some:package.

@BrooklynC
Copy link
Author

Hi Scott, added this to my last comment while you were typing:

When I cd into a project directory that I created using "meteor create", the directory is followed by a line of text like [master +2 ~0 -0 !]. This does not appear for directories created using iron create. Is this relevant?

I typically add projects using the meteor command, but I don't see how I can apply the iron file structure that way. But when created using the iron command, they aren't recognized as meteor.

@BrooklynC
Copy link
Author

I realize that line of text likely has to do with Git commits, was using Git shell, sorry to mix that up.

But still curious about which direction to create projects from. Thanks again.

@scottmcpherson
Copy link
Contributor

You should be able to use iron to create your project and then use iron commands in place meteor commands, unless WebStorm is somehow preventing that.

meteor = iron
meteor add my:package = iron add my:package
etc..

@BrooklynC
Copy link
Author

Thanks Scott, I was able to resolve by creating the project using "iron create", then taking the .meteor folder out of the app folder and moving it up a level into the project directory. Somehow, it wasn't being recognized where it was. Meteor commands now work, but iron commands do not:

"iron add aldeed:autoform" results in following error:

meteor add aldeed:autoform
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1001:11)
at Process.ChildProcess._handle.onexit (child_process.js:792:34)

@scottmcpherson
Copy link
Contributor

Does WebStorm have a built in console that your trying to run the commands from? What platform are you on?

Iron won't work if you move meteor out of the app directory.

@BrooklynC
Copy link
Author

WebStorm does have its own console for me to run command lines, but the same issues exist whether I use that or another shell (I was using Git Shell last night). I'm on Windows 8.

To the note I added about the text showing up after the project directory ([master...]) when running in Git Shell, I'm assuming this is realated to Git, but it only appears for projects I have created using "meteor create", never for ones by "iron create". Those just aren't being recognized as Meteor projects.

@cmather
Copy link
Contributor

cmather commented Mar 11, 2015

Any chance you could take a screenshot of the error and the command that produces it?

On Mar 11, 2015, at 7:14 AM, BrooklynC [email protected] wrote:

WebStorm does have its own console for me to run command lines, but the same issues exist whether I use that or another shell (I was using Git Shell last night). I'm on Windows 8.

To the note I added about the text showing up after the project directory ([master...]) when running in Git Shell, I'm assuming this is realated to Git, but it only appears for projects I have created using "meteor create", never for ones by "iron create". Those just aren't being recognized as Meteor projects.


Reply to this email directly or view it on GitHub.

@BrooklynC
Copy link
Author

Hey Chris, I'll do that tonight, thanks.

@BrooklynC
Copy link
Author

OK, I'm getting closer. It was unclear to me that the app directory IS the Meteor project, wrapped within the Iron project. I was under the impression that the Iron project and Meteor project were one and the same. Now I can open the Iron project in WebStorm and either:

  • run Iron commands (like iron g) while in the Iron directory (but not Meteor commands)
  • run cd app and run Meteor commands from there

I can't run Iron commands while in the app directory to add collections or to run Meteor. Screenshots attached. I assume I'm fine as long as Meteor commands work, please let me know if I'm mistaken. Thanks for all your help.

iron command error 1
iron command error 2

@cmather
Copy link
Contributor

cmather commented Mar 12, 2015

Thanks for the screenshots. I think you correctly discovered how it works.

But the screenshot illustrates a situation we should probably fix. I don't see any reason why you can't run the 'iron' command in any subdirectory. I think what's happening here is the default iron command is to run meteor run but it can't find the meteor app directory from the current directory. Looks like a bug.

If anyone wants to take a crack at this the fix, it should be pretty straight forward. See these lines:

@cmather
Copy link
Contributor

cmather commented Mar 20, 2015

Hey @BrooklynC, Did this get resolved?

@cmather cmather added this to the Triage milestone Mar 20, 2015
@BrooklynC
Copy link
Author

Hey Chris, thanks for checking in. It is resolved to the extent that I can work on and run the Meteor app as long as I am in the app directory. I still can't do anything if I am a level up. I saw your note asking if anyone wants to try to fix this, that's WAY beyond my abilities :-)

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

No branches or pull requests

4 participants