Skip to content

Commit 732e9ba

Browse files
authored
Merge pull request #305 from posthtml/milestone-0.7.0
Milestone 0.7.0
2 parents 343aa03 + 2b605dc commit 732e9ba

10 files changed

Lines changed: 3117 additions & 1777 deletions

File tree

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"xo-space"
1515
],
1616
"rules": {
17-
"capitalized-comments": "off"
17+
"capitalized-comments": "off",
18+
"unicorn/no-reduce": "off"
1819
}
1920
}

changelog.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1+
## 0.7.0 (2020-08-10)
2+
3+
* build: update dep dev ([129e717](https://github.com/posthtml/posthtml-cli/commit/129e717))
4+
* fix: after change use priority ([5b41e62](https://github.com/posthtml/posthtml-cli/commit/5b41e62))
5+
* fix: override config file options via CLI args, close #304 ([e1f1334](https://github.com/posthtml/posthtml-cli/commit/e1f1334)), closes [#304](https://github.com/posthtml/posthtml-cli/issues/304)
6+
* fix: priority use higher than config ([e41d220](https://github.com/posthtml/posthtml-cli/commit/e41d220))
7+
* fix: test for issue #304 ([51f9190](https://github.com/posthtml/posthtml-cli/commit/51f9190)), closes [#304](https://github.com/posthtml/posthtml-cli/issues/304)
8+
* test: override config file options via CLI args, issue #304 ([c6f50d5](https://github.com/posthtml/posthtml-cli/commit/c6f50d5)), closes [#304](https://github.com/posthtml/posthtml-cli/issues/304)
9+
* perf: off no reduce ([9815f80](https://github.com/posthtml/posthtml-cli/commit/9815f80))
10+
11+
12+
113
## 0.6.0 (2020-06-02)
214

15+
* 0.6.0 ([153a9d7](https://github.com/posthtml/posthtml-cli/commit/153a9d7))
16+
* build: update changelog ([bc8f8ce](https://github.com/posthtml/posthtml-cli/commit/bc8f8ce))
17+
* build: update dep dev ([dc9f63c](https://github.com/posthtml/posthtml-cli/commit/dc9f63c))
318
* ci: add nyc config ([3c23315](https://github.com/posthtml/posthtml-cli/commit/3c23315))
419
* ci: enable package lock ([52b5eda](https://github.com/posthtml/posthtml-cli/commit/52b5eda))
520
* ci: migrate to github action, close #299 ([fe8e6c3](https://github.com/posthtml/posthtml-cli/commit/fe8e6c3)), closes [#299](https://github.com/posthtml/posthtml-cli/issues/299)
621
* ci: off use travis ([13b31e3](https://github.com/posthtml/posthtml-cli/commit/13b31e3))
722
* docs: readme.md space adjustment ([13af1fc](https://github.com/posthtml/posthtml-cli/commit/13af1fc))
823
* docs: update github badges ([f0c75ef](https://github.com/posthtml/posthtml-cli/commit/f0c75ef))
924
* style: after update dep dev ([ec75743](https://github.com/posthtml/posthtml-cli/commit/ec75743))
10-
* build: update dep dev ([dc9f63c](https://github.com/posthtml/posthtml-cli/commit/dc9f63c))
1125
* test: add tests for allInOutput and root options ([362a00b](https://github.com/posthtml/posthtml-cli/commit/362a00b))
1226
* test: added timeout option to test script ([279ad8b](https://github.com/posthtml/posthtml-cli/commit/279ad8b))
1327
* test: rename base to root ([cbe615e](https://github.com/posthtml/posthtml-cli/commit/cbe615e))

package-lock.json

Lines changed: 3045 additions & 1739 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "posthtml-cli",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"description": "CLI for posthtml",
55
"license": "MIT",
66
"repository": "posthtml/posthtml-cli",
@@ -34,45 +34,45 @@
3434
"cli"
3535
],
3636
"dependencies": {
37-
"cosmiconfig": "^6.0.0",
38-
"fast-glob": "^3.2.0",
37+
"cosmiconfig": "^7.0.0",
38+
"fast-glob": "^3.2.4",
3939
"make-dir": "^3.0.0",
4040
"meow": "^7.0.1",
4141
"merge-options": "^2.0.0",
42-
"posthtml": "^0.13.0",
42+
"posthtml": "^0.13.1",
4343
"to-camel-case": "^1.0.0"
4444
},
4545
"devDependencies": {
46-
"@babel/cli": "^7.8.3",
47-
"@babel/core": "^7.8.3",
48-
"@babel/node": "^7.8.3",
49-
"@babel/preset-env": "^7.8.3",
50-
"@babel/register": "^7.8.3",
51-
"@commitlint/cli": "^8.3.5",
52-
"@commitlint/config-angular": "^8.3.4",
53-
"acorn": "^7.1.0",
54-
"ava": "*",
46+
"@babel/cli": "^7.10.5",
47+
"@babel/core": "^7.11.1",
48+
"@babel/node": "^7.10.5",
49+
"@babel/preset-env": "^7.11.0",
50+
"@babel/register": "^7.10.5",
51+
"@commitlint/cli": "^9.1.1",
52+
"@commitlint/config-angular": "^9.1.1",
53+
"acorn": "^7.4.0",
54+
"ava": "^3.11.1",
5555
"babel-eslint": "^10.0.3",
5656
"babel-preset-minify": "^0.5.1",
5757
"clinton": "^0.14.0",
5858
"conventional-changelog-cli": "^2.0.31",
5959
"coveralls": "^3.0.9",
6060
"cpy": "^8.0.0",
61-
"eslint": "^7.1.0",
62-
"eslint-config-xo": "^0.29.1",
63-
"eslint-config-xo-space": "^0.24.0",
64-
"eslint-plugin-ava": "^10.2.0",
65-
"eslint-plugin-babel": "^5.3.0",
66-
"eslint-plugin-html": "^6.0.0",
67-
"eslint-plugin-import": "^2.20.0",
61+
"eslint": "^7.6.0",
62+
"eslint-config-xo": "^0.32.1",
63+
"eslint-config-xo-space": "^0.25.0",
64+
"eslint-plugin-ava": "^10.5.0",
65+
"eslint-plugin-babel": "^5.3.1",
66+
"eslint-plugin-html": "^6.0.3",
67+
"eslint-plugin-import": "^2.22.0",
6868
"eslint-plugin-markdown": "^1.0.1",
6969
"eslint-plugin-node": "^11.0.0",
7070
"eslint-plugin-promise": "^4.1.1",
71-
"eslint-plugin-unicorn": "^20.1.0",
72-
"execa": "^4.0.0",
71+
"eslint-plugin-unicorn": "^21.0.0",
72+
"execa": "^4.0.3",
7373
"husky": "^4.0.10",
7474
"is-promise": "^4.0.0",
75-
"lint-staged": "^10.0.1",
75+
"lint-staged": "^10.2.11",
7676
"merge": "^1.2.1",
7777
"nyc": "^15.0.0",
7878
"posthtml-bem": "^0.2.2",

src/cfg-resolve.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import mergeOptions from 'merge-options';
44

55
export default ({input, flags = {}}) => {
66
const explorer = cosmiconfigSync('posthtml');
7-
let {config, use, output, root, allInOutput} = flags;
7+
let {config, use, output, root = './', allInOutput} = flags;
88

99
if (config) {
1010
({config} = explorer.load(config));
@@ -18,10 +18,10 @@ export default ({input, flags = {}}) => {
1818
({config} = explorer.search());
1919
}
2020

21-
return mergeOptions({
21+
return mergeOptions(config || {}, {
2222
input,
2323
output,
2424
root,
2525
allInOutput
26-
}, use || {}, config || {});
26+
}, use || {});
2727
};

test/config/.config-input-priority

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

test/expected/output-bem.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<span class="myComponent MadTeaParty">
2-
<span class="myTitle MadTeaParty--march-title">Super Title</span>
3-
<span class="myText MadTeaParty--march-text">Awesome Text</span>
1+
<span class="MadTeaParty myComponent">
2+
<span class="MadTeaParty--march-title myTitle">Super Title</span>
3+
<span class="MadTeaParty--march-text myText">Awesome Text</span>
44
</span>

test/test-cfg-resolve.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ test('should return config with one use key with one property', async t => {
3030

3131
test('should return config with key config', async t => {
3232
const flags = {
33-
config: 'test/config/.config'
33+
config: 'test/config/.config-plugins'
3434
};
3535
const config = await cfgResolve({flags});
3636
const expected = {'posthtml-bem': {}};
@@ -41,11 +41,27 @@ test('should return config with key config', async t => {
4141
test('should return config with key config and use key', async t => {
4242
const flags = {
4343
use: 'posthtml-assets',
44-
config: 'test/config/.config'
44+
config: 'test/config/.config-plugins'
4545
};
4646
const config = await cfgResolve({flags});
4747
const expected = {'posthtml-bem': {}, 'posthtml-assets': {}};
4848

4949
t.deepEqual(config.plugins, expected);
5050
});
5151

52+
test('should return config when CLI params priority', async t => {
53+
const input = 'src/template/**/*.html';
54+
const flags = {
55+
config: 'test/config/.config-input-priority'
56+
};
57+
const config = await cfgResolve({input, flags});
58+
const expected = {
59+
allInOutput: undefined,
60+
input: 'src/template/**/*.html',
61+
output: undefined,
62+
root: './'
63+
};
64+
65+
t.deepEqual(config, expected);
66+
});
67+

test/test-cli.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ test('Transform html witch stdin options use two key', async t => {
115115
'-o',
116116
filename,
117117
'-u',
118+
'posthtml-custom-elements',
119+
'--posthtml-custom-elements.defaultTag',
120+
'span',
121+
'-u',
118122
'posthtml-bem',
119123
'--posthtml-bem.elemPrefix=--',
120124
'--posthtml-bem.modPrefix',
121125
'_',
122-
'--posthtml-bem.modDlmtr',
123-
'-u',
124-
'posthtml-custom-elements',
125-
'--posthtml-custom-elements.defaultTag',
126-
'span'
126+
'--posthtml-bem.modDlmtr'
127127
]);
128128
t.true(await pathExists(filename));
129129
t.is((await read('test/expected/output-bem.html')), (await read(filename)));

0 commit comments

Comments
 (0)