2
0
forked from Wavyzz/dolibarr

Fix: restore jselect2 4.0.5 (4.0.6 create troubles in responsive)

This commit is contained in:
Laurent Destailleur
2020-04-18 14:39:02 +02:00
parent 47ff3f866a
commit 8f7c3fc867
79 changed files with 694 additions and 1725 deletions

View File

@@ -1,5 +1,3 @@
const sass = require('node-sass');
module.exports = function (grunt) {
// Full list of files that must be included by RequireJS
includes = [
@@ -64,6 +62,10 @@ module.exports = function (grunt) {
grunt.initConfig({
package: grunt.file.readJSON('package.json'),
clean: {
docs: ['docs/_site']
},
concat: {
'dist': {
options: {
@@ -122,10 +124,81 @@ module.exports = function (grunt) {
}
},
'saucelabs-qunit': {
all: {
options: {
build: testBuildNumber,
tags: ['tests', 'qunit'],
urls: testUrls,
testname: 'QUnit test for Select2',
browsers: [
{
browserName: 'internet explorer',
version: '8'
},
{
browserName: 'internet explorer',
version: '9'
},
{
browserName: 'internet explorer',
version: '10'
},
{
browserName: 'internet explorer',
version: '11'
},
{
browserName: 'firefox',
platform: 'linux'
},
{
browserName: 'chrome'
},
{
browserName: 'opera',
version: '12',
platform: 'linux'
}
]
}
}
},
'gh-pages': {
options: {
base: 'docs',
branch: 'master',
clone: 'node_modules/grunt-gh-pages/repo',
message: 'Updated docs with master',
push: true,
repo: 'git@github.com:select2/select2.github.io.git'
},
src: '**'
},
jekyll: {
options: {
src: 'docs',
dest: 'docs/_site'
},
build: {
d: null
},
serve: {
options: {
serve: true,
watch: true
}
}
},
jshint: {
options: {
jshintrc: true,
reporterOutput: ''
jshintrc: true
},
code: {
src: ['src/js/**/*.js']
@@ -138,7 +211,6 @@ module.exports = function (grunt) {
sass: {
dist: {
options: {
implementation: sass,
outputStyle: 'compressed'
},
files: {
@@ -150,7 +222,6 @@ module.exports = function (grunt) {
},
dev: {
options: {
implementation: sass,
outputStyle: 'nested'
},
files: {
@@ -162,6 +233,19 @@ module.exports = function (grunt) {
}
},
symlink: {
docs: {
cwd: 'dist',
expand: true,
overwrite: false,
src: [
'*'
],
dest: 'docs/dist',
filter: 'isDirectory'
}
},
requirejs: {
'dist': {
options: {
@@ -240,17 +324,22 @@ module.exports = function (grunt) {
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-symlink');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-jekyll');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('grunt-sass');
grunt.registerTask('default', ['compile', 'test', 'lint', 'minify']);
grunt.registerTask('default', ['compile', 'test', 'minify']);
grunt.registerTask('compile', [
'requirejs:dist', 'requirejs:dist.full', 'requirejs:i18n',
@@ -258,6 +347,24 @@ module.exports = function (grunt) {
'sass:dev'
]);
grunt.registerTask('minify', ['uglify', 'sass:dist']);
grunt.registerTask('lint', ['jshint']);
grunt.registerTask('test', ['connect:tests', 'qunit']);
grunt.registerTask('test', ['connect:tests', 'qunit', 'jshint']);
var ciTasks = [];
ciTasks.push('compile');
ciTasks.push('connect:tests');
// Can't run Sauce Labs tests in pull requests
if (process.env.TRAVIS_PULL_REQUEST == 'false') {
ciTasks.push('saucelabs-qunit');
}
ciTasks.push('qunit');
ciTasks.push('jshint');
grunt.registerTask('ci', ciTasks);
grunt.registerTask('docs', ['symlink:docs', 'jekyll:serve']);
grunt.registerTask('docs-release', ['default', 'clean:docs', 'gh-pages']);
};