Skip to content

Commit

Permalink
Release 0.6.0 (#76)
Browse files Browse the repository at this point in the history
* **Breaking Change:** All packages now require Node.js version 12.20.0 or newer
* Support UTF-8 characters in SVG
* Support SVG dimensions (width, height) that use `pt` units
* Add `rounding` API and CLI option to control how dimensions are rounded (defaults to `"round"`)
* Fix [CVE-2021-23631](https://nvd.nist.gov/vuln/detail/CVE-2021-23631) by improving input validation
* `quality` CLI option for JPEG not passed correctly [#65](#65)
* Bump dependencies (incl. major for Puppeteer)
* Bump devDependencies
* Skip inconsistent tests
  • Loading branch information
neocotic committed Apr 28, 2022
1 parent a27affa commit c9e48d2
Show file tree
Hide file tree
Showing 100 changed files with 263 additions and 139 deletions.
42 changes: 40 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
node_modules/
packages/*/node_modules/
# Environment
.env*

# Compiled output
/node_modules
/packages/*/node_modules

# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store
Thumbs.db

# Linting
/.eslintcache

# Tests
/coverage
/.nyc_output
/packages/*/test/fixtures/actual

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
2 changes: 1 addition & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Authors ordered by first contribution

* Alasdair Mercer <mercer.alasdair@gmail.com>
* neocotic <https://github.com/neocotic>
12 changes: 12 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## Version 0.6.0, 2022.04.28

* **Breaking Change:** All packages now require Node.js version 12.20.0 or newer
* Support UTF-8 characters in SVG
* Support SVG dimensions (width, height) that use `pt` units
* Add `rounding` API and CLI option to control how dimensions are rounded (defaults to `"round"`)
* Fix [CVE-2021-23631](https://nvd.nist.gov/vuln/detail/CVE-2021-23631) by improving input validation
* `quality` CLI option for JPEG not passed correctly [#65](https://github.com/neocotic/convert-svg/issues/65)
* Bump dependencies (incl. major for Puppeteer)
* Bump devDependencies
* Skip inconsistent tests

## Version 0.5.0, 2018.11.23

* moved from !ninja to neocotic [ad5aa55](https://github.com/neocotic/convert-svg/commit/ad5aa559daa04a4276fc025e0a37d0d9768eab28)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $ npm run bootstrap
$ npm test
```

You must have at least [Node.js](https://nodejs.org) version 8 or newer installed.
You must have at least [Node.js](https://nodejs.org) version 12.20.0 or newer installed.

Some of the test fixtures include Microsoft-based fonts so, if you're a non-Windows user, you will have to ensure that
you have Microsoft fonts installed. For example; Ubuntu users can do the following:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2018 Alasdair Mercer
Copyright (C) 2022 neocotic

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# convert-svg

[![Build Status](https://img.shields.io/github/workflow/status/neocotic/convert-svg/ci.yml?style=flat-square)](https://github.com/neocotic/convert-svg/actions/workflows/ci.yml)
[![Build Status](https://img.shields.io/github/workflow/status/neocotic/convert-svg/CI/develop?style=flat-square)](https://github.com/neocotic/convert-svg/actions/workflows/ci.yml)
[![License](https://img.shields.io/github/license/neocotic/convert-svg.svg?style=flat-square)](https://github.com/neocotic/convert-svg/blob/master/LICENSE.md)
[![Release](https://img.shields.io/github/release/neocotic/convert-svg.svg?style=flat-square)](https://github.com/neocotic/convert-svg)

Expand Down Expand Up @@ -29,6 +29,6 @@ them.

## License

Copyright © 2018 Alasdair Mercer
Copyright © 2022 neocotic

See [LICENSE.md](https://github.com/neocotic/convert-svg/raw/master/LICENSE.md) for more information on our MIT license.
4 changes: 2 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "3.4.3",
"version": "0.5.0",
"lerna": "4.0.0",
"version": "0.6.0",
"packages": [
"packages/*"
],
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
"name": "convert-svg",
"license": "MIT",
"devDependencies": {
"eslint": "^5.9.0",
"eslint": "^8.14.0",
"eslint-config-notninja": "^0.4.0",
"lerna": "^3.4.3",
"mocha": "^5.2.0"
"lerna": "^4.0.0",
"mocha": "^9.2.2"
},
"scripts": {
"bootstrap": "lerna bootstrap",
"packages:outdated": "lerna exec --stream --no-bail \"npm outdated\"",
"pretest": "eslint .",
"test": "mocha -R list \"packages/*/test/**/*.spec.js\""
"test": "mocha -O maxDiffSize=32 -R list \"packages/*/test/**/*.spec.js\""
},
"engines": {
"node": ">=8"
"node": "^12.20.0 || >=14"
},
"private": true
}
4 changes: 2 additions & 2 deletions packages/convert-svg-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The core [Node.js](https://nodejs.org) package for converting SVG into other for
contains the shared logic for all converters. This package is not intended to be used directly to convert SVGs and,
instead, provides core support for SVG conversion.

[![Build Status](https://img.shields.io/github/workflow/status/neocotic/convert-svg/ci.yml?style=flat-square)](https://github.com/neocotic/convert-svg/actions/workflows/ci.yml)
[![Build Status](https://img.shields.io/github/workflow/status/neocotic/convert-svg/CI/develop?style=flat-square)](https://github.com/neocotic/convert-svg/actions/workflows/ci.yml)
[![License](https://img.shields.io/github/license/neocotic/convert-svg.svg?style=flat-square)](https://github.com/neocotic/convert-svg/blob/master/LICENSE.md)
[![Release](https://img.shields.io/github/release/neocotic/convert-svg.svg?style=flat-square)](https://github.com/neocotic/convert-svg/tree/master/packages/convert-svg-core)

Expand Down Expand Up @@ -120,6 +120,6 @@ A list of all contributors can be found in [AUTHORS.md](https://github.com/neoco

## License

Copyright © 2018 Alasdair Mercer
Copyright © 2022 neocotic

See [LICENSE.md](https://github.com/neocotic/convert-svg/raw/master/LICENSE.md) for more information on our MIT license.
28 changes: 14 additions & 14 deletions packages/convert-svg-core/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"name": "convert-svg-core",
"version": "0.5.0",
"version": "0.6.0",
"description": "Supports converting SVG into another format using headless Chromium",
"homepage": "https://github.com/neocotic/convert-svg",
"bugs": {
"url": "https://github.com/neocotic/convert-svg/issues"
},
"author": {
"name": "Alasdair Mercer",
"email": "mercer.alasdair@gmail.com",
"url": "https://neocotic.com"
"name": "neocotic",
"url": "https://github.com/neocotic"
},
"funding": [
{
Expand All @@ -35,23 +34,24 @@
"url": "https://github.com/neocotic/convert-svg.git"
},
"dependencies": {
"chalk": "^2.4.1",
"commander": "^2.19.0",
"file-url": "^2.0.2",
"get-stdin": "^6.0.0",
"glob": "^7.1.3",
"chalk": "^4.1.2",
"cheerio": "^0.22.0",
"commander": "^9.2.0",
"file-url": "^3.0.0",
"get-stdin": "^8.0.0",
"glob": "^8.0.1",
"lodash.omit": "^4.5.0",
"lodash.pick": "^4.4.0",
"pollock": "^0.2.0",
"puppeteer": "^1.10.0",
"tmp": "0.0.33"
"puppeteer": "^13.7.0",
"tmp": "^0.2.1"
},
"devDependencies": {
"mocha": "^5.2.0",
"sinon": "^7.1.1"
"mocha": "^9.2.2",
"sinon": "^13.0.2"
},
"main": "src/index.js",
"engines": {
"node": ">=8"
"node": "^12.20.0 || >=14"
}
}
6 changes: 3 additions & 3 deletions packages/convert-svg-core/src/API.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 Alasdair Mercer
* Copyright (C) 2022 neocotic
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -69,7 +69,7 @@ class API {
*
* @param {Buffer|string} input - the SVG input to be converted to another format
* @param {API~ConvertOptions} [options] - the options to be used
* @return {Promise.<Buffer, Error>} A <code>Promise</code> that is resolved with the converted output buffer.
* @return {Promise<Buffer>} A <code>Promise</code> that is resolved with the converted output buffer.
* @public
*/
async convert(input, options) {
Expand Down Expand Up @@ -105,7 +105,7 @@ class API {
*
* @param {string} inputFilePath - the path of the SVG file to be converted to another file format
* @param {API~ConvertFileOptions} [options] - the options to be used
* @return {Promise.<string, Error>} A <code>Promise</code> that is resolved with the output file path.
* @return {Promise<string>} A <code>Promise</code> that is resolved with the output file path.
* @public
*/
async convertFile(inputFilePath, options) {
Expand Down
8 changes: 6 additions & 2 deletions packages/convert-svg-core/src/CLI.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 Alasdair Mercer
* Copyright (C) 2022 neocotic
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -105,6 +105,10 @@ class CLI {
description: 'specify a json object for puppeteer.launch options',
transformer: JSON.parse
},
{
flags: '--rounding <type>',
description: 'specify type of rounding to apply to dimensions'
},
{
flags: '--scale <value>',
description: 'specify scale to apply to dimensions [1]',
Expand Down Expand Up @@ -146,7 +150,7 @@ class CLI {
* An error will occur if any problem arises.
*
* @param {string[]} [args] - the arguments to be parsed
* @return {Promise.<void, Error>} A <code>Promise</code> that is resolved once all actions have been completed.
* @return {Promise<void>} A <code>Promise</code> that is resolved once all actions have been completed.
* @public
*/
async parse(args = []) {
Expand Down
Loading

0 comments on commit c9e48d2

Please sign in to comment.