Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene committed Oct 7, 2015
1 parent 3daaab9 commit 7c99b07
Show file tree
Hide file tree
Showing 933 changed files with 463,334 additions and 2 deletions.
85 changes: 84 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,78 @@
#### joe made this: https://goel.io/joe

#####=== JetBrains ===#####
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm

*.iml

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml

# Gradle:
# .idea/gradle.xml
# .idea/libraries

# Mongo Explorer plugin:
# .idea/mongoSettings.xml

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties

#####=== OSX ===#####
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

#####=== Node ===#####

# Logs
logs
*.log
Expand All @@ -23,5 +98,13 @@ coverage
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

# Debug log from npm
npm-debug.log


#####=== Proprietary ===#####
lib.compiled
/tests/*
3 changes: 3 additions & 0 deletions .jscs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"preset": "airbnb"
}
31 changes: 31 additions & 0 deletions .travis.yml
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

1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ 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.

39 changes: 39 additions & 0 deletions bin/_head.sh
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
}
31 changes: 31 additions & 0 deletions bin/gen_api_docs.sh
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
16 changes: 16 additions & 0 deletions bin/install_precommit.sh
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/.
33 changes: 33 additions & 0 deletions bin/pre-commit
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
72 changes: 72 additions & 0 deletions bin/publish.sh
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
9 changes: 9 additions & 0 deletions bin/remove_node_modules.sh
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
Loading

0 comments on commit 7c99b07

Please sign in to comment.