diff --git a/examples/flow-example/.meteor/.finished-upgraders b/examples/flow-example/.meteor/.finished-upgraders new file mode 100644 index 0000000..8a76103 --- /dev/null +++ b/examples/flow-example/.meteor/.finished-upgraders @@ -0,0 +1,8 @@ +# This file contains information which helps Meteor properly upgrade your +# app when you run 'meteor update'. You should check it into version control +# with your project. + +notices-for-0.9.0 +notices-for-0.9.1 +0.9.4-platform-file +notices-for-facebook-graph-api-2 diff --git a/examples/flow-example/.meteor/.gitignore b/examples/flow-example/.meteor/.gitignore new file mode 100644 index 0000000..4083037 --- /dev/null +++ b/examples/flow-example/.meteor/.gitignore @@ -0,0 +1 @@ +local diff --git a/examples/flow-example/.meteor/.id b/examples/flow-example/.meteor/.id new file mode 100644 index 0000000..c4b53f7 --- /dev/null +++ b/examples/flow-example/.meteor/.id @@ -0,0 +1,7 @@ +# This file contains a token that is unique to your project. +# Check it into your repository along with the rest of this directory. +# It can be used for purposes such as: +# - ensuring you don't accidentally deploy one app on top of another +# - providing package authors with aggregated statistics + +1nina3n1bv46e61rs3xrt diff --git a/examples/flow-example/.meteor/packages b/examples/flow-example/.meteor/packages new file mode 100644 index 0000000..3d0420e --- /dev/null +++ b/examples/flow-example/.meteor/packages @@ -0,0 +1,14 @@ +# Meteor packages used by this project, one per line. +# Check this file (and the other files in this directory) into your repository. +# +# 'meteor add' and 'meteor remove' will edit this file for you, +# but you can also edit it by hand. + +meteor-platform +msgfmt:core +msgfmt:extract +msgfmt:ui +meteorhacks:flow-router +meteorhacks:flow-layout +accounts-password +accounts-ui diff --git a/examples/flow-example/.meteor/platforms b/examples/flow-example/.meteor/platforms new file mode 100644 index 0000000..efeba1b --- /dev/null +++ b/examples/flow-example/.meteor/platforms @@ -0,0 +1,2 @@ +server +browser diff --git a/examples/flow-example/.meteor/release b/examples/flow-example/.meteor/release new file mode 100644 index 0000000..dab6b55 --- /dev/null +++ b/examples/flow-example/.meteor/release @@ -0,0 +1 @@ +METEOR@1.1.0.2 diff --git a/examples/flow-example/.meteor/versions b/examples/flow-example/.meteor/versions new file mode 100644 index 0000000..e844418 --- /dev/null +++ b/examples/flow-example/.meteor/versions @@ -0,0 +1,68 @@ +accounts-base@1.2.0 +accounts-password@1.1.1 +accounts-ui@1.1.5 +accounts-ui-unstyled@1.1.7 +amplify@1.0.0 +autoupdate@1.2.1 +base64@1.0.3 +binary-heap@1.0.3 +blaze@2.1.2 +blaze-tools@1.0.3 +boilerplate-generator@1.0.3 +callback-hook@1.0.3 +check@1.0.5 +coffeescript@1.0.6 +cosmos:browserify@0.1.4 +ddp@1.1.0 +deps@1.0.7 +ejson@1.0.6 +email@1.0.6 +fastclick@1.0.3 +geojson-utils@1.0.3 +html-tools@1.0.4 +htmljs@1.0.4 +http@1.1.0 +id-map@1.0.3 +jag:pince@0.0.6 +jquery@1.11.3_2 +json@1.0.3 +launch-screen@1.0.2 +less@1.0.14 +livedata@1.0.13 +localstorage@1.0.3 +logging@1.0.7 +meteor@1.1.6 +meteor-platform@1.2.2 +meteorhacks:flow-layout@1.3.0 +meteorhacks:flow-router@1.9.0 +meteorhacks:inject-initial@1.0.2 +minifiers@1.1.5 +minimongo@1.0.8 +mobile-status-bar@1.0.3 +mongo@1.1.0 +msgfmt:core@2.0.0-preview.12 +msgfmt:extract@2.0.0-preview.8 +msgfmt:ui@2.0.0-preview.3 +npm-bcrypt@0.7.8_2 +observe-sequence@1.0.6 +ordered-dict@1.0.3 +raix:eventemitter@0.1.2 +random@1.0.3 +reactive-dict@1.1.0 +reactive-var@1.0.5 +reload@1.1.3 +retry@1.0.3 +routepolicy@1.0.5 +service-configuration@1.0.4 +session@1.1.0 +sha@1.0.3 +spacebars@1.0.6 +spacebars-compiler@1.0.6 +srp@1.0.3 +templating@1.1.1 +tracker@1.0.7 +ui@1.0.6 +underscore@1.0.3 +url@1.0.4 +webapp@1.2.0 +webapp-hashing@1.0.3 diff --git a/examples/flow-example/client/FlowTest.css b/examples/flow-example/client/FlowTest.css new file mode 100644 index 0000000..b6b4052 --- /dev/null +++ b/examples/flow-example/client/FlowTest.css @@ -0,0 +1 @@ +/* CSS declarations go here */ diff --git a/examples/flow-example/client/FlowTest.html b/examples/flow-example/client/FlowTest.html new file mode 100644 index 0000000..8617969 --- /dev/null +++ b/examples/flow-example/client/FlowTest.html @@ -0,0 +1,10 @@ + + + diff --git a/examples/flow-example/client/FlowTest.js b/examples/flow-example/client/FlowTest.js new file mode 100644 index 0000000..c26b48a --- /dev/null +++ b/examples/flow-example/client/FlowTest.js @@ -0,0 +1,23 @@ +// if (Meteor.isClient) { +// // counter starts at 0 +// Session.setDefault('counter', 0); +// +// Template.hello.helpers({ +// counter: function () { +// return Session.get('counter'); +// } +// }); +// +// Template.hello.events({ +// 'click button': function () { +// // increment the counter when button is clicked +// Session.set('counter', Session.get('counter') + 1); +// } +// }); +// } +// +// if (Meteor.isServer) { +// Meteor.startup(function () { +// // code to run on server at startup +// }); +// } diff --git a/examples/flow-example/client/layout.html b/examples/flow-example/client/layout.html new file mode 100644 index 0000000..ce248e9 --- /dev/null +++ b/examples/flow-example/client/layout.html @@ -0,0 +1,4 @@ + diff --git a/examples/flow-example/client/router.js b/examples/flow-example/client/router.js new file mode 100644 index 0000000..77ac5ff --- /dev/null +++ b/examples/flow-example/client/router.js @@ -0,0 +1,5 @@ +FlowRouter.route('/', { + action: function(params) { + FlowLayout.render('layout', { top: "header", main: "hello" }); + } +}); diff --git a/examples/flow-example/packages/msgfmt:core b/examples/flow-example/packages/msgfmt:core new file mode 120000 index 0000000..1250e60 --- /dev/null +++ b/examples/flow-example/packages/msgfmt:core @@ -0,0 +1 @@ +/Users/tomi/Documents/Programming/Github/meteor-messageformat/msgfmt:core/ \ No newline at end of file diff --git a/examples/flow-example/packages/msgfmt:extract b/examples/flow-example/packages/msgfmt:extract new file mode 120000 index 0000000..553e0e3 --- /dev/null +++ b/examples/flow-example/packages/msgfmt:extract @@ -0,0 +1 @@ +/Users/tomi/Documents/Programming/Github/meteor-messageformat/msgfmt:extract/ \ No newline at end of file diff --git a/examples/flow-example/packages/msgfmt:ui b/examples/flow-example/packages/msgfmt:ui new file mode 120000 index 0000000..14e9a8a --- /dev/null +++ b/examples/flow-example/packages/msgfmt:ui @@ -0,0 +1 @@ +/Users/tomi/Documents/Programming/Github/meteor-messageformat/msgfmt:ui \ No newline at end of file diff --git a/examples/flow-example/server/config.js b/examples/flow-example/server/config.js new file mode 100644 index 0000000..0b0b73e --- /dev/null +++ b/examples/flow-example/server/config.js @@ -0,0 +1 @@ +msgfmt.init('en'); diff --git a/examples/flow-example/server/extracts.msgfmt b/examples/flow-example/server/extracts.msgfmt new file mode 100644 index 0000000..1dfddc6 --- /dev/null +++ b/examples/flow-example/server/extracts.msgfmt @@ -0,0 +1 @@ +# Used by server/extracts.msgfmt~, do not delete. diff --git a/examples/iron-example/.meteor/.finished-upgraders b/examples/iron-example/.meteor/.finished-upgraders new file mode 100644 index 0000000..8a76103 --- /dev/null +++ b/examples/iron-example/.meteor/.finished-upgraders @@ -0,0 +1,8 @@ +# This file contains information which helps Meteor properly upgrade your +# app when you run 'meteor update'. You should check it into version control +# with your project. + +notices-for-0.9.0 +notices-for-0.9.1 +0.9.4-platform-file +notices-for-facebook-graph-api-2 diff --git a/examples/iron-example/.meteor/.gitignore b/examples/iron-example/.meteor/.gitignore new file mode 100644 index 0000000..4083037 --- /dev/null +++ b/examples/iron-example/.meteor/.gitignore @@ -0,0 +1 @@ +local diff --git a/examples/iron-example/.meteor/.id b/examples/iron-example/.meteor/.id new file mode 100644 index 0000000..c4b53f7 --- /dev/null +++ b/examples/iron-example/.meteor/.id @@ -0,0 +1,7 @@ +# This file contains a token that is unique to your project. +# Check it into your repository along with the rest of this directory. +# It can be used for purposes such as: +# - ensuring you don't accidentally deploy one app on top of another +# - providing package authors with aggregated statistics + +1nina3n1bv46e61rs3xrt diff --git a/examples/iron-example/.meteor/packages b/examples/iron-example/.meteor/packages new file mode 100644 index 0000000..295169f --- /dev/null +++ b/examples/iron-example/.meteor/packages @@ -0,0 +1,13 @@ +# Meteor packages used by this project, one per line. +# Check this file (and the other files in this directory) into your repository. +# +# 'meteor add' and 'meteor remove' will edit this file for you, +# but you can also edit it by hand. + +meteor-platform +msgfmt:core +msgfmt:extract +msgfmt:ui +iron:router +accounts-password +accounts-ui diff --git a/examples/iron-example/.meteor/platforms b/examples/iron-example/.meteor/platforms new file mode 100644 index 0000000..efeba1b --- /dev/null +++ b/examples/iron-example/.meteor/platforms @@ -0,0 +1,2 @@ +server +browser diff --git a/examples/iron-example/.meteor/release b/examples/iron-example/.meteor/release new file mode 100644 index 0000000..dab6b55 --- /dev/null +++ b/examples/iron-example/.meteor/release @@ -0,0 +1 @@ +METEOR@1.1.0.2 diff --git a/examples/iron-example/.meteor/versions b/examples/iron-example/.meteor/versions new file mode 100644 index 0000000..e61246d --- /dev/null +++ b/examples/iron-example/.meteor/versions @@ -0,0 +1,73 @@ +accounts-base@1.2.0 +accounts-password@1.1.1 +accounts-ui@1.1.5 +accounts-ui-unstyled@1.1.7 +amplify@1.0.0 +autoupdate@1.2.1 +base64@1.0.3 +binary-heap@1.0.3 +blaze@2.1.2 +blaze-tools@1.0.3 +boilerplate-generator@1.0.3 +callback-hook@1.0.3 +check@1.0.5 +coffeescript@1.0.6 +ddp@1.1.0 +deps@1.0.7 +ejson@1.0.6 +email@1.0.6 +fastclick@1.0.3 +geojson-utils@1.0.3 +html-tools@1.0.4 +htmljs@1.0.4 +http@1.1.0 +id-map@1.0.3 +iron:controller@1.0.7 +iron:core@1.0.7 +iron:dynamic-template@1.0.7 +iron:layout@1.0.7 +iron:location@1.0.7 +iron:middleware-stack@1.0.7 +iron:router@1.0.7 +iron:url@1.0.7 +jag:pince@0.0.6 +jquery@1.11.3_2 +json@1.0.3 +launch-screen@1.0.2 +less@1.0.14 +livedata@1.0.13 +localstorage@1.0.3 +logging@1.0.7 +meteor@1.1.6 +meteor-platform@1.2.2 +meteorhacks:inject-initial@1.0.2 +minifiers@1.1.5 +minimongo@1.0.8 +mobile-status-bar@1.0.3 +mongo@1.1.0 +msgfmt:core@2.0.0-preview.12 +msgfmt:extract@2.0.0-preview.8 +msgfmt:ui@2.0.0-preview.3 +npm-bcrypt@0.7.8_2 +observe-sequence@1.0.6 +ordered-dict@1.0.3 +raix:eventemitter@0.1.2 +random@1.0.3 +reactive-dict@1.1.0 +reactive-var@1.0.5 +reload@1.1.3 +retry@1.0.3 +routepolicy@1.0.5 +service-configuration@1.0.4 +session@1.1.0 +sha@1.0.3 +spacebars@1.0.6 +spacebars-compiler@1.0.6 +srp@1.0.3 +templating@1.1.1 +tracker@1.0.7 +ui@1.0.6 +underscore@1.0.3 +url@1.0.4 +webapp@1.2.0 +webapp-hashing@1.0.3 diff --git a/examples/iron-example/client/FlowTest.css b/examples/iron-example/client/FlowTest.css new file mode 100644 index 0000000..b6b4052 --- /dev/null +++ b/examples/iron-example/client/FlowTest.css @@ -0,0 +1 @@ +/* CSS declarations go here */ diff --git a/examples/iron-example/client/FlowTest.html b/examples/iron-example/client/FlowTest.html new file mode 100644 index 0000000..8617969 --- /dev/null +++ b/examples/iron-example/client/FlowTest.html @@ -0,0 +1,10 @@ + + + diff --git a/examples/iron-example/client/FlowTest.js b/examples/iron-example/client/FlowTest.js new file mode 100644 index 0000000..c26b48a --- /dev/null +++ b/examples/iron-example/client/FlowTest.js @@ -0,0 +1,23 @@ +// if (Meteor.isClient) { +// // counter starts at 0 +// Session.setDefault('counter', 0); +// +// Template.hello.helpers({ +// counter: function () { +// return Session.get('counter'); +// } +// }); +// +// Template.hello.events({ +// 'click button': function () { +// // increment the counter when button is clicked +// Session.set('counter', Session.get('counter') + 1); +// } +// }); +// } +// +// if (Meteor.isServer) { +// Meteor.startup(function () { +// // code to run on server at startup +// }); +// } diff --git a/examples/iron-example/client/layout.html b/examples/iron-example/client/layout.html new file mode 100644 index 0000000..ce248e9 --- /dev/null +++ b/examples/iron-example/client/layout.html @@ -0,0 +1,4 @@ + diff --git a/examples/iron-example/client/router.js b/examples/iron-example/client/router.js new file mode 100644 index 0000000..53bdc7d --- /dev/null +++ b/examples/iron-example/client/router.js @@ -0,0 +1,3 @@ +Router.route('/', function () { + this.render('hello'); +}); diff --git a/examples/iron-example/packages/msgfmt:core b/examples/iron-example/packages/msgfmt:core new file mode 120000 index 0000000..1250e60 --- /dev/null +++ b/examples/iron-example/packages/msgfmt:core @@ -0,0 +1 @@ +/Users/tomi/Documents/Programming/Github/meteor-messageformat/msgfmt:core/ \ No newline at end of file diff --git a/examples/iron-example/packages/msgfmt:extract b/examples/iron-example/packages/msgfmt:extract new file mode 120000 index 0000000..553e0e3 --- /dev/null +++ b/examples/iron-example/packages/msgfmt:extract @@ -0,0 +1 @@ +/Users/tomi/Documents/Programming/Github/meteor-messageformat/msgfmt:extract/ \ No newline at end of file diff --git a/examples/iron-example/packages/msgfmt:ui b/examples/iron-example/packages/msgfmt:ui new file mode 120000 index 0000000..14e9a8a --- /dev/null +++ b/examples/iron-example/packages/msgfmt:ui @@ -0,0 +1 @@ +/Users/tomi/Documents/Programming/Github/meteor-messageformat/msgfmt:ui \ No newline at end of file diff --git a/examples/iron-example/server/config.js b/examples/iron-example/server/config.js new file mode 100644 index 0000000..0b0b73e --- /dev/null +++ b/examples/iron-example/server/config.js @@ -0,0 +1 @@ +msgfmt.init('en'); diff --git a/examples/iron-example/server/extracts.msgfmt b/examples/iron-example/server/extracts.msgfmt new file mode 100644 index 0000000..1dfddc6 --- /dev/null +++ b/examples/iron-example/server/extracts.msgfmt @@ -0,0 +1 @@ +# Used by server/extracts.msgfmt~, do not delete. diff --git a/msgfmt:extract/extract.js b/msgfmt:extract/extract.js index b8670f2..08054e2 100644 --- a/msgfmt:extract/extract.js +++ b/msgfmt:extract/extract.js @@ -41,7 +41,7 @@ var checkForUpdates = function(m, force) { var walker = walk.walk(relUp, { followLinks: false, - filters: [ + filters: [ /\/\.[^\.]+\// // skip .directories (hidden) ] }); @@ -211,7 +211,7 @@ var boundCheck = Meteor.bindEnvironment(checkForUpdates); // https://github.com/meteor/meteor/pull/3704/files process.on('SIGUSR2', boundCheck); // Meteor < 1.0.4 -process.on('SIGHUP', boundCheck); // Meteor >= 1.0.4 +process.on('SIGHUP', boundCheck); // Meteor >= 1.0.4 process.on('message', boundCheck); // Meteor >= 1.0.4 // No reason to block startup, we can do update gradually asyncronously @@ -238,7 +238,7 @@ Meteor.startup(function() { }); checkForUpdates(); -}); +}); /* handler helpers */ @@ -254,7 +254,7 @@ var lastFile = null; function logKey(file, key, text, file, line, strings) { if (strings[key] && strings[key].text != text) log.warn('{ ' + key + ': "' + text + '" } in ' - + file + ':' + line + ' replaces DUP_KEY\n { ' + + file + ':' + line + ' replaces DUP_KEY { ' + key + ': "' + strings[key].text + '" } in ' + strings[key].file + ':' + strings[key].line); @@ -266,7 +266,11 @@ function logKey(file, key, text, file, line, strings) { log.trace(file); } - log.trace('* ' + key + ': "' + text.replace(/\s+/g, ' ') + '"'); + log.trace('* ' + key + ': "' + (text ? text.replace(/\s+/g, ' ') : "NO TEXT") + '"'); +} + +function checkText(text, key) { + return (text == null || text == '' || text == "''" || text == '"') ? ("<" + key + ">" ) : text; } /* handlers */ @@ -278,12 +282,13 @@ handlers.html = function(file, data, mtime, strings) { var result, re; // {{mf "key" 'text' attr1=val1 attr2=val2 etc}} - re = /{{[\s]?mf (['"])(.*?)\1 ?(["'])(.*?)\3(.*?)}}/g; + re = /\{\{[\s]?mf ['"](.*?)['"] ?(["'](.*?)['"])?(.*?)\}\}/g; while (result = re.exec(data)) { - var key = result[2], text = result[4], attributes = attrDict(result[5]); + var key = result[1], text = result[3], attributes = attrDict(result[4]); var tpl = /