Skip to content

Commit

Permalink
cleaned up package build files (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
amsul committed Apr 12, 2014
1 parent 71eb81b commit 8c6118e
Show file tree
Hide file tree
Showing 103 changed files with 142 additions and 6,540 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

>>>>> add aria role and labels to the month navigation buttons
>>>>> animations don’t work on firefox for classic theme
>>>>> fix date obj representation from {'...'} to new Date(...)
http://amsul.ca/pickadate.js/api.htm#method-set-select

## 3.4.0

- ARIA support added. :star2:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ A few other things to keep in mind:
- Discuss any significant features before endeavoring into developing them. I’d hate to have anyone spend effort on something only for me to not merge it into the main project.
- Include the relevant test coverage if any JavaScript files are involved.
- Compile the project using `grunt --verbose` to make sure everything passes with a green flag.
- Use the Semantic Versioning guide, as mentioned in the [readme file](/blob/v3.0.0/README.md), in the case that a version bump is due.
- Use the Semantic Versioning guide, as mentioned in the [readme file](https://github.com/amsul/pickadate.js/#README.md), in the case that a version bump is due.


#### All pull requests should be submitted to the `dev` branch.
Expand Down
172 changes: 64 additions & 108 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ module.exports = function( grunt ) {


// Load the NPM tasks.
grunt.loadNpmTasks( 'grunt-contrib-concat' )
grunt.loadNpmTasks( 'grunt-contrib-watch' )
grunt.loadNpmTasks( 'grunt-contrib-jshint' )
grunt.loadNpmTasks( 'grunt-contrib-qunit' )
grunt.loadNpmTasks( 'grunt-contrib-copy' )
grunt.loadNpmTasks( 'grunt-contrib-less' )
grunt.loadNpmTasks( 'grunt-contrib-clean' )
grunt.loadNpmTasks( 'grunt-contrib-cssmin' )
grunt.loadNpmTasks( 'grunt-contrib-uglify' )

Expand All @@ -41,42 +39,39 @@ module.exports = function( grunt ) {
// Set up the directories.
dirs: {
tests: 'tests',
src: {
raw: '_raw',
demos: '_raw/demo',
pickers: '_raw/lib',
themes: '_raw/lib/themes',
translations: '_raw/lib/translations'
lib: {
src: 'lib',
min: 'lib/compressed'
},
dest: {
demos: 'demo',
pickers: 'lib',
themes: 'lib/themes',
translations: 'lib/translations'
themes: {
src: 'lib/themes/less',
dest: 'lib/themes/css',
min: 'lib/compressed/themes'
},
translations: {
src: 'lib/translations',
min: 'lib/compressed/translations'
},
docs: {
src: '_docs',
dest: '.'
},
demo: {
images: 'demo/images',
scripts: 'demo/scripts',
styles: {
src: 'demo/styles/less',
dest: 'demo/styles/css'
}
},
min: {
pickers: 'lib/compressed',
themes: 'lib/compressed/themes',
translations: 'lib/compressed/translations'
}
},


// Clean the destination files and directories.
clean: {
demos: [ '<%= dirs.dest.demos %>', '*.htm' ],
pickers: [ '<%= dirs.dest.pickers %>/*.js' ],
themes: [ '<%= dirs.dest.themes %>' ],
translations: [ '<%= dirs.dest.translations %>' ],
pkg: [ '<%= dirs.dest.pickers %>', '<%= pkg.name %>.jquery.json', '*.md' ]
},


// Generate static HTML templates.
htmlify: {
demos: {
docs: {
expand: true,
cwd: '<%= dirs.src.raw %>',
cwd: '<%= dirs.docs.src %>',
src: [ '/!(base|hero)*.htm' ],
dest: '',
base: '/base.htm'
Expand All @@ -86,18 +81,6 @@ module.exports = function( grunt ) {

// Copy over files to destination directions.
copy: {
demos: {
expand: true,
cwd: '<%= dirs.src.demos %>',
src: [ 'styles/.css', 'images/*.{png,ico}' ],
dest: '<%= dirs.dest.demos %>'
},
translations: {
expand: true,
cwd: '<%= dirs.src.translations %>',
src: [ '*' ],
dest: '<%= dirs.dest.translations %>'
},
pkg: {
options: {
processContent: function( content ) {
Expand All @@ -107,10 +90,10 @@ module.exports = function( grunt ) {
files: [
{ '<%= pkg.name %>.jquery.json': 'package.json' },
{ 'bower.json': 'package.json' },
{ 'README.md': '<%= dirs.src.raw %>/README.md' },
{ 'LICENSE.md': '<%= dirs.src.raw %>/LICENSE.md' },
{ 'CHANGELOG.md': '<%= dirs.src.raw %>/CHANGELOG.md' },
{ 'CONTRIBUTING.md': '<%= dirs.src.raw %>/CONTRIBUTING.md' }
{ 'README.md': '<%= dirs.docs.src %>/README.md' },
{ 'LICENSE.md': '<%= dirs.docs.src %>/LICENSE.md' },
{ 'CHANGELOG.md': '<%= dirs.docs.src %>/CHANGELOG.md' },
{ 'CONTRIBUTING.md': '<%= dirs.docs.src %>/CONTRIBUTING.md' }
]
}
},
Expand All @@ -121,40 +104,21 @@ module.exports = function( grunt ) {
options: {
style: 'expanded'
},
demos: {
demo: {
files: {
'<%= dirs.dest.demos %>/styles/main.css': '<%= dirs.src.demos %>/styles/base.less'
'<%= dirs.demo.styles.dest %>/main.css': '<%= dirs.demo.styles.src %>/base.less'
}
},
themes: {
files: {
'<%= dirs.dest.themes %>/default.css': [ '<%= dirs.src.themes %>/base.less', '<%= dirs.src.themes %>/default.less' ],
'<%= dirs.dest.themes %>/classic.css': [ '<%= dirs.src.themes %>/base.less', '<%= dirs.src.themes %>/classic.less' ],
'<%= dirs.dest.themes %>/default.date.css': [ '<%= dirs.src.themes %>/base.date.less', '<%= dirs.src.themes %>/default.date.less' ],
'<%= dirs.dest.themes %>/default.time.css': [ '<%= dirs.src.themes %>/base.time.less', '<%= dirs.src.themes %>/default.time.less' ],
'<%= dirs.dest.themes %>/classic.date.css': [ '<%= dirs.src.themes %>/base.date.less', '<%= dirs.src.themes %>/classic.date.less' ],
'<%= dirs.dest.themes %>/classic.time.css': [ '<%= dirs.src.themes %>/base.time.less', '<%= dirs.src.themes %>/classic.time.less' ],
'<%= dirs.dest.themes %>/rtl.css': [ '<%= dirs.src.themes %>/rtl.less' ]
}
}
},


// Concatenate the files and add the banner.
concat: {
options: {
process: function( content ) {
return grunt.template.process( content, { delimiters: 'curly' } )
'<%= dirs.themes.dest %>/default.css': [ '<%= dirs.themes.src %>/base.less', '<%= dirs.themes.src %>/default.less' ],
'<%= dirs.themes.dest %>/classic.css': [ '<%= dirs.themes.src %>/base.less', '<%= dirs.themes.src %>/classic.less' ],
'<%= dirs.themes.dest %>/default.date.css': [ '<%= dirs.themes.src %>/base.date.less', '<%= dirs.themes.src %>/default.date.less' ],
'<%= dirs.themes.dest %>/default.time.css': [ '<%= dirs.themes.src %>/base.time.less', '<%= dirs.themes.src %>/default.time.less' ],
'<%= dirs.themes.dest %>/classic.date.css': [ '<%= dirs.themes.src %>/base.date.less', '<%= dirs.themes.src %>/classic.date.less' ],
'<%= dirs.themes.dest %>/classic.time.css': [ '<%= dirs.themes.src %>/base.time.less', '<%= dirs.themes.src %>/classic.time.less' ],
'<%= dirs.themes.dest %>/rtl.css': [ '<%= dirs.themes.src %>/rtl.less' ]
}
},
demos: {
files: { '<%= dirs.dest.demos %>/scripts/main.js': '<%= dirs.src.demos %>/scripts/*.js' }
},
pickers: {
expand: true,
cwd: '<%= dirs.src.pickers %>',
src: [ '*.js' ],
dest: '<%= dirs.dest.pickers %>'
}
},

Expand All @@ -165,14 +129,14 @@ module.exports = function( grunt ) {
jshintrc: true
},
gruntfile: 'Gruntfile.js',
demos: [ '<%= dirs.src.demos %>/scripts/base.js' ],
pickers: [
demo: [ '<%= dirs.demo.scripts %>/demo.js' ],
lib: [
'<%= dirs.tests %>/units/*.js',
'<%= dirs.dest.pickers %>/**/*.js',
'<%= dirs.lib.src %>/**/*.js',

// Ignore the legacy and minified files.
'!<%= dirs.dest.pickers %>/legacy.js',
'!<%= dirs.dest.pickers %>/compressed/**/*.js'
'!<%= dirs.lib.src %>/legacy.js',
'!<%= dirs.lib.src %>/compressed/**/*.js'
]
},

Expand All @@ -182,62 +146,54 @@ module.exports = function( grunt ) {
options: {
preserveComments: 'some'
},
pickers: {
lib: {
files: [
{
expand : true,
cwd : '<%= dirs.dest.pickers %>',
cwd : '<%= dirs.lib.src %>',
src : [ '**/*.js', '!compressed/**/*.js' ],
dest : '<%= dirs.dest.pickers %>/compressed'
dest : '<%= dirs.lib.min %>'
}
]
}
},
cssmin: {
pickers: {
lib: {
expand: true,
cwd: '<%= dirs.dest.pickers %>',
cwd: '<%= dirs.themes.dest %>',
src: [ '**/*.css', '!compressed/**/*.css' ],
dest: '<%= dirs.dest.pickers %>/compressed'
dest: '<%= dirs.themes.min %>'
}
},


// Unit test the files.
qunit: {
pickers: [ '<%= dirs.tests %>/units/all.htm' ]
lib: [ '<%= dirs.tests %>/units/all.htm' ]
},


// Watch the project files.
watch: {
gruntfile: {
files: [ 'Gruntfile.js' ],
tasks: [ 'jshint:gruntfile', 'default' ]
},
quick: {
files: [
'<%= dirs.src.raw %>/*.htm',
'<%= dirs.src.raw %>/*.md',
'<%= dirs.src.demos %>/styles/*.less', '<%= dirs.src.demos %>/scripts/*.js',
'<%= dirs.src.pickers %>/**/*.js', '<%= dirs.src.pickers %>/themes/*.css',
'<%= dirs.src.themes %>/*.less',
'<%= dirs.src.translations %>/*.js'
'<%= dirs.docs.src %>/*.htm',
'<%= dirs.docs.src %>/*.md',
'<%= dirs.demo.src %>/styles/*.less',
'<%= dirs.themes.src %>/*.less'
],
tasks: [ 'quick' ]
},
demos: {
docs: {
files: [
'<%= dirs.src.raw %>/*.htm',
'<%= dirs.src.demos %>/styles/*.less', '<%= dirs.src.demos %>/scripts/*.js'
'<%= dirs.docs.src %>/*.htm',
'<%= dirs.docs.src %>/styles/*.less'
],
tasks: [ 'demo' ]
},
pickers: {
lib: {
files: [
'<%= dirs.src.pickers %>/**/*.js', '<%= dirs.src.pickers %>/themes/*.css',
'<%= dirs.src.themes %>/*.less',
'<%= dirs.src.translations %>/*.js'
'<%= dirs.themes.src %>/*.less'
],
tasks: [ 'picker' ]
}
Expand All @@ -263,11 +219,11 @@ module.exports = function( grunt ) {

// Register the tasks.
// * `htmlify` and `copy:pkg` should come after `uglify` because some package files measure `.min` file sizes.
grunt.registerTask( 'default', [ 'clean', 'concat', 'copy:demos', 'copy:translations', 'less', 'jshint', 'qunit', 'uglify', 'cssmin', 'htmlify', 'copy:pkg' ] )
grunt.registerTask( 'quick', [ 'concat', 'copy:demos', 'copy:translations', 'less', 'uglify', 'cssmin', 'htmlify', 'copy:pkg' ] )
grunt.registerTask( 'picker', [ 'clean:pickers', 'concat:pickers', 'copy:translations', 'less:themes', 'jshint:pickers', 'qunit:pickers', 'uglify:pickers', 'cssmin:pickers' ] )
grunt.registerTask( 'demo', [ 'clean:demos', 'concat:demos', 'copy:demos', 'less:demos', 'jshint:demos', 'htmlify:demos' ] )
grunt.registerTask( 'travis', [ 'jshint:pickers', 'qunit:pickers' ] )
grunt.registerTask( 'default', [ 'less', 'jshint', 'qunit', 'uglify', 'cssmin', 'htmlify', 'copy:pkg' ] )
grunt.registerTask( 'quick', [ 'less', 'uglify', 'cssmin', 'htmlify', 'copy:pkg' ] )
grunt.registerTask( 'picker', [ 'less:themes', 'jshint:lib', 'qunit:lib', 'uglify:lib', 'cssmin:lib' ] )
grunt.registerTask( 'docs', [ 'copy:docs', 'less:docs', 'jshint:docs', 'htmlify:docs' ] )
grunt.registerTask( 'travis', [ 'jshint:lib', 'qunit:lib' ] )



Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ The v3 API is significantly different from v2 (all for the greater good!). So if
<br>
## Library files

The `lib` folder includes all the compiled files and a `compressed` folder with the minified counter-parts. These files are all generated from the `_raw/lib` folder using [Grunt](#building-with-grunt).
The `` folder includes all the compiled files and a `compressed` folder with the minified counter-parts. These files are all generated from the `_raw/lib` folder using [Grunt](#building-with-grunt).

### Pickers

There are currently two pickers: **date** and **time**.

File | Contents | Size (min & gzip)
----------------------- | ------------------------ | ----------------------
`picker.js` | __Base *__ | 1.58kb
`picker.js` | __Base *__ | 1.52kb
`picker.date.js` | Date picker | 2.45kb
`picker.time.js` | Time picker | 1.81kb

Expand All @@ -47,7 +47,7 @@ _To support old browsers, namely IE8, **also include** the `legacy.js` file._

### Themes

All themes are [generated using LESS](#less-styling) and compiled into the `lib/themes` folder.
All themes are [generated using LESS](#less-styling) and compiled into the `lib/themes/css` folder.

File | Contents | Size (min & gzip)
----------------------- | ---------------------------- | ----------------------
Expand All @@ -65,7 +65,7 @@ __**__ For languages with text flowing from right-to-left, also include the `rtl

### Translations

The translations are copied into the `lib/translations` folder. There are currently [37 languages](https://github.com/amsul/pickadate.js/blob/3.4.0/lib/translations) included.
The translations are copied into the `` folder. There are currently [37 languages](https://github.com/amsul/pickadate.js/blob/3.4.0/lib/translations) included.



Expand All @@ -88,7 +88,7 @@ Read the Gruntfile to see the build tasks and relative directories of the source
<a name="less-styling"></a>
## Styling with LESS

The picker themes are built using [LESS](http://lesscss.org/) with Grunt. To customize the CSS output, read the `_variables.less` file in the `_raw/lib/themes` folder. You can specify:
The picker themes are built using [LESS](http://lesscss.org/) with Grunt. To customize the CSS output, read the `_variables.less` file in the `lib/themes/less` folder. You can specify:

- colors for the theme,
- sizes for the picker,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion _raw/CONTRIBUTING.md → _docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ A few other things to keep in mind:
- Discuss any significant features before endeavoring into developing them. I’d hate to have anyone spend effort on something only for me to not merge it into the main project.
- Include the relevant test coverage if any JavaScript files are involved.
- Compile the project using `grunt --verbose` to make sure everything passes with a green flag.
- Use the Semantic Versioning guide, as mentioned in the [readme file]({%= gitrepo_url %}/blob/v3.0.0/README.md), in the case that a version bump is due.
- Use the Semantic Versioning guide, as mentioned in the [readme file]({%= meta.gitrepo_url %}/#readme), in the case that a version bump is due.


#### All pull requests should be submitted to the `dev` branch.
Expand Down
File renamed without changes.
Loading

0 comments on commit 8c6118e

Please sign in to comment.