forked from MitocGroup/deep-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eugene
committed
Oct 7, 2015
1 parent
3daaab9
commit 7c99b07
Showing
933 changed files
with
463,334 additions
and
2 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
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,3 @@ | ||
{ | ||
"preset": "airbnb" | ||
} |
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,31 @@ | ||
language: node_js | ||
sudo: false | ||
node_js: | ||
- '0.12' | ||
|
||
cache: | ||
directories: | ||
- "$(npm root -g)" | ||
|
||
branches: | ||
only: | ||
- master | ||
- stage | ||
- test | ||
- dev | ||
|
||
before_install: | ||
- npm install -g babel | ||
- npm install -g browserify | ||
- npm install -g mocha | ||
- npm install -g mocha-babel | ||
- npm install -g istanbul | ||
- npm install -g coveralls | ||
- npm install -g codacy-coverage | ||
- npm install -g istanbul-combine | ||
- cp test/package.json . | ||
- test/bin/setup_npm.sh | ||
|
||
after_success: | ||
- npm run coverage | ||
|
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,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
path=$(cd $(dirname $0); pwd -P) | ||
npm=$(which npm) | ||
esdoc=$(which esdoc) | ||
|
||
publish_npm_package() { | ||
name=$(basename $1) | ||
|
||
echo "Publishing "${name} | ||
|
||
if [ -z $2 ] || ! $2; then | ||
cd $1 && rm -rf node_modules/ && npm install && ${npm} version $3 && ${npm} publish | ||
else | ||
cd $1 && ${npm} version $3 | ||
fi | ||
} | ||
|
||
escape_sed() { | ||
echo $(echo $1 | sed -e 's/[\/&]/\\&/g') | ||
} | ||
|
||
assure_esdoc() { | ||
if [ -z ${esdoc} ]; then | ||
echo "Installing esdoc..." | ||
${npm} install -g esdoc | ||
|
||
esdoc=$(which esdoc) | ||
fi | ||
} | ||
|
||
assure_npm() { | ||
if [ -z ${npm} ]; then | ||
echo "Installing nodejs..." | ||
brew install nodejs | ||
|
||
npm=$(which npm) | ||
fi | ||
} |
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,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
source $(dirname $0)/_head.sh | ||
|
||
assure_npm | ||
assure_esdoc | ||
|
||
ESDOC_CFG_TPL='{"index": "{readme}","source": "{src}","destination": "{dest}","includes": ["\\.(js|es6)$"],"title": "{title}", "package": "{pkg}"}' | ||
|
||
DOCS_BASEPATH=${path}/../docs-api | ||
|
||
for lib in ${path}/../src/deep-*/; do | ||
name=$(basename ${lib}) | ||
lib=$(cd ${lib}; pwd -P) | ||
|
||
lib_path=$(escape_sed ${lib}/lib) | ||
raw_docs_path=${DOCS_BASEPATH}/${name} | ||
docs_path=$(escape_sed ${raw_docs_path}) | ||
npm_pkg=$(escape_sed ${lib}/package.json) | ||
readme=$(escape_sed ${lib}/README.md) | ||
pck_name=$(node -e "console.log(require('$npm_pkg').description)") | ||
|
||
if [ ${name} != 'deep-framework' ]; then | ||
tmp_esdoc_cfg=$(mktemp) | ||
esdoc_cfg=$(echo ${ESDOC_CFG_TPL} | sed "s/{src}/$lib_path/" | sed "s/{dest}/$docs_path/" | sed "s/{title}/$pck_name/" | sed "s/{pkg}/$npm_pkg/" | sed "s/{readme}/$readme/") | ||
|
||
echo ${esdoc_cfg} > ${tmp_esdoc_cfg} | ||
|
||
${esdoc} -c ${tmp_esdoc_cfg} | ||
fi | ||
done |
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,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
source $(dirname $0)/_head.sh | ||
jscs=`which jscs` | ||
|
||
if [ -z ${jscs} ]; then | ||
assure_npm | ||
|
||
${npm} -g install jscs | ||
fi | ||
|
||
if [ -f ${path}/../.git/hooks/pre-commit ]; then | ||
cp ${path}/../.git/hooks/pre-commit ${path}/../.git/hooks/pre-commit_$(date +%F-%H%M%S).bak | ||
fi | ||
|
||
cp ${path}/pre-commit ${path}/../.git/hooks/. |
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,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
files=$(git diff --cached --name-only --diff-filter=ACM | egrep "^lib/(.)+/lib/(.)+\.js$|^microservice/(.)+/Backend/src/(.)+\.es6$|^src/(.)+/lib/(.)+\.js$") | ||
|
||
if [ "$files" = "" ]; then | ||
exit 0 | ||
fi | ||
|
||
pass=true | ||
|
||
echo -e "\nValidating JavaScript:\n" | ||
|
||
for file in ${files}; do | ||
output=$(jscs ${file} --config=./.jscs.json) | ||
|
||
jscs_run_result=$(echo $?) | ||
|
||
if [ ${jscs_run_result} -eq 0 ]; then | ||
echo -e "\t\033[32mJSCS Passed: ${file}\033[0m" | ||
else | ||
echo -e "\t\033[31mJSCS Failed: ${file}\033[0m" | ||
pass=false | ||
fi | ||
done | ||
|
||
echo -e "\nJavaScript validation complete\n" | ||
|
||
if ! $pass; then | ||
echo -e "\033[41mCOMMIT FAILED:\033[0m Your commit contains files that should pass JSCS but do not. Please fix the JSCS errors and try again.\n" | ||
exit 1 | ||
else | ||
echo -e "\033[42mCOMMIT SUCCEEDED\033[0m\n" | ||
fi |
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,72 @@ | ||
#!/usr/bin/env bash | ||
|
||
source $(dirname $0)/_head.sh | ||
|
||
assure_npm | ||
|
||
DRY_RUN=false | ||
HELP=false | ||
PACKAGE_PATH="" | ||
VERSION_TYPE="patch" | ||
|
||
for i in "$@" | ||
do | ||
case ${i} in | ||
--patch) | ||
VERSION_TYPE="patch" | ||
;; | ||
--minor) | ||
VERSION_TYPE="minor" | ||
;; | ||
--major) | ||
VERSION_TYPE="major" | ||
;; | ||
--help) | ||
HELP=true | ||
;; | ||
--dry-run) | ||
DRY_RUN=true | ||
;; | ||
*) | ||
PACKAGE_PATH=${i} | ||
;; | ||
esac | ||
|
||
shift | ||
done | ||
|
||
if ${HELP}; then | ||
echo "-------------------------------------------------------------------" | ||
echo "Usage example: bin/publish.sh src/deep-db --dry-run" | ||
echo "" | ||
echo "Arguments and options:" | ||
echo " src/deep-db The path to the certain package to be published" | ||
echo " --dry-run Skip uploading packages to NPM registry" | ||
echo "-------------------------------------------------------------------" | ||
exit 0 | ||
fi | ||
|
||
if ${DRY_RUN}; then | ||
echo "" | ||
echo "Dry run mode on!!!" | ||
echo "" | ||
fi | ||
|
||
if [ -z ${PACKAGE_PATH} ]; then | ||
publish_npm_package ${path}/../src/deep-core/ ${DRY_RUN} ${VERSION_TYPE} | ||
publish_npm_package ${path}/../src/deep-di/ ${DRY_RUN} ${VERSION_TYPE} | ||
publish_npm_package ${path}/../src/deep-kernel/ ${DRY_RUN} ${VERSION_TYPE} | ||
publish_npm_package ${path}/../src/deep-validation/ ${DRY_RUN} ${VERSION_TYPE} | ||
|
||
for src in ${path}/../src/deep-*/; do | ||
name=$(basename ${src}) | ||
|
||
if [ ${name} != 'deep-framework' ] && [ ${name} != 'deep-core' ] && [ ${name} != 'deep-di' ] && [ ${name} != 'deep-kernel' ] && [ ${name} != 'deep-validation' ]; then | ||
publish_npm_package ${src} ${DRY_RUN} ${VERSION_TYPE} | ||
fi | ||
done | ||
|
||
publish_npm_package ${path}/../src/deep-framework/ ${DRY_RUN} ${VERSION_TYPE} | ||
else | ||
publish_npm_package ${PACKAGE_PATH} ${DRY_RUN} ${VERSION_TYPE} | ||
fi |
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,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
__SCRIPT_PATH=$(cd $(dirname $0); pwd -P) | ||
|
||
for path in $__SCRIPT_PATH/../*/*/node_modules | ||
do | ||
echo "Removed "${path} | ||
rm -rf ${path} | ||
done |
Oops, something went wrong.