Skip to content

Commit bfecaf3

Browse files
authored
Merge pull request #328 from posthtml/milestone-0.7.7
Milestone 0.7.7
2 parents f7c0674 + a5c47c1 commit bfecaf3

File tree

7 files changed

+35
-4
lines changed

7 files changed

+35
-4
lines changed

changelog.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1+
## <small>0.7.7 (2020-10-12)</small>
2+
3+
* test: incorrect resolve with root, issue #326 ([c4014d3](https://github.com/posthtml/posthtml-cli/commit/c4014d3)), closes [#326](https://github.com/posthtml/posthtml-cli/issues/326)
4+
* test: normalize expected path ([55b7845](https://github.com/posthtml/posthtml-cli/commit/55b7845))
5+
* docs: fix example with root ([8a86282](https://github.com/posthtml/posthtml-cli/commit/8a86282))
6+
* fix: resolve path with root, close #326 ([45a42ee](https://github.com/posthtml/posthtml-cli/commit/45a42ee)), closes [#326](https://github.com/posthtml/posthtml-cli/issues/326)
7+
8+
9+
110
## <small>0.7.6 (2020-09-22)</small>
211

12+
* 0.7.6 ([0cc6ffe](https://github.com/posthtml/posthtml-cli/commit/0cc6ffe))
13+
* build: update changelog ([85c8caf](https://github.com/posthtml/posthtml-cli/commit/85c8caf))
14+
* build: update dep dev, close #312 ([0807b07](https://github.com/posthtml/posthtml-cli/commit/0807b07)), closes [#312](https://github.com/posthtml/posthtml-cli/issues/312)
315
* test: fix for window os ([f657858](https://github.com/posthtml/posthtml-cli/commit/f657858))
416
* ci: enable window test, close #316 ([c86172d](https://github.com/posthtml/posthtml-cli/commit/c86172d)), closes [#316](https://github.com/posthtml/posthtml-cli/issues/316)
517
* ci: update config ([a4516bc](https://github.com/posthtml/posthtml-cli/commit/a4516bc))
6-
* build: update dep dev, close #312 ([0807b07](https://github.com/posthtml/posthtml-cli/commit/0807b07)), closes [#312](https://github.com/posthtml/posthtml-cli/issues/312)
718
* fix: resolve path on window, close #323 ([2447d87](https://github.com/posthtml/posthtml-cli/commit/2447d87)), closes [#323](https://github.com/posthtml/posthtml-cli/issues/323)
819
* docs: fix typo ([27c8748](https://github.com/posthtml/posthtml-cli/commit/27c8748))
920

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "posthtml-cli",
3-
"version": "0.7.6",
3+
"version": "0.7.7",
44
"description": "CLI for posthtml",
55
"license": "MIT",
66
"repository": "posthtml/posthtml-cli",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $ posthtml --help
4141
$ posthtml input.html -o output.html -u posthtml-bem --posthtml-bem.elemPrefix __
4242
$ posthtml inputFolder/*.html -o outputFolder
4343
$ posthtml inputFolder/**/*.html -o outputFolder -a
44-
$ posthtml inputFolder/**/*.html -o outputFolder -a -r inputFolder
44+
$ posthtml '**/*.html' -o outputFolder -a -r inputFolder
4545
```
4646
> ⚠️ Please note that when using patterns on the command line `*` and `!` escaping of characters is necessary. When using as **npm** scripts, you only need to screen the pattern `*`. [About the reasons](https://github.com/posthtml/posthtml-cli/issues/317#issuecomment-676330082)
4747

src/cfg-resolve.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ export default ({input, flags = {}}) => {
5858
({config} = explorer.search());
5959
}
6060

61+
if (config?.root) {
62+
root = config.root;
63+
}
64+
6165
input = []
6266
.concat(input && input.length > 0 ? input : config?.input)
6367
.filter(Boolean)

test/config/.config-root

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
'root': './src'
3+
}

test/test-cfg-resolve.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,19 @@ test('should return config options', t => {
9191
t.deepEqual(config.options, expected);
9292
});
9393

94+
test('should return config root', t => {
95+
const input = 'input.html';
96+
const flags = {
97+
config: 'test/config/.config-root'
98+
};
99+
const config = cfgResolve({input, flags});
100+
const expectedRoot = './src';
101+
const expectedInput = [normalizePath(path.join(process.cwd(), expectedRoot, input))];
102+
103+
t.is(config.root, expectedRoot);
104+
t.deepEqual(config.input, expectedInput);
105+
});
106+
94107
test('should return config with key config and use key', t => {
95108
const input = 'input.html';
96109
const flags = {

0 commit comments

Comments
 (0)