Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.

Commit f697b2d

Browse files
authored
Merge pull request #13 from justcoded/develop
WSK 5.1.0
2 parents 4da7b98 + 0174717 commit f697b2d

4 files changed

Lines changed: 62 additions & 41 deletions

File tree

README.md

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,24 @@ Instruction for installation WSK please read in main repo [README.md](https://gi
3333
There are few commands available to help you build and test sites:
3434

3535

36+
### Test
37+
38+
Test run with logs
39+
40+
```sh
41+
$ npm run test
42+
```
43+
3644
### Development mode
3745

3846
Watch For Changes & Automatically Refresh Across Devices
3947

4048
```sh
41-
$ gulp
49+
$ npm run dev
4250
```
4351

44-
This includes linting as well as script, stylesheet and HTML compiling.
52+
`dev` creates the `assets` folder in the root of the project.
53+
This includes linting as well as image, script, stylesheet and HTML optimization.
4554
Also, a [browsersync](https://browsersync.io/) script will be automatically generated, which will take care of precaching your sites resources.
4655

4756

@@ -50,27 +59,40 @@ Also, a [browsersync](https://browsersync.io/) script will be automatically gene
5059
Serve the Fully Built & Optimized Site
5160

5261
```sh
53-
$ gulp build
62+
$ npm run build
5463
```
5564

56-
Command for building current project, ready for WordPress.
57-
This includes linting as well as script, stylesheet (group & sort CSS media queries) and HTML compiling.
65+
`build` creates the `production` folder in the root of the project with **minifying** files from `assets`. It will help you to create clear instances of code for the **production** or **further implementation**.
66+
5867

59-
### Linter - only for JS
68+
### Lint for HTML
6069

6170
```sh
62-
$ gulp lint-js
71+
$ npm run lint-html
6372
```
6473

65-
`gulp lint-js` task run the separate lint for JS files.
66-
Included in `gulp` and `gulp build` tasks.
74+
### Lint & fix for JS
6775

6876
```sh
69-
$ gulp fix-js
77+
$ npm run lint-js
7078
```
7179

72-
`gulp fix-js` task run lint and auto-fix (eslint method) for JS files.
73-
**Not included in any tasks**.
80+
`lint-js` run the separate lint for JS files.
81+
Included in `dev` and `build`.
82+
83+
```sh
84+
$ npm run fix-js
85+
```
86+
87+
`fix-js` run lint and auto-fix (eslint method) for JS files.
88+
**Not included in any mode**.
89+
90+
91+
### Lint for HTML & JS
92+
93+
```sh
94+
$ npm run lint
95+
```
7496

7597
## Structure
7698

package.json

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-starter-jc-wp",
3-
"version": "5.0.0",
3+
"version": "5.1.0",
44
"description": "Starter kit for markup projects",
55
"repository": {
66
"type": "git",
@@ -20,42 +20,45 @@
2020
},
2121
"homepage": "https://github.com/justcoded/web-starter-kit-wp",
2222
"devDependencies": {
23-
"@babel/core": "7.11.1",
23+
"@babel/core": "7.11.6",
2424
"@babel/plugin-proposal-object-rest-spread": "7.11.0",
2525
"@babel/plugin-syntax-dynamic-import": "7.8.3",
26-
"@babel/plugin-transform-runtime": "7.11.0",
27-
"@babel/preset-env": "7.11.0",
26+
"@babel/plugin-transform-runtime": "7.11.5",
27+
"@babel/preset-env": "7.11.5",
2828
"@babel/runtime": "7.11.2",
29-
"autoprefixer": "9.8.6",
29+
"autoprefixer": "10.0.0",
3030
"babel-loader": "8.1.0",
3131
"browser-sync": "2.26.12",
3232
"del": "5.1.0",
33-
"eslint": "7.8.1",
33+
"eslint": "7.9.0",
3434
"eslint-config-airbnb-base": "14.2.0",
3535
"eslint-plugin-import": "2.22.0",
3636
"gulp": "4.0.2",
3737
"gulp-debug": "4.0.0",
3838
"gulp-file-include": "2.2.2",
3939
"gulp-htmlhint": "3.0.1",
4040
"gulp-if": "3.0.0",
41-
"gulp-postcss": "8.0.0",
41+
"gulp-postcss": "9.0.0",
4242
"gulp-sass": "4.1.0",
43-
"gulp-sourcemaps": "2.6.5",
4443
"htmlhint-stylish": "1.0.3",
4544
"node-notifier": "8.0.0",
45+
"postcss": "8.0.9",
4646
"postcss-import": "12.0.1",
47-
"postcss-sort-media-queries": "1.7.26",
48-
"sass": "1.26.10",
49-
"webpack": "4.44.1"
47+
"postcss-sort-media-queries": "2.0.3",
48+
"sass": "1.26.11",
49+
"webpack": "4.44.2"
5050
},
5151
"engines": {
5252
"node": ">=10.0.0"
5353
},
5454
"scripts": {
55-
"dev": "gulp",
56-
"test": "gulp build --log-level -LLLL",
57-
"build": "gulp build",
58-
"fix-js": "gulp fix-js"
55+
"dev": "npx gulp",
56+
"test": "npx gulp build --log-level -LLLL",
57+
"build": "npx gulp build",
58+
"lint-html": "npx gulp lint-html",
59+
"lint-js": "npx gulp lint-js",
60+
"fix-js": "npx gulp fix-js",
61+
"lint": "npm run lint-html lint-js"
5962
},
6063
"dependencies": {
6164
"normalize.css": "8.0.1"

tasks/build-styles-custom.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
const gulp = require('gulp');
77
const sass = require('gulp-sass');
88
const postcss = require('gulp-postcss');
9-
const gulpif = require('gulp-if');
10-
const sourcemaps = require('gulp-sourcemaps');
119
const autoprefixer = require('autoprefixer');
1210
const gcmq = require('postcss-sort-media-queries');
1311

@@ -23,17 +21,17 @@ module.exports = function () {
2321
autoprefixer(),
2422
];
2523

26-
isGcmq ? plugins.push(gcmq({ sort: global.buildStyles.sortType, })) : null;
24+
if (isGcmq) {
25+
plugins.push(gcmq({ sort: global.buildStyles.sortType, }));
26+
}
2727

2828
return (done) => {
2929
if (files.length > 0) {
30-
return gulp.src(files)
31-
.pipe(gulpif(!production, sourcemaps.init({ loadMaps: true, })))
30+
return gulp.src(files, { sourcemaps: !production })
3231
.pipe(sass.sync({ sourceMap: !production, }))
3332
.on('error', (error) => notifier.error(error.message, 'Custom Sass compiling error', done))
3433
.pipe(postcss(plugins))
35-
.pipe(gulpif(!production, sourcemaps.write('./')))
36-
.pipe(gulp.dest(`../${global.folder.build}/css`));
34+
.pipe(gulp.dest(`../${global.folder.build}/css`, { sourcemaps: './' }));
3735
}
3836

3937
return done();

tasks/build-styles.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
const gulp = require('gulp');
77
const sass = require('gulp-sass');
88
const postcss = require('gulp-postcss');
9-
const gulpif = require('gulp-if');
10-
const sourcemaps = require('gulp-sourcemaps');
119
const autoprefixer = require('autoprefixer');
1210
const gcmq = require('postcss-sort-media-queries');
1311

@@ -22,15 +20,15 @@ module.exports = function () {
2220
autoprefixer(),
2321
];
2422

25-
production ? plugins.push(gcmq({ sort: global.buildStyles.sortType, })) : null;
23+
if (production) {
24+
plugins.push(gcmq({ sort: global.buildStyles.sortType, }));
25+
}
2626

2727
return (done) => {
28-
return gulp.src(`./scss/${global.file.mainStylesSrc}`)
29-
.pipe(gulpif(!production, sourcemaps.init({ loadMaps: true, })))
28+
return gulp.src(`./scss/${global.file.mainStylesSrc}`, { sourcemaps: !production })
3029
.pipe(sass.sync({ sourceMap: !production, }))
3130
.on('error', (error) => notifier.error(error.message, 'Main Sass compiling error', done))
3231
.pipe(postcss(plugins))
33-
.pipe(gulpif(!production, sourcemaps.write('./')))
34-
.pipe(gulp.dest(`../${global.folder.build}/css`));
32+
.pipe(gulp.dest(`../${global.folder.build}/css`, { sourcemaps: './' }));
3533
};
3634
};

0 commit comments

Comments
 (0)