From 44f23f9f6c927d8491dddd181c5fc454a49ea829 Mon Sep 17 00:00:00 2001 From: Ivan Demidov Date: Tue, 10 May 2016 12:11:45 +0300 Subject: [PATCH 1/8] Fixed #81, add files to package.json --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 7b13ffb..1c17912 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,9 @@ "bin": { "posthtml": "./cli.js" }, + "files": [ + "cli.js" + ], "engines": { "node": ">=4" }, From e3e5dd69dc9cf5435bf293788d95756f99c015b1 Mon Sep 17 00:00:00 2001 From: Ivan Demidov Date: Tue, 10 May 2016 13:52:25 +0300 Subject: [PATCH 2/8] Update devDep --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 1c17912..0ccf99e 100644 --- a/package.json +++ b/package.json @@ -34,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", @@ -43,13 +43,13 @@ "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-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": { From 319de0410cc39ffbd5030b07022ad9a242c0b611 Mon Sep 17 00:00:00 2001 From: Ivan Demidov Date: Tue, 10 May 2016 13:54:16 +0300 Subject: [PATCH 3/8] Added posthtml-css-modules for the test --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 0ccf99e..f717eb9 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "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", From d763927985ce836f104f30fd59cb92576a7cc67c Mon Sep 17 00:00:00 2001 From: Ivan Demidov Date: Tue, 10 May 2016 13:54:52 +0300 Subject: [PATCH 4/8] Added css modules testing --- test/expected/output-modules.html | 2 ++ test/fixtures/css-modules.json | 6 ++++++ test/fixtures/input-modules.html | 2 ++ test/test-cli.js | 17 +++++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 test/expected/output-modules.html create mode 100644 test/fixtures/css-modules.json create mode 100644 test/fixtures/input-modules.html 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 @@ +

Title

+

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 @@ +

Title

+

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))); +}); From 939795cf213eb8f34dfc0f20fa68c2a4c66a59bf Mon Sep 17 00:00:00 2001 From: Ivan Demidov Date: Tue, 10 May 2016 13:55:33 +0300 Subject: [PATCH 5/8] v0.2.1 ... v0.2.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f717eb9..2c32b5d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "posthtml-cli", - "version": "0.2.1", + "version": "0.2.2", "description": "CLI for posthtml", "bin": { "posthtml": "./cli.js" From eb4ab6a6d0d32990c84e6ab0a17165c1017ad136 Mon Sep 17 00:00:00 2001 From: Ivan Demidov Date: Tue, 10 May 2016 13:55:47 +0300 Subject: [PATCH 6/8] bump --- CHANGELOG.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fcbd32..77fd69e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,13 @@ -## [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 + +## [0.2.1] - 05-05-2016 ### Change - Update #78, readme, add description for use From f03a1613ae1b4b22b2c66e6a15c5ddaf5f3de4ef Mon Sep 17 00:00:00 2001 From: Ivan Demidov Date: Tue, 10 May 2016 13:57:30 +0300 Subject: [PATCH 7/8] Update readme, added css modules --- README.md | 2 ++ 1 file changed, 2 insertions(+) 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 ``` From 1b1a3ce90e679d58ad8e441d282f9000a49b77a1 Mon Sep 17 00:00:00 2001 From: Ivan Demidov Date: Tue, 10 May 2016 13:58:16 +0300 Subject: [PATCH 8/8] bump --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77fd69e..c68248e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### 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