Remove Gulp

This commit is contained in:
Raimund Schlüßler 2018-08-31 17:19:00 +02:00
parent 7166986d44
commit 33f2446a2d
No known key found for this signature in database
GPG Key ID: 036FA7EB1A599178
6 changed files with 13192 additions and 16865 deletions

View File

@ -14,7 +14,7 @@
"selector-type-case": null,
"selector-list-comma-newline-after": null,
"no-descending-specificity": null,
"string-quotes": null
"string-quotes": "single"
},
"plugins": [
"stylelint-scss"

View File

@ -1,68 +0,0 @@
/**
* Nextcloud - Tasks
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Bernhard Posselt <dev@bernhard-posselt.com>
* @copyright Bernhard Posselt 2012, 2014
*
* @author Georg Ehrke
* @copyright 2017 Georg Ehrke <oc.list@georgehrke.com>
*
* @author Raimund Schlüßler
* @copyright 2018 Raimund Schlüßler <raimund.schluessler@mailbox.org>
*/
/*jslint node: true */
'use strict';
// get plugins
const gulp = require('gulp'),
svgSprite = require('gulp-svg-sprite'),
webpackStream = require('webpack-stream'),
webpackDevelopmentConfig = require('./webpack.dev.js'),
webpackProductionConfig = require('./webpack.prod.js');
// configure
const destinationFolder = __dirname + '/js/';
const svgConfig = {
shape: {
transform: []
},
mode: {
css: { // Activate the «css» mode
bust: false,
common: 'icon',
dimensions: '',
prefix: '.icon-%s',
sprite: '../img/sprites.svg',
render: {
scss: {
dest: 'src/sprites.scss'
}
}
}
}
};
// tasks
gulp.task('default', ['build']);
gulp.task('build', ['svg_sprite'], function(callback) {
return webpackStream(webpackProductionConfig, require('webpack'))
.pipe(gulp.dest(destinationFolder));
});
gulp.task('development', ['svg_sprite'], function(callback) {
return webpackStream(webpackDevelopmentConfig, require('webpack'))
.pipe(gulp.dest(destinationFolder));
});
gulp.task('svg_sprite', () => {
return gulp.src('**/*.svg', {cwd: 'img/src'})
.pipe(svgSprite(svgConfig))
.pipe(gulp.dest('.'));
});

29926
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,13 +10,13 @@
"private": true,
"homepage": "https://github.com/nextcloud/tasks",
"scripts": {
"test": "jest --verbose",
"prebuild": "npm install && npm upgrade",
"build": "node node_modules/gulp-cli/bin/gulp.js build",
"dev": "npm run svg_sprite && webpack --config webpack.dev.js",
"watch": "webpack --progress --watch --config webpack.dev.js",
"build": "npm run svg_sprite && webpack --progress --hide-modules --config webpack.prod.js",
"lint": "eslint --ext .js,.vue src tests",
"lint:fix": "eslint --ext .js,.vue src tests --fix",
"dev": "node node_modules/gulp-cli/bin/gulp.js development",
"watch": "webpack --progress --watch --config webpack.dev.js"
"test": "jest --verbose",
"svg_sprite": "svg-sprite --config svg-sprite.json img/src/**/*.svg"
},
"repository": {
"type": "git",
@ -51,11 +51,7 @@
"eslint-plugin-promise": "^3.8.0",
"eslint-plugin-standard": "^3.1.0",
"eslint-plugin-vue": "^4.5.0",
"expect": "^23.5.0",
"file-loader": "^1.1.11",
"gulp": "^3.9.1",
"gulp-cli": "^2.0.1",
"gulp-svg-sprite": "1.4.0",
"jest": "^23.5.0",
"jest-serializer-vue": "^2.0.2",
"prettier-eslint": "^8.8.2",
@ -65,15 +61,13 @@
"stylelint-config-recommended-scss": "^3.2.0",
"stylelint-scss": "^3.1.3",
"stylelint-webpack-plugin": "^0.10.5",
"svg-sprite": "^1.4.0",
"vue-jest": "^2.6.0",
"vue-loader": "^15.4.1",
"vue-template-compiler": "^2.5.17",
"webpack": "^4.17.1",
"webpack-cli": "^3.1.0",
"webpack-dev-server": "^3.1.7",
"webpack-merge": "^4.1.4",
"webpack-node-externals": "^1.6.0",
"webpack-stream": "^5.1.1"
"webpack-merge": "^4.1.4"
},
"engines": {
"node": ">=6"

22
svg-sprite.json Normal file
View File

@ -0,0 +1,22 @@
{
"shape": {
"dimension": {
"attributes": false
},
"transform": []
},
"mode": {
"css": {
"bust": false,
"common": "icon",
"prefix": ".icon-%s",
"sprite": "../img/sprites.svg",
"render": {
"scss": {
"template": "svg-sprite.tmpl",
"dest": "src/sprites.scss"
}
}
}
}
}

19
svg-sprite.tmpl Normal file
View File

@ -0,0 +1,19 @@
{{#hasMixin}}@mixin {{mixinName}} {
background: url('{{{sprite}}}') no-repeat;
}
{{#hasCommon}}.{{commonName}} {
@include {{mixinName}};
}
{{/hasCommon}}{{/hasMixin}}{{^hasMixin}}{{#hasCommon}}.{{/hasCommon}}{{^hasCommon}}%{{/hasCommon}}{{commonName}} {
background: url('{{{sprite}}}') no-repeat;
}
{{/hasMixin}}{{#shapes}}{{#selector.shape}}{{expression}}{{^last}},
{{/last}}{{/selector.shape}} {
{{^hasCommon}}{{#hasMixin}}@include {{mixinName}};{{/hasMixin}}{{^hasMixin}}@extend %{{commonName}};{{/hasMixin}}
{{/hasCommon}}background-position: {{position.relative.xy}};
}
{{/shapes}}