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

Request: Publish to npm #59

Open
jimf opened this issue Jun 8, 2015 · 16 comments
Open

Request: Publish to npm #59

jimf opened this issue Jun 8, 2015 · 16 comments

Comments

@jimf
Copy link

jimf commented Jun 8, 2015

Would be handy to have this published to npm in addition to bower, since many projects are moving away from bower.

@simeydotme
Copy link
Owner

Thanks for the feedback, @jimf :) -- I'll look in to it, but isn't it possible for NPM to specify a github repo as the dependency? :)

@jimf
Copy link
Author

jimf commented Jun 9, 2015

It is. However, you lose the version tracking, i.e., it'd be up to the user to manage the dependency manually, as tools like npm outdated etc. won't have insight into the github package (afaik).

@jamescoletti
Copy link

In the meantime, npm is complaining about the main property in package.json being an array. It expects a string pointing to the entry point of the module/script.

$ npm install git://github.com/simeydotme/jQuery-ui-Slider-Pips.git#v1.10.5
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/Cellar/node/4.1.0/bin/node" "/usr/local/bin/npm" "install" "git://github.com/simeydotme/jQuery-ui-Slider-Pips.git#v1.10.5"
npm ERR! node v4.1.0
npm ERR! npm  v3.3.9

npm ERR! Path must be a string. Received [ 'dist/jquery-ui-slider-pips.css',
npm ERR!   'dist/jquery-ui-slider-pips.min.js' ]
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
...

@simeydotme
Copy link
Owner

any assistance on this would be appreciated 😄 -- I have no experience with NPM packages

@jimf
Copy link
Author

jimf commented Nov 13, 2015

Once you have created an npm account, it should just be a matter of running npm publish with your account credentials (you can create a ~/.npmrc to not specify these every time).

Also, I believe it's recommended, if not required, for the package.json name field to be in all lowercase. In addition, main should point to a single js file.

@simeydotme
Copy link
Owner

thanks @jimf ... I understand that.
So I only had the package.json originally so Grunt could run, thats why it's a bit weird.

I do not have any intention for this to be a exported anonymous module as it is an extension method for jqueryui... Am I right in thinking that NPM modules should always be self-executing functions, and not extensions for other libraries? -- This is the part I require some help/advice on :)

I do not want to wrap the extentions in an exported module, as that will make it inaccessible for non-npm/browserify users... or should I have anohter, new file, explicitly for browserify/npm which is wrapped as an exported module, and should it be classified as the "main" file?

Thanks for any insight.

@jimf
Copy link
Author

jimf commented Nov 16, 2015

Ah, gotcha. Yeah, I suppose it comes down to how much you want to put into it. FWIW, jQuery officially moved their plugin repository to npm. The npm blog posted a couple of articles (here and here) on making the transition. But yeah, a true CommonJS setup would look a little different. You likely could always use a UMD wrapper though to keep the existing sort of plug-and-play support.

@simeydotme
Copy link
Owner

Excellent, @jimf -- thanks for your help.
I'll read through those links and try to come up with a solution! 😄

And thanks for your patience.

Simon.

@jamescoletti
Copy link

Yep, that's the article. Thanks @jimf. The last few code snippets in the 2nd npm blog post describe how to handle both browser and CommonJS environments using a simple factory. Module exporting can be useful for things like unit testing or attaching the jQuery plugin manually for more specialized use cases. Thanks for looking into this.

@jimf
Copy link
Author

jimf commented Nov 17, 2015

Glad to help! 🍻

@simeydotme simeydotme modified the milestone: 1.11.0 Dec 10, 2015
@ramytamer
Copy link

I still can't install it via npm.

@simeydotme simeydotme added this to the 2.0.0 milestone Sep 5, 2016
@trailofdad
Copy link

+1 would love to have this in NPM

@simeydotme
Copy link
Owner

simeydotme commented Oct 2, 2016

Hey, anyone who's interested in this being available on NPM, could you please review the changes on the 2nd of Oct, https://github.com/simeydotme/jQuery-ui-Slider-Pips/commits/2.0.0-alpha -- if anyone can test this on browserify/webpack I'd be greatly appreciative... if that works I'll release it as 2.0.0 and push to NPM :)

@simeydotme
Copy link
Owner

simeydotme commented Oct 2, 2016


edited for milestone tracking

@simeydotme simeydotme self-assigned this Oct 2, 2016
@Deckluhm
Copy link

Also, I believe it's recommended, if not required, for the package.json name field to be in all lowercase.

https://docs.npmjs.com/getting-started/using-a-package.json#requirements

simeydotme added a commit that referenced this issue Feb 10, 2018
- change package version to 2.0.0-alpha (#59)
- change package name to lowercase (#59)
@khandelwalriya
Copy link

How can we get values of the slider to perform some operation based on slider value?

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

No branches or pull requests

7 participants