Skip to content

Commit 85cabc9

Browse files
authored
Merge pull request #145 from justcoded/develop
Develop
2 parents 857fca4 + fb7dcce commit 85cabc9

22 files changed

+827
-182
lines changed

.babelrc

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
{
22
"presets": [
3-
["@babel/env", {"modules": false}]
3+
[
4+
"@babel/env",
5+
{
6+
"modules": false,
7+
"forceAllTransforms": true
8+
}
9+
]
410
],
5-
"plugins": []
11+
"plugins": [
12+
"@babel/plugin-syntax-dynamic-import",
13+
"@babel/plugin-proposal-object-rest-spread",
14+
[
15+
"@babel/plugin-transform-runtime",
16+
{
17+
"helpers": false
18+
}
19+
]
20+
]
621
}

.eslintrc

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
22
"root": true,
3-
"globals": {
4-
"jQuery": true,
5-
"$": true
6-
},
3+
"globals": {},
74
"env": {
85
"browser": true,
96
"node": true

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ branches:
44
only:
55
- master
66
node_js:
7+
- '14'
78
- '13'
89
- '12'
910
- '11'

README.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This is not to say that WSK cannot be used in browsers older than those reflecte
5151
| HTML templating | Used [gulp-file-include](https://github.com/haoxins/gulp-file-include) for templating html files. |
5252
| Sass support | Compile [Sass](http://sass-lang.com/) into CSS with ease, bringing support for variables, mixins and more (run `gulp` for project compiling). In our WSK we use [Dart-Sass](https://sass-lang.com/dart-sass) version compiler and follow [Sass guidelines](https://sass-guidelin.es/#architecture). |
5353
| PostCSS support | PostCSS connecting most usable plugins library for CSS optimisation. In our WSK we use [autoprefixer](https://github.com/postcss/autoprefixer), [cssnano](https://github.com/cssnano/cssnano), [postcss-sort-media-queries](https://github.com/solversgroup/postcss-sort-media-queries), etc. |
54-
| JavaScript ES6+ Support | Optional JavaScript ES6+ support .You can use all kind of ES6+ features here. ES6+ source code will be automatically transpiled to ES5 for wide browser support. For bundling and transpiling used [Rollup](https://rollupjs.org/) and [Babel](https://babeljs.io/). |
54+
| JavaScript ES6+ Support | Optional JavaScript ES6+ support .You can use all kind of ES6+ features here. ES6+ source code will be automatically transpiled to ES5 for wide browser support. For bundling and transpiling used [Webpack](https://webpack.js.org/) and [Babel](https://babeljs.io/). |
5555
| Code Linting | JavaScript code linting is done using [esLint](https://eslint.org/) - a linter tool for identifying and reporting on patterns in JavaScript (used [airbnb-base rules](https://www.npmjs.com/package/eslint-config-airbnb-base)). HTML code linting is done using [HTMLHint](https://github.com/htmlhint/HTMLHint). |
5656
| Performance optimization | Minify and concatenate JavaScript, CSS, HTML and images to help keep your pages lean (run `gulp` to create an optimised version of your project to `assets`). |
5757
| Built-in HTTP Server | A built-in server for previewing your site locally while you develop and iterate. |
@@ -227,8 +227,6 @@ In `package.json` you can find all the dependencies. Folder `tasks` - for gulpfi
227227
├── pages #Global styles for pages
228228
├── styles.scss #Main file to import project styles (used for importing another files)
229229
├── vendor_entries #Folder for vendor entries (plugins)
230-
├── vendor.js #File for plugins js
231-
├── vendor-compile.js #File for compiling (bunling) plugins js
232230
├── vendor.scss #File for plugins styles
233231
```
234232

@@ -283,14 +281,13 @@ In our WSK we use **CSS3 custom properties** and **relative units** `rem`. By de
283281

284282
It is not an alternative syntax or language like CoffeeScript or TypeScript. It's good ol' fashioned JavaScript. The reason so many people are excited is that this version introduces a lot of much-needed improvements to the language.
285283

286-
For bundling and transpiling `.js` files in our WSK we used [Rollup](https://rollupjs.org/) and [Babel](https://babeljs.io/).
284+
For bundling and transpiling `.js` files in our WSK we used [Webpack](https://webpack.js.org/) and [Babel](https://babeljs.io/).
287285

288286
* All custom **javascript** files are located in `js` folder;
289287
* Entry point for javascript is `src/js/app.js` you can **import** all your **javascript** files from here using [ES6 import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) feature;
290288
* All **javascript** is **babelified** so yes! You can use all kind of [ES6 features](https://babeljs.io/docs/learn-es2015/) here.
291289
* All **extensions** must be installed by the [npm](https://docs.npmjs.com/cli/install);
292-
* After installing the extension you must **include** its **javascript** files in `src/vendor_entries/vendor.js` by adding new elements to the **array**.
293-
* If you using ES modules or any types of modules, please import your modules in `src/vendor_entries/vendor-compile.js`.
290+
* All third party libraries from `node_modules` and `src/vendor_entries`, are automatically separate in `vendor.js`.
294291

295292
In **build (production)** mode we use:
296293

@@ -314,8 +311,7 @@ For minify images used [gulp-imagemin](https://github.com/sindresorhus/gulp-imag
314311
| --- | --- |
315312
| browser-sync-server | Browsersync can watch your files as you work. Changes you make will either be injected into the page (CSS & images) or will cause all browsers to do a full-page refresh. |
316313
| build-html | Compiles all html templates into html files. |
317-
| build-js | Compiles all js from `src/js` to `assets/js` folder. |
318-
| build-js-vendors | Compiles all vendor js from `src/vendor_entries` to `assets/js` folder. |
314+
| build-js | Compiles all js from `src/js` to `assets/js` folder. Automatically separate your code and vendors. |
319315
| build-styles | Compiles all scss from `src/scss` to `assets/css` folder. |
320316
| build-styles-custom | Compiles all custom scss files listed in the `gulp-config.js` to `assets/css` folder |
321317
| build-styles-vendors | Compiles all vendor styles from `src/vendor_entries` to `assets/css` folder. |

gulp-config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module.exports = {
55
fixJs: 'fix-js',
66
buildHtml: 'build-html',
77
buildJs: 'build-js',
8-
buildJsVendors: 'build-js-vendors',
98
buildStyles: 'build-styles',
109
buildStylesCustom: 'build-styles-custom',
1110
buildStylesVendors: 'build-styles-vendors',
@@ -22,16 +21,13 @@ module.exports = {
2221
src: 'src',
2322
dev: 'assets',
2423
build: 'production',
25-
temp: '.temp',
2624
},
2725
file: {
2826
mainHtml: 'index.html',
2927
mainJs: 'app.js',
3028
mainJsMin: 'app.min.js',
3129
vendorJs: 'vendor.js',
3230
vendorJsMin: 'vendor.min.js',
33-
vendorJsComp: 'vendor-compile.js',
34-
vendorJsTemp: 'vendor.temp.js',
3531
mainStylesSrc: 'styles.scss',
3632
mainStyles: 'styles.css',
3733
mainStylesMin: 'styles.min.css',
@@ -46,6 +42,9 @@ module.exports = {
4642
// Sorting type css media queries: 'desktop-first' || 'mobile-first'
4743
sortType: 'desktop-first',
4844
},
45+
buildJs: {
46+
externalLibs: {},
47+
},
4948
buildImages: {
5049
imageExtensions: 'jpg,jpeg,png,svg,gif,ico',
5150
isImageMin: false,
@@ -59,6 +58,7 @@ module.exports = {
5958
getFilesForStylesCustom() {
6059
return {
6160
files: [],
61+
// gcmq - group css media queries
6262
isGcmq: false,
6363
};
6464
},

gulpfile.js

+28-21
Original file line numberDiff line numberDiff line change
@@ -30,80 +30,89 @@ const browserSyncInstance = require('browser-sync').create();
3030

3131
const global = require('./gulp-config.js');
3232

33+
const cleanBuild = require('./tasks/clean-build');
34+
const lintHtml = require('./tasks/lint-html');
35+
const buildHtml = require('./tasks/build-html');
36+
const buildStyles = require('./tasks/build-styles');
37+
const buildStylesCustom = require('./tasks/build-styles-custom');
38+
const buildStylesVendors = require('./tasks/build-styles-vendors');
39+
const lintJs = require('./tasks/lint-js');
40+
const buildJs = require('./tasks/build-js');
41+
const buildImages = require('./tasks/build-images');
42+
const copyFiles = require('./tasks/copy-files');
43+
const copyFilesProd = require('./tasks/copy-files-production');
44+
const browserSync = require('./tasks/browser-sync-server');
45+
const watch = require('./tasks/watch');
46+
3347
/**
3448
* Clean build folders
3549
*/
36-
gulp.task(global.task.cleanBuild, require('./tasks/clean-build')());
50+
gulp.task(global.task.cleanBuild, cleanBuild());
3751

3852
/**
3953
* Lint HTML
4054
*/
41-
gulp.task(global.task.lintHtml, require('./tasks/lint-html')());
55+
gulp.task(global.task.lintHtml, lintHtml());
4256

4357
/**
4458
* Template HTML
4559
*/
46-
gulp.task(global.task.buildHtml, require('./tasks/build-html')());
60+
gulp.task(global.task.buildHtml, buildHtml());
4761

4862
/**
4963
* Build styles for application
5064
*/
51-
gulp.task(global.task.buildStyles, require('./tasks/build-styles')());
65+
gulp.task(global.task.buildStyles, buildStyles());
5266

5367
/**
5468
* Build styles custom files listed in the config
5569
*/
56-
gulp.task(global.task.buildStylesCustom, require('./tasks/build-styles-custom')());
70+
gulp.task(global.task.buildStylesCustom, buildStylesCustom());
5771

5872
/**
5973
* Build styles for vendor
6074
*/
61-
gulp.task(global.task.buildStylesVendors, require('./tasks/build-styles-vendors')());
75+
gulp.task(global.task.buildStylesVendors, buildStylesVendors());
6276

6377
/**
6478
* Lint JS
6579
*/
66-
gulp.task(global.task.lintJs, require('./tasks/lint-js')());
80+
gulp.task(global.task.lintJs, lintJs());
6781

6882
/**
6983
* Fix JS files
7084
*/
71-
gulp.task(global.task.fixJs, require('./tasks/lint-js')());
85+
gulp.task(global.task.fixJs, lintJs());
7286

7387
/**
7488
* Build JS
7589
*/
76-
gulp.task(global.task.buildJs, require('./tasks/build-js')());
77-
78-
/**
79-
* Build JS vendor (concatenate vendors array)
80-
*/
81-
gulp.task(global.task.buildJsVendors, require('./tasks/build-js-vendors')());
90+
gulp.task(global.task.buildJs, buildJs());
8291

8392
/**
8493
* Copy & minify images
8594
*/
86-
gulp.task(global.task.buildImages, require('./tasks/build-images')());
95+
gulp.task(global.task.buildImages, buildImages());
8796

8897
/**
8998
* Copy folders to the build folder
9099
*/
91-
gulp.task(global.task.copyFiles, require('./tasks/copy-files')());
100+
gulp.task(global.task.copyFiles, copyFiles());
92101

93102
/**
94103
* Copy folders to the production folder
95104
*/
96-
gulp.task(global.task.copyFilesProd, require('./tasks/copy-files-production')());
105+
gulp.task(global.task.copyFilesProd, copyFilesProd());
97106

98107
/**
99108
* Start browserSync server
100109
*/
101-
gulp.task(global.task.browserSync, require('./tasks/browser-sync-server')({ browserSyncInstance }));
110+
gulp.task(global.task.browserSync, browserSync({ browserSyncInstance }));
102111

103112
/**
104113
* Watch for file changes
105114
*/
106-
gulp.task(global.task.watch, require('./tasks/watch')({ browserSyncInstance }));
115+
gulp.task(global.task.watch, watch({ browserSyncInstance }));
107116

108117
/**
109118
* Develop mode - with browser sync, file watch & live reload
@@ -123,7 +132,6 @@ gulp.task('default', gulp.series(
123132
),
124133
gulp.series(
125134
global.task.buildJs,
126-
global.task.buildJsVendors,
127135
),
128136
),
129137
global.task.buildImages,
@@ -152,7 +160,6 @@ gulp.task(global.task.build, gulp.series(
152160
),
153161
gulp.series(
154162
global.task.buildJs,
155-
global.task.buildJsVendors,
156163
),
157164
),
158165
global.task.buildImages,

package.json

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-starter-jc",
3-
"version": "4.1.0",
3+
"version": "5.0.0",
44
"description": "Starter kit for markup projects",
55
"repository": {
66
"type": "git",
@@ -19,37 +19,38 @@
1919
},
2020
"homepage": "https://github.com/justcoded/web-starter-kit",
2121
"devDependencies": {
22-
"@babel/core": "7.9.0",
23-
"@babel/preset-env": "7.9.0",
24-
"@rollup/plugin-node-resolve": "7.1.1",
25-
"autoprefixer": "9.7.5",
26-
"browser-sync": "2.26.7",
22+
"@babel/core": "7.11.1",
23+
"@babel/plugin-proposal-object-rest-spread": "7.11.0",
24+
"@babel/plugin-syntax-dynamic-import": "7.8.3",
25+
"@babel/plugin-transform-runtime": "7.11.0",
26+
"@babel/preset-env": "7.11.0",
27+
"@babel/runtime": "7.11.2",
28+
"autoprefixer": "9.8.6",
29+
"babel-loader": "8.1.0",
30+
"browser-sync": "2.26.12",
2731
"cssnano": "4.1.10",
2832
"del": "5.1.0",
29-
"eslint": "6.8.0",
30-
"eslint-config-airbnb-base": "14.1.0",
31-
"eslint-plugin-import": "2.20.1",
32-
"files-exist": "1.1.0",
33+
"eslint": "7.8.1",
34+
"eslint-config-airbnb-base": "14.2.0",
35+
"eslint-plugin-import": "2.22.0",
3336
"gulp": "4.0.2",
34-
"gulp-concat": "2.6.1",
3537
"gulp-debug": "4.0.0",
36-
"gulp-file-include": "2.1.1",
37-
"gulp-htmlhint": "3.0.0",
38+
"gulp-file-include": "2.2.2",
39+
"gulp-htmlhint": "3.0.1",
3840
"gulp-if": "3.0.0",
3941
"gulp-imagemin": "7.1.0",
4042
"gulp-newer": "1.4.0",
4143
"gulp-postcss": "8.0.0",
4244
"gulp-rename": "2.0.0",
43-
"gulp-sass": "4.0.2",
45+
"gulp-sass": "4.1.0",
4446
"gulp-sourcemaps": "2.6.5",
4547
"htmlhint-stylish": "1.0.3",
46-
"node-notifier": "7.0.0",
48+
"node-notifier": "8.0.0",
4749
"postcss-import": "12.0.1",
48-
"postcss-sort-media-queries": "1.4.23",
49-
"rollup": "2.7.1",
50-
"rollup-plugin-babel": "4.4.0",
51-
"rollup-plugin-terser": "5.3.0",
52-
"sass": "1.26.3"
50+
"postcss-sort-media-queries": "1.7.26",
51+
"sass": "1.26.10",
52+
"terser-webpack-plugin": "4.1.0",
53+
"webpack": "4.44.1"
5354
},
5455
"engines": {
5556
"node": ">=10.0.0"
@@ -61,8 +62,7 @@
6162
"fix-js": "gulp fix-js"
6263
},
6364
"dependencies": {
64-
"include-media": "1.4.9",
65-
"jquery": "3.5.0",
65+
"jquery": "3.5.1",
6666
"normalize.css": "8.0.1"
6767
}
6868
}

src/html/partials/head/head.html

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<meta charset="utf-8">
33
<meta name="viewport" content="width=device-width, initial-scale=1.0">
44
<title>Web Starter Kit</title>
5+
<link rel="icon"
6+
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🚀</text></svg>">
57
<link media="all" rel="stylesheet" href="@@webRoot/css/@@vendorStyles">
68
<link media="all" rel="stylesheet" href="@@webRoot/css/@@mainStyles">
79
</head>

src/js/app.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
//
33
// This file will be compiled into app.js
44
// Feel free with using ES6 here.
5+
import $ from 'jquery';
56

67
import dots from './modules/dots';
78

8-
(($) => {
9-
// When DOM is ready
10-
$(() => {
11-
dots();
12-
});
13-
})(jQuery);
9+
// When DOM is ready
10+
$(() => {
11+
dots();
12+
});

src/js/modules/dots.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// This is an examples of simple export.
22
//
33
// You can remove or add your own function in this file.
4+
import $ from 'jquery';
45

56
const _createCells = () => {
67
const width = 10;
@@ -20,6 +21,7 @@ const _createCells = () => {
2021
const dots = () => {
2122
const $cnt = $('.entry-section');
2223
const cells = _createCells();
24+
2325
$cnt.html(cells);
2426
};
2527

src/scss/abstracts/helpers.scss

+1-4
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,5 @@
5757
/// * 2. Add ellipsis at the end of the line.
5858

5959
.ellipsis {
60-
white-space: nowrap; // 1
61-
text-overflow: ellipsis; // 2
62-
overflow: hidden;
60+
@include ellipsis;
6361
}
64-

0 commit comments

Comments
 (0)