Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release on NPM #60

Closed
andreypopp opened this issue Aug 2, 2013 · 15 comments
Closed

Release on NPM #60

andreypopp opened this issue Aug 2, 2013 · 15 comments

Comments

@andreypopp
Copy link

It would be call to have selectize on npm, especially for those using CommonJS browser bundlers such as browserify.

@brianreavis
Copy link
Member

This isn't a node package, so I'd really like to not clutter NPM with it. Selectize is on bower, however (which is specifically for client-side packages). Check out debowerify to use bower components with browserify.

@andreypopp
Copy link
Author

That is sad, npm stands for "Node Packaged Modules" and that doesn't mean it is for Node packages only. A lot of client side packages already released on npm. Some people see no value is using different package systems for Node and for browser and even think that this will complicate sharing code between server and the browser.

Anyway, what do you think if I release selectize on npm and will maintain it? You can reclaim npm package name in the future if you want so.

@brianreavis
Copy link
Member

I don't want to turn this into a long debate on NPM. You're right, you can put Python / Ruby / PHP packages on NPM too—but it's shoe-horning, in my opinion. If Selectize ever has server-side helpers, I'll happily put it on there, but until then, it's not going on just for the sake of browserify (which has an adapter which makes this non-issue).

Please don't register Selectize on NPM. Having a third party keep it in sync is just going to create confusion.

@andreypopp
Copy link
Author

The issue is not with browserify but with the way one would need to manage dependencies in a project — both with bower and with npm.

Please don't register Selectize on NPM. Having a third party keep it in sync is just going to create confusion.

Hm... what confusion? I'm going to maintain it and if you will change you mind in the future I'll be happy to transfer ownership of npm package back to you.

@andreypopp
Copy link
Author

Maybe I can register a package name selectize-browserify?

@brianreavis
Copy link
Member

"selectize-browserify" is fine if you're inclined.

Hm... what confusion? I'm going to maintain it and if you will change you mind in the future I'll be happy to transfer ownership of npm package back to you.

You have to fork, keep your fork up to date (along with your own "package.json"), and manually push updates up to NPM every time the library changes. If you're not always on the ball, and other people use this, they'll be working on out-of-date copies.

@o5
Copy link

o5 commented Mar 17, 2014

It's any way to use selectize.js via browserify?

I tried this:

require('bower/selectize/dist/js/standalone/selectize.js');

$('input').selectize({
        delimiter: ',',
        persist: false,
        create: function(input) {
            return {
                value: input,
                text: input
            };
        }
});

But I got a known error message: Cannot call method 'mixin' of undefined [selectize.js:1111]

This was referenced Mar 17, 2014
@mikemaccana
Copy link
Contributor

@brianreavis there's a whole bunch of browser-specific packages on npm and using it as a package manager for client side stuff is becoming increasingly common - for example, jquery core maintain the jquery package, the snapsvg guys maintain the snapsvg package, ractive publish ractive. I actually just searched for selectize and expected it, as a popular library, to be there.

@andreypopp Is selectize-browserify coming soon?

@mikemaccana
Copy link
Contributor

@andreypopp (and others) StyleSelect is available on NPM. Please let me know if you have any problems with the packages and feel free to contribute.

@mikemaccana
Copy link
Contributor

Although if you want all the selectize features (and don't feel like adding them to styleselect), here's how to run selectize in browserify:

First npm install --save jquery sifter microplugin.

Then in your package.json:

"browser": {
  "selectize": "./public/js/src/vendor/selectize.js"
},
"browserify": {
  "transform": [
    "brfs",
    "browserify-shim"
  ]
},
"browserify-shim": {
  "selectize": {
    "depends": [
      "jquery:$",
      "sifter:sifter",
      "microplugin:microplugin"
    ]
  }
},

@brianreavis
Copy link
Member

Caved in and published it: https://www.npmjs.com/package/selectize

@mikemaccana
Copy link
Contributor

Thanks @brianreavis - installed it, required it, added the CSS files and it's working perfectly 👍

@tulbox
Copy link

tulbox commented Jun 10, 2015

Many thanks @brianreavis!

@fabricioferreira
Copy link

So, after the package was published to NPM, was it removed from Bower?
I don't want to reopen the discussion, but how is it going to work for those who want to use bower for client-side code dependencies?

@mikeymckay
Copy link

I'm not sure how to use it with browserify.

I've npm installed it and I've tried:
selectize = require 'selectize'

but: TypeError: $(...).selectize is not a function

Any guidance would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants