knockout.observableDictionary icon indicating copy to clipboard operation
knockout.observableDictionary copied to clipboard

Added Bower configuration and Gruntfile

Open bennycode opened this issue 11 years ago • 3 comments

Hello,

as promised here are the changes to have your "observableDictionary" as a Bower dependency. This commit includes a Bower package description (bower.json) and a Grunt configuration (package.json & Gruntfile.js).

All you need to do now is installing "node.js" (http://nodejs.org/). If you have "node" then you can install Grunt via the command-line with: npm install -g grunt-cli and Bower with npm install -g bower.

If you have grunt installed then you should go to your project via command-line and execute:

npm install
bower install

These two commands will resolve external dependencies (like Knockout). You can then open the index.html file to see if the needed dependencies have been resolved. :)

If you want to create a package for distribution of your plugin, then just run:

grunt default

Grunt will package your plugin to the "dist" folder including the source files, a minified version and a source-code mapping file. :) If you are happy with that, then just create a new Version of your plugin on GitHub and release it as a Bower package, using:

bower init
bower register knockout.observableDictionary git://github.com/jamesfoster/knockout.observableDictionary.git

Feel free to contact me if there are any problems!

More information:

bennycode avatar Jun 20 '14 11:06 bennycode

Awesome!

lipis avatar Jun 20 '14 11:06 lipis

Please update your docs because bower complains about camel case notation of package name. It will produce an error EINVFORMAT Invalid URL format for the install command:

bower register knockout.observableDictionary git://github.com/jamesfoster/knockout.observableDictionary.git

Instead use:

bower register knockout.dictionary git://github.com/jamesfoster/knockout.observableDictionary.git

Also see http://stackoverflow.com/questions/25387908/unable-to-register-bower-package-einvformat It is also possible to add the dependency to the bower.json referencing the git repository location like this

{
  "name": "some project",
  "dependencies": {
    "knockout-dict": "git://github.com/jamesfoster/knockout.observableDictionary.git"
  }
}

bennidi avatar Nov 10 '14 10:11 bennidi

@bennidi - Thanks for the info! I updated the package.json and bower.json file with a package name which doesn't use camelCase. But @jamesfoster still needs to merge my pull request. Otherwise this change will be only available in my fork: https://github.com/bennyn/knockout.observableDictionary

bennycode avatar Nov 10 '14 10:11 bennycode