Skip to content

Commit cc177e6

Browse files
authored
Merge pull request #291 from posthtml/milestone-0.5.1
Milestone 0.5.1
2 parents 2a7130c + 16fbf31 commit cc177e6

7 files changed

Lines changed: 62 additions & 3 deletions

File tree

changelog.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1+
## <small>0.5.1 (2019-06-28)</small>
2+
3+
* ci: try fix in windows ([ad49a51](https://github.com/posthtml/posthtml-cli/commit/ad49a51))
4+
* build: add path in test script ([efa1950](https://github.com/posthtml/posthtml-cli/commit/efa1950))
5+
* fix: if plugins is array ([f550f11](https://github.com/posthtml/posthtml-cli/commit/f550f11))
6+
* test: expected for plugins array ([df36e4f](https://github.com/posthtml/posthtml-cli/commit/df36e4f))
7+
* test: when plugins array ([1c1b3db](https://github.com/posthtml/posthtml-cli/commit/1c1b3db))
8+
* docs: update example ([2a7130c](https://github.com/posthtml/posthtml-cli/commit/2a7130c))
9+
10+
11+
112
## 0.5.0 (2019-06-27)
213

14+
* 0.5.0 ([0199026](https://github.com/posthtml/posthtml-cli/commit/0199026))
315
* build: fix linter ([50e592d](https://github.com/posthtml/posthtml-cli/commit/50e592d))
416
* build: npm lock to false ([43f1f4b](https://github.com/posthtml/posthtml-cli/commit/43f1f4b))
517
* build: perf script for changelog ([e963ea9](https://github.com/posthtml/posthtml-cli/commit/e963ea9))
18+
* build: update changelog ([09980f6](https://github.com/posthtml/posthtml-cli/commit/09980f6))
619
* build: update config for chgngelog ([de5ff40](https://github.com/posthtml/posthtml-cli/commit/de5ff40))
720
* build: update config for editor ([33ffa69](https://github.com/posthtml/posthtml-cli/commit/33ffa69))
821
* build: update depDev ([4f5cbb5](https://github.com/posthtml/posthtml-cli/commit/4f5cbb5))

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "posthtml-cli",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"description": "CLI for posthtml",
55
"license": "MIT",
66
"repository": "posthtml/posthtml-cli",
@@ -95,6 +95,9 @@
9595
"*.md": "eslint"
9696
},
9797
"ava": {
98+
"files": [
99+
"test/test-*"
100+
],
98101
"require": [
99102
"@babel/register"
100103
]

src/cli.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ const config = cfgResolve(cli);
6767

6868
const processing = async file => {
6969
const output = await outResolve(file, config.output);
70-
// const output = path.resolve(config.output, path.basename(file));
71-
const plugins = getPlugins(config);
70+
const plugins = Array.isArray(config.plugins) ? config.plugins : getPlugins(config);
7271

7372
makeDir(path.dirname(output))
7473
.then(read.bind(null, file))
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
11+
</body>
12+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
11+
</body>
12+
</html>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
input: 'test/fixtures/by-config/one-io-and-plugins-array/input.html',
3+
output: 'test/expected/by-config/one-io-and-plugins-array/output.html',
4+
plugins: [
5+
require('posthtml-custom-elements')()
6+
]
7+
};

test/test-cli.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,16 @@ test('Transform html stdin options only config one-io-by-pattern', async t => {
188188
(await read('test/fixtures/by-config/one-io-by-pattern/input-1.html'))
189189
);
190190
});
191+
192+
test('Transform html stdin options only config one-io anf plugins array', async t => {
193+
t.plan(2);
194+
await execa(cli, [
195+
'-c',
196+
'test/fixtures/by-config/one-io-and-plugins-array/posthtml.config.js'
197+
]);
198+
t.true(await pathExists('test/expected/by-config/one-io-and-plugins-array/output.html'));
199+
t.is(
200+
(await read('test/expected/by-config/one-io-and-plugins-array/output.html')),
201+
(await read('test/fixtures/by-config/one-io-and-plugins-array/input.html'))
202+
);
203+
});

0 commit comments

Comments
 (0)