Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- v6.21.5 January 24, 2013 - Supports Node v0.9 - Added `renderSingleExtensions` option - Note: currently this will render `src/documents/script.coffee` from CoffeeScript to JavaScript as intended, HOWEVER the outfile will be `out/script.coffee` instead of the expected `out/script.js`. We will likely have to do an extension mapping for single extensions. - Added expiremental `docpad-compile` executable - Updated dependencies - [bal-util](https://github.com/balupton/bal-util) from ~1.15.4 to ~1.16.0
- Loading branch information
Showing
12 changed files
with
230 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
.travis* | ||
Cakefile | ||
Makefile | ||
History.md | ||
|
||
docs/ | ||
src/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# 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 | ||
|
||
|
||
# ----------------- | ||
# Variables | ||
|
||
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}" | ||
OUT = "#{APP}/out" | ||
SRC = "#{APP}/src" | ||
TEST = "#{APP}/test" | ||
|
||
|
||
# ----------------- | ||
# Requires | ||
|
||
pathUtil = require('path') | ||
{exec,spawn} = require('child_process') | ||
safe = (next,fn) -> | ||
return (err) -> | ||
return next(err) if err | ||
return fn() | ||
|
||
|
||
# ----------------- | ||
# Actions | ||
|
||
clean = (opts,next) -> | ||
(next = opts; opts = {}) unless next? | ||
args = [ | ||
'-Rf' | ||
OUT | ||
pathUtil.join(APP,'node_modules') | ||
pathUtil.join(APP,'*out') | ||
pathUtil.join(APP,'*log') | ||
pathUtil.join(TEST,'node_modules') | ||
pathUtil.join(TEST,'*out') | ||
pathUtil.join(TEST,'*log') | ||
] | ||
spawn('rm', args, {stdio:'inherit',cwd:APP}).on('exit',next) | ||
|
||
compile = (opts,next) -> | ||
(next = opts; opts = {}) unless next? | ||
spawn(COFFEE, ['-bco', OUT, SRC], {stdio:'inherit',cwd:APP}).on('exit',next) | ||
|
||
watch = (opts,next) -> | ||
(next = opts; opts = {}) unless next? | ||
spawn(COFFEE, ['-bwco', OUT, SRC], {stdio:'inherit',cwd:APP}).on('exit',next) | ||
|
||
install = (opts,next) -> | ||
(next = opts; opts = {}) unless next? | ||
spawn(NPM, ['install'], {stdio:'inherit',cwd:APP}).on 'exit', safe next, -> | ||
spawn(NPM, ['install'], {stdio:'inherit',cwd:TEST}).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("#{OUT}/test/everything.test.js") | ||
args.push("--joe-reporter=list") | ||
spawn(NODE, args, {stdio:'inherit',cwd:APP}, next) | ||
|
||
finish = (err) -> | ||
throw err if err | ||
console.log('OK') | ||
|
||
|
||
# ----------------- | ||
# Commands | ||
|
||
# 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 | ||
|
||
# test-prepare | ||
task 'test-prepare', 'prepare out tests', -> | ||
setup finish | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env node | ||
require(__dirname+'/../out/bin/docpad-compile'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Require | ||
DocPad = require(__dirname+'/../lib/docpad') | ||
|
||
# Prepare | ||
getArgument = (name,value=null,defaultValue=null) -> | ||
result = defaultValue | ||
argumentIndex = process.argv.indexOf("--#{name}") | ||
if argumentIndex isnt -1 | ||
result = value ? process.argv[argumentIndex+1] | ||
return result | ||
|
||
# DocPad Action | ||
action = (getArgument('action',null,'generate')+' '+getArgument('watch','watch','')).trim() | ||
|
||
# DocPad Configuration | ||
docpadConfig = {} | ||
docpadConfig.rootPath = getArgument('rootPath',null,process.cwd()) | ||
docpadConfig.outPath = getArgument('outPath',null,docpadConfig.rootPath+'/out') | ||
docpadConfig.srcPath = getArgument('srcPath',null,docpadConfig.rootPath+'/src') | ||
docpadConfig.documentsPaths = (-> | ||
documentsPath = getArgument('documentsPath') | ||
if documentsPath? | ||
documentsPath = docpadConfig.srcPath if documentsPath is 'auto' | ||
else | ||
documentsPath = docpadConfig.srcPath+'/documents' | ||
return [documentsPath] | ||
)() | ||
docpadConfig.port = (-> | ||
port = getArgument('port') | ||
port = parseInt(port,10) if port and isNaN(port) is false | ||
return port | ||
)() | ||
docpadConfig.renderSingleExtensions = (-> | ||
renderSingleExtensions = getArgument('renderSingleExtensions',null,'auto') | ||
if renderSingleExtensions in ['true','yes'] | ||
renderSingleExtensions = true | ||
else if renderSingleExtensions in ['false','no'] | ||
renderSingleExtensions = false | ||
return renderSingleExtensions | ||
)() | ||
|
||
# Create DocPad Instance | ||
DocPad.createInstance docpadConfig, (err,docpad) -> | ||
# Check | ||
return console.log(err.stack) if err | ||
|
||
# Generate and Serve | ||
docpad.action action, (err) -> | ||
# Check | ||
return console.log(err.stack) if err | ||
|
||
# Done | ||
console.log('OK') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.