perak / kitchen-site

Meteor Kitchen site source code
MIT License
282 stars 38 forks source link

Plugin error using examples #263

Open lmaddio opened 8 years ago

lmaddio commented 8 years ago

When I try doing meteor-kitchen -JSON -OUTPUTDIRECTORY It gives error in: *** Meteor Kitchen v0.9.57 *** Meteor Application Generator - www.meteorkitchen.com Copyright (c) Petar Korponai─ç <petar.korponaic@gmail.com> Reading input file... Executing "meteor create D:\AllProjects\meteor\newpage\"... Created a new Meteor app in 'D:\AllProjects\meteor\newpage\'. To run your new app: cd D:\AllProjects\meteor\newpage\ meteor If you are new to Meteor, try some of the learning resources here: https://www.meteor.com/learn Creating directory structure... Checking installed packages... Executing "meteor remove insecure autopublish"... Changes to your project's package version selections: autopublish removed from your project insecure removed from your project insecure: removed dependency autopublish: removed dependency Checking installed packages... Executing "meteor add http email spiderable ejson random iron:router natestrauser:font-awesome matb33:collection-hooks copleykj:livestamp less nemo64:bootstrap perak:markdown reactive-dict mrt:moment rajit:bootstrap3-datepicker mizzao:bootboxjs"... Changes to your project's package version selections: copleykj:livestamp added, version 1.1.7 email added, version 1.0.8 iron:controller added, version 1.0.12 iron:core added, version 1.0.11 iron:dynamic-template added, version 1.0.12 iron:layout added, version 1.0.12 iron:location added, version 1.0.11 iron:middleware-stack added, version 1.0.11 iron:router added, version 1.0.12 iron:url added, version 1.0.11 less added, version 2.5.1 matb33:collection-hooks added, version 0.8.1 mizzao:bootboxjs added, version 4.4.0 momentjs:moment added, version 2.9.0 mrt:moment added, version 2.8.1 natestrauser:font-awesome added, version 4.5.0 nemo64:bootstrap added, version 3.3.5_2 nemo64:bootstrap-data added, version 3.3.5 perak:markdown added, version 1.0.5 rajit:bootstrap3-datepicker added, version 1.5.1 spiderable added, version 1.0.9 http: Make HTTP calls to remote servers email: Send email messages spiderable: Makes the application crawlable to web spiders ejson: Extended and Extensible JSON library random: Random number generator and utilities iron:router: Routing specifically designed for Meteor natestrauser:font-awesome: Latest version Font-Awesome loaded via CDN matb33:collection-hooks: Extends Mongo.Collection with before/after hooks for insert/update/remove/find/findOne copleykj:livestamp: jQuery plugin providing auto-updating timeago text to your timestamped HTML elements using Moment.js less: Leaner CSS language nemo64:bootstrap: Highly configurable bootstrap integration. perak:markdown: GitHub flavored markdown parser for Meteor based on marked.js reactive-dict: Reactive dictionary mrt:moment: Moment.js, a JavaScript date library for dates, packaged for Meteor. See http://momentjs.com. rajit:bootstrap3-datepicker: Meteor packaging of eternicode/bootstrap-datepicker for Bootstrap 3 mizzao:bootboxjs: Programmatic dialog boxes using Twitter's bootstrap modals Creating router... Using theme "bootswatch-cyborg"... Copying theme files... Creating stylesheet... Creating layout... Creating zone "free_zone"... Creating component "main_menu"... Creating page "home"... Creating component "jumbotron"... Creating component "jumbotron_content"... Creating component "section1"... Creating component "content1"... Creating component "three_columns"... Creating component "section2"... Plugin "example2"... Executing plugin... undefined:1 {name:plugin-1,type:example2,output_html:C:\Users\SONYVA~1\AppData\Local\Temp\VsCxGgBwKf.html,output_js:C:\Users\SONYVA~1\AppData\Local\Temp\VsCxGgBwKf.js} ^ SyntaxError: Unexpected token n at Object.parse (native) at D:\AllProjects\meteor-kitchen\node_modules\meteor-kitchen.js:7:21 at Array.forEach (native) at Object.exports.getInput (D:\AllProjects\meteor-kitchen\node_modules\meteor-kitchen.js:5:15) at Object.<anonymous> (D:\AllProjects\meteor-kitchen\plugins\example2\plugin.js:15:21) at Module._compile (module.js:398:26) at Object.Module._extensions..js (module.js:405:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Function.Module.runMain (module.js:430:10) Creating component "plugin-1"... File not found "C:\Users\SONYVA~1\AppData\Local\Temp\VsCxGgBwKf.html".

lmaddio commented 8 years ago

I have been looking for the code in "meteor-kitchen.js" and I found out that the JSON.parse(val) is failing because the argument val is not a proper JSON, It's left the quotes in everyplace, and it also left to escape the "\" for the path. Sorry for the english if any mistake.

perak commented 8 years ago

@lmaddio thank you! I'll see what I can do (in next release 0.9.58)

adnoh commented 8 years ago

Would be cool to get this working - currently no chance to use plugins from within windows.

perak commented 8 years ago

@adnoh busy with new gui and react implementation. BTW, there are big plans related to plugin system (central repository, server-side plugins etc.) but priority is new gui and react... so please be patient. Sorry.

perak commented 8 years ago

What I can do is to fix bug found by @lmaddio (argument string passed to plugin is not properly escaped/valid json)

adnoh commented 8 years ago

@perak understanding the time issue. I'd use custom_component as a workaround but don'the see any chance to get data to a custom_component which dies not belong to a collection. If I could also pass a 'properties' object to it like in plugin it would be a workaround for most of the stuff. custom_data_code is not generated. Problem looks like it generates json on which the keys AND the values are not quoted (so YSON.parse (val) failes). I've tried to hack a regex in the node module which corrects the missing quotes just before the call...but failed with not enough regex knowhow ;) Willing to help if somebody points me to the right direction/regexp.

perak commented 8 years ago

@adnoh Isee you started hacking to much :D Let me promise: I'll fix this issue for you tomorrow (~24 hours after now). Would that work?

adnoh commented 8 years ago

Would be great ;) one time hacker-always hacker