kenkeiter / skeuocard

Skeuocard progressively enhances credit card inputs to provide a skeuomorphic interface.
http://kenkeiter.com/skeuocard/
MIT License
3.24k stars 231 forks source link

Dependency issues / doesn't play nice with yeoman/bower #149

Open ghost opened 9 years ago

ghost commented 9 years ago

I've got a project with quite a few bower packages in it. When I run bower install skeuomorph -S, it injects some redundant stuff:

<script src="bower_components/skeuocard/javascripts/vendor/cssua.min.js"></script>
<script src="bower_components/skeuocard/javascripts/vendor/demo.fix.js"></script>
<script src="bower_components/skeuocard/javascripts/vendor/jquery-2.0.3.min.js"></script>
<script src="bower_components/skeuocard/javascripts/skeuocard.js"></script>
<script src="bower_components/skeuocard/javascripts/skeuocard.min.js"></script>

Not only does it inject the Skeuocard JS file twice (one minified), it also includes jQuery which I've already got in my project. I'm no expert at all with bower, but it seems there's a way to check to see if the project already has jQuery, and if it doesn't, to go ahead and install it.

ninjasort commented 9 years ago

I definitely agree that it would be ideal to just have one script tag for skeuocard.js. Including jquery defeats the purpose of bower where one is looking to include bower dependencies rather than coupled vendor code. Can you use bower.json to include other dependencies?

JohnMorales commented 9 years ago

@cameronjroe this doesn't give you just one dependency, but here's what I used to fix the main files problem:

In your bower.json add the following :

  "overrides": {
    "skeuocard": {
      "main": [
          "styles/skeuocard.reset.css",
          "styles/skeuocard.css",
          "javascripts/vendor/cssua.min.js",
          "javascripts/skeuocard.js"
        ] 
      }
    }

That said, I'm not planning on using this project but instead a different solution for providing card input as the owner has seemingly moved on.

ninjasort commented 9 years ago

Cool, thanks for the update.