Skip to content

Commit

Permalink
Merge pull request #30 from NotNinja/develop
Browse files Browse the repository at this point in the history
0.3.3 Release
  • Loading branch information
neocotic committed Dec 8, 2017
2 parents c1cd433 + c82bf78 commit 2e1dfc7
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Version 0.3.3, 2017.12.08

* Add puppeteer.launch options available into CLI [#29](https://github.com/NotNinja/convert-svg/issues/29)

## Version 0.3.2, 2017.11.21

* Error being thrown caused by lost context for CLI [#24](https://github.com/NotNinja/convert-svg/issues/24)
Expand Down
6 changes: 5 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"lerna": "2.5.1",
"version": "0.3.2",
"version": "0.3.3",
"packages": [
"packages/*"
],
"command": {
"bootstrap": {
"hoist": true,
"nohoist": "puppeteer"
},
"publish": {
"skipGit": true,
"skipNpm": true
}
},
"npmClientArgs": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "convert-svg",
"license": "MIT",
"devDependencies": {
"eslint": "^4.11.0",
"eslint": "^4.13.0",
"eslint-config-notninja": "^0.2.3",
"lerna": "^2.5.1",
"mocha": "^4.0.1"
Expand Down
6 changes: 3 additions & 3 deletions packages/convert-svg-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "convert-svg-core",
"version": "0.3.2",
"version": "0.3.3",
"description": "Supports converting SVG into another format using headless Chromium",
"homepage": "https://github.com/NotNinja/convert-svg",
"bugs": {
Expand All @@ -26,7 +26,7 @@
},
"dependencies": {
"chalk": "^2.3.0",
"commander": "^2.11.0",
"commander": "^2.12.0",
"file-url": "^2.0.2",
"get-stdin": "^5.0.1",
"glob": "^7.1.2",
Expand All @@ -40,7 +40,7 @@
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"mocha": "^4.0.1",
"sinon": "^4.1.2"
"sinon": "^4.1.3"
},
"main": "src/index.js",
"engines": {
Expand Down
15 changes: 12 additions & 3 deletions packages/convert-svg-core/src/CLI.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ const { EOL } = require('os');
const fs = require('fs');
const getStdin = require('get-stdin').buffer;
const glob = require('glob');
const omit = require('lodash.omit');
const path = require('path');
const pick = require('lodash.pick');
const util = require('util');

const Converter = require('./Converter');
Expand Down Expand Up @@ -98,6 +100,11 @@ class CLI {
flags: '--height <value>',
description: `specify height for ${format}`
},
{
flags: '--puppeteer <json>',
description: 'specify a json object for puppeteer.launch options',
transformer: JSON.parse
},
{
flags: '--scale <value>',
description: 'specify scale to apply to dimensions [1]',
Expand Down Expand Up @@ -144,9 +151,10 @@ class CLI {
*/
async parse(args = []) {
const command = this[_command].parse(args);
const converter = new Converter(this[_provider]);
const options = this[_parseOptions]();

const converter = new Converter(this[_provider], pick(options, 'puppeteer'));

try {
if (command.args.length) {
const filePaths = [];
Expand All @@ -161,11 +169,11 @@ class CLI {
filePaths.push(...files);
}

await this[_convertFiles](converter, filePaths, options);
await this[_convertFiles](converter, filePaths, omit(options, 'puppeteer'));
} else {
const input = await getStdin();

await this[_convertInput](converter, input, options,
await this[_convertInput](converter, input, omit(options, 'puppeteer'),
command.filename ? path.resolve(this[_baseDir], command.filename) : null);
}
} finally {
Expand Down Expand Up @@ -219,6 +227,7 @@ class CLI {
background: command.background,
baseUrl: command.baseUrl,
height: command.height,
puppeteer: command.puppeteer,
scale: command.scale,
width: command.width
};
Expand Down
4 changes: 2 additions & 2 deletions packages/convert-svg-test-helper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "convert-svg-test-helper",
"version": "0.3.2",
"version": "0.3.3",
"description": "Helper for testing convert-svg-core implementations",
"homepage": "https://github.com/NotNinja/convert-svg",
"bugs": {
Expand Down Expand Up @@ -33,7 +33,7 @@
"lodash.clonedeep": "^4.5.0",
"mocha": "^4.0.1",
"rimraf": "^2.6.2",
"sinon": "^4.1.2"
"sinon": "^4.1.3"
},
"main": "src/index.js",
"engines": {
Expand Down
1 change: 1 addition & 0 deletions packages/convert-svg-to-jpeg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ $ npm install --global convert-svg-to-jpeg
--base-url <url> specify base URL to use for all relative URLs in SVG
--filename <filename> specify filename for the JPEG output when processing STDIN
--height <value> specify height for JPEG
--puppeteer <json> specify a json object for puppeteer.launch options
--scale <value> specify scale to apply to dimensions [1]
--width <value> specify width for JPEG
--quality <value> specify quality for JPEG [100]
Expand Down
6 changes: 3 additions & 3 deletions packages/convert-svg-to-jpeg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "convert-svg-to-jpeg",
"version": "0.3.2",
"version": "0.3.3",
"description": "Converts SVG to JPEG using headless Chromium",
"homepage": "https://github.com/NotNinja/convert-svg",
"bugs": {
Expand All @@ -26,11 +26,11 @@
"url": "https://github.com/NotNinja/convert-svg.git"
},
"dependencies": {
"convert-svg-core": "^0.3.2"
"convert-svg-core": "^0.3.3"
},
"devDependencies": {
"chai": "^4.1.2",
"convert-svg-test-helper": "^0.3.2",
"convert-svg-test-helper": "^0.3.3",
"mocha": "^4.0.1"
},
"bin": {
Expand Down
1 change: 1 addition & 0 deletions packages/convert-svg-to-png/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ $ npm install --global convert-svg-to-png
--base-url <url> specify base URL to use for all relative URLs in SVG
--filename <filename> specify filename for the PNG output when processing STDIN
--height <value> specify height for PNG
--puppeteer <json> specify a json object for puppeteer.launch options
--scale <value> specify scale to apply to dimensions [1]
--width <value> specify width for PNG
-h, --help output usage information
Expand Down
6 changes: 3 additions & 3 deletions packages/convert-svg-to-png/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "convert-svg-to-png",
"version": "0.3.2",
"version": "0.3.3",
"description": "Converts SVG to PNG using headless Chromium",
"homepage": "https://github.com/NotNinja/convert-svg",
"bugs": {
Expand All @@ -25,11 +25,11 @@
"url": "https://github.com/NotNinja/convert-svg.git"
},
"dependencies": {
"convert-svg-core": "^0.3.2"
"convert-svg-core": "^0.3.3"
},
"devDependencies": {
"chai": "^4.1.2",
"convert-svg-test-helper": "^0.3.2",
"convert-svg-test-helper": "^0.3.3",
"mocha": "^4.0.1"
},
"bin": {
Expand Down

0 comments on commit 2e1dfc7

Please sign in to comment.