Permalink
Browse files

Command line task to extract moog definitions for use by the document…

…ation generator
  • Loading branch information...
1 parent c588dd5 commit 94fba76698a1df9eb9f39be160e3430269cc0258 @boutell boutell committed Jul 30, 2016
View
@@ -5,12 +5,17 @@ npm-debug.log
*.npmignore
node_modules
test/node_modules
-# We do not commit CSS, only LESS
+
+# We do not commit CSS, only LESS, with the exception of a few vendor CSS files we don't have LESS for
*/public/css/*.css
+lib/modules/*/public/css/*.css
+lib/modules/apostrophe-assets/public/css/vendor/cropper.css
+lib/modules/apostrophe-assets/public/css/vendor/pikaday.css
+lib/modules/apostrophe-ui/public/css/vendor/font-awesome/font-awesome.css
# Dont commit test generated css
test/public/css/*.css
test/public/css/master-*.less
# Dont commit test uploads
-test/public/uploads
+test/public/uploads
@@ -1,7 +1,7 @@
var _ = require('lodash');
var fs = require('fs');
-// Assists in generating documentation for A2. Normally disabled.
+// Assists in generating documentation for A2
module.exports = {
enabled: false,
@@ -13,21 +13,21 @@ module.exports = {
req.scene = 'user';
return self.sendPage(req, 'scripts', {});
});
- self.modulesReady = function() {
- console.log('Server side definitions');
- console.log(self.apos.synth.definitions);
- console.log('browser side definitions');
+ self.apos.tasks.add('apostrophe-documentation', 'extract-moog-types', function(callback) {
+ console.log('Fetching server side definitions');
+ fs.writeFileSync(self.apos.rootDir + '/data/server-types.json', JSON.stringify(self.apos.synth.definitions));
+ console.log('Fetching browser side definitions');
self.apos.options.afterListen = function() {
console.log('in afterListen');
return require('child_process').exec('phantomjs ' + __dirname + '/phantomjs-print-definitions.js', function(err, stdout, stderr) {
- console.log('hi mom');
if (err) {
throw err;
}
- console.log(stdout);
- // process.exit(0);
+ fs.writeFileSync(self.apos.rootDir + '/data/browser-types.json', stdout);
+ process.exit(0);
});
};
- };
+ self.apos.listen();
+ });
}
};
@@ -4,13 +4,10 @@ page.onConsoleMessage = function(msg, lineNum, sourceId) {
console.log(msg);
};
page.open(url, function (status) {
- console.log('in callback');
if ( status !== "success" ) {
- console.log('status was', status);
throw status;
}
setTimeout(function() {
- console.log('exiting');
phantom.exit();
}, 5000);
});
@@ -1,8 +1,8 @@
-{% extends data.outerLayout %}
-{% block main %}
+{{ apos.assets.scripts(data.when) }}
<script type="text/javascript">
+ {{ data.js.globalCalls }}
+ {{ data.js.reqCalls }}
setTimeout(function() {
console.log(JSON.stringify(apos.synth.definitions, null, ' '));
}, 500);
</script>
-{% endblock %}

0 comments on commit 94fba76

Please sign in to comment.