Skip to content

Commit c026449

Browse files
author
David Aurelio
committed
initial commit
0 parents  commit c026449

File tree

331 files changed

+37313
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

331 files changed

+37313
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.project
2+
.DS_Store
3+
.idea
4+
*.idea
5+
dist
6+
jsdoc
7+
node_modules
8+
tmp
9+
lib/r.js

AUTHORS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Jens Arps <[email protected]>
2+
David Aurelio <[email protected]>
3+
John-David Dalton <[email protected]>
4+
Tobias von Klipstein <[email protected]>
5+
Wolfram Kriesing <[email protected]>
6+
Nikolai Onken <[email protected]>
7+
James Padolsey <[email protected]>
8+
Tobias Reiss <[email protected]>
9+
Stephan Seidt <[email protected]>
10+
Peter van der Zee <[email protected]>

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright 2012 uxebu Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a
4+
copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to permit
8+
persons to whom the Software is furnished to do so, subject to the
9+
following conditions:
10+
11+
The above copyright notice and this permission notice shall be included
12+
in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20+
USE OR OTHER DEALINGS IN THE SOFTWARE.

Makefile

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# ** MODIFY THIS FILE AS REQUIRED **
2+
# ** ADD CUSTOM BUILD- & TEST-EXECUTION-COMMANDS HERE **
3+
#
4+
# Building & testing for development and CI environment
5+
#
6+
# Following binaries need to be installed and available in your PATH:
7+
#
8+
# * jsdoc
9+
# * jshint
10+
# * phantomjs
11+
# * jscoverage-server
12+
# * node
13+
#
14+
# CI-Tools (https://github.com/uxebu/ci-tools) need to be installed in:
15+
#
16+
# /opt/ci-tools
17+
#
18+
# The Jenkins-CI environment is executing the task `ci-run`:
19+
#
20+
# make ci-run
21+
22+
ifndef TEST_RUNNER
23+
# CHANGE HERE, IF THE DEFAULT TEST-RUNNER IS SOMEWHERE ELSE
24+
TEST_RUNNER=test/runner.html
25+
TEST_RUNNER_COMPARE=test/runner-compare.html
26+
TEST_RUNNER_QC=test/runner-qc.html
27+
TEST_RUNNER_BUILD=test/runner-build.html
28+
endif
29+
30+
ifndef WORKSPACE
31+
WORKSPACE=${CURDIR}
32+
endif
33+
34+
ifndef PROJECT_NAME
35+
PROJECT_NAME = $(shell basename ${WORKSPACE})
36+
endif
37+
38+
CURRENT_USER = $(shell whoami)
39+
40+
ifndef BASE_URL
41+
BASE_URL=http://localhost/${CURRENT_USER}/${PROJECT_NAME}
42+
endif
43+
44+
ifdef JOB_URL
45+
# jenkins env URL params end with "/"
46+
BASE_URL=${JOB_URL}ws
47+
endif
48+
49+
ifdef GIT_BRANCH
50+
SUB_DIR=/${shell echo ${GIT_BRANCH} | sed "s/origin\///"}
51+
endif
52+
53+
# You can install the CI-Tools on your machine: https://github.com/uxebu/ci-tools
54+
ifndef CI_TOOLS_DIR
55+
CI_TOOLS_DIR=/opt/ci-tools
56+
endif
57+
58+
ifndef TEMP_DIR
59+
TEMP_DIR=${WORKSPACE}/tmp
60+
endif
61+
62+
ifndef DIST_DIR
63+
DIST_DIR=${WORKSPACE}/dist
64+
endif
65+
66+
CLOSURE=java -jar lib/closure/compiler.jar
67+
CLOSURE_AMD=${CLOSURE} \
68+
--transform_amd_modules \
69+
--process_common_js_modules \
70+
--common_js_module_path_prefix src \
71+
--output_wrapper '(function(){%output%}());'
72+
CLOSURE_FINALIZE=${CLOSURE}
73+
CLOSURE_PRETTY=${CLOSURE} --formatting PRETTY_PRINT --compilation_level WHITESPACE_ONLY
74+
75+
default: build
76+
77+
jshint: mktemp
78+
- jshint ${WORKSPACE}/src/ --config config/jshint.json > ${TEMP_DIR}/jshint-report.txt
79+
80+
coverage: mktemp
81+
${CI_TOOLS_DIR}/bin/coverage_phantom.sh ${TEST_RUNNER} ${WORKSPACE}
82+
83+
test: mktemp
84+
phantomjs --load-plugins=yes ${CI_TOOLS_DIR}/script/phantom_runner.js ${BASE_URL}/${TEST_RUNNER_BUILD} ${TEMP_DIR} 1 jasmine | grep -q "Testcase passed"
85+
phantomjs --load-plugins=yes ${CI_TOOLS_DIR}/script/phantom_runner.js ${BASE_URL}/${TEST_RUNNER} ${TEMP_DIR} 0 jasmine
86+
phantomjs --load-plugins=yes ${CI_TOOLS_DIR}/script/phantom_runner.js ${BASE_URL}/${TEST_RUNNER_COMPARE} ${TEMP_DIR} 0 jasmine
87+
phantomjs --load-plugins=yes ${CI_TOOLS_DIR}/script/phantom_runner.js ${BASE_URL}/${TEST_RUNNER_QC} ${TEMP_DIR} 0 qc
88+
89+
syntux-diff: mktemp
90+
${CI_TOOLS_DIR}/bin/syntux_diff.sh ${WORKSPACE}/src ${TEMP_DIR}
91+
92+
profile: mktemp
93+
cd ${WORKSPACE}/example/profiling && npm install
94+
- ${WORKSPACE}/example/profiling/run.js \
95+
-b ${BUILD_NUMBER} \
96+
-d 10000 \
97+
-e ${BASE_URL}/test/bonsai_executor_src.html \
98+
-j ${JOB_NAME} \
99+
-r http://riak.ux:8098/riak/profile \
100+
${WORKSPACE}/test/profile \
101+
102+
doc: mkjsdoc
103+
jsdoc -r -d ${WORKSPACE}/jsdoc${SUB_DIR} ${WORKSPACE}/src || true
104+
105+
build: clean mkdist
106+
${CLOSURE_AMD} --common_js_entry_module bootstrapper/_build/worker.js \
107+
src/bootstrapper/_build/worker.js \
108+
`find src -name '*.js' -not -path 'src/bootstrapper/_dev/*' -not -path 'src/bootstrapper/_build/*' -not -path 'src/bootstrapper/context/socketio/*' -not -path 'src/bootstrapper/context/iframe/*' -not -path 'src/bootstrapper/context/node/*'` | ${CLOSURE_PRETTY} > ${DIST_DIR}/bonsai.js
109+
echo "/*" > ${DIST_DIR}/bonsai.min.js
110+
cat ${WORKSPACE}/LICENSE >> ${DIST_DIR}/bonsai.min.js
111+
echo "*/" >> ${DIST_DIR}/bonsai.min.js
112+
cat ${DIST_DIR}/bonsai.js | ${CLOSURE_FINALIZE} >> ${DIST_DIR}/bonsai.min.js
113+
${CLOSURE_AMD} --common_js_entry_module bootstrapper/_build/iframe.js \
114+
src/bootstrapper/_build/iframe.js \
115+
`find src -name '*.js' -not -path 'src/bootstrapper/_dev/*' -not -path 'src/bootstrapper/_build/*' -not -path 'src/bootstrapper/context/socketio/*' -not -path 'src/bootstrapper/context/worker/*' -not -path 'src/bootstrapper/context/node/*'` | ${CLOSURE_PRETTY} > ${DIST_DIR}/bonsai.iframe.js
116+
echo "/*" > ${DIST_DIR}/bonsai.iframe.min.js
117+
cat ${WORKSPACE}/LICENSE >> ${DIST_DIR}/bonsai.iframe.min.js
118+
echo "*/" >> ${DIST_DIR}/bonsai.iframe.min.js
119+
cat ${DIST_DIR}/bonsai.iframe.js | ${CLOSURE_FINALIZE} >> ${DIST_DIR}/bonsai.iframe.min.js
120+
121+
preview-bundle: build
122+
mkdir -p ${TEMP_DIR}/preview-bundle/lib
123+
mkdir -p ${TEMP_DIR}/preview-bundle/example
124+
mkdir -p ${TEMP_DIR}/preview-bundle/dist
125+
cp -R example/library ${TEMP_DIR}/preview-bundle/example
126+
- rm ${TEMP_DIR}/preview-bundle/example/library/movies/assets/*.mp4
127+
- rm ${TEMP_DIR}/preview-bundle/example/library/movies/assets/*.m4v
128+
- rm ${TEMP_DIR}/preview-bundle/example/library/movies/assets/*.ogv
129+
cp -R dist/*.min.js ${TEMP_DIR}/preview-bundle/dist
130+
cp -R lib/requirejs ${TEMP_DIR}/preview-bundle/lib
131+
cd ${TEMP_DIR} && tar czf bonsai-preview.tgz preview-bundle/
132+
133+
mktemp:
134+
mkdir -p ${TEMP_DIR}
135+
136+
mkdist:
137+
mkdir -p ${DIST_DIR}
138+
139+
mkjsdoc:
140+
mkdir -p ${WORKSPACE}/jsdoc
141+
142+
clean:
143+
rm -rf ${TEMP_DIR} ${DIST_DIR}
144+
145+
ci-run: clean build test coverage syntux-diff doc jshint profile

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Bonsai
2+
3+
*The art of bonsai tells a story through living illusion*
4+
5+
(more information coming soon!)

config/jshint.json

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
// Settings
3+
"passfail" : false, // Stop on first error.
4+
"maxerr" : 500, // Maximum error before stopping.
5+
6+
7+
// Predefined globals whom JSHint will ignore.
8+
"browser" : true, // Standard browser globals e.g. `window`, `document`.
9+
10+
"node" : true,
11+
"rhino" : false,
12+
"couch" : false,
13+
"wsh" : false,
14+
15+
"jquery" : true,
16+
"prototypejs" : false,
17+
"mootools" : false,
18+
"dojo" : false,
19+
20+
"predef" : [ // Custom globals.
21+
// phantomjs globals
22+
"WebPage",
23+
"phantom"
24+
],
25+
26+
27+
// Development.
28+
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
29+
"devel" : false, // Allow developments statements e.g. `console.log();`.
30+
31+
32+
// ECMAScript 5.
33+
"es5" : true, // Allow ECMAScript 5 syntax.
34+
"strict" : false, // Require `use strict` pragma in every file.
35+
"globalstrict" : false, // Allow global "use strict" (also enables 'strict').
36+
37+
38+
// The Good Parts.
39+
"asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons).
40+
"laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
41+
"bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.).
42+
"boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
43+
"curly" : true, // Require {} for every new block or scope.
44+
"eqeqeq" : false, // Require triple equals i.e. `===`.
45+
"eqnull" : false, // Tolerate use of `== null`.
46+
"evil" : false, // Tolerate use of `eval`.
47+
"expr" : false, // Tolerate `ExpressionStatement` as Programs.
48+
"forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`.
49+
"immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
50+
"latedef" : true, // Prohipit variable use before definition.
51+
"loopfunc" : false, // Allow functions to be defined within loops.
52+
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
53+
"regexp" : true, // Prohibit `.` and `[^...]` in regular expressions.
54+
"regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`.
55+
"scripturl" : true, // Tolerate script-targeted URLs.
56+
"shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
57+
"supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
58+
"undef" : true, // Require all non-global variables be declared before they are used.
59+
60+
61+
// Personal styling preferences.
62+
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
63+
"noempty" : true, // Prohibit use of empty blocks.
64+
"nonew" : true, // Prohibit use of constructors for side-effects.
65+
"nomen" : true, // Prohibit use of initial or trailing underbars in names.
66+
"onevar" : false, // Allow only one `var` statement per function.
67+
"plusplus" : false, // Prohibit use of `++` & `--`.
68+
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
69+
"trailing" : true, // Prohibit trailing whitespaces.
70+
"white" : false, // Check against strict whitespace and indentation rules.
71+
"indent" : 2 // Specify indentation spacing
72+
}
73+

0 commit comments

Comments
 (0)