You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
generation of the whole Collection related code is suppressed,
the code regarding any joins defined on that Collection is not suppressed
Thus startup errors appear:
ReferenceError: Submissions is not defined
W20160311-08:13:29.531(2)? (STDERR) at both/joins/joins.coffee:2:1
W20160311-08:13:29.531(2)? (STDERR) at both/joins/joins.coffee:2:1
I looked at ~/.meteor-kitchen/templates/blaze/code/collection_shared.js but that part seems unrelated as it is not rendered at all into both/collections/submissions.coffee @perak Can you confirm that this happens because of code inside kitchen_cli, and add a bug tag?
The text was updated successfully, but these errors were encountered:
The above only happens like described with the --coffee option.
Skipping --coffee actually points to the root problem: the object literal in .meteor-kitchen/templates/blaze/code/collection_shared_schema.js has unescaped keys which prevents defining schema keys containing .like field.$.array_member_field
A most dirty hack around proper escaping is replacing the contents of collection_shared_schema.js with the snippet below.
this.Schemas = this.Schemas || {};
var objKeysRegex = /({|,)(?:\s*)(?:')?([A-Za-z_$\.][A-Za-z0-9_ \-\.$]*)(?:')?(?:\s*):/g;
var json = `SIMPLE_SCHEMA`.replace(objKeysRegex, "$1\"\$2\":"); console.log(json);
eval( "json="+json);
this.Schemas.COLLECTION_VAR = new SimpleSchema(json);
this.COLLECTION_VAR.attachSchema(this.Schemas.COLLECTION_VAR);
The hack is dirty in so many ways:
it uses ES6 string template literals
it does evil-eval
it breaks coffeescript generation completely because ES6 does not work for js2coffee
EDIT: it will break if you use : in field name, but why would you want to do that?
@perak On another note: Where is the output of js2coffee? Do you send it to some file or just /dev/null?
Hi,
When adding any
SimpleSchema
array content type checking the output of the collection definition is skipped altogether.Say you have this fields in a collection definition:
Collection
related code is suppressed,Collection
is not suppressedThus startup errors appear:
I looked at
~/.meteor-kitchen/templates/blaze/code/collection_shared.js
but that part seems unrelated as it is not rendered at all intoboth/collections/submissions.coffee
@perak Can you confirm that this happens because of code inside kitchen_cli, and add a
bug
tag?The text was updated successfully, but these errors were encountered: