Skip to content

Commit ba9eaeb

Browse files
Updated Gulp version
- Updated Gulp version to v4.x.x - Added yarn support - Removed SVG and cache clean tasks - Renamed task es6 to babel - Fixed watchStyles task - Updated dependencies
1 parent 834c4d4 commit ba9eaeb

31 files changed

+22257
-443
lines changed

.gitignore.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/gulpfile.js
2+
/dev/tools/gulp
3+
/dev/tools/grunt/configs/local-themes.js
4+
/.stylelintrc
5+
/.eslintrc
6+
/.babelrc

README.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Check for Node and NPM
44

5-
Make sure that you've installed Node and NPM before attempting to install gulp (supports `gulp 3.x.x`).
5+
Make sure that you've installed Node and NPM before attempting to install gulp (supports gulp `4.x.x`). For gulp `3.x.x` use [~1.4.0](https://github.com/bobmotor/magento-2-gulp/tree/v1.4.1) version.
66
```
77
$ node -v
88
```
@@ -38,13 +38,17 @@ $ composer require --dev bobmotor/magento-2-gulp
3838

3939
Rename the following files in your project root directory
4040

41-
* `package.json.sample-aws` to `package.json`
41+
* `package.json.example` to `package.json`
4242

4343
Install modules listed as dependencies in `package.json`
4444

4545
```
4646
$ npm install
4747
```
48+
or
49+
```
50+
$ yarn
51+
```
4852

4953
- ### Manually
5054

@@ -53,13 +57,17 @@ Copy source files to your project root directory
5357

5458
Rename the following files in your project root directory
5559

56-
* `package.json.sample-aws` to `package.json`
60+
* `package.json.example` to `package.json`
5761

5862
Install modules listed as dependencies in `package.json`
5963

6064
```
6165
$ npm install
6266
```
67+
or
68+
```
69+
$ yarn
70+
```
6371

6472
## Configuration
6573

@@ -87,9 +95,9 @@ Example:
8795
```
8896
module.exports = {
8997
...
90-
capezio: {
98+
themeName: {
9199
area: 'frontend',
92-
name: 'Aws/capezio',
100+
name: 'Package/themeName',
93101
locale: 'en_US',
94102
files: [
95103
'css/styles-m',
@@ -101,7 +109,7 @@ module.exports = {
101109
}
102110
```
103111

104-
Rename `dev/tools/gulp/configs/local.js.sample-aws` to `dev/tools/gulp/configs/local.js` and set your `hostname` to configure `BrowserSync` and `Critical CSS` urls.
112+
Open `dev/tools/gulp/configs/local.js` and set your `hostname` to configure `BrowserSync` and `Critical CSS` urls.
105113

106114
```
107115
module.exports = {
@@ -115,7 +123,7 @@ Example:
115123

116124
```
117125
module.exports = {
118-
hostname: 'capezio',
126+
hostname: 'localhost',
119127
generic: 'loc',
120128
useHttp2: true
121129
};
@@ -174,14 +182,12 @@ In project root dir run `gulp [command] --[theme] --[arguments]`
174182
Avaliable commands:
175183

176184
```
177-
cache-clean Clean Magento cache
185+
babel Compile ES6+ to ES5
178186
clean Remove cached files (pub/static/*, var/*)
179187
critical Compile critical css
180188
default, help Display this help message
181-
es6 Compile ES6+ to ES5
182189
exec Republishes symlinks to the source files
183190
less Compile LESS to CSS
184-
svg Create svg sprite
185191
watch-scripts Watch for src/*.js files
186192
watch-styles Watch for *.less files
187193
```
@@ -200,23 +206,22 @@ Examples:
200206

201207
Removes the theme related static files in the `pub/static` and `var` directories, republishes symlinks to the source files to the `pub/static/frontend/ directory` and compiles CSS files using the symlinks published in the `pub/static/frontend/ directory` with source map and minification.
202208
```
203-
gulp clean --capezio && gulp exec --capezio && gulp less --capezio --map --min
209+
gulp clean --luma && gulp exec --luma && gulp less --luma --map --min
204210
```
205-
Compiles CSS files using the symlinks published in the `pub/static/frontend/ directory` with source map.
211+
Compiles CSS files using the symlinks published in the `pub/static/frontend/` directory with source map.
206212
```
207-
gulp less --capezio --map
213+
gulp less --luma --map
208214
```
209215
Watch styles with `livereload` (`LiveReload` browser extension should be installed)
210216
```
211-
gulp watch-styles --capezio --map --live
217+
gulp watch-styles --luma --live
212218
```
213219
Creates `critical.css` from `styles-l.css` and `styles-m.css` and put it to `app/design/frontend/<VandorName>/<ThemeName>/web/css`.
214220
In `production` mode should be run after `php bin/magento s:s:d` (task uses `pub/static/deployed_version.txt` to create absolute path to the static files)
215221
```
216-
gulp critical --capezio
222+
gulp critical --luma
217223
```
218224

219225
Note:
220226

221227
* ES6 files should be placed at `.../web/js/src/*.js`. Compiled files will be in the `.../web/js/*.js`
222-
* svg icons (`*.svg`) need to be uploaded to `app/design/frontend/<VandorName>/<ThemeName>/web/images/icons/`

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"homepage": "https://github.com/bobmotor/magento-2-gulp",
77
"authors": [
88
{
9-
"name": "Absolute Web"
9+
"name": "Volodymyr Lisniak <thebobmotor@gmail.com>"
1010
}
1111
],
1212
"minimum-stability": "dev",
@@ -19,8 +19,8 @@
1919
"gulpfile.js",
2020
"gulpfile.js"
2121
], [
22-
"package.json.sample-aws",
23-
"package.json.sample-aws"
22+
"package.json.example",
23+
"package.json.example"
2424
], [
2525
".stylelintrc",
2626
".stylelintrc"
@@ -30,6 +30,9 @@
3030
], [
3131
".babelrc",
3232
".babelrc"
33+
], [
34+
".gitignore.example",
35+
".gitignore.example"
3336
]
3437
]
3538
}

dev/tools/gulp/args.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
/**
2-
* Absolute Web Services Intellectual Property
3-
*
4-
* @category {development/deployment}
5-
* @copyright Copyright © 1999-2020 Absolute Web Services, Inc. (http://www.absolutewebservices.com)
6-
* @author Absolute Web Services
7-
* @license http://www.absolutewebservices.com/license-agreement/ Single domain license
8-
* @terms of use http://www.absolutewebservices.com/terms-of-use/
9-
*/
10-
111
const devArgs = require('./constants/devArgs');
122

133
const devArguments = (argList => {

dev/tools/gulp/configs/bsConfig.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
/**
2-
* Absolute Web Services Intellectual Property
3-
*
4-
* @category {development/deployment}
5-
* @copyright Copyright © 1999-2020 Absolute Web Services, Inc. (http://www.absolutewebservices.com)
6-
* @author Absolute Web Services
7-
* @license http://www.absolutewebservices.com/license-agreement/ Single domain license
8-
* @terms of use http://www.absolutewebservices.com/terms-of-use/
9-
*/
10-
111
const localConfig = require('./local');
122

133
const ptotocol = localConfig.useHttp2 ? 'https' : 'http';
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
/**
2-
* Absolute Web Services Intellectual Property
3-
*
4-
* @category {development/deployment}
5-
* @copyright Copyright © 1999-2020 Absolute Web Services, Inc. (http://www.absolutewebservices.com)
6-
* @author Absolute Web Services
7-
* @license http://www.absolutewebservices.com/license-agreement/ Single domain license
8-
* @terms of use http://www.absolutewebservices.com/terms-of-use/
9-
*/
10-
111
const localConfig = require('./local');
122

133
const ptotocol = localConfig.useHttp2 ? 'https' : 'http';
@@ -16,6 +6,6 @@ module.exports = {
166
out: 'critical.css',
177
url: `${ptotocol}://${localConfig.hostname}.${localConfig.generic}/`,
188
width: 1920,
19-
height: 900,
9+
height: 200,
2010
forceExclude: [/\[data-role=main-css-loader]/]
2111
};

dev/tools/gulp/constants/commands.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
1-
/**
2-
* Absolute Web Services Intellectual Property
3-
*
4-
* @category {development/deployment}
5-
* @copyright Copyright © 1999-2020 Absolute Web Services, Inc. (http://www.absolutewebservices.com)
6-
* @author Absolute Web Services
7-
* @license http://www.absolutewebservices.com/license-agreement/ Single domain license
8-
* @terms of use http://www.absolutewebservices.com/terms-of-use/
9-
*/
10-
111
module.exports = {
12-
CACHE_FLUSH_COMMAND: 'cache:flush',
132
EXECUTION_FILE: 'php bin/magento',
143
EXEC_COMMAND: 'dev:source-theme:deploy'
154
};

dev/tools/gulp/constants/devArgs.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
/**
2-
* Absolute Web Services Intellectual Property
3-
*
4-
* @category {development/deployment}
5-
* @copyright Copyright © 1999-2020 Absolute Web Services, Inc. (http://www.absolutewebservices.com)
6-
* @author Absolute Web Services
7-
* @license http://www.absolutewebservices.com/license-agreement/ Single domain license
8-
* @terms of use http://www.absolutewebservices.com/terms-of-use/
9-
*/
10-
111
module.exports = {
122
BS_KEY: 'bs',
133
LIVE_KEY: 'live',

dev/tools/gulp/constants/folders.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
1-
/**
2-
* Absolute Web Services Intellectual Property
3-
*
4-
* @category {development/deployment}
5-
* @copyright Copyright © 1999-2020 Absolute Web Services, Inc. (http://www.absolutewebservices.com)
6-
* @author Absolute Web Services
7-
* @license http://www.absolutewebservices.com/license-agreement/ Single domain license
8-
* @terms of use http://www.absolutewebservices.com/terms-of-use/
9-
*/
10-
111
module.exports = {
122
CACHED_FILES: ['var/cache/**', 'var/view_preprocessed/**'],
133
CRITICAL_CSS_DEST: 'web/css',
144
CSS_FOLDER: 'css',
15-
IMAGE_SVG_FOLDER: 'web/',
16-
IMAGE_SVG_FOLDER_DEST: 'web/images/icons/',
17-
IMAGE_SVG_FOLDER_SRC: 'web/images/icons/**/*',
18-
IMAGE_SVG_STYLES_FOLDER_DEST: '../../../css/source/aws/_aws-sprite-svg.less',
19-
IMAGE_SVG_STYLE_FILE: 'web/css/source/aws/_aws-sprite-svg.less',
20-
IMAGE_SVG_SPRITE_FOLDER: 'web/images/icons/svg',
21-
IMAGE_SVG_SPRITE_FOLDER_DEST: '../../../images/icons/svg/aws-sprite.svg',
225
JS_FOLDER_BASEDIR: 'app/',
236
JS_FOLDER_DIST: '../',
247
JS_FOLDER_SRC: 'app/**/web/js/**/src/*.js',

0 commit comments

Comments
 (0)