Skip to content

Commit 8b03bc9

Browse files
committed
Made Strip compatible with Bower
Reorganized files to make the repo compatible with bower. We no longer build into a `/dist` directory since this would create duplicate files. `/src' now only holds files used for concatenation.
1 parent e2c589e commit 8b03bc9

24 files changed

Lines changed: 2838 additions & 44 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
node_modules/
2-
dist/
2+
strip-*.zip

Gruntfile.js

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = function(grunt) {
44
grunt.initConfig({
55
pkg: grunt.file.readJSON('package.json'),
66
dirs: {
7-
dest: 'dist/<%= pkg.name %>-<%= pkg.version %>'
7+
dest: ''
88
},
99

1010
vars: { },
@@ -42,48 +42,52 @@ module.exports = function(grunt) {
4242

4343
'src/js/outro.js'
4444
],
45-
dest: '<%= dirs.dest %>/js/strip/strip.js'
45+
dest: 'js/strip.js'
4646
}
4747
},
4848

49-
copy: {
49+
uglify: {
5050
production: {
51-
files: [
52-
{
53-
expand: true,
54-
cwd: 'src/css/',
55-
src: ['**'],
56-
dest: '<%= dirs.dest %>/css/'
57-
}
58-
],
51+
options: {
52+
preserveComments: 'some'
53+
},
54+
'src': ['js/strip.js'],
55+
'dest': 'js/strip.min.js'
5956
}
6057
},
6158

62-
uglify: {
59+
compress: {
6360
production: {
6461
options: {
65-
preserveComments: 'some'
62+
archive: '<%= pkg.name %>-<%= pkg.version %>.zip'
6663
},
67-
'src': ['<%= dirs.dest %>/js/strip/strip.js'],
68-
'dest': '<%= dirs.dest %>/js/strip/strip.min.js'
64+
files: [
65+
{ expand: true, cwd: '', src: ['css/*', 'js/*'], dest: '<%= pkg.name %>'}
66+
]
6967
}
7068
},
7169

7270
clean: {
73-
dist: 'dist/'
71+
js: 'js/*'
7472
}
7573
});
7674

7775
// Load plugins
7876
grunt.loadNpmTasks('grunt-contrib-concat');
7977
grunt.loadNpmTasks('grunt-contrib-copy');
8078
grunt.loadNpmTasks('grunt-contrib-uglify');
79+
grunt.loadNpmTasks('grunt-contrib-compress');
8180
grunt.loadNpmTasks('grunt-contrib-clean');
8281

8382
// Tasks
8483
grunt.registerTask('default', [
85-
'clean:dist',
86-
'concat:production', 'copy:production', 'uglify:production'
84+
'clean:js',
85+
'concat:production', 'uglify:production'
8786
]);
8887

88+
grunt.registerTask('zip', [
89+
'clean:js',
90+
'concat:production', 'uglify:production',
91+
'compress:production'
92+
]);
8993
};

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ For non-commercial projects and applications, you may use Strip under the terms
1818

1919
## Build
2020

21-
The latest build can be found on [stripjs.com/download](http://www.stripjs.com/download).
21+
The latest stable build can be found on [stripjs.com/download](http://www.stripjs.com/download).
2222

2323
To build Strip yourself start by cloning a copy of the main Strip git repo by running:
2424

@@ -38,7 +38,7 @@ Install the [grunt command line interface](https://github.com/gruntjs/grunt-cli)
3838
npm install -g grunt-cli
3939
```
4040

41-
Now run the `grunt` command in the strip directory to output the latest build in the `/dist` directory:
41+
Now run the `grunt` command in the strip directory, this updates `js/strip.js` and `js/strip.min.js` to include the latest changes:
4242

4343
```
4444
grunt

bower.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "strip",
3+
"description": "A Less Intrusive Responsive Lightbox",
4+
"version": "1.2.0",
5+
"homepage": "http://stripjs.com",
6+
7+
"license": [
8+
"CC-BY-NC-ND-3.0",
9+
"http://stripjs.com/license"
10+
],
11+
12+
"authors": [
13+
{
14+
"name": "Nick Stakenburg",
15+
"homepage": "http://nickstakenburg.com"
16+
}
17+
],
18+
19+
"keywords": [
20+
"lightbox",
21+
"modal",
22+
"window",
23+
"responsive",
24+
"jquery"
25+
],
26+
27+
"main": [
28+
"dist/js/strip.js",
29+
"dist/css/strip.css",
30+
// Directories and wildcards are not in the bower.json spec (yet) :(
31+
// We use a wildcard anyway because including individual files
32+
// would be unmaintainable.
33+
"dist/css/strip-skins/*"
34+
],
35+
36+
"ignore": [
37+
"node_modules",
38+
"bower_components",
39+
"src",
40+
"/.*",
41+
"bower.json",
42+
"Gruntfile.js",
43+
"package.json",
44+
"README.md"
45+
],
46+
47+
"dependencies": {
48+
"jquery": ">= 1.11.1"
49+
}
50+
}
File renamed without changes.

0 commit comments

Comments
 (0)