Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/6.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
borodean committed May 13, 2021
2 parents 16bbee9 + b820487 commit e56ae79
Show file tree
Hide file tree
Showing 15 changed files with 5,302 additions and 282 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "airbnb-base/legacy",
"extends": "airbnb-base",
"root": true
}
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sudo: false
language: node_js
node_js:
- stable
- "6"
- "4"
- 14
- 12
- 10
after_success: npm run coveralls
90 changes: 72 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,50 @@
# Change log

## 6.0.0

**Breaking**

- Updates to PostCSS 8 (https://github.com/borodean/postcss-assets/issues/86, https://github.com/borodean/postcss-assets/pull/87)
- Drops nodejs <10 support.

**Under the hook**

- Minor documentation tweaks (https://github.com/borodean/postcss-assets/pull/78, https://github.com/borodean/postcss-assets/pull/84)

## 5.0.0

**Breaking**

- Updates to PostCSS 6 (https://github.com/borodean/postcss-assets/issues/70, https://github.com/borodean/postcss-assets/issues/71, https://github.com/borodean/postcss-assets/pull/72).
- Drops nodejs 0.12 support.

## 4.2.0

**Features:**

* Add `cache` option to cache resolved dimensions (https://github.com/borodean/postcss-assets/pull/73).
- Add `cache` option to cache resolved dimensions (https://github.com/borodean/postcss-assets/pull/73).

## 4.1.0

**Features:**

* `relative` option supports what `relativeTo` option did in 3.x: if a string is passed, paths are generated relatively to a path in that string. A behavior of relating to input files by passing `true` is kept untouched.
- `relative` option supports what `relativeTo` option did in 3.x: if a string is passed, paths are generated relatively to a path in that string. A behavior of relating to input files by passing `true` is kept untouched.

**Under the hood:**

* Code updated to match [Airbnb code style](https://github.com/airbnb/javascript).
* Tests converted to ES6 syntax.
- Code updated to match [Airbnb code style](https://github.com/airbnb/javascript).
- Tests converted to ES6 syntax.

## 4.0.1

**Bugfixes**

- Works fine with no options provided (https://github.com/assetsjs/postcss-assets/issues/45).

## 4.0.0

**Breaking**

- Removes `relativeTo` option, introduces `relative` one.

There is no need to specify a particular file to relate to anymore - set `relative` to `true` and Assets would resolve URLs relatively to the current CSS file.
Expand All @@ -36,27 +54,30 @@
(https://github.com/assetsjs/postcss-assets/issues/42)

**Features**

- Load paths now accept globs:

```js
var options = { loadPaths: ['images', 'assets/**/img'] };
var options = { loadPaths: ["images", "assets/**/img"] };
```

(https://github.com/assetsjs/postcss-assets/issues/40)

- Load paths now also accept single strings:

```js
var options = { loadPaths: 'assets/**/img' };
var options = { loadPaths: "assets/**/img" };
```

**Bugfixes**

- Really fixes the SVG rendering on Internet Explorer.
- SCSS flags are preserved (https://github.com/assetsjs/postcss-assets/issues/43).
- No more funky file names in the repo to make Windows archiver happy (https://github.com/assetsjs/postcss-assets/issues/35).
- Allows numbers to be returned from the cachebuster function.

**Under the hood**

- Coverage hits 100%.
- Automated tests against the latest stable nodejs, v0.12 and v4.
- Builds are automatically tested on Windows by [AppVeyor](https://ci.appveyor.com/project/borodean/postcss-assets).
Expand All @@ -67,99 +88,132 @@
- Cleans up dependencies.

## 3.0.3

**Bugfixes**

- no longer uses private `image-size` fork, so properly installs on Windows (https://github.com/borodean/postcss-assets/pull/30, https://github.com/borodean/postcss-assets/issues/32);
- properly calculates dimensions of SVGs with percentage values of `width`/`height` attributes (https://github.com/borodean/postcss-assets/issues/33).

## 3.0.2

**Bugfixes**
* IE understands generated SVG (https://github.com/borodean/postcss-assets/issues/24).

- IE understands generated SVG (https://github.com/borodean/postcss-assets/issues/24).

## 3.0.1

**Bugfixes**

- Preserves Microsoft filters (https://github.com/borodean/postcss-assets/issues/27).

**Under the hood**

- Uses ESLint instead of JSHint/JSCS.

## 3.0.0

**API updates**
* better PostCSS 5.0 API conformance (https://github.com/borodean/postcss-assets/issues/25).

- better PostCSS 5.0 API conformance (https://github.com/borodean/postcss-assets/issues/25).

## 2.1.4

Since private `image-size` fork was removed, releases 2.1.0—3.0.2 has stopped working. While 3.0.3 release fixes this for the 3.0.x versions, this release is fixing the same for the 2.1.x.

**Bugfixes**

- no longer uses private `image-size` fork (https://github.com/borodean/postcss-assets/issues/37)

## 2.1.3

**Bugfixes**

- better PostCSS plugin API conformance (https://github.com/borodean/postcss-assets/pull/21). This allows plugin to be used with Webpack.

## 2.1.2

**Under the hood**
* [PostCSS Plugin Guidelines](https://github.com/postcss/postcss/blob/master/docs/guidelines/plugin.md) conformance (https://github.com/borodean/postcss-assets/issues/20);
* continious integration tests on both Node.js and io.js;
* shows coverage statistics on the repository page.

- [PostCSS Plugin Guidelines](https://github.com/postcss/postcss/blob/master/docs/guidelines/plugin.md) conformance (https://github.com/borodean/postcss-assets/issues/20);
- continious integration tests on both Node.js and io.js;
- shows coverage statistics on the repository page.

## 2.1.1

**Bugfixes**

- fix path separator handling on Windows (https://github.com/borodean/postcss-assets/issues/19).

**Under the hood**

- covers 99% of the code;
- explains code with comments.

## 2.1.0

**API updates**

- extends cachebuster to support modifying the filename (https://github.com/borodean/postcss-assets/pull/17, [docs](https://github.com/borodean/postcss-assets#cachebuster)).

**Bugfixes**

- uses [forked version of image-size](https://github.com/borodean/image-size) to support viewbox-only svgs;
- properly encodes some tricky SVG files (https://github.com/borodean/postcss-assets/pull/18).

**Under the hood**

- uses [Gulp](http://gulpjs.com/) for development routines;
- validates code style with [JSHint](http://jshint.com/) and [JSCS](http://jscs.info/).

## 2.0.0

**API updates**

- Renames `url()` function to `resolve()` https://github.com/borodean/postcss-assets/issues/13
- Resolves assets relative to the source file https://github.com/borodean/postcss-assets/issues/7
- Starts throwing errors instead of warnings https://github.com/borodean/postcss-assets/issues/8
- Fixes a bug when complex URL declarations were crashing Gonzales https://github.com/borodean/postcss-assets/issues/15

**Under the hood**

- Tests with Mocha/Chai instead of Tape https://github.com/borodean/postcss-assets/issues/12
- Updates dependencies upto the latest versions

## 1.1.4

Allows to use common PostCSS plugin API (https://github.com/borodean/postcss-assets/issues/6)
Fixes quotes when inlining SVG (https://github.com/borodean/postcss-assets/pull/14)

## 1.1.3

Base64-encodes with Buffer.

## 1.1.2

Cachebuster recognizes resolved paths.

## 1.1.1

Uses PostCSS 4.0.

## 1.1.0

Introduces [cachebuster](https://github.com/borodean/postcss-assets#cachebuster).

## 1.0.0
* [`width`, `height` and `size` functions][1] are introduced to measure image dimesions with high density pixels support;
* [`inline` function][2] introduced to inline files;
* `url` function automagic is removed;
* `inline.maxSize` option is removed;
* all modifiers are removed.
[1]: https://github.com/borodean/postcss-assets/tree/3168ab2b07cf537240ecc20e0eb7688434987614#image-dimensions
[2]: https://github.com/borodean/postcss-assets/tree/3168ab2b07cf537240ecc20e0eb7688434987614#inlining-files

- [`width`, `height` and `size` functions][1] are introduced to measure image dimesions with high density pixels support;
- [`inline` function][2] introduced to inline files;
- `url` function automagic is removed;
- `inline.maxSize` option is removed;
- all modifiers are removed.
[1]: https://github.com/borodean/postcss-assets/tree/3168ab2b07cf537240ecc20e0eb7688434987614#image-dimensions
[2]: https://github.com/borodean/postcss-assets/tree/3168ab2b07cf537240ecc20e0eb7688434987614#inlining-files

## 0.9.1

Inlines SVG as UTF-8, not Base64.

## 0.9.0

Hello, world.
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# ![postcss-assets](https://rawgit.com/assetsjs/postcss-assets/develop/media/postcss-assets.svg)
# ![postcss-assets](https://cdn.jsdelivr.net/gh/borodean/postcss-assets@master/media/postcss-assets.svg)

PostCSS Assets is an asset manager for CSS. It isolates stylesheets from environmental changes, gets image sizes and inlines files.

[![Unix Build Status][travis-badge]][travis] [![Windows Build Status][appveyor-badge]][appveyor] [![Coverage][coveralls-badge]][coveralls]

[appveyor]: https://ci.appveyor.com/project/borodean/postcss-assets
[appveyor-badge]: https://img.shields.io/appveyor/ci/borodean/postcss-assets.svg?label=windows
[coveralls]: https://coveralls.io/github/assetsjs/postcss-assets
[coveralls-badge]: https://img.shields.io/coveralls/assetsjs/postcss-assets.svg
[travis]: https://travis-ci.org/assetsjs/postcss-assets
[travis-badge]: https://img.shields.io/travis/assetsjs/postcss-assets.svg?label=unix
[appveyor]: https://ci.appveyor.com/project/borodean/postcss-assets/branch/master
[appveyor-badge]: https://img.shields.io/appveyor/build/borodean/postcss-assets/master?label=windows
[coveralls]: https://coveralls.io/github/borodean/postcss-assets
[coveralls-badge]: https://img.shields.io/coveralls/github/borodean/postcss-assets/master
[travis]: https://travis-ci.org/borodean/postcss-assets
[travis-badge]: https://img.shields.io/travis/borodean/postcss-assets/master?label=unix

Table of contents
-----------------
Expand Down Expand Up @@ -148,14 +148,24 @@ var options = {
Cachebuster
-----------

PostCSS Assets can bust assets cache, changing urls depending on asset’s modification date:
PostCSS Assets can bust assets cache:

```js
var options = {
cachebuster: true
};
```

Example:

```css
body {
background: resolve('/images/icons/baz.png');
}
```

PostCSS Assets will change urls depending on asset’s modification date:

```css
body {
background: url('/images/icons/baz.png?14a931c501f');
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
environment:
matrix:
- nodejs_version: '' # is latest stable
- nodejs_version: 6
- nodejs_version: 4
- nodejs_version: 12
- nodejs_version: 10

# Install scripts (runs after repo cloning)
install:
Expand Down
4 changes: 2 additions & 2 deletions lib/__utils__/generateFileUniqueId.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var fs = require('fs');
const fs = require('fs');

module.exports = function generateFileUniqueId(resolvedPath) {
var mtime = fs.statSync(resolvedPath).mtime;
const { mtime } = fs.statSync(resolvedPath);
return mtime.getTime().toString(16);
};
Loading

0 comments on commit e56ae79

Please sign in to comment.