Skip to content

Commit 90bdee7

Browse files
committed
fancy package
1 parent 25cca81 commit 90bdee7

File tree

5 files changed

+77
-6
lines changed

5 files changed

+77
-6
lines changed

LICENSE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The MIT License (MIT)
2+
Copyright (c) 2016 uhyo
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5+
6+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7+
8+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# gulp-typed-css-modules
2+
3+
This is a gulp plugin for me, that wraps [typed-css-modules](https://github.com/Quramy/typed-css-modules).
4+
5+
## Installation
6+
```sh
7+
npm install --save-dev gulp-typed-css-modules
8+
```
9+
10+
## Usage
11+
```js
12+
const gulp = require('gulp');
13+
const gulp_tcm = require('gulp-typed-css-modules');
14+
15+
gulp.task('tcm', function(){
16+
return gulp.src(["src/**/*.css"], {
17+
base: '.',
18+
})
19+
.pipe(gulp_tcm())
20+
.pipe(gulp.dest("./"));
21+
});
22+
```
23+
24+
This will create `*.css.d.ts` files next to each `*.css` file.
25+
26+
### Providing `typed-css-modules`
27+
To use your own `typed-css-modules` instead of the built in one, do:
28+
29+
```js
30+
gulp_tcm({
31+
tcm: require('typed-css-modules'),
32+
})
33+
```
34+
35+
## Options
36+
- **quiet**: if true, suppress warning messages from `typed-css-modules`.
37+
- **tcm**: `typed-css-modules` module.
38+
39+
Any other options are passed to `typed-css-modules` (`DtsCreator`).
40+
41+
## Contributing
42+
welcome
43+
44+
## License
45+
MIT

index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
const path = require('path');
24
const through2 = require('through2');
35
const gutil = require('gulp-util');
@@ -54,11 +56,11 @@ module.exports = options=>{
5456
});
5557
};
5658

57-
function showWarning(file, ...err){
58-
gutil.log(gutil.colors.cyan(pluginName), gutil.colors.yellow('Warning'), gutil.colors.gray(file), ...err);
59+
function showWarning(file, err){
60+
gutil.log(gutil.colors.cyan(pluginName), gutil.colors.yellow('Warning'), gutil.colors.gray(file), err);
5961
}
60-
function showError(...err){
61-
gutil.log(gutil.colors.cyan(pluginName), gutil.colors.red('Error'), gutil.colors.gray(file), ...err);
62+
function showError(file, err){
63+
gutil.log(gutil.colors.cyan(pluginName), gutil.colors.red('Error'), gutil.colors.gray(file), err);
6264
}
6365

6466
function runtcm(filepath, creator, content, options){

package.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
"scripts": {
77
"test": "mocha"
88
},
9+
"engines": {
10+
"node": ">= 4.0.0"
11+
},
912
"keywords": [
10-
"gulp",
13+
"gulpplugin",
1114
"typed-css-modules"
1215
],
1316
"author": "uhyo",
@@ -22,5 +25,16 @@
2225
"event-stream": "^3.3.4",
2326
"mocha": "^3.2.0",
2427
"vinyl": "^2.0.1"
25-
}
28+
},
29+
"directories": {
30+
"test": "test"
31+
},
32+
"repository": {
33+
"type": "git",
34+
"url": "git+https://github.com/uhyo/gulp-typed-css-modules.git"
35+
},
36+
"bugs": {
37+
"url": "https://github.com/uhyo/gulp-typed-css-modules/issues"
38+
},
39+
"homepage": "https://github.com/uhyo/gulp-typed-css-modules#readme"
2640
}

test/test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
const assert = require('assert');
24
const path = require('path');
35
const PassThrough = require('stream').PassThrough;

0 commit comments

Comments
 (0)