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

no compiled version of your script in the repo for bower #338

Closed
daviestar opened this issue Sep 7, 2014 · 22 comments
Closed

no compiled version of your script in the repo for bower #338

daviestar opened this issue Sep 7, 2014 · 22 comments

Comments

@daviestar
Copy link

Hey

Thanks for an awesome package, the recent 'pips' addition is great :)

I just updated your package with bower and the compiled versions of your script appear to be removed from the repo, and the only way I can get at them are from the downloadable zip.

This is causing me issues - if it's not installed via bower it doesn't get picked up by my automated build process. (supposedly bower will install zips but it doesn't work for me).

Please add them back in, and add a 'main' link in bower.json. Cheers!

@leongersen
Copy link
Owner

This has been an issue for some time. The Bower guide claims I should not add minified files to the repository, but people keep requesting it. If you are using npm, you can build them using grunt create.

@daviestar
Copy link
Author

jquery.nouislider.full.min.js
jquery.nouislider.min.js

Both were there on 7.0.1 but are gone as of yesterday.

I got round it by installing the 7.0.1 tag

@daviestar
Copy link
Author

Just thinking about what you said - you should definitely have a 'main' file, which should be a compiled (not compressed/minified) version of your build, and link it in bower.json. In fact, just now bower tells me:

invalid-meta nouislider is missing "main" entry in bower.json

I'd suggest adding jquery.nouislider.full.js to the repo and linking it to main to avoid alot more people like me coming along and complaining :)

@moderndegree
Copy link

+1 for adding jquery.nouislider.full.js. Bower expects there to be a "main" file and there are several tools, such as grunt-bower-task, that require it. I understand not including minified files, as people will should be minifying their own assets for production builds.

@daviestar
Copy link
Author

Yeah I use bower-main-files with gulp, that's how I ended up here

@leongersen
Copy link
Owner

Ok then. I'll set it up.

@karlhorky
Copy link

You may want to consider also making bower packages out of libLink and wnumb (and making them dependencies of the noUiSlider bower package), unless you are planning on including them in your main compiled JavaScript file.

As a workaround for this now, I've included them separately in my bower.json with the GitHub project references like in the following code, but it would be better if this was handled by the noUiSlider package alone.

"libLink": "leongersen/libLink#e6a1ddf4bd411e9f793db80c8692314783d28200",
"wnumb": "leongersen/wnumb#2bf0af44c1e0ef316cc913236682ca4ef7ead548",

@karlhorky
Copy link

The reason for this is that the git submodules will not show up if you install the library with Bower.

@leongersen
Copy link
Owner

I've added the compiled files to the repository. I don't like it very much, though.

@leongersen
Copy link
Owner

Could someone do me the favour of trying this solution with the following url:

https://github.com/leongersen/noUiSlider/releases/download/7.0.3/noUiSlider.7.0.3.zip

Thanks!

@karlhorky
Copy link

@leongersen I tried this out, but it gave me an error:

$ bower install
bower nouislider#*          not-cached https://github.com/leongersen/noUiSlider/releases/download/7.0.3/noUiSlider.7.0.3.zip#*
bower nouislider#*             resolve https://github.com/leongersen/noUiSlider/releases/download/7.0.3/noUiSlider.7.0.3.zip#*
bower nouislider#*            download https://github.com/leongersen/noUiSlider/releases/download/7.0.3/noUiSlider.7.0.3.zip
bower nouislider#*             extract noUiSlider.7.0.3.zip
bower nouislider#*               error Unsupported file type "undefined"

Stack trace:
Error: Unsupported file type "undefined"
    at DecompressZip.extractFile (/usr/local/lib/node_modules/bower/node_modules/decompress-zip/lib/decompress-zip.js:311:11)
    at /usr/local/lib/node_modules/bower/node_modules/decompress-zip/lib/decompress-zip.js:245:28
    at Array.forEach (native)
    at DecompressZip.extractFiles (/usr/local/lib/node_modules/bower/node_modules/decompress-zip/lib/decompress-zip.js:244:11)
    at /usr/local/lib/node_modules/bower/node_modules/decompress-zip/lib/decompress-zip.js:124:21
    at _fulfilled (/usr/local/lib/node_modules/bower/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/bower/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/bower/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/bower/node_modules/q/q.js:557:44
    at flush (/usr/local/lib/node_modules/bower/node_modules/q/q.js:108:17)

Console trace:
Trace
    at StandardRenderer.error (/usr/local/lib/node_modules/bower/lib/renderers/StandardRenderer.js:72:17)
    at Logger.<anonymous> (/usr/local/lib/node_modules/bower/bin/bower:110:22)
    at Logger.EventEmitter.emit (events.js:95:17)
    at Logger.emit (/usr/local/lib/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
    at /usr/local/lib/node_modules/bower/lib/commands/index.js:40:20
    at _rejected (/usr/local/lib/node_modules/bower/node_modules/q/q.js:797:24)
    at /usr/local/lib/node_modules/bower/node_modules/q/q.js:823:30
    at Promise.when (/usr/local/lib/node_modules/bower/node_modules/q/q.js:1035:31)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/bower/node_modules/q/q.js:741:41)
    at /usr/local/lib/node_modules/bower/node_modules/q/q.js:557:44

System info:
Bower version: 1.3.9
Node version: 0.10.28
OS: Darwin 13.3.0 x64

Thanks for adding the compiled files by the way.

@leongersen
Copy link
Owner

I figured out why it doesn't work with the releases-zip. Writing a blog post now ;)

@karlhorky
Copy link

I've also been looking a bit on trying to keep compiled files out of bower repos, but this seems to be the recommended way of doing things.

@benschwarz does have a point to about the user experience:

In my opinion, built libraries should be apart of the repository (and managed by semver). Having to install / manage / build sass/styl/compass/less/coffee based components is a bad user experience.

@daviestar
Copy link
Author

Thanks for debugging this issue for us Leon.

The Unsupported file type "undefined" error above is similar to what I was getting when trying to install your zip. I presumed it was to do with my Linux install.

I will be interested to read your results. Thanks.

@daviestar
Copy link
Author

What are your reasons for keeping the compiled file out of the repo, but adding to the zip release?

I think most people using an automated build process are looking for the fastest way to install plugins. My job involves making several small websites per week, and your plugin is my go-to slider. My process is something like:

bower search nouislider
(get repo name from results)
bower install nouislider -S
(then later...)
bower update

Developers will still run into the 'main' error when installing the repo with bower if you keep the 'main' file only in the zip, and I think you will only get more issues about it. Anything thats a little different or slows me down at installation has to be put down as a negative.

Just trying to make your life a little easier :)

@leongersen
Copy link
Owner

Well, the whole Bower thing is a bit of a headache. Committing minified files makes changes hard to see, as a single-line change gets buried in 5 (!) files that changed 100%.

@daviestar
Copy link
Author

What about a dist folder that you only update on a tagged release, not each commit?

It could contain compiled and/or minified files, and link to bower main.

@leongersen
Copy link
Owner

I did just that - kinda. I create a new repository, which I add to the noUiSlider repository as a submodule. I've updated the release task (grunt release) to copy all files into it. Now to create a new release, I can do:

  • Update the version number in package.json.
  • Run grunt release
  • Move to the submodule. cd submodules/noUiSlider-dist
  • Update git add. git commit -m "Update" git push

I've updated to bower registry, so you can still happily do:

bower install nouislider

This should keep everyone happy 😃.

@daviestar
Copy link
Author

Hey

I followed your instructions and installed with command bower install nouislider --save which currently brings down the 7.0.5 tag from leongersen/noUiSlider with no bower.json file. Maybe bower is cached for the time being, I will try again tomorrow.

Have you heard of Git flow? You might find the methodology could help fix your issues without creating a separate repo.

Thanks for your work.

@leongersen
Copy link
Owner

You might need bower cache clean to update the repository.

@leongersen
Copy link
Owner

I give up. #340 addresses the issue of all old dependencies, which I failed to consider. I've marked the files as -diff and committed them back in.

@github-actions
Copy link

github-actions bot commented Jun 7, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants