Skip to content

Commit d0bef4a

Browse files
author
Jed Mao
committed
v1.1.1: Fix issue #7, retire Babel, update deps
1 parent 6bb72d3 commit d0bef4a

27 files changed

+1022
-291
lines changed

.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 134 deletions
This file was deleted.

.tasks/gulp-clean.js renamed to .tasks/gulp-clean.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import gulp from 'gulp';
2-
import rimraf from 'gulp-rimraf';
1+
/// <reference path="../typings/gulp.d.ts" />
2+
import * as gulp from 'gulp';
3+
var rimraf = require('gulp-rimraf');
34

45
export default () => {
56
return gulp.src([

.tasks/gulp-copy.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

.tasks/gulp-copy.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/// <reference path="../typings/gulp.d.ts" />
2+
import * as gulp from 'gulp';
3+
4+
export default () => {
5+
return gulp.src(
6+
[
7+
'build/lib/**/*.js',
8+
'build/lib/**/*.d.ts'
9+
],
10+
{ base: 'build' }
11+
)
12+
.pipe(gulp.dest('dist'));
13+
};

.tasks/gulp-eslint.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

.tasks/gulp-scripts.js

Lines changed: 0 additions & 44 deletions
This file was deleted.

.tasks/gulp-test.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

.tasks/gulp-tslint.js renamed to .tasks/gulp-tslint.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import gulp from 'gulp';
2-
import plumber from 'gulp-plumber';
3-
import tslint from 'gulp-tslint';
1+
/// <reference path="../typings/gulp.d.ts" />
2+
import * as gulp from 'gulp';
3+
var plumber = require('gulp-plumber');
4+
var tslint = require('gulp-tslint');
45

56
export default () => {
67
return gulp.src([

.tasks/gulp-typescript.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

.tasks/gulp-watch.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
## 1.1.2
2-
- Supports PostCSS 5.2.9.
3-
1+
## 1.1.2
2+
- Supports PostCSS 5.2.9.
3+
4+
## 1.1.1
5+
- Fix module resolution (fixes [`#5`](https://github.com/jedmao/postcss-nested-props/issues/5)).
6+
47
## 1.1.0
58
- [Supports vendor pseudo elements](https://github.com/jedmao/postcss-nested-props/pull/4). Thanks [@ooHmartY](https://github.com/ooHmartY)!
69

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ postcss([ require('postcss-nested-props') ]);
7676

7777
```ts
7878
///<reference path="node_modules/postcss-nested-props/.d.ts" />
79-
import postcssNestedProps from 'postcss-nested-props';
79+
import * as postcssNestedProps from 'postcss-nested-props';
8080

8181
postcss([ postcssNestedProps ]);
8282
```

gulpfile.babel.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

gulpfile.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/// <reference path="typings/gulp.d.ts" />
2+
import * as gulp from 'gulp';
3+
4+
function loadTask(taskName: string) {
5+
return require(`./.tasks/gulp-${taskName}`).default;
6+
}
7+
8+
gulp.task('default', ['tslint']);
9+
gulp.task('clean', loadTask('clean'));
10+
gulp.task('tslint', loadTask('tslint'));
11+
gulp.task('copy', loadTask('copy'));

lib/plugin.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import postcss from 'postcss';
1+
import * as postcss from 'postcss';
22
const pseudoClasses = require('pseudo-classes');
33
const pseudoElements = require('pseudo-elements');
44

5-
export default postcss.plugin('postcss-nested-props', () => {
5+
const PostCssNestedProps = postcss.plugin('postcss-nested-props', () => {
66
return root => {
77
root.walkRules(rule => {
88
unwrapRule([], rule);
@@ -49,3 +49,5 @@ function unwrapRule(namespace: string[], rule: postcss.Rule) {
4949
rule.remove();
5050
namespace.pop();
5151
}
52+
53+
export = PostCssNestedProps;

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
"main": "dist/lib/plugin.js",
66
"types": "dist/lib/plugin.d.ts",
77
"scripts": {
8-
"prepublish": "gulp && gulp copy && npm run babelify",
9-
"babelify": "babel build/lib --out-dir dist/lib",
10-
"test": "gulp && npm run cover && npm run check-coverage",
11-
"cover": "isparta cover node_modules/mocha/bin/_mocha -i build/lib/plugin.js",
12-
"check-coverage": "istanbul check-coverage",
8+
"prepublish": "gulp && npm run tsc && gulp copy",
9+
"tsc": "tsc",
10+
"test": "gulp && npm run tsc && npm run mocha",
11+
"mocha": "mocha",
1312
"watch": "sh scripts/watch"
1413
},
1514
"repository": {

test/mocha.opts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
--colors
12
--inline-diffs
23
--reporter spec
3-
--compilers js:babel-core/register
4+
--compilers ts:ts-node/register
45
build/test/plugin.js

test/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from 'chai';
2-
import plugin from '../lib/plugin';
3-
import postcss from 'postcss';
2+
import * as plugin from '../lib/plugin';
3+
import * as postcss from 'postcss';
44
const pseudoClasses = require('pseudo-classes');
55
const pseudoElements = require('pseudo-elements');
66

0 commit comments

Comments
 (0)