Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
searls committed Dec 6, 2013
0 parents commit cd6805d
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules

.DS_Store
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# lineman-bower

This is a plugin to make it easy to use Bower in conjunction with a
[Lineman](http://linemanjs.com) app.

## Usage

First, add the plugin to your lineman project:

```
$ npm install lineman-bower --save-dev
```

Second, you'll want to make sure that your bower dependencies don't get checked
into git, so add them to your `.gitignore`:

```
/vendor/bower
```

Next, you'll need a `bower.json` to start pulling down dependencies:

```
{
"name": "my-app",
"version": "0.0.1",
"dependencies": {
"jquery": "~1.9.0"
}
}
```

Finally, you'll want to make sure that jquery is made available when Lineman
concatenates your vendor JavaScript libraries. You can do this by extending the
`js.vendor` configuration in `config/files.js` like so:

```
module.exports = require(process.env["LINEMAN_MAIN"]).config.extend("files", {
js: {
vendor: [
"vendor/bower/jquery/jquery.js",
"vendor/js/**/*.js" //Note that this glob remains for traditional vendor libs
]
}
});
```

Now, when you run `lineman run` and visit [localhost:8000](http://localhost:8000),
you should see Bower install jQuery and have access to the library on the page.
16 changes: 16 additions & 0 deletions config/plugins/bower.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = (lineman) ->
config:
loadNpmTasks: lineman.config.application.loadNpmTasks.concat("grunt-bower-task")

prependTasks:
common: ["bower"].concat(lineman.config.application.prependTasks.common)

clean:
bower:
src: "vendor/bower"

bower:
install:
options:
targetDir: "vendor/bower"
cleanBowerDir: true
3 changes: 3 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
version: require('./package').version
};
32 changes: 32 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "lineman-bower",
"title": "A Bower plugin for Lineman",
"version": "0.0.1",
"homepage": "https://github.com/testdouble/lineman-bower",
"author": {
"name": "Justin Searls",
"company": "Test Double"
},
"repository": {
"type": "git",
"url": "git://github.com/testdouble/lineman-bower.git"
},
"main": "main.js",
"dependencies": {
"grunt-bower-task": "~0.3.4",
"coffee-script": "~1.6.3",
"grunt": "~0.4.2"
},
"devDependencies": {
"grunt": "~0.4.1"
},
"peerDependencies": {
"lineman": ">= 0.19.0"
},
"licenses": [
{
"type": "MIT",
"url": "http://mit-license.org"
}
]
}

0 comments on commit cd6805d

Please sign in to comment.