Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
ee9c65e
Watches the js files in the components folders
lejoe Aug 17, 2016
afd430e
Fixes JS error reporting in gulp
lejoe Aug 17, 2016
cad26bd
Merge pull request #117 from ginetta/fix-js-error-reporting
meodai Aug 18, 2016
de816e6
Merge pull request #116 from ginetta/fix-js-watch
meodai Aug 18, 2016
0aec0e2
Fixes the relative path calculations
lejoe Sep 1, 2016
8db1e7b
Merge pull request #119 from ginetta/bugfix/relative-path
lucalanca Sep 14, 2016
37c7a16
fixes babel loader for es 2015
meodai Oct 28, 2016
14c83af
adds es2015 linting
meodai Oct 28, 2016
e1a3c6e
make use of the query option
meodai Oct 28, 2016
8fd2c11
Merge pull request #120 from ginetta/es6-transpilin
lucalanca Oct 28, 2016
4520a76
makes sure its easier to mix classes with attributes
meodai Oct 31, 2016
acd9f16
Merge pull request #121 from ginetta/mixin-classes
lucalanca Oct 31, 2016
567aa88
Add Wercker to README
brunnolou Feb 9, 2017
c363194
Add wercker.yml
brunnolou Feb 9, 2017
75c42f1
Merge pull request #126 from ginetta/feature/wercker-support
lejoe Feb 9, 2017
5384d18
Removes the live deploy
lejoe Feb 14, 2017
28f9e8f
Adds npm-debug.log to .gitignore
lucalanca Feb 16, 2017
172009a
Merge pull request #128 from ginetta/feature/add-npm-debug-to-gitignore
lejoe Feb 16, 2017
593f8a7
Replaces jade by pug.
lucalanca Feb 16, 2017
563fb10
Merge pull request #131 from ginetta/feature/replaces-jade-by-pug
lejoe Feb 16, 2017
ffc63e0
Updates to webpack2
lucalanca Feb 16, 2017
b8d64fd
correct configuration for CommonChunksPlugin
lucalanca Feb 16, 2017
61dcc7a
Adds babel loader but moves configuration to its own file.
lucalanca Feb 16, 2017
bd6a398
Moves eslint file to its own file for better ide integration.
lucalanca Feb 16, 2017
98c0f84
adds airbnb-base extends as it provides better defaults.
lucalanca Feb 16, 2017
7a523f1
gulp eslint file disables browser environment.
lucalanca Feb 16, 2017
240c437
fix lint with airbnb-base rules.
lucalanca Feb 16, 2017
3159806
Removes our custom eslint rules (just kept the static complexity warn…
lucalanca Feb 17, 2017
af76771
Fixes lint error on header element.
lucalanca Feb 17, 2017
45c6a39
Cache-busting on scripts, styles, images and logos.
lucalanca Feb 3, 2017
96a1d61
Moved isProd to gulp/config.
lucalanca Feb 13, 2017
01efe7c
Forces build to be on production mode
lucalanca Feb 13, 2017
168de9d
doesn’t write original js files
lucalanca Feb 13, 2017
3c309a8
fixes css files not being copied on non production.
lucalanca Feb 13, 2017
ff33cd0
Also cache-busts images and logos.
lucalanca Feb 13, 2017
799f874
Removes unused merge import.
lucalanca Feb 16, 2017
5dd66fe
uses gulp-rev-replace also on scripts. merges all rev-manifest files …
lucalanca Feb 16, 2017
8818e08
defensive programming when there’s no images.
lucalanca Feb 16, 2017
d8d3b69
Fixes webpack commonchunks plugin vendor splitting.
lucalanca Feb 17, 2017
941d9bf
Moves .eslint from gulp to root (default is node) and creates .eslint…
lucalanca Feb 17, 2017
be6e418
Fixes linting on webpack.config.js
lucalanca Feb 17, 2017
c1029d2
Fixes linting.
lucalanca Feb 17, 2017
bf6bd0a
fixes node trailing comma error on functions.
lucalanca Feb 17, 2017
de96607
comma-dangle only on multi-line
lucalanca Feb 17, 2017
e17671e
Removes key-spacing and uses airbnb default.
lucalanca Feb 17, 2017
6c1c470
removes custom no-multi-spaces rule
lucalanca Feb 17, 2017
9c5c0c6
Adds webpack production settings.
lucalanca Feb 17, 2017
15109df
Adds styles settings
lucalanca Feb 17, 2017
55888bc
Fixes linting.
lucalanca Feb 17, 2017
8945351
performance improvements on mergeDefaultOptions
lucalanca Feb 17, 2017
9ae4c05
Fix lint errors on pageHelpers.js
lucalanca Feb 17, 2017
00133f3
Fix gulp handle error function
brunnolou Feb 18, 2017
050a1c0
Merge pull request #138 from ginetta/bugfix/error-handle-emit
lucalanca Feb 20, 2017
3c5d26e
Merge branch 'master' of https://github.com/ginetta/skeleton into fea…
lucalanca Feb 20, 2017
f2fe723
Merge branch 'master' of https://github.com/ginetta/skeleton into fea…
lucalanca Feb 20, 2017
ed9a569
Fixes .yaml files.
lucalanca Feb 20, 2017
ac8d1a2
fixes main.js
lucalanca Feb 20, 2017
93a25f6
fix pages task.
lucalanca Feb 20, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": ["es2015"],
"plugins": [
"syntax-trailing-function-commas"
]
}
39 changes: 29 additions & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
extends: 'airbnb-base'
env:
node: true
browser: false
rules:
# specify whether double or single quotes should be used
quotes: [2, "single", "avoid-escape"]

# controls location of Use Strict Directives
strict: [2, "global"]
no-multiple-empty-lines:
- 2
- max: 1

# disallow use of multiple spaces
no-multi-spaces: [0]
# Force trailing commas as this promotes smaller diffs. However
# we want to disable on functions, as this is invalid syntax (without any
# transpilation)
comma-dangle:
- 2
- arrays: only-multiline
objects: only-multiline
imports: only-multiline
exports: only-multiline
functions: never

# enforces spacing between keys and values in object literal properties
key-spacing: [0]

# allow just one var statement per function (off by default)
one-var: [2, {uninitialized: "always", initialized: "never"}]

# -------------------
# Static Complexity Rules: they guide us to write better code.
# -------------------

# specify the maximum number of statement allowed in a function
# (off by default)
Expand All @@ -31,3 +42,11 @@ rules:

# specify the maximum depth callbacks can be nested (off by default)
max-nested-callbacks: [1, 2]

# Forbid the import of external modules that are not declared in the
# package.json's dependencies, devDependencies, optionalDependencies or
# peerDependencies
# (note: we disable this rule because packages inside `src` behave like
# aliases: e.g.: require('elements/foo') works).
import/no-extraneous-dependencies: [0]
import/no-unresolved: [0]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules
.DS_Store
*.orig
.tmp
npm-debug.log
5 changes: 2 additions & 3 deletions readme.md → README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Skeleton - styleguide
This project is about creating templates to display a frontend styleguide
---

---

## Instructions to run the project

### Prerequisites
You will need
You will need
- [node.js](http://nodejs.org) to run the skeleton.

### Build
Expand Down
2 changes: 0 additions & 2 deletions gulp/.eslintrc

This file was deleted.

129 changes: 63 additions & 66 deletions gulp/config.js
Original file line number Diff line number Diff line change
@@ -1,108 +1,105 @@
'use strict';
var argv = require('yargs').argv;
var path = require('path');
const argv = require('yargs').argv;
const path = require('path');

module.exports = function (dest) {
var root = path.join(__dirname, '..');
var basePaths = {
root: path.join(__dirname, '..'),
src: root + '/src/',
content: root + '/content/',
assets: root + '/assets/',
dest: root + '/build/',
tmp: root + '/.tmp/'
module.exports = (dest) => {
const basePaths = {
root: path.join(__dirname, '..'),
src: 'src/',
content: 'content/',
assets: 'assets/',
dest: 'build/',
tmp: '.tmp/',
};

// This helps overwriting the target destination
// For changing .src folders you need to overwrite by hand:
// conf = require('thisConfig');
// conf.paths.content.src = 'anotherFolder'
if (dest != undefined) {
basePaths.dest = dest;
}

var languages = ['en'];
const languages = ['en'];

var paths = {
const paths = {
scripts: {
src: basePaths.src + 'scripts/',
dest: basePaths.dest + 'js/'
src: `${basePaths.src}scripts/`,
dest: `${basePaths.dest}js/`,
},
styles: {
src: basePaths.src + 'styles/',
dest: basePaths.dest + 'css/'
src: `${basePaths.src}styles/`,
dest: `${basePaths.dest}css/`,
},
content: {
src: basePaths.content + 'data/',
dest: basePaths.dest + 'content/data/'
src: `${basePaths.content}data/`,
dest: `${basePaths.dest}content/data/`
},
pages: {
src: basePaths.src + 'pages/',
dest: basePaths.dest
src: `${basePaths.src}pages/`,
dest: basePaths.dest,
},
layouts: {
src: basePaths.src + 'layouts/'
src: `${basePaths.src}layouts/`,
},
images: {
src: basePaths.content + 'images/',
dest: basePaths.dest + 'content/images/'
src: `${basePaths.content}images/`,
dest: `${basePaths.dest}content/images/`,
},
logos: {
src: basePaths.assets + 'logos/',
dest: basePaths.dest + 'assets/logos/'
src: `${basePaths.assets}logos/`,
dest: `${basePaths.dest}assets/logos/`,
},
favicons: {
src: basePaths.assets + 'favicons/',
dest: basePaths.dest
src: `${basePaths.assets}favicons/`,
dest: basePaths.dest,
},
fonts: {
src: basePaths.assets + 'fonts/',
dest: basePaths.dest + 'assets/fonts/'
}
src: `${basePaths.assets}fonts/`,
dest: `${basePaths.dest}assets/fonts/`,
},
revManifest: {
dest: `${basePaths.dest}rev-manifest.json`,
},
};

var appFiles = {
scripts: paths.scripts.src + '**/*.js',
styles: paths.styles.src + '**/*.scss',
content: paths.content.src + '**/*.yml',
pages: paths.pages.src + '**/*.jade',
layouts: paths.layouts.src + '**/*.jade',
images: paths.images.src + '**/*',
logos: paths.logos.src + '**/*',
favicons: paths.favicons.src + '**/*',
fonts: paths.fonts.src + '**/*'
const appFiles = {
scripts: `${paths.scripts.src}**/*.js`,
styles: `${paths.styles.src}**/*.scss`,
content: `${paths.content.src}**/*.yml`,
pages: `${paths.pages.src}**/*.pug`,
layouts: `${paths.layouts.src}**/*.pug`,
images: `${paths.images.src}**/*`,
logos: `${paths.logos.src}**/*`,
favicons: `${paths.favicons.src}**/*`,
fonts: `${paths.fonts.src}**/*`,
};

var components = [
basePaths.src + 'modules/',
basePaths.src + 'partials/'
const components = [
`${basePaths.src}modules/`,
`${basePaths.src}elements/`,
`${basePaths.src}partials/`,
];

var gulpFiles = [
const gulpFiles = [
'gulp/**/*.js',
'gulpfile.js'
'gulpfile.js',
];

var environments = {
const environments = {
testing: {
host: argv.host,
username: argv.username,
host: argv.host,
username: argv.username,
projectPath: 'preview.ginetta.net/skeleton-styleguide/',
releasePath: argv.path,
privateKey: argv.privateKey
}
privateKey: argv.privateKey,
},
};

return {
root: root,
basePaths: basePaths,
languages: languages,
paths: paths,
appFiles: appFiles,
components: components,
gulpFiles: gulpFiles,
environments: environments
root,
basePaths,
languages,
paths,
appFiles,
components,
gulpFiles,
environments,
isProd: process.env.NODE_ENV === 'production',
};
};


41 changes: 24 additions & 17 deletions gulp/tasks/assets.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
'use strict';
var merge = require('merge-stream');
const merge = require('merge-stream');

module.exports = function (gulp, $, config) {
var imagesSrc = config.appFiles.images;
var imagesDest = config.paths.images.dest;
var logosSrc = config.appFiles.logos;
var logosDest = config.paths.logos.dest;
var faviconsSrc = config.appFiles.favicons;
var faviconsDest = config.paths.favicons.dest;
var fontsSrc = config.appFiles.fonts;
var fontsDest = config.paths.fonts.dest;
module.exports = (gulp, $, config) => {
const imagesSrc = config.appFiles.images;
const imagesDest = config.paths.images.dest;
const logosSrc = config.appFiles.logos;
const logosDest = config.paths.logos.dest;
const faviconsSrc = config.appFiles.favicons;
const faviconsDest = config.paths.favicons.dest;
const fontsSrc = config.appFiles.fonts;
const fontsDest = config.paths.fonts.dest;
const manifestFile = config.paths.revManifest.dest;

var task = function () {
var imagesSt = gulp.src(imagesSrc)
const task = () => {
const imagesSt = gulp.src(imagesSrc)
.pipe($.changed(imagesDest))
.pipe(gulp.dest(imagesDest));
.pipe($.if(config.isProd, $.rev()))
.pipe($.if(config.isProd, gulp.dest(imagesDest)))
.pipe($.if(config.isProd, $.rev.manifest(manifestFile, { merge: true, base: imagesDest })))
.pipe(gulp.dest(imagesDest))
;

var logosSt = gulp.src(logosSrc)
const logosSt = gulp.src(logosSrc)
.pipe($.changed(logosSrc))
.pipe($.if(config.isProd, $.rev()))
.pipe($.if(config.isProd, gulp.dest(logosSrc)))
.pipe($.if(config.isProd, $.rev.manifest(manifestFile, { merge: true, base: logosDest })))
.pipe(gulp.dest(logosDest));

var faviconsSt = gulp.src(faviconsSrc)
const faviconsSt = gulp.src(faviconsSrc)
.pipe($.changed(faviconsSrc))
.pipe(gulp.dest(faviconsDest));

var fontsSt = gulp.src(fontsSrc)
const fontsSt = gulp.src(fontsSrc)
.pipe($.changed(fontsSrc))
.pipe(gulp.dest(fontsDest));

Expand Down
12 changes: 4 additions & 8 deletions gulp/tasks/clean.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
'use strict';
var del = require('del');
const del = require('del');

module.exports = function (gulp, $, config) {
var destFolder = config.basePaths.dest + '*';
module.exports = (gulp, $, config) => {
const destFolder = `${config.basePaths.dest}*`;

var task = function (cb) {
return del([destFolder]);
};
const task = () => del([destFolder]);

task.description = 'Cleans the build folder';
return task;
};

Loading