Skip to content

Commit 5a3bee8

Browse files
author
Jed Mao
committed
v2.0.0 - Upgrade to PostCSS 6
1 parent 7b1e860 commit 5a3bee8

File tree

5 files changed

+44
-15
lines changed

5 files changed

+44
-15
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.0.0
2+
**Breaking:** Upgrade to PostCSS 6 (no longer works with PostCSS 5).
3+
14
## 1.1.7
25
- Fix module resolution ([#26](https://github.com/jedmao/postcss-nested-props/pull/26)).
36

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,29 @@ postcss([ postcssNestedProps ]);
8484
### Options
8585

8686
None at this time.
87+
88+
## Testing
89+
90+
Run the following command:
91+
92+
```
93+
$ npm test
94+
```
95+
96+
This will build scripts, run tests and generate a code coverage report. Anything less than 100% coverage will throw an error.
97+
98+
### Watching
99+
100+
For much faster development cycles, run the following commands in 2 separate processes:
101+
102+
```
103+
$ npm run build:watch
104+
```
105+
106+
Compiles TypeScript source into the `./dist` folder and watches for changes.
107+
108+
```
109+
$ npm run watch
110+
```
111+
112+
Runs the tests in the `./dist` folder and watches for changes.

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "postcss-nested-props",
3-
"version": "1.1.7",
3+
"version": "2.0.0",
44
"description": "PostCSS plugin to unwrap nested properties.",
55
"main": "dist/plugin.js",
66
"types": "dist/plugin.d.ts",
77
"scripts": {
88
"clean": "rimraf coverage dist *.log",
99
"codecov": "codecov -f coverage/lcov.info",
10-
"compile": "tsc",
11-
"compile:watch": "tsc --watch",
10+
"build": "tsc",
11+
"build:watch": "tsc --watch",
1212
"prepublish": "npm test",
13-
"pretest": "npm run tslint && npm run clean && npm run compile",
13+
"pretest": "npm run tslint && npm run clean && npm run build",
1414
"test": "nyc ava",
1515
"test:watch": "ava --watch",
1616
"tslint": "tslint --project tsconfig.json",
@@ -63,16 +63,16 @@
6363
},
6464
"homepage": "https://github.com/jedmao/postcss-nested-props#readme",
6565
"dependencies": {
66-
"postcss": "^5.2.16",
66+
"postcss": "^6.0.14",
6767
"pseudo-classes": "^1.0.0",
68-
"pseudo-elements": "^1.0.0"
68+
"pseudo-elements": "^1.1.0"
6969
},
7070
"devDependencies": {
71-
"@types/node": "^7.0.8",
72-
"ava": "^0.18.2",
73-
"nyc": "^10.1.2",
74-
"rimraf": "^2.6.1",
75-
"tslint": "^4.5.1",
76-
"typescript": "^2.2.1"
71+
"@types/node": "^8.0.47",
72+
"ava": "^0.23.0",
73+
"nyc": "^11.3.0",
74+
"rimraf": "^2.6.2",
75+
"tslint": "^5.8.0",
76+
"typescript": "^2.6.1"
7777
}
7878
}

src/plugin.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import test, { ContextualTestContext } from 'ava';
1+
import test, { TestContext } from 'ava';
22
import * as postcss from 'postcss';
33
const pseudoClasses = require('pseudo-classes');
44
const pseudoElements = require('pseudo-elements');
@@ -66,7 +66,7 @@ pseudoElements().forEach((pseudoElement: string) => {
6666
});
6767

6868
function macro(
69-
t: ContextualTestContext,
69+
t: TestContext,
7070
input: string,
7171
expected?: string | RegExp
7272
) {

src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function unwrapRule(namespace: string[], rule: postcss.Rule) {
5050
}
5151
});
5252
rule.walkDecls(decl2 => {
53-
decl2.moveBefore(rule);
53+
rule.before(decl2.remove());
5454
});
5555
rule.remove();
5656
namespace.pop();

0 commit comments

Comments
 (0)