Giter VIP home page Giter VIP logo

kanso-bower's Introduction

bower kanso module

module to integrate bower and compile components into the frontend of a couchapp.

Install

Add "kanso-bower" to your kanso.json dependencies setting:

"dependencies": {
	"kanso-bower": null
}

Run kanso install to install into your packages directory:

kanso install

Usage

You can use a component.json beside your kanso.json, but you can also integrate the contents of component.json into your kanso.json file.

{
	"bower":{
		"install": false,
		"minify": true,
		"deployment": "frontend/libs",
		"dependencies": {
			"angular": "~1.0.5",
			"angular-resource": "http://code.angularjs.org/1.0.5/angular-resource.js",
			"jquery": "~1.8.3",
			"jquery.couch": "https://raw.github.com/apache/couchdb/master/share/www/script/jquery.couch.js",
			"bootstrap": "~2.3.1"
		}
	}
}

Options

  • install: should the bower components be deployed with every push? this option is used until there is a way to use command line parameters with kanso packages ( see issue #391 )
  • minify: if true uses uglify to minify all components into a single compressed file with the suffix ".min.js". If false the components are just concentrated and saved with the suffix ".js".
  • deployment: path where the deployed compressed or concentrated components should be deployed. Folder relative to kanso.json.
  • dependencies: Object compatible to the bower component.json with the needed components and versions (or if single script files with the key-value of name and url)

Credits

Special thank to Oren Zomer for fixing some bugs.

node modules

bower: 0.8.5 colors: 0.6.0-1 uglify-js: 2.2.5

kanso-bower's People

Contributors

kulturpessimist avatar ozomer avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ozomer

kanso-bower's Issues

kanso-bower has undeclared dependence on kanso 'properties' package

Hi, nice package, and a necessary on given the paucity of up-to-date front-end libraries in the kanso package repo.

So, I was test driving kanso-bower by adding it to the simplest possible app example kanso.json as:

 {
     "name": "example",
     "version": "0.0.1",
     "description": "The simplest possible app with d3.js from bower",
     "attachments": ["index.html"],
     "dependencies": {
         "attachments": null,
         "kanso-bower": null
     },
    "bower":{
        "install": true,
        "minify": true,
        "deployment": "libs",
        "dependencies": {
            "d3": "~3.3.1"
        }
    }
 }

Running kanso install and kanso push http://localhost:5984/example on this results in the following error:

 /Users/user/kanso_test2/packages/kanso-bower/node_modules/bower/node_modules/tmp/lib/tmp.js:219
     throw err;
           ^
 TypeError: Cannot read property 'complete' of undefined
     at BuildManager.isComplete (/opt/local/lib/node_modules/kanso/lib/buildsteps.js:213:22)
     at BuildManager.ready (/opt/local/lib/node_modules/kanso/lib/buildsteps.js:189:23)
     at /opt/local/lib/node_modules/kanso/lib/buildsteps.js:131:18
     at Array.forEach (native)
     at BuildManager.run (/opt/local/lib/node_modules/kanso/lib/buildsteps.js:130:16)
     at Object.exports.preprocess (/opt/local/lib/node_modules/kanso/lib/packages.js:282:8)
     at async.map.exports.postprocess.doc.kanso (/opt/local/lib/node_modules/kanso/lib/packages.js:70:21)
     at /opt/local/lib/node_modules/kanso/node_modules/async/lib/async.js:194:13
     at /opt/local/lib/node_modules/kanso/node_modules/async/lib/async.js:97:13
     at Array.forEach (native)

Inspection of the running build_steps.js process in kanso led me to discover that the undefined above was stemming from an attempt to use the properties package, which isn't present.

Sure enough, adding "properties": null to the kanso.json dependencies list solved the problem. So it appears as though kanso-bower really does need the properties package, but doesn't declare it in its own (currently empty) kanso.json dependencies list.

Thanks again for this truly useful package, I'm glad I didn't give up on it upon hitting a stack trace dump on my initial trivial test case!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.