Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
## [0.2.0] - 05-05-2016
## [0.2.2] - 05-05-2016
### Added
- Added posthtml-css-modules for the test
- Added test css modules

### Change
- Update #81, add files to pkg.json
- Update devDep
- Update Readme, added css modules to use example

## [0.2.1] - 05-05-2016
### Change
- Update #78, readme, add description for use

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ $ posthtml
-u posthtml-bem
--posthtml-bem.elemPrefix __
--posthtml-bem.elemMod _
-u posthtml-css-modules
--posthtml-css-modules path/to/json
-u posthtml-custom-elements
```

Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"name": "posthtml-cli",
"version": "0.2.1",
"version": "0.2.2",
"description": "CLI for posthtml",
"bin": {
"posthtml": "./cli.js"
},
"files": [
"cli.js"
],
"engines": {
"node": ">=4"
},
Expand All @@ -31,22 +34,23 @@
"dependencies": {
"globby": "^4.0.0",
"posthtml": "^0.8.7",
"posthtml-load-plugins": "^0.10.0",
"yargs": "^4.6.0"
"posthtml-load-plugins": "^0.10.1",
"yargs": "^4.7.0"
},
"devDependencies": {
"ava": "^0.14.0",
"ava-codemods": "^0.2.1",
"coveralls": "^2.11.9",
"cpy": "^4.0.0",
"execa": "^0.4.0",
"nyc": "^6.4.1",
"nyc": "^6.4.4",
"path-exists": "^3.0.0",
"posthtml-bem": "^0.2.2",
"posthtml-css-modules": "^0.1.0",
"posthtml-custom-elements": "^1.0.3",
"read-pkg": "^1.1.0",
"tempfile": "^1.1.1",
"updtr": "^0.1.10",
"updtr": "^0.1.13",
"xo": "^0.15.0"
},
"posthtml": {
Expand Down
2 changes: 2 additions & 0 deletions test/expected/output-modules.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1 class="_title_116zl_1 _heading_9dkf">Title</h1>
<p class="_profile_user_f93j">User article</p>
6 changes: 6 additions & 0 deletions test/fixtures/css-modules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "_title_116zl_1 _heading_9dkf",
"profile": {
"user": "_profile_user_f93j"
}
}
2 changes: 2 additions & 0 deletions test/fixtures/input-modules.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1 css-module="title">Title</h1>
<p css-module="profile.user">User article</p>
17 changes: 17 additions & 0 deletions test/test-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,20 @@ test('Transform html witch config in file and stdin options use', async t => {
t.true(await pathExists(filename));
t.is((await read('expected/output-bem.html')), (await read(filename)));
});

test('Transform html stdin options use witch modules', async t => {
t.plan(2);
const filename = tempfile('.html');
await execa(cli, [
'-o',
filename,
'-i',
'fixtures/input-modules.html',
'-u',
'posthtml-css-modules',
'--posthtml-css-modules',
'fixtures/css-modules.json'
]);
t.true(await pathExists(filename));
t.is((await read('expected/output-modules.html')), (await read(filename)));
});