Permalink
Browse files

Updated build files. Repackaged as v1.5.3.

  • Loading branch information...
1 parent b8f8e7f commit 6ebd1866ecd261b566147fad02736a01f6db62cf @balupton balupton committed Oct 26, 2013
Showing with 427 additions and 401 deletions.
  1. +4 −2 .travis.yml
  2. +0 −5 Backers.md
  3. +38 −0 CONTRIBUTING.md
  4. +140 −113 Cakefile
  5. +3 −0 History.md
  6. +11 −3 LICENSE.md
  7. +97 −39 README.md
  8. +17 −0 bower.json
  9. +25 −0 component.json
  10. +0 −21 docpad.coffee
  11. +0 −2 out/demo/code.js
  12. +0 −4 out/demo/search.js
  13. +0 −4 out/demo/visual-search.js
  14. +20 −82 out/lib/query-engine.js
  15. +0 −38 out/test/live-test.js
  16. +0 −1 out/test/misc-test.js
  17. +0 −11 out/test/queries-test.js
  18. +0 −18 out/test/sort-test.js
  19. +72 −58 package.json
View
@@ -1,7 +1,9 @@
+# v1.3.2 October 26, 2013
+# https://github.com/bevry/base
language: node_js
install: "npm install"
-before_script: "./node_modules/.bin/cake test-prepare"
-script: "./node_modules/.bin/cake test"
+before_script: "./node_modules/.bin/cake compile"
+script: "npm test"
node_js:
- "0.8"
- "0.10"
View
@@ -1,5 +0,0 @@
-# Backers
-
-Thanks go out to the following entities for contributing financially to support the growth of this project:
-
-- [BugHerd](http://bugherd.com/)
View
@@ -0,0 +1,38 @@
+# Contribute
+
+## Development
+
+1. Fork the project and clone your fork
+2. Install global dependencies
+
+ ``` bash
+ npm install -g coffee-script
+ ```
+
+3. Compile the project
+
+ ``` bash
+ # Only once
+ cake compile
+
+ # On every change
+ cake watch
+ ```
+
+4. Run your tests
+
+ ``` bash
+ cake test
+ ```
+
+5. Prepare the project for publishing
+
+ ``` bash
+ cake prepublish
+ ```
+
+6. Publish the project
+
+ ``` bash
+ cake publish
+ ```
View
253 Cakefile
@@ -1,133 +1,160 @@
-# This file was originally created by Benjamin Lupton <b@lupton.cc> (http://balupton.com)
-# and is currently licensed under the Creative Commons Zero (http://creativecommons.org/publicdomain/zero/1.0/)
-# making it public domain so you can do whatever you wish with it without worry (you can even remove this notice!)
-#
-# If you change something here, be sure to reflect the changes in:
-# - the scripts section of the package.json file
-# - the .travis.yml file
+# v1.3.1 October 26, 2013
+# https://github.com/bevry/base
-# -----------------
-# Variables
+# =====================================
+# Imports
+
+fsUtil = require('fs')
+pathUtil = require('path')
-WINDOWS = process.platform.indexOf('win') is 0
-NODE = process.execPath
-NPM = if WINDOWS then process.execPath.replace('node.exe','npm.cmd') else 'npm'
-EXT = (if WINDOWS then '.cmd' else '')
-APP = process.cwd()
-BIN = "#{APP}/node_modules/.bin"
-CAKE = "#{BIN}/cake#{EXT}"
-COFFEE = "#{BIN}/coffee#{EXT}"
-DOCPAD = "#{BIN}/docpad#{EXT}"
-OUT = "#{APP}/out"
-SRC = "#{APP}/src"
+# =====================================
+# Variables
-# -----------------
-# Requires
+WINDOWS = process.platform.indexOf('win') is 0
+NODE = process.execPath
+NPM = (if WINDOWS then process.execPath.replace('node.exe', 'npm.cmd') else 'npm')
+EXT = (if WINDOWS then '.cmd' else '')
+APP_DIR = process.cwd()
+PACKAGE_PATH = pathUtil.join(APP_DIR, "package.json")
+PACKAGE_DATA = require(PACKAGE_PATH)
+DOCS_DIR = pathUtil.join(APP_DIR, "docs")
+DOCS_INPUT = pathUtil.join(APP_DIR, "src", "lib", "*")
+SRC_DIR = pathUtil.join(APP_DIR, "src")
+OUT_DIR = pathUtil.join(APP_DIR, "out")
+TEST_DIR = pathUtil.join(APP_DIR, "test")
+MODULES_DIR = pathUtil.join(APP_DIR, "node_modules")
+BIN_DIR = pathUtil.join(MODULES_DIR, ".bin")
+GIT = "git"
+CAKE = pathUtil.join(BIN_DIR, "cake#{EXT}")
+COFFEE = pathUtil.join(BIN_DIR, "coffee#{EXT}")
+PROJECTZ = pathUtil.join(BIN_DIR, "projectz#{EXT}")
+DOCCO = pathUtil.join(BIN_DIR, "docco#{EXT}")
+DOCPAD = pathUtil.join(BIN_DIR, "docpad#{EXT}")
+
+
+# =====================================
+# Generic
-pathUtil = require('path')
{exec,spawn} = require('child_process')
safe = (next,fn) ->
+ fn ?= next # support only one argument
return (err) ->
- return next(err) if err
- return fn()
+ # success status code
+ if err is 0
+ err = null
+ # error status code
+ else if err is 1
+ err = new Error('Process exited with error status code')
-# -----------------
-# Actions
+ # Error
+ return next(err) if err
-bench = (opts,next) ->
- (next = opts; opts = {}) unless next?
- spawn(NODE, ["#{OUT}/test/benchmark.js"], {stdio:'inherit',cwd:APP}).on('exit',next)
-
-clean = (opts,next) ->
- (next = opts; opts = {}) unless next?
- args = [
- '-Rf'
- OUT
- pathUtil.join(APP,'node_modules')
- pathUtil.join(APP,'*out')
- pathUtil.join(APP,'*log')
- ]
- spawn('rm', args, {stdio:'inherit',cwd:APP}).on('exit',next)
-
-compile = (opts,next) ->
- (next = opts; opts = {}) unless next?
- spawn(DOCPAD, ['generate'], {stdio:'inherit',cwd:APP}).on('exit',next)
-
-watch = (opts,next) ->
- (next = opts; opts = {}) unless next?
- spawn(DOCPAD, ['watch'], {stdio:'inherit',cwd:APP}).on('exit',next)
-
-install = (opts,next) ->
- (next = opts; opts = {}) unless next?
- spawn(NPM, ['install'], {stdio:'inherit',cwd:APP}).on('exit',next)
-
-reset = (opts,next) ->
- (next = opts; opts = {}) unless next?
- clean opts, safe next, -> install opts, safe next, -> compile opts, next
-
-setup = (opts,next) ->
- (next = opts; opts = {}) unless next?
- install opts, safe next, ->
- compile opts, next
-
-test = (opts,next) ->
- (next = opts; opts = {}) unless next?
- args = []
- args.push("--debug-brk") if opts.debug
- args.push("--joe-reporter=list")
- args.push("#{OUT}/test/everything-test.js")
- spawn(NODE, args, {stdio:'inherit',cwd:APP}, next)
+ # Continue
+ return fn()
finish = (err) ->
throw err if err
console.log('OK')
-# -----------------
-# Commands
-
-# bench
-task 'bench', 'benchmark our project', ->
- bench finish
-
-# clean
-task 'clean', 'clean up instance', ->
- clean finish
-
-# compile
-task 'compile', 'compile our files', ->
- compile finish
-
-# dev/watch
-task 'dev', 'watch and recompile our files', ->
- watch finish
-task 'watch', 'watch and recompile our files', ->
- watch finish
-
-# install
-task 'install', 'install dependencies', ->
- install finish
-
-# reset
-task 'reset', 'reset instance', ->
- reset finish
-
-# setup
-task 'setup', 'setup for development', ->
- setup finish
-
-# test
-task 'test', 'run our tests', ->
- test finish
-
-# test-debug
-task 'test-debug', 'run our tests in debug mode', ->
- test {debug:true}, finish
+# =====================================
+# Actions
-# test-prepare
-task 'test-prepare', 'prepare out tests', ->
- setup finish
+actions =
+ clean: (opts,next) ->
+ (next = opts; opts = {}) unless next?
+ args = ['-Rf', OUT_DIR]
+ for path in [APP_DIR, TEST_DIR]
+ args.push(
+ pathUtil.join(path, 'build')
+ pathUtil.join(path, 'components')
+ pathUtil.join(path, 'bower_components')
+ pathUtil.join(path, 'node_modules')
+ pathUtil.join(path, '*out')
+ pathUtil.join(path, '*log')
+ )
+ # rm
+ spawn('rm', args, {stdio:'inherit', cwd:APP_DIR}).on('close', safe next)
+
+ install: (opts,next) ->
+ (next = opts; opts = {}) unless next?
+ step1 = ->
+ # npm install (for app)
+ spawn(NPM, ['install'], {stdio:'inherit', cwd:APP_DIR}).on('close', safe next, step2)
+ step2 = ->
+ fsUtil.exists TEST_DIR, (exists) ->
+ return next() unless exists
+ # npm install (for test)
+ spawn(NPM, ['install'], {stdio:'inherit', cwd:TEST_DIR}).on('close', safe next)
+ step1()
+
+ compile: (opts,next) ->
+ (next = opts; opts = {}) unless next?
+ # cake install
+ actions.install opts, safe next, ->
+ # coffee compile
+ spawn(DOCPAD, ['generate'], {stdio:'inherit', cwd:APP_DIR}).on('close', safe next)
+
+ watch: (opts,next) ->
+ (next = opts; opts = {}) unless next?
+ # cake install
+ actions.install opts, safe next, ->
+ # coffee watch
+ spawn(DOCPAD, ['watch'], {stdio:'inherit', cwd:APP_DIR}).on('close', safe next)
+
+ test: (opts,next) ->
+ (next = opts; opts = {}) unless next?
+ # cake compile
+ actions.compile opts, safe next, ->
+ # npm test
+ spawn(NPM, ['test'], {stdio:'inherit', cwd:APP_DIR}).on('close', safe next)
+
+ prepublish: (opts,next) ->
+ (next = opts; opts = {}) unless next?
+ step1 = ->
+ # cake compile
+ actions.compile(opts, safe next, step2)
+ step2 = ->
+ # project compile
+ fsUtil.exists PROJECTZ, (exists) ->
+ return step3() unless exists
+ spawn(PROJECTZ, ['compile'], {stdio:'inherit', cwd:APP_DIR}).on('close', safe next, step3)
+ step3 = ->
+ # docco compile
+ fsUtil.exists DOCCO, (exists) ->
+ return step4() unless exists
+ exec("#{DOCCO} -o #{DOCS_DIR} #{DOCS_INPUT}", {stdio:'inherit', cwd:APP_DIR}, safe next, step4)
+ step4 = ->
+ # npm test
+ actions.test(opts, safe next)
+ step1()
+
+ publish: (opts,next) ->
+ (next = opts; opts = {}) unless next?
+ # cake prepublish
+ actions.prepublish opts, safe next, ->
+ # npm publish
+ spawn(NPM, ['publish'], {stdio:'inherit', cwd:APP_DIR}).on 'close', safe next, ->
+ # git tag
+ spawn(GIT, ['tag', 'v'+PACKAGE_DATA.version, '-a'], {stdio:'inherit', cwd:APP_DIR}).on('close', safe next)
+
+
+# =====================================
+# Commands
+commands =
+ clean: 'clean up instance'
+ install: 'install dependencies'
+ compile: 'compile our files (runs install)'
+ watch: 'compile our files initially, and again for each change (runs install)'
+ test: 'run our tests (runs compile)'
+ prepublish: 'prepare our package for publishing'
+ publish: 'publish our package (runs prepublish)'
+
+Object.keys(commands).forEach (key) ->
+ description = commands[key]
+ fn = actions[key]
+ task key, description, (opts) -> fn(opts, finish)
View
@@ -1,5 +1,8 @@
## History
+- v1.5.3 October 27, 2013
+ - Re-packaged
+
- v1.5.2 March 21, 2013
- Backbone peerDependency now supports any version
- Tested again Backbone.js v1.0.0
View
@@ -1,10 +1,18 @@
-(The MIT License)
-Copyright (c) 2012+ Bevry Pty Ltd <us@bevry.me>
-Copyright (c) 2011 Benjamin Lupton <b@lupton.cc>
+<!-- LICENSEFILE/ -->
+# License
+
+Copyright &copy; 2012+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me)
+<br/>Copyright &copy; 2011 Benjamin Lupton <b@lupton.cc> (http://balupton.com)
+
+## The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+<!-- /LICENSEFILE -->
+
+
Oops, something went wrong.

0 comments on commit 6ebd186

Please sign in to comment.