Skip to content

Commit

Permalink
fix peer dep issue, add deprecation notice, simplify build, update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyWebb committed Jul 18, 2016
1 parent 0c35fa4 commit 12d92a5
Show file tree
Hide file tree
Showing 17 changed files with 731 additions and 148 deletions.
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
__NOTE:__ This package is unmaintained, but I'll do my best to tend to any PRs that are submitted. Why? I've found it
much easier to implement the same thing natively with whichever framework/library I'm using (Knockout, Angular, etc.).

# Selectr

Selectr is a jQuery plugin that aims to accomplish a seemingly simple task: make a select box that doesn't suck.
Expand Down Expand Up @@ -114,19 +117,3 @@ Tested in the following browsers:

selectr uses MutationObservers to update the list of options, which are unsupported by older browsers. Instead of hacking together a buggy solution,
I've opted to require that, in order to sync the options list in older browsers, a change event be manually fired on the source select element when the options change.

### Contributing

#### Bugs

If you encounter a bug, please file an issue in Github, or shoot me an email at NotCaseyWebb@gmail.com

#### Pull requests

PRs and forks are always welcome. With webpack installed, use `npm run build` to build.

### Legal Junk

Selectr is distributed under the [MIT License](http://opensource.org/licenses/mit-license.php). Have at it.

### If you find this useful, send me an email. I'd love to see some selectrs in the wild and add them to the README
1 change: 0 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "selectr",
"version": "2.0.2",
"homepage": "https://github.com/caseyWebb/selectr",
"authors": [
"Casey Webb"
Expand Down
3 changes: 2 additions & 1 deletion dist/selectr.bs-polyfilled.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/selectr.bs-polyfilled.js.map

Large diffs are not rendered by default.

659 changes: 639 additions & 20 deletions dist/selectr.debug.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/selectr.debug.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/selectr.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/selectr.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/selectr.no-styles.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/selectr.no-styles.js.map

Large diffs are not rendered by default.

29 changes: 14 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
{
"name": "selectr",
"version": "2.0.2",
"version": "2.0.3",
"scripts": {
"build-native": "webpack -p --config ./webpack.config.js",
"build-debug": "webpack --config ./webpack.config.debug.js",
"build-polyfilled": "webpack -p --config ./webpack.config.polyfill.js",
"build-no-styles": "webpack -p --config ./webpack.config.no-styles.js",
"build": "npm run build-native && npm run build-debug && npm run build-polyfilled && npm run build-no-styles",
"prepublish": "npm run build"
"build": "webpack",
"prepublish": "webpack"
},
"devDependencies": {
"autoprefixer-loader": "=1.1.0",
"autoprefixer": "^6.3.7",
"coffee-loader": "^0.7.2",
"css-loader": "^0.9.1",
"lodash": "^3.3.1",
"sass-loader": "^0.4.0",
"style-loader": "^0.8.3",
"webpack": "^1.6.0"
"css-loader": "^0.23.1",
"lodash": "^4.0.0",
"node-sass": "^3.8.0",
"postcss-loader": "^0.9.1",
"precss": "^1.4.0",
"sass-loader": "^4.0.0",
"style-loader": "^0.13.1",
"webpack": "^1.13.1"
},
"dependencies": {
"jquery": "^2.1.3"
"peerDependencies": {
"jquery": "2.x.x || 3.x.x"
},
"description": "Selectr is a jQuery plugin that aims to accomplish a seemingly simple task: make a select box that doesn't suck.",
"main": "./dist/selectr.js",
Expand Down
26 changes: 0 additions & 26 deletions selectr.sublime-project

This file was deleted.

8 changes: 4 additions & 4 deletions src/selectr.coffee
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
jQuery = require 'jquery'

unless NO_STYLES
unless window.NO_STYLES
require './selectr.scss'
require './bs-polyfill.scss' if POLYFILL_BOOTSTRAP_STYLES
require './bs-polyfill.scss' if window.POLYFILL_BOOTSTRAP_STYLES

do ($ = jQuery, window = @) ->

Expand Down Expand Up @@ -121,7 +121,7 @@ do ($ = jQuery, window = @) ->
_sync() if selectrInitiated != 'selectrInitiated'

# The below causes issues in IE, remove and improve in v3

# observer = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
# return if !observer?

Expand Down Expand Up @@ -288,4 +288,4 @@ do ($ = jQuery, window = @) ->
return if $el.data 'selectr-initialized'

new Selectr $el, args
$el.data 'selectr-initialized', true
$el.data 'selectr-initialized', true
13 changes: 0 additions & 13 deletions webpack.config.debug.js

This file was deleted.

79 changes: 61 additions & 18 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
var path = require('path'),
webpack = require('webpack')
var _ = require('lodash'),
path = require('path'),
webpack = require('webpack'),
precss = require('precss'),
autoprefixer = require('autoprefixer')

module.exports = {
const baseConfig = {
entry: './src/selectr.coffee',

output: {
path: path.join(__dirname, 'dist'),
filename: 'selectr.js',
library: 'selectr',
libraryTarget: 'umd'
},

module: {
loaders: [

{ test: /\.coffee$/,
loader: 'coffee' },

{ test: /\.scss$/,
loader: 'style!css!autoprefixer!sass?outputStyle=compressed' }
{
test: /\.coffee$/,
loader: 'coffee'
},

{
test: /\.scss$/,
loaders: ['style', 'css', 'postcss', 'sass']
}
]
},

postcss() {
return [precss, autoprefixer]
},

externals: {
jquery: {
root: '$',
Expand All @@ -31,10 +40,44 @@ module.exports = {
}
},

plugins: [
new webpack.DefinePlugin({
NO_STYLES: false,
POLYFILL_BOOTSTRAP_STYLES: false
})
]
}
devtool: 'source-map'
}

module.exports = [
_.merge({}, baseConfig, {
output: {
filename: 'selectr.js'
},
plugins: [
new webpack.optimize.UglifyJsPlugin()
]
}),
_.merge({}, baseConfig, {
output: {
filename: 'selectr.debug.js'
},
debug: true
}),
_.merge({}, baseConfig, {
output: {
filename: 'selectr.no-styles.js'
},
plugins: [
new webpack.DefinePlugin({
NO_STYLES: true
}),
new webpack.optimize.UglifyJsPlugin()
]
}),
_.merge({}, baseConfig, {
output: {
filename: 'selectr.bs-polyfilled.js'
},
plugins: [
new webpack.DefinePlugin({
POLYFILL_BOOTSTRAP_STYLES: true
}),
new webpack.optimize.UglifyJsPlugin()
]
})
]
16 changes: 0 additions & 16 deletions webpack.config.no-styles.js

This file was deleted.

16 changes: 0 additions & 16 deletions webpack.config.polyfill.js

This file was deleted.

0 comments on commit 12d92a5

Please sign in to comment.