Permalink
Browse files

Made the index file more readable

  • Loading branch information...
1 parent 07529ef commit 9dbcbb32aa0023c74774b2646f2339f1028513c0 @3rd-Eden 3rd-Eden committed Jul 12, 2012
Showing with 65 additions and 10 deletions.
  1. +65 −10 static/index.js
View
@@ -1,24 +1,79 @@
-var path = require('path')
- , file = path.join(process.env.PWD, 'package.json')
- , pkg;
+"use strict";
-try { pkg = require(file); }
-catch (e) { pkg = {}; }
+// try to parse out the package.json as we want to use some data from it to fill
+// in our defaults
+var packagejson;
+try { packagejson = require(require('path').join(process.env.PWD, 'package.json')); }
+catch (e) { packagejson = {}; }
+
+/**
+ * The default configuration for the square.json files.
+ *
+ * @type {Object}
+ */
module.exports = {
- // output config
+ /**
+ * Default configuration output. This is where the different distribution
+ * are written to.
+ *
+ * The keys in this Object are the type's of distribution and the value is
+ * the path where the files should be written to.
+ *
+ * If there are no differences path, you can also specify this as an String
+ * instead of an Object.
+ *
+ * @type {Mixed}
+ */
+
dist: {
min: '~/square.{type}.{ext}'
, dev: '~/square.{type}.{ext}'
}
- // plugin configuration
+ /**
+ * Dedicated configuration section for the plugins. The key of this Object
+ * should be the name of the plugin in lowercase and the value an Object
+ * with the options that you wish to configure.
+ *
+ * @type {Object}
+ */
+
, plugins: {}
- // hinting and linting
+ /**
+ * List of platforms that can be used to target specifically in stylus..
+ *
+ * @type {Array}
+ */
+
+ , platforms: ['android', 'iphone', 'ipad', 'web']
+
+ /**
+ * Code quality is always important, so we have list of the jshint and the
+ * csslint configuration flags here, if you want to to use the `lint`
+ * plugin. Other wise it's pretty useless..
+ *
+ * @type {Object}
+ */
+
, jshint: require('./jshint')
, csslint: require('./csshint')
- // add package.json if it exists
- , vars: pkg
+ /**
+ * Expose the package.json in the tags property so it can be used to
+ * generate names and other sorts of content.
+ *
+ * @type {Object}
+ */
+
+ , tags: packagejson
+
+ /**
+ * This version is depricated, use the `tags` property instead.
+ *
+ * @deprecated
+ */
+
+ , vars: packagejson
};

0 comments on commit 9dbcbb3

Please sign in to comment.