Skip to content

Commit

Permalink
[UI] New gulp config
Browse files Browse the repository at this point in the history
  • Loading branch information
lchrusciel committed Jun 7, 2018
1 parent d1bfcee commit 03552ea
Show file tree
Hide file tree
Showing 8 changed files with 2,936 additions and 723 deletions.
20 changes: 20 additions & 0 deletions .babelrc
@@ -0,0 +1,20 @@
{
"presets": [
["env", {
"targets": {
"node": "6"
},
"useBuiltIns": true
}]
],
"plugins": [
["transform-object-rest-spread", {
"useBuiltIns": true
}],
["transform-runtime", {
"helpers": true,
"polyfill": true,
"regenerator": true
}]
]
}
13 changes: 13 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,13 @@
module.exports = {
extends: 'airbnb-base',
rules: {
'function-paren-newline': ['error', 'consistent'],
'max-len': ['warn', 120, 2, {
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
},
};
2 changes: 1 addition & 1 deletion .platform.app.yaml
Expand Up @@ -77,7 +77,7 @@ hooks:
php bin/console --env=prod --no-debug --ansi cache:warmup
php bin/console --env=prod --no-debug --ansi assets:install
yarn install
GULP_ENV=prod yarn run gulp
GULP_ENV=prod yarn build
deploy: |
rm -rf var/cache/*
rm -rf var/media/*
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -37,7 +37,7 @@ before_script:
- bin/console doctrine:migrations:migrate --no-interaction --env=test_cached --no-debug -vvv

- bin/console assets:install --env=test_cached --no-debug -vvv
- yarn run gulp
- yarn build

# Configure display
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1680x1050x16
Expand Down
36 changes: 0 additions & 36 deletions Gulpfile.js

This file was deleted.

62 changes: 62 additions & 0 deletions gulpfile.babel.js
@@ -0,0 +1,62 @@
import chug from 'gulp-chug';
import gulp from 'gulp';
import yargs from 'yargs';

const { argv } = yargs
.options({
rootPath: {
description: '<path> path to web assets directory',
type: 'string',
requiresArg: true,
required: false,
},
nodeModulesPath: {
description: '<path> path to node_modules directory',
type: 'string',
requiresArg: true,
required: false,
},
});

const config = [
'--rootPath',
argv.rootPath || '../../../../../../../web/assets',
'--nodeModulesPath',
argv.nodeModulesPath || '../../../../../../../node_modules',
];

export const buildAdmin = function buildAdmin() {
return gulp.src('vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/gulpfile.babel.js', { read: false })
.pipe(chug({ args: config, tasks: 'build' }));
};
buildAdmin.description = 'Build admin assets.';

export const watchAdmin = function watchAdmin() {
return gulp.src('vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/gulpfile.babel.js', { read: false })
.pipe(chug({ args: config, tasks: 'watch' }));
};
watchAdmin.description = 'Watch admin asset sources and rebuild on changes.';

export const buildShop = function buildShop() {
return gulp.src('vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/gulpfile.babel.js', { read: false })
.pipe(chug({ args: config, tasks: 'build' }));
};
buildShop.description = 'Build shop assets.';

export const watchShop = function watchShop() {
return gulp.src('vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/gulpfile.babel.js', { read: false })
.pipe(chug({ args: config, tasks: 'watch' }));
};
watchShop.description = 'Watch shop asset sources and rebuild on changes.';
export const build = gulp.parallel(buildAdmin, buildShop);
build.description = 'Build assets.';

export const watch = gulp.parallel(watchAdmin, watchShop);
watch.description = 'Watch asset sources and rebuild on changes.';

gulp.task('admin', buildAdmin);
gulp.task('admin-watch', watchAdmin);
gulp.task('shop', buildShop);
gulp.task('shop-watch', watchShop);

export default build;
20 changes: 16 additions & 4 deletions package.json
@@ -1,27 +1,39 @@
{
"dependencies": {
"babel-runtime": "^6.26.0",
"jquery": "^3.2.0",
"lightbox2": "^2.9.0",
"semantic-ui-css": "^2.2.0"
},
"devDependencies": {
"gulp": "^3.9.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.12.0",
"gulp": "^4.0.0",
"gulp-chug": "^0.5",
"gulp-concat": "^2.6.0",
"gulp-debug": "^2.1.2",
"gulp-if": "^2.0.0",
"gulp-livereload": "^3.8.1",
"gulp-order": "^1.1.1",
"gulp-sass": "^2.3.0",
"gulp-sass": "^4.0.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.1",
"gulp-uglifycss": "^1.0.5",
"merge-stream": "^1.0.0",
"node-sass": "^4.5.3",
"upath": "^1.1.0",
"yargs": "^6.4.0"
},
"scripts": {
"gulp": "gulp"
"build": "gulp build",
"gulp": "gulp build",
"lint": "yarn lint:js",
"lint:js": "eslint gulpfile.babel.js src/AppBundle/gulpfile.babel.js",
"watch": "gulp watch"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 03552ea

Please sign in to comment.