Skip to content

Commit

Permalink
Merge 3b6c193 into d673e87
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSkierniewski committed Apr 24, 2017
2 parents d673e87 + 3b6c193 commit dfb2da1
Show file tree
Hide file tree
Showing 37 changed files with 1,806 additions and 947 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.gitattributes
.gitignore
.gitlab-ci.yml
.nyc_output
.phpstorm.meta.php
.release.json
.server/ssl
Expand All @@ -13,6 +14,7 @@ ansible
backups
build
codeception.yml
coverage
develop
docker-compose.yml
Dockerfile
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resources/assets/js/vendor/*.js
20 changes: 11 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
+/.vagrant
+/public/hot
.env
.nyc_output
.phpstorm.meta.php
.vscode
/.idea
/node_modules
/public/gzero/*
/public/storage
/tests/_output
/vendor
/.idea
_ide_helper.php
coverage
Homestead.json
Homestead.yaml
.env
/tests/_output
/public/gzero/*
tests/_output/*
.phpstorm.meta.php
_ide_helper.php
.vscode
+/public/hot
+/.vagrant
15 changes: 11 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
sudo: required

language: php
sudo: required
cache:
timeout: 2000
directories:
- vendor # Composer packages
- node_modules # NPM packages

php:
- '7.1'
Expand All @@ -9,7 +13,7 @@ services:
- docker

env:
DOCKER_VERSION: 1.12.5-0~ubuntu-trusty
DOCKER_VERSION: 1.13.1-0~ubuntu-trusty
DOCKER_COMPOSE_VERSION: 1.9.0

before_install:
Expand All @@ -24,11 +28,14 @@ before_script:
- docker version
- docker-compose version
- docker-compose up -d
- docker-compose run --rm -w /var/www node_server npm -s install
- docker exec -i platform_web_server_1 phpdismod xdebug # disabling xdebug to speed up composer
- docker exec -i platform_web_server_1 composer install -d /var/www/ --prefer-dist --no-interaction || true
- docker exec -i platform_web_server_1 composer install -d /var/www/ --prefer-dist --no-interaction --no-suggest --no-progress || true
- docker exec -i platform_web_server_1 phpenmod xdebug # enabling xdebug for code coverage

script:
- docker-compose run --rm -w /var/www node_server npm -s run lint
- docker-compose run --rm -w /var/www node_server npm -s test -- --verbose
- "docker exec -i platform_web_server_1 php /var/www/vendor/bin/codecept run -c /var/www/codeception.yml -o \"settings: lint:false\" --coverage --coverage-xml --env platform,ml_disabled"
- docker exec -i platform_web_server_1 mkdir -p /var/www/build/logs
- docker exec -i platform_web_server_1 cp /var/www/tests/_output/coverage.xml /var/www/build/logs/clover.xml
Expand Down
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ To run tests use:

```
./develop test
./develop frontend-test
```

## Working on frontend
Expand All @@ -155,10 +156,36 @@ Install required npm modules:
./develop npm install
```

To use gulp:
To run webpack:

```
./develop gulp {command}
./develop npm run dev
```
or
```
./develop npm run watch
```

## Testing on frontend

To run only ava tests:

```
./develop npm test
```
or
```
./develop npm run test:watch
```

To run only eslint:

```
./develop npm lint
```
or
```
./develop npm run lint:watch
```

## Updating composer dependencies
Expand Down
18 changes: 9 additions & 9 deletions develop
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ if [ $# -gt 0 ];then
web_server \
vendor/bin/codecept run --env platform,ml_disabled "$@"

elif [ "$1" == "frontend-test" ]; then
shift 1
${COMPOSE} run --rm -w /var/www \
-u $(id -u):www-data \
node_server \
npm -s start "$@"

elif [ "$1" == "artisan" ]; then
shift 1
${COMPOSE} run --rm -w /var/www \
Expand All @@ -43,14 +50,7 @@ if [ $# -gt 0 ];then
${COMPOSE} run --rm -w /var/www \
-u $(id -u):www-data \
node_server \
npm "$@"

elif [ "$1" == "gulp" ]; then
shift 1
${COMPOSE} run -T --rm -w /var/www \
-u $(id -u):www-data \
node_server \
./node_modules/.bin/gulp "$@"
npm -s "$@"

elif [ "$1" == "link" ]; then
shift 1
Expand Down Expand Up @@ -88,4 +88,4 @@ if [ $# -gt 0 ];then
fi
else
${COMPOSE} ps
fi
fi
115 changes: 107 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,121 @@
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"start": "npm-run-all --parallel --silent -c lint:watch test:watch",
"test": "cross-env NODE_ENV=test ava",
"test:watch": "npm run test -- --watch",
"lint": "cross-env NODE_ENV=test esw resources/assets/js/ --color",
"lint:watch": "npm run lint -- --watch"
},
"babel": {
"presets": [
"es2015"
]
},
"ava": {
"files": [
"resources/assets/js/**/*.spec.js"
],
"source": [
"resources/assets/js/**/*.{js,vue,snap}"
],
"concurrency": 4,
"failFast": false,
"failWithoutAssertions": true,
"powerAssert": true,
"require": [
"babel-register",
"./test-setup.js"
]
},
"eslintConfig": {
"env": {
"es6": true,
"browser": true,
"node": true
},
"globals": {
"$": true,
"jQuery": true,
"axiosMock": true
},
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module"
},
"plugins": [
"ava"
],
"extends": [
"eslint:recommended",
"plugin:ava/recommended"
],
"rules": {
"ava/prefer-async-await": "off",
"ava/no-cb-test": "error",
"brace-style": [
"error",
"1tbs",
{
"allowSingleLine": true
}
],
"comma-dangle": "error",
"curly": "error",
"default-case": "error",
"eqeqeq": [
"error",
"always"
],
"guard-for-in": "error",
"linebreak-style": [
"error",
"unix"
],
"no-alert": "error",
"no-confusing-arrow": "error",
"no-else-return": "error",
"no-floating-decimal": "error",
"no-multi-spaces": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"semi": [
"error",
"never"
],
"valid-jsdoc": "error",
"vars-on-top": "error"
}
},
"devDependencies": {
"animate-scss": "^3.2.1",
"ava": "^0.19.1",
"avoriaz": "^1.11.1",
"axios": "^0.15.3",
"axios-mock-adapter": "^1.8.1",
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.24.1",
"bluebird": "^3.5.0",
"bootstrap-sass": "^3.3.7",
"browser-env": "^2.0.30",
"cross-env": "^3.2.3",
"jquery": "^3.1.1",
"laravel-mix": "0.*",
"lodash": "^4.17.4",
"vue": "^2.1.10"
},
"dependencies": {
"animate-scss": "^3.2.1",
"eslint": "^3.19.0",
"eslint-plugin-ava": "^4.2.0",
"eslint-watch": "^3.1.0",
"font-awesome": "^4.7.0",
"jquery": "^3.1.1",
"jquery-colorbox": "^1.6.4",
"jquery-match-height": "^0.7.2",
"js-cookie": "^2.1.4",
"laravel-mix": "0.*",
"lodash": "^4.17.4",
"npm-run-all": "^4.0.2",
"require-extension-hooks": "^0.2.0",
"require-extension-hooks-babel": "^0.1.0",
"require-extension-hooks-vue": "^0.2.1",
"sinon": "^2.1.0",
"vue": "^2.1.10",
"vue-i18n": "^6.0.0"
}
}
Loading

0 comments on commit dfb2da1

Please sign in to comment.