perak / kitchen-examples

Meteor Kitchen examples
164 stars 115 forks source link

Cryptic input file missing messages: Error: input file not found "/var/tmp/LrFkQyUqFj.json" #23

Open kaustavha opened 9 years ago

kaustavha commented 9 years ago

Sometimes when spawning the meteor kitchen generator from a nodejs spawn I get this message. Appears to only happen on yaml files. Thought? Any ideas what could be causing this?

Spawning: meteor-kitchen example-subpages.yaml /Dev/meteor/examples/kitchen-examples/example-subpages/example-subpages_yaml
*** Meteor Kitchen v0.9.47 ***
Meteor Application Generator - www.meteorkitchen.com
Copyright (c) Petar Korponaić
<petar.korponaic@gmail.com>

Converting yaml to json using "js-yaml"...

Error: input file not found "/var/tmp/LrFkQyUqFj.json".
perak commented 9 years ago

hi. when input is yaml, meteor-kitchen executes js-yaml to convert yaml to json. json is written to your temp directory with "cryptic" name where meteor-kitchen reads it and continues running. Now, looks like that file is not found after conversion. maybe some issue with access rights...? btw, what OS you are using? (and I suggest you to update kitchen to 0.9.48) On Aug 15, 2015 19:54, "Kaustav Haldar" notifications@github.com wrote:

Sometimes when spawning the meteor kitchen generator from a nodejs spawn I get this message. Appears to only happen on yaml files. Thought? Any ideas what could be causing this?

Spawning: meteor-kitchen example-subpages.yaml /Dev/meteor/examples/kitchen-examples/example-subpages/example-subpages_yaml * Meteor Kitchen v0.9.47 * Meteor Application Generator - www.meteorkitchen.com Copyright (c) Petar Korponaić petar.korponaic@gmail.com

Converting yaml to json using "js-yaml"...

Error: input file not found "/var/tmp/LrFkQyUqFj.json".

— Reply to this email directly or view it on GitHub https://github.com/perak/kitchen-examples/issues/23.

kaustavha commented 9 years ago

Hey, So my OS is OSX 10.10.3. The folder /var/tmp seems to have the correct permissions. Upgraded to 0.9.48 meteor kitchen, and tried running the spawns with sudo (uid: 0) and running them in series with async but didnt remedy the problem. This is the script if you wanna run it and see if something obvious pops up. Atm its run by going coffee <scriptname> in the kitchen examples folder. https://gist.github.com/kaustavha/f2ba6aded5d946813eef Sorry if it isnt very readable atm.

kaustavha commented 9 years ago

Hey running it as a eachSeries loop fixed it, there was also a couple bugs with the initial script, perhaps there was something going wrong due to all the async spawning and file writing. The script might be interesting to you though since there doesn't seem to be a test runner for this project. Feel free to close this issue

perak commented 9 years ago

@kaustavha OK, cool.

But, I'm just curious - what are you doing/trying to do with this script?

kaustavha commented 9 years ago

@perak I was/am trying to evaluate if meteor kitchen is a worthwhile project to use to build mobile apps with for a couple of startups I'm loosely associated with/cofounding.

Part of that process is to just check to see if all the examples here work. The human ones dont but thats acceptable and there was one example that didnt work but should've. May file an issue/pr for it next weekend. This also allows me to see if the examples actually render out to whats expected since code you've put online may have been changed between generation and deploy.

And i had a non-trivial example working but the yaml file got rather large and unwieldily and i started getting strange errors (not these, something about a misquoted character string when running with the -jc opt). So i plan on hopefully making an example with a multipart yaml file before moving ahead. And that should get rid of the errors, I'm prolly mis-indenting somewhere. But I found myself compiling it with different options/sources and hopefully this script will help me there as well to more easily spot differences between versions and spot where bugs creep up. Figure out if it's better to use a different tool than meteor-kitchen uses to convert files.

The other error was with buttons not rendering properly on mobile (android and ios emulators on a mac). Part of what i want/need to do is package it as a mobile app. So gonna need to take a look at that as well. Perhaps its a simple emulator bug(doubt it).

Sorry for delays replying, this is kind of a weekends project and I'm usually occupied by my fulltime job, which comes with way too many repositories sending me alerts, drowning out relevant things. Need to fix that.

Kinda wish this project was open source, since it's sort of like googles yeoman, but significantly more feature complete. And that way I could port it to use better tested ui libraries like materialize and add stylus as a css output option. But open sourcing things brings its own headaches.

perak commented 9 years ago

Hi @kaustavha

Thanks for detailed review.

I am using simple shell script to build all examples. Always testing before deploying new version, so I'm surprised that some of examples doesn't work. Script looks like this:

#!/bin/sh

set -e
cd ~/meteor/

CLEAN="clean"

if [ "$1" = "$CLEAN" ]; then
    rm -rf ./example-dataview
    rm -rf ./example-subpages
    rm -rf ./example-minimal
    rm -rf ./example-plugins
    rm -rf ./example-accounts
    rm -rf ./example-admin
    rm -rf ./example-invoices
    rm -rf ./example-onepage
    rm -rf ./example-markdowned
    rm -rf ./example-photosharing
    rm -rf ./example-upload
    rm -rf ./example-iot
    rm -rf ./example-geiger
    rm -rf ./example-ide
    rm -rf ./example-human
    rm -rf ./example-human-iot
    rm -rf ./example-human2machine
    rm -rf ./example-semantic
fi

meteor-kitchen --example-dataview ./example-dataview
meteor-kitchen --example-subpages ./example-subpages
meteor-kitchen --example-minimal ./example-minimal
meteor-kitchen --example-plugins ./example-plugins
meteor-kitchen --example-accounts ./example-accounts
meteor-kitchen --example-admin ./example-admin
meteor-kitchen --example-onepage ./example-onepage
meteor-kitchen --example-invoices ./example-invoices
meteor-kitchen --example-markdowned ./example-markdowned
meteor-kitchen --example-photosharing ./example-photosharing
meteor-kitchen --example-upload ./example-upload
meteor-kitchen --example-iot ./example-iot
meteor-kitchen --example-geiger ./example-geiger
meteor-kitchen --example-ide ./example-ide
meteor-kitchen --example-human ./example-human
meteor-kitchen --example-human-iot ./example-human-iot
meteor-kitchen --example-human2machine ./example-human2machine
meteor-kitchen --example-semantic ./example-semantic

All examples are built properly and I'm executing each one to see if everything looks and works as expected (well, that's not fully automated test and maybe sometimes I miss something).

Examples are built from json (not from yaml) - I am not testing that - so maybe this is why some examples don't work for you (maybe some problem with json to yaml converter?). I'l check that (maybe this weekend).

I didn't have issue with buttons on android (don't know about iOS).

For mobile apps, I got fork of meteor kitchen that can build android .apk on single click, but my server doesn't have enough RAM, so I didn't publish it. Screenshot:

android

Meteor Kitchen is my hobby/weekend project, and I'm occupied with my "regular" freelancing job too :)

I'm preparing to open-source it - cleaning up the code and writing docs, I belive I'l publish the code in couple of weeks. Here is repo for that: https://github.com/perak/kitchen-cli

Feel free to contact me if you have more issues and questions. :+1:

perak commented 9 years ago

One more thing:

there is no -jc option (it doesn't work), you need to use -j -c to produce jade + coffee.

And yet another possible issue is that I am not regularly testing examples converted to coffe / jade, maybe that's why you got issues.

What 100% is working (tested) is generate examples from json producing js + html

I'l try to play with yaml -> coffee/jade too to catch possible bugs.

Thank you again for reporting issues.