Skip to content

Commit

Permalink
first pass at restoring lost changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ctalkington committed Dec 13, 2012
1 parent 978463d commit bfc8bbe
Show file tree
Hide file tree
Showing 23 changed files with 239 additions and 206 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v0.4.0:
date: 2012-12-15
changes:
- Conversion to grunt v0.4 conventions.
- Remove node v0.6 and grunt v0.3 support.
- Merge grunt-stylus features (plugin loading, embedding).
- Remove experimental destination wildcards.
v0.3.1:
date: 2012-10-12
changes:
Expand Down
39 changes: 30 additions & 9 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

module.exports = function(grunt) {

function testPlugin() {
return function(style){
style.define('test-plugin', 'yep');
};
}

// Project configuration.
grunt.initConfig({
jshint: {
Expand All @@ -33,31 +39,46 @@ module.exports = function(grunt) {
compile: {
files: {
'tmp/stylus.css': ['test/fixtures/stylus.styl'],
'tmp/concat.css': ['test/fixtures/stylus.styl', 'test/fixtures/stylus2.styl'],
'tmp/individual/*.css': ['test/fixtures/*.styl', 'test/fixtures/level2/*.styl']
'tmp/concat.css': ['test/fixtures/stylus.styl', 'test/fixtures/stylus2.styl']
},
options: {
paths: ['test/fixtures/include'],
compress: true
}
},
flatten: {
nib: {
files: {
'tmp/individual_flatten/*.css': ['test/fixtures/*.styl', 'test/fixtures/level2/*.styl']
'tmp/nib_.css': 'test/fixtures/nib_/nib_.styl'
},
options: {
paths: ['test/fixtures/include'],
compress: true,
flatten: true
paths: ['test/fixtures/include']
}
},
nib: {
autocompress: {
files: {
'tmp/nib.css': 'test/fixtures/nib/nib.styl'
'tmp/autocompress.css': 'test/fixtures/stylus.styl',
},
options: {
paths: ['test/fixtures/include']
}
},
plugin: {
files: {
'tmp/plugin.css': 'test/fixtures/plugin/plugin.styl'
},
options: {
use: [
testPlugin
]
}
},
embedurl: {
files: {
'tmp/embedurl.css': 'test/fixtures/embedurl/embedurl.styl'
},
options: {
urlfunc: 'embedurl'
}
}
},

Expand Down
168 changes: 81 additions & 87 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,81 @@
# grunt-contrib-stylus [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-stylus.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-stylus)

> Compile Stylus files to CSS.

## Getting Started
If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide, as it explains how to create a [gruntfile][Getting Started] as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:

```shell
npm install grunt-contrib-stylus --save-dev
```

[grunt]: http://gruntjs.com/
[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md


## Stylus task
_Run this task with the `grunt stylus` command._

_This task is a [multi task][] so any targets, files and options should be specified according to the [multi task][] documentation._
[multi task]: https://github.com/gruntjs/grunt/wiki/Configuring-tasks


This task comes preloaded with [nib](http://visionmedia.github.com/nib/).

### Options

#### basePath
Type: `String` (individual only)

Adjusts the folder structure when compiled to the destination directory. When not explicitly set, best effort is made to locate the basePath by comparing all source filepaths left to right for a common pattern. You can use *.{ext} as your destination filename to individually compile each file to the destination directory. Otherwise, when the source contains an array of multiple filepaths, the contents are concatenated in the order passed. **This API will be changing**

#### compress
Type: `Boolean`
Default: false

Specifies if we should compress the compiled css.

#### flatten
Type: `Boolean` (individual only)

Performs a flat compile that dumps all the files into the root of the destination directory, overwriting files if they exist.

#### paths
Type: `String` `Array`

Specifies directories to scan for @import directives when parsing.

### Examples

```js
stylus: {
compile: {
options: {
compress: true,
paths: ['path/to/import', 'another/to/import']
},
files: {
'path/to/result.css': 'path/to/source.styl', // 1:1 compile
'path/to/another.css': ['path/to/sources/*.styl', 'path/to/more/*.style'], // compile and concat into single file
'path/to/*.css': ['path/to/sources/*.styl', 'path/to/more/*.styl'] // compile individually into dest, maintaining folder structure
}
},
flatten: {
options: {
flatten: true,
paths: ['path/to/import', 'another/to/import']
},
files: {
'path/to/*.css': ['path/to/sources/*.styl', 'path/to/more/*.styl'] // compile individually into dest, flattening folder structure
}
}
}
```

## Release History

* 2012-10-11   v0.3.1   Rename grunt-contrib-lib dep to grunt-lib-contrib.
* 2012-09-23   v0.3.0   Options no longer accepted from global config key. Individually compile into dest, maintaining folder structure.
* 2012-09-16   v0.2.2   Tests refactored, better watch integration.
* 2012-09-09   v0.2.0   Refactored from grunt-contrib into individual repo.

---

Task submitted by [Eric Woroshow](http://ericw.ca)

*This file was generated on Wed Nov 28 2012 08:47:07.*
# grunt-contrib-stylus [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-stylus.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-stylus)

> Compile Stylus files to CSS.

## Getting Started
If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide, as it explains how to create a [gruntfile][Getting Started] as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:

```shell
npm install grunt-contrib-stylus --save-dev
```

[grunt]: http://gruntjs.com/
[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md


## Stylus task
_Run this task with the `grunt stylus` command._

_This task is a [multi task][] so any targets, files and options should be specified according to the [multi task][] documentation._
[multi task]: https://github.com/gruntjs/grunt/wiki/Configuring-tasks


This task comes preloaded with [nib](http://visionmedia.github.com/nib/).

### Options

#### compress
Type: `Boolean`
Default: true

Specifies if we should compress the compiled css. Compression is always disabled when `--debug` flag is passed to grunt.

#### paths
Type: `String` `Array`

Specifies directories to scan for @import directives when parsing.

#### urlfunc
Type: `String`

Specifies function name that should be used for embedding images as Data URI.

#### use
Type: `Array`

Allows passing of stylus plugins to be used during compile.

### Examples

```js
stylus: {
compile: {
options: {
paths: ['path/to/import', 'another/to/import'],
urlfunc: 'embedurl', // use embedurl('test.png') in our code to trigger Data URI embedding
use: [
require('fluidity') // use stylus plugin at compile time
]
},
files: {
'path/to/result.css': 'path/to/source.styl', // 1:1 compile
'path/to/another.css': ['path/to/sources/*.styl', 'path/to/more/*.styl'] // compile and concat into single file
}
}
}
```

## Release History

* 2012-12-14   v0.4.0   Conversion to grunt v0.4 conventions. Remove node v0.6 and grunt v0.3 support. Merge grunt-stylus features (plugin loading, embedding). Remove experimental destination wildcards.
* 2012-10-11   v0.3.1   Rename grunt-contrib-lib dep to grunt-lib-contrib.
* 2012-09-23   v0.3.0   Options no longer accepted from global config key. Individually compile into dest, maintaining folder structure.
* 2012-09-16   v0.2.2   Tests refactored, better watch integration.
* 2012-09-09   v0.2.0   Refactored from grunt-contrib into individual repo.

---

Task submitted by [Eric Woroshow](http://ericw.ca)

*This file was generated on Wed Dec 12 2012 19:13:54.*
19 changes: 6 additions & 13 deletions docs/stylus-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,15 @@
stylus: {
compile: {
options: {
compress: true,
paths: ['path/to/import', 'another/to/import']
paths: ['path/to/import', 'another/to/import'],
urlfunc: 'embedurl', // use embedurl('test.png') in our code to trigger Data URI embedding
use: [
require('fluidity') // use stylus plugin at compile time
]
},
files: {
'path/to/result.css': 'path/to/source.styl', // 1:1 compile
'path/to/another.css': ['path/to/sources/*.styl', 'path/to/more/*.style'], // compile and concat into single file
'path/to/*.css': ['path/to/sources/*.styl', 'path/to/more/*.styl'] // compile individually into dest, maintaining folder structure
}
},
flatten: {
options: {
flatten: true,
paths: ['path/to/import', 'another/to/import']
},
files: {
'path/to/*.css': ['path/to/sources/*.styl', 'path/to/more/*.styl'] // compile individually into dest, flattening folder structure
'path/to/another.css': ['path/to/sources/*.styl', 'path/to/more/*.styl'] // compile and concat into single file
}
}
}
Expand Down
24 changes: 12 additions & 12 deletions docs/stylus-options.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Options

## basePath
Type: `String` (individual only)

Adjusts the folder structure when compiled to the destination directory. When not explicitly set, best effort is made to locate the basePath by comparing all source filepaths left to right for a common pattern. You can use *.{ext} as your destination filename to individually compile each file to the destination directory. Otherwise, when the source contains an array of multiple filepaths, the contents are concatenated in the order passed. **This API will be changing**

## compress
Type: `Boolean`
Default: false

Specifies if we should compress the compiled css.

## flatten
Type: `Boolean` (individual only)
Default: true

Performs a flat compile that dumps all the files into the root of the destination directory, overwriting files if they exist.
Specifies if we should compress the compiled css. Compression is always disabled when `--debug` flag is passed to grunt.

## paths
Type: `String` `Array`

Specifies directories to scan for @import directives when parsing.

## urlfunc
Type: `String`

Specifies function name that should be used for embedding images as Data URI.

## use
Type: `Array`

Allows passing of stylus plugins to be used during compile.
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-contrib-stylus",
"description": "Compile Stylus files to CSS.",
"version": "0.3.1",
"version": "0.4.0a",
"homepage": "https://github.com/gruntjs/grunt-contrib-stylus",
"author": {
"name": "Grunt Team",
Expand All @@ -22,23 +22,22 @@
],
"main": "grunt.js",
"engines": {
"node": ">= 0.6.0"
"node": ">= 0.8.0"
},
"scripts": {
"test": "grunt test"
},
"dependencies": {
"stylus": "~0.29.0",
"nib": "~0.8.2",
"grunt-lib-contrib": "~0.3.0"
"stylus": "~0.31.0",
"nib": "~0.9.0",
"grunt-lib-contrib": "~0.4.0"
},
"devDependencies": {
"grunt-contrib-jshint": "0.1.0",
"grunt-contrib-nodeunit": "0.1.0",
"grunt-contrib-jshint": "~0.1.0",
"grunt-contrib-nodeunit": "~0.1.1",
"grunt-contrib-internal": "~0.1.0",
"grunt-contrib-clean": "~0.4.0",
"grunt": "~0.4.0a",
"grunt-cli": "~0.1.1"
"grunt": "~0.4.0"
},
"keywords": [
"gruntplugin"
Expand Down
Loading

0 comments on commit bfc8bbe

Please sign in to comment.