Skip to content

Commit

Permalink
fix: remove gulp from dist folder build pipeline (#1385)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbadan authored Apr 15, 2019
1 parent b31df0b commit 2ae183a
Show file tree
Hide file tree
Showing 18 changed files with 3,201 additions and 3,486 deletions.
2 changes: 1 addition & 1 deletion ci-scripts/publish-rc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ npm run std-version -- --prerelease rc --no-verify

git push --follow-tags "https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG" "$TRAVIS_BRANCH" > /dev/null 2>&1;

#build dist folder
#build dist and less folders
npm run build:prod

npm publish --tag prerelease
2 changes: 1 addition & 1 deletion ci-scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ echo "$std_ver"

git push --follow-tags "https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG" master > /dev/null 2>&1;

# build dist folder
# build dist and less folders
npm run build:prod

npm publish
Expand Down
26 changes: 26 additions & 0 deletions config/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict'

const packageVersion = require('../package.json').version;
const year = new Date().getFullYear();

module.exports = {
inline: false,
annotation: true,
sourcesContent: true,
plugins: {
autoprefixer: {
cascade: true,
browsers: ["last 2 versions"]
},
'postcss-clean': {
format: 'beautify',
level: 1
},
'postcss-banner': {
banner: `Fiori Fundamentals v${packageVersion}
Copyright (c) ${year} SAP SE or an SAP affiliate company.
Licensed under Apache License 2.0 (https://github.com/SAP/Fundamental/blob/master/LICENSE)`,
important: true
}
}
}
17 changes: 0 additions & 17 deletions ops/gulp/dev-jekyll-mvx.js

This file was deleted.

4 changes: 2 additions & 2 deletions ops/gulp/docs-build.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const gulp = require('gulp');

module.exports = gulp.task('docs-build', gulp.series('build:dist',
module.exports = gulp.task('docs-build',
gulp.parallel(
'docs-resources',
'docs-icons',
'docs-css',
'docs-site',
'docs-styleguide',
'docs-fonts')));
'docs-fonts'));
71 changes: 0 additions & 71 deletions ops/gulp/error-detection.js

This file was deleted.

35 changes: 0 additions & 35 deletions ops/gulp/ghpages-deploy.js

This file was deleted.

3 changes: 0 additions & 3 deletions ops/gulp/pkg-build.js

This file was deleted.

22 changes: 0 additions & 22 deletions ops/gulp/pkg-cdn.js

This file was deleted.

14 changes: 0 additions & 14 deletions ops/gulp/pkg-clean.js

This file was deleted.

78 changes: 1 addition & 77 deletions ops/gulp/pkg-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,14 @@ const gulpif = require('gulp-if');
const sourcemaps = require('gulp-sourcemaps');
const cleanCSS = require('gulp-clean-css');
const autoprefixer = require('gulp-autoprefixer');
const header = require('gulp-header');
const config = require('../config');
const pkg = require('../../package');
const environment = require('../lib/environment');
const signale = require('signale');
const paths = {
src: config.root.css,
dest: './dist'
}

const d = new Date();
const y = d.getFullYear();
const banner = `/*!
* Fiori Fundamentals v${pkg.version}
* Copyright (c) ${y} SAP SE or an SAP affiliate company.
* Licensed under Apache License 2.0 (https://github.com/SAP/Fundamental/blob/master/LICENSE)
*/\n`;

//compile top-level files
const sassTask = () => {
const prefix = config.tasks.css.prefix;
Expand Down Expand Up @@ -51,71 +41,5 @@ const sassTask = () => {
};
gulp.task('pkg-sass', sassTask);

//compile top-level (dark) files
const darkSassTask = () => {
const prefix = config.tasks.css.prefix;
const files = environment.production ? `${paths.src}/*.${config.tasks.css.extensions}` : `${paths.src}/all-dark.scss`;

const isAllCss = file => file.path.includes('all-dark');
return gulp.src(files)
.pipe(gulpif(environment.development, sourcemaps.init()))
.pipe(sass().on('error', (e) => {
signale.error(e);
return sass.logError;
}))
.pipe(autoprefixer(config.tasks.css.autoprefixer))
.pipe(gulpif(environment.production, cleanCSS(config.tasks.css.cleanCSS)))
.pipe(gulpif(isAllCss, rename({
basename: prefix
})))
.pipe(gulpif(environment.development, sourcemaps.write()))
.pipe(gulp.dest(paths.dest));
};
gulp.task('pkg-dark-sass', darkSassTask);

//compile individual component files
const componentsTask = () => {
const files = [
`${paths.src}/components/*.${config.tasks.css.extensions}`,
`!${paths.src}/components/_*.${config.tasks.css.extensions}`
];
return gulp.src(files)
.pipe(sass().on('error', (e) => {
signale.error(e);
return sass.logError;
}))
.pipe(autoprefixer(config.tasks.css.autoprefixer))
.pipe(gulpif(environment.production, cleanCSS(config.tasks.css.cleanCSS)))
.pipe(gulp.dest(`${paths.dest}/components`));
};
gulp.task('pkg-css-components', componentsTask);

//create minify versions
const minifyTask = () => {
return gulp.src([`${paths.dest}/**/*.css`])
.pipe(cleanCSS({
level: {
1: {
specialComments: false
}
}
}))
.pipe(rename({
suffix: `.min`
}))
.pipe(gulp.dest(paths.dest));
}
gulp.task('pkg-css-minify', minifyTask);

//add banner
const bannerTask = () => {
return gulp.src([`${paths.dest}/**/*.css`])
.pipe(header(banner))
.pipe(gulp.dest(paths.dest));
};
gulp.task('pkg-css-banner', bannerTask);

//main css task
module.exports = gulp.task('pkg-css', environment.production ?
gulp.series('pkg-sass', 'pkg-less', 'pkg-css-components', 'pkg-css-minify', 'pkg-css-banner') :
gulp.series('pkg-sass'));
module.exports = gulp.task('pkg-css', gulp.series('pkg-sass'));
20 changes: 0 additions & 20 deletions ops/gulp/pkg-fonts.js

This file was deleted.

17 changes: 0 additions & 17 deletions ops/gulp/pkg-icons.js

This file was deleted.

26 changes: 0 additions & 26 deletions ops/gulp/pkg-images.js

This file was deleted.

Loading

0 comments on commit 2ae183a

Please sign in to comment.