Skip to content
This repository
Browse code

Made the index file more readable

  • Loading branch information...
commit 9dbcbb32aa0023c74774b2646f2339f1028513c0 1 parent 07529ef
Arnout Kazemier 3rd-Eden authored

Showing 1 changed file with 65 additions and 10 deletions. Show diff stats Hide diff stats

  1. +65 10 static/index.js
75 static/index.js
... ... @@ -1,24 +1,79 @@
1   -var path = require('path')
2   - , file = path.join(process.env.PWD, 'package.json')
3   - , pkg;
  1 +"use strict";
4 2
5   -try { pkg = require(file); }
6   -catch (e) { pkg = {}; }
  3 +// try to parse out the package.json as we want to use some data from it to fill
  4 +// in our defaults
  5 +var packagejson;
  6 +try { packagejson = require(require('path').join(process.env.PWD, 'package.json')); }
  7 +catch (e) { packagejson = {}; }
  8 +
  9 +/**
  10 + * The default configuration for the square.json files.
  11 + *
  12 + * @type {Object}
  13 + */
7 14
8 15 module.exports = {
9   - // output config
  16 + /**
  17 + * Default configuration output. This is where the different distribution
  18 + * are written to.
  19 + *
  20 + * The keys in this Object are the type's of distribution and the value is
  21 + * the path where the files should be written to.
  22 + *
  23 + * If there are no differences path, you can also specify this as an String
  24 + * instead of an Object.
  25 + *
  26 + * @type {Mixed}
  27 + */
  28 +
10 29 dist: {
11 30 min: '~/square.{type}.{ext}'
12 31 , dev: '~/square.{type}.{ext}'
13 32 }
14 33
15   - // plugin configuration
  34 + /**
  35 + * Dedicated configuration section for the plugins. The key of this Object
  36 + * should be the name of the plugin in lowercase and the value an Object
  37 + * with the options that you wish to configure.
  38 + *
  39 + * @type {Object}
  40 + */
  41 +
16 42 , plugins: {}
17 43
18   - // hinting and linting
  44 + /**
  45 + * List of platforms that can be used to target specifically in stylus..
  46 + *
  47 + * @type {Array}
  48 + */
  49 +
  50 + , platforms: ['android', 'iphone', 'ipad', 'web']
  51 +
  52 + /**
  53 + * Code quality is always important, so we have list of the jshint and the
  54 + * csslint configuration flags here, if you want to to use the `lint`
  55 + * plugin. Other wise it's pretty useless..
  56 + *
  57 + * @type {Object}
  58 + */
  59 +
19 60 , jshint: require('./jshint')
20 61 , csslint: require('./csshint')
21 62
22   - // add package.json if it exists
23   - , vars: pkg
  63 + /**
  64 + * Expose the package.json in the tags property so it can be used to
  65 + * generate names and other sorts of content.
  66 + *
  67 + * @type {Object}
  68 + */
  69 +
  70 + , tags: packagejson
  71 +
  72 + /**
  73 + * This version is depricated, use the `tags` property instead.
  74 + *
  75 + * @deprecated
  76 + */
  77 +
  78 + , vars: packagejson
24 79 };

0 comments on commit 9dbcbb3

Please sign in to comment.
Something went wrong with that request. Please try again.