Skip to content

Commit

Permalink
Changed: Messages are now passed via postcss messages api (4.0.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Jun 18, 2015
1 parent a068127 commit dbac3d7
Show file tree
Hide file tree
Showing 6 changed files with 269 additions and 109 deletions.
31 changes: 19 additions & 12 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
---
ecmaFeatures:
modules: true
jsx: true

env:
es6: true
browser: true
node: true

# 0: off, 1: warning, 2: error
rules:
# semicolons are useless
semi: [2, "never"]

indent: [2, 2] # 2 spaces indentation
max-len: [2, 80, 4]
quotes: [2, "double"]
semi: [2, "never"]
no-multiple-empty-lines: [2, {"max": 1}]

# 2 spaces indentation
indent: [2, 2]

# trailing coma are cool for diff
brace-style: [2, "stroustrup"]
comma-dangle: [2, "always-multiline"]

# enforce comma at eol (never before)
comma-style: [2, "last"]
computed-property-spacing: [2, "never"]
dot-location: [2, "property"]

one-var: [2, "never"]
no-bitwise: [2]

space-after-keywords: [2, "always"]
space-before-blocks: [2, "always"]
space-before-function-paren: [2, "never"]
space-in-brackets: [2, "never"]
space-in-parens: [2, "never"]
spaced-line-comment: [2, "always"]

valid-jsdoc: 2
# this plugin need a refactoring...
no-use-before-define: 0
42 changes: 31 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 4.0.0 - 2015-06-18

- Fixed: fallback callback is working again
([#33](https://github.com/postcss/postcss-url/pull/33))
- Changed: Messages are now passed via postcss messages api
(no more console.warn)
- Added: callbacks might have now postcss result object as last param.
Handy to send some messages.

# 3.3.0 - 2015-06-16

- Added: postcss ^4.1.x dependency
Expand All @@ -7,31 +16,36 @@

# 3.2.0 - 2015-05-01

- Added: New `fallback` option to use if max size is exceeded or url contains a hash ([#30](https://github.com/postcss/postcss-url/pull/30))
- Added: New `fallback` option to use if max size is exceeded or url contains a hash
([#30](https://github.com/postcss/postcss-url/pull/30))

# 3.1.0 - 2015-05-01

- Added: New copy value for `url` option ([#29](https://github.com/postcss/postcss-url/pull/29))
- Added: New copy value for `url` option
([#29](https://github.com/postcss/postcss-url/pull/29))

# 3.0.0 - 2015-03-02

- Changed: upgraded to postcss v4.1.x

# 2.1.1 - 2015-03-31

- Fixed: whitespace before and after url() value are now supported and preserved ([#27](https://github.com/postcss/postcss-url/pull/27))
- Fixed: whitespace before and after url() value are now supported and preserved
([#27](https://github.com/postcss/postcss-url/pull/27))

# 2.1.0 - 2015-03-12

- Added: related postcss declaration object has been added as a 2nd parameter to the url callback for custom processing

# 2.0.2 - 2015-01-31

- Fixed: url that are just hashes are ignored completely ([#25](https://github.com/postcss/postcss-url/issues/25))
- Fixed: url that are just hashes are ignored completely
([#25](https://github.com/postcss/postcss-url/issues/25))

# 2.0.1 - 2015-01-31

- Fixed: url with hashes are ignored for inline mode only ([#23](https://github.com/postcss/postcss-url/pull/23))
- Fixed: url with hashes are ignored for inline mode only
([#23](https://github.com/postcss/postcss-url/pull/23))

# 2.0.0 - 2015-01-26

Expand All @@ -40,7 +54,8 @@

# 1.3.1 - 2015-01-26

- Fixed: dependency issue related to "directory-encoder" ([#22](https://github.com/postcss/postcss-url/pull/22))
- Fixed: dependency issue related to "directory-encoder"
([#22](https://github.com/postcss/postcss-url/pull/22))

# 1.3.0 - 2015-01-26

Expand All @@ -49,13 +64,15 @@

# 1.2.3 - 2015-01-10

- Use Node's native buffer.toString("base64"). The js-base64 library was producing incorrect base64 for certain files ([#17](https://github.com/postcss/postcss-url/pull/17))
- Use Node's native buffer.toString("base64"). The js-base64 library was producing incorrect base64 for certain files
([#17](https://github.com/postcss/postcss-url/pull/17))

# 1.2.2 - unpublished

# 1.2.1 - 2014-12-09

- Data URIs are ignored correctly ([#15](https://github.com/postcss/postcss-url/pull/15))
- Data URIs are ignored correctly
([#15](https://github.com/postcss/postcss-url/pull/15))

# 1.2.0 - 2014-12-04

Expand All @@ -64,11 +81,13 @@

# 1.1.3 - 2014-12-04

- Fix absolute urls being mangled ([#13](https://github.com/postcss/postcss-url/issues/13))
- Fix absolute urls being mangled
([#13](https://github.com/postcss/postcss-url/issues/13))

# 1.1.2 - 2014-11-08

- Fix MaxSize issue ([#9](https://github.com/postcss/postcss-url/issues/9))
- Fix MaxSize issue
([#9](https://github.com/postcss/postcss-url/issues/9))

# 1.1.1 - 2014-10-30

Expand All @@ -84,7 +103,8 @@

# 1.0.1 - 2014-10-09

- Fix paths for Windows ([#3](https://github.com/postcss/postcss-url/issue/3) via [#4](https://github.com/postcss/postcss-url/pull/4))
- Fix paths for Windows
([#3](https://github.com/postcss/postcss-url/issue/3) via [#4](https://github.com/postcss/postcss-url/pull/4))

# 1.0.0 - 2014-08-24

Expand Down
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ Checkout [tests](test) for examples.

### Options

#### `url` (default: `"rebase"`)
#### `url`

_(default: `"rebase"`)_

##### `url: "rebase"`

Expand All @@ -61,29 +63,36 @@ Custom transform function. Takes following arguments:
* `dirname` – dirname of processing file
* `to` – from postcss option
* `options` – plugin options
* `result` – postcss result object

And should return the transformed url.
You can use this option to adjust urls for CDN.

#### `maxSize: "size in kbytes"`
#### `maxSize`

Specify the maximum file size to inline (in kbytes)

#### `fallback`

Specify the maximum file size to inline
The url fallback method to use if max size is exceeded or url contains a hash.
Custom transform functions are supported.

#### `fallback: "copy or custom {Function}"`
#### `basePath`

The url fallback method to use if max size is exceeded or url contains a hash. Custom transform functions are supported.
Specify the base path from where to search images

#### `basePath: "basePath for images to inline"`
#### `assetsPath`

Specify the basePath from where to search images
_(default: `false`)_

#### `assetsPath: "the destination where postcss-url is going to copy the assets"`
If you specify an `assetsPath`, the assets files would be copy in that
destination

If you specify an assetsPath the assets files would be copy in that destination
#### `useHash`

#### `useHash: "If is set in true the copy method is going to rename the path of the files by a hash name"`
_(default: `false`)_

By default is set in false but you can change that
If is set in true the copy method is going to rename the path of the files by a hash name

---

Expand Down
Loading

0 comments on commit dbac3d7

Please sign in to comment.