Skip to content

Commit 97b5a03

Browse files
committed
migration to gulp
1 parent 6e99cb3 commit 97b5a03

File tree

9 files changed

+96
-291
lines changed

9 files changed

+96
-291
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ mock.png
44
.build*
55
jquery.fn.*
66
.idea/
7+
package-lock.json

CONTRIBUTING.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,11 @@
44

55
1. Try [master](https://github.com/SortableJS/Sortable/tree/master/)-branch, perhaps the problem has been solved;
66
2. [Use the search](https://github.com/SortableJS/Sortable/search?type=Issues&q=problem), maybe already have an answer;
7-
3. If not found, create example on [jsbin.com (draft)](http://jsbin.com/zunibaxada/1/edit?html,js,output) and describe the problem.
7+
3. If not found, create example on [jsbin.com (draft)](https://jsbin.com/kamiwez/edit?html,js,output) and describe the problem.
88

99
---
1010

1111
### Pull Request
1212

1313
1. Only into [master](https://github.com/SortableJS/Sortable/tree/master/)-branch.
1414
2. Do not modify `Sortable.min.js`, this will be compiled before each release.
15-
16-
### Setup
17-
18-
Pieced together from [gruntjs](http://gruntjs.com/getting-started)
19-
20-
1. Fork repo on [github](https://github.com)
21-
2. Clone locally
22-
3. from local repro ```npm install```
23-
4. Install grunt-cli globally ```sudo -H npm install -g grunt-cli```

Gruntfile.js

Lines changed: 0 additions & 103 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Demo: http://sortablejs.github.io/Sortable/
2626
* Supports any CSS library, e.g. [Bootstrap](#bs)
2727
* Simple API
2828
* [CDN](#cdn)
29-
* No jQuery (but there is [support](#jq))
29+
* No jQuery required (but there is [support](https://github.com/SortableJS/jquery-sortablejs))
3030

3131

3232
<br/>
@@ -656,36 +656,6 @@ Link to the active instance.
656656
---
657657

658658

659-
<a name="jq"></a>
660-
### jQuery compatibility
661-
To assemble plugin for jQuery, perform the following steps:
662-
663-
```bash
664-
cd Sortable
665-
npm install
666-
grunt jquery
667-
```
668-
669-
Now you can use `jquery.fn.sortable.js`:<br/>
670-
(or `jquery.fn.sortable.min.js` if you run `grunt jquery:min`)
671-
672-
```js
673-
$("#list").sortable({ /* options */ }); // init
674-
675-
$("#list").sortable("widget"); // get Sortable instance
676-
677-
$("#list").sortable("destroy"); // destroy Sortable instance
678-
679-
$("#list").sortable("{method-name}"); // call an instance method
680-
681-
$("#list").sortable("{method-name}", "foo", "bar"); // call an instance method with parameters
682-
```
683-
684-
And `grunt jquery:mySortableFunc``jquery.fn.mySortableFunc.js`
685-
686-
---
687-
688-
689659
### Contributing (Issue/PR)
690660

691661
Please, [read this](CONTRIBUTING.md).

gulpfile.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* jshint ignore:start */
2+
const gulp = require('gulp'),
3+
uglify = require('gulp-uglify'),
4+
rename = require('gulp-rename'),
5+
each = require('gulp-each'),
6+
path = require('path'),
7+
pump = require('pump')
8+
;
9+
10+
const package = require('./package.json'),
11+
name = package.exportName,
12+
versionExp = /(?<=\"version\":\s{0,}\")(.{0,})(?=\")/i;
13+
14+
gulp.task('version', function() {
15+
let version = package.version;
16+
return pump([
17+
gulp.src('./*.json'),
18+
each(function(content, file, callback){
19+
let prevVersion = content.match(versionExp);
20+
prevVersion && (prevVersion = prevVersion[0]);
21+
content = content.replace(versionExp, version);
22+
prevVersion && prevVersion !== version && console.info(`Updated version in ${ path.basename(file.history[0]) }:\t${ prevVersion } -> ${ version }`);
23+
callback(null, content);
24+
}),
25+
gulp.dest('./')
26+
]);
27+
});
28+
29+
gulp.task('minify', function() {
30+
return pump([
31+
gulp.src(`./${ name }.js`),
32+
uglify({
33+
output: {
34+
preamble: `/*! ${ name } ${ package.version } - ${ package.license } | ${ package.repository.url } */\n`
35+
}
36+
}),
37+
rename({
38+
suffix: '.min'
39+
}),
40+
gulp.dest(`./`)
41+
]);
42+
});
43+
44+
gulp.task('build', gulp.series('version', 'minify'));
45+
/* jshint ignore:end */

jquery.binding.js

Lines changed: 0 additions & 61 deletions
This file was deleted.

package.json

Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,50 @@
11
{
2-
"name": "sortablejs",
3-
"exportName": "Sortable",
4-
"version": "1.8.0-rc1",
5-
"devDependencies": {
6-
"grunt": "*",
7-
"grunt-contrib-jshint": "*",
8-
"grunt-contrib-uglify": "*",
9-
"grunt-testcafe": "^0.15.0",
10-
"grunt-version": "*",
11-
"http-server": "^0.9.0",
12-
"testcafe": "^0.16.0"
13-
},
14-
"description": "Minimalist JavaScript library for reorderable drag-and-drop lists on modern browsers and touch devices. No jQuery. Supports AngularJS and any CSS library, e.g. Bootstrap.",
15-
"main": "Sortable.js",
16-
"scripts": {
17-
"test": "./node_modules/grunt/bin/grunt",
18-
"prepublish": "./node_modules/grunt/bin/grunt",
19-
"http-server": "http-server -s ./"
20-
},
21-
"contributors" : [
22-
"Konstantin Lebedev <ibnRubaXa@gmail.com>",
23-
"Owen Mills <owen23355@gmail.com>"
24-
],
25-
"repository": {
26-
"type": "git",
27-
"url": "git://github.com/SortableJS/Sortable.git"
28-
},
29-
"files": [
30-
"Sortable.js",
31-
"Sortable.min.js"
32-
],
33-
"keywords": [
34-
"sortable",
35-
"reorder",
36-
"drag",
37-
"meteor",
38-
"angular",
39-
"ng-sortable",
40-
"react",
41-
"vue",
42-
"mixin"
43-
],
44-
"license": "MIT",
45-
"spm": {
46-
"main": "Sortable.js",
47-
"ignore": [
48-
"meteor",
49-
"st"
50-
]
51-
}
2+
"name": "sortablejs",
3+
"exportName": "Sortable",
4+
"version": "1.8.0-rc1",
5+
"devDependencies": {
6+
"gulp": "^4.0.0",
7+
"gulp-each": "^0.5.0",
8+
"gulp-rename": "^1.4.0",
9+
"gulp-uglify": "^3.0.1",
10+
"http-server": "^0.9.0",
11+
"pump": "^3.0.0"
12+
},
13+
"description": "Minimalist JavaScript library for reorderable drag-and-drop lists on modern browsers and touch devices. No jQuery. Supports AngularJS and any CSS library, e.g. Bootstrap.",
14+
"main": "Sortable.js",
15+
"scripts": {
16+
"http-server": "http-server -s ./",
17+
"prepublish": "gulp build"
18+
},
19+
"contributors": [
20+
"Konstantin Lebedev <ibnRubaXa@gmail.com>",
21+
"Owen Mills <owen23355@gmail.com>"
22+
],
23+
"repository": {
24+
"type": "git",
25+
"url": "git://github.com/SortableJS/Sortable.git"
26+
},
27+
"files": [
28+
"Sortable.js",
29+
"Sortable.min.js"
30+
],
31+
"keywords": [
32+
"sortable",
33+
"reorder",
34+
"drag",
35+
"meteor",
36+
"angular",
37+
"ng-sortable",
38+
"react",
39+
"vue",
40+
"mixin"
41+
],
42+
"license": "MIT",
43+
"spm": {
44+
"main": "Sortable.js",
45+
"ignore": [
46+
"meteor",
47+
"st"
48+
]
49+
}
5250
}

0 commit comments

Comments
 (0)