Skip to content

Commit

Permalink
v2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
aMarCruz committed Apr 10, 2018
1 parent a3dc69e commit d768bdc
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# rollup-plugin-cleanup changes

### v2.0.1
- Adds rollup >=0.50 as peerDependencies, hope to update devDependencies soon\*.
- Preserves empty lines inside multi-line strings.
- Welcome to @mkhl to the rollup-plugin-cleanup team!

\* MagicString v0.24.x has great enhancements, but it needs testing with this plugin.

### v2.0.0
- Requires node v4.2 or later.
Expand Down
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![Build Status][build-image]][build-url]
[![Test Coverage][cover-image]][cover-url]
[![npm Version][npm-image]][npm-url]
[![License][license-image]][license-url]

Expand All @@ -12,7 +11,7 @@ With *cleanup*, you have:
* Removal of JavaScript comments through powerful filters (configurable)
* Normalization of line endings (Unix, Mac, or Windows)
* Empty lines compactation (configurable)
* Remotion of trailing spaces
* Remotion of trailing spaces preserving ES6 Template Literal Strings
* Source Map support

Please see [Whats New](#whats-new), cleanup v2.0.0 requires node v4.2 or above.
Expand Down Expand Up @@ -106,14 +105,11 @@ This filter will preserve multiline comments starting with a dash, in addition t

### What's New

- Requires node v4.2 or later.
- Emission of source map honors the Rollup `sourceMap` or `sourcemap` (lowercased) options.
- Generated errors are displayed through the standard Rollup's `error` method.
- Fixed tests to match rollup v0.48.x parameters and async operation.
- Now the plugin operation is async and returns a Promise.
- Using facebook [jest](http://facebook.github.io/jest/) for tests.

- Adds rollup >=0.50 as peerDependencies, hope to update devDependencies soon\*.
- Preserves empty lines inside ES6 Template Literal Strings, thanks to @mkhl.
- Welcome to @mkhl to the rollup-plugin-cleanup team!

\* MagicString v0.24.x has great enhancements, but it needs testing with this plugin.

---

Expand Down
6 changes: 3 additions & 3 deletions dist/rollup-plugin-cleanup.es.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* rollup-plugin-cleanup v2.0.0
* rollup-plugin-cleanup v2.0.1
* @author aMarCruz
* @license MIT
*/
Expand Down Expand Up @@ -224,13 +224,13 @@ function removeLines(magicStr, code, file, options) {

if (empties) {
// maxEmptyLines -1 or > 0
while (match = NEXT_LINES.exec(region)) {
while ((match = NEXT_LINES.exec(region))) {
block = match[0];
replaceBlock(block, start + match.index, limitLines(block, maxEolChars));
}
} else {
// removes all the empty lines
while (match = NEXT_LINES.exec(region)) {
while ((match = NEXT_LINES.exec(region))) {
replaceBlock(match[0], start + match.index, eolTo);
}
}
Expand Down
6 changes: 3 additions & 3 deletions dist/rollup-plugin-cleanup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* rollup-plugin-cleanup v2.0.0
* rollup-plugin-cleanup v2.0.1
* @author aMarCruz
* @license MIT
*/
Expand Down Expand Up @@ -226,13 +226,13 @@ function removeLines(magicStr, code, file, options) {

if (empties) {
// maxEmptyLines -1 or > 0
while (match = NEXT_LINES.exec(region)) {
while ((match = NEXT_LINES.exec(region))) {
block = match[0];
replaceBlock(block, start + match.index, limitLines(block, maxEolChars));
}
} else {
// removes all the empty lines
while (match = NEXT_LINES.exec(region)) {
while ((match = NEXT_LINES.exec(region))) {
replaceBlock(match[0], start + match.index, eolTo);
}
}
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rollup-plugin-cleanup",
"version": "2.0.0",
"version": "2.0.1",
"description": "Rollup plugin to trim trailing spaces, compact empty lines, and normalize line endings",
"main": "dist/rollup-plugin-cleanup.js",
"module": "dist/rollup-plugin-cleanup.es.js",
Expand Down Expand Up @@ -54,5 +54,8 @@
"rollup-plugin-buble": "^0.16.0",
"rollup-plugin-jsx": "^1.0.3",
"rollup-plugin-riot": "^1.1.0"
},
"peerDependencies": {
"rollup": ">=0.50.0"
}
}

0 comments on commit d768bdc

Please sign in to comment.