diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fcbd32..c68248e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index d74f5f7..28b6694 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/package.json b/package.json index 7b13ffb..2c32b5d 100644 --- a/package.json +++ b/package.json @@ -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" }, @@ -31,8 +34,8 @@ "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", @@ -40,13 +43,14 @@ "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": { diff --git a/test/expected/output-modules.html b/test/expected/output-modules.html new file mode 100644 index 0000000..2f3abdf --- /dev/null +++ b/test/expected/output-modules.html @@ -0,0 +1,2 @@ +
User article
diff --git a/test/fixtures/css-modules.json b/test/fixtures/css-modules.json new file mode 100644 index 0000000..3d2c870 --- /dev/null +++ b/test/fixtures/css-modules.json @@ -0,0 +1,6 @@ +{ + "title": "_title_116zl_1 _heading_9dkf", + "profile": { + "user": "_profile_user_f93j" + } +} diff --git a/test/fixtures/input-modules.html b/test/fixtures/input-modules.html new file mode 100644 index 0000000..bdc4168 --- /dev/null +++ b/test/fixtures/input-modules.html @@ -0,0 +1,2 @@ +User article
diff --git a/test/test-cli.js b/test/test-cli.js index fb335fc..2c54a79 100644 --- a/test/test-cli.js +++ b/test/test-cli.js @@ -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))); +});