diff --git a/CHANGELOG.md b/CHANGELOG.md index ef2e6bc4..51d75d61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,24 @@ ## Changelog -### master +### 3.0.0-beta.1 +#### Breaking changes +- Rewrite library using TypeScript. TypeScript declaration files are now provided by the library. Hopefully, it should be a bit easier to refactor now... +- Rename generated build files. The new files are: +```bash +dist/signature_pad.js # unminified CommonJS +dist/signature_pad.min.js # minified CommonJS +dist/signature_pad.umd.js # unminified UMD +dist/signature_pad.umd.min.js # minified UMD +dist/signature_pad.m.js # unminified ES module +dist/signature_pad.m.min.js # minified ES module +``` + #### Bug Fixes - Allow scrolling via touch after calling `SignaturePad#off`([felixhammerl](https://github.com/felixhammerl) and [patrickbussmann](https://github.com/patrickbussmann)). +#### Features +- Add very basic unit tests for Point and Bezier classes. + ### 2.3.2 #### Bug Fixes - Fix `fromData` to properly handle color changes. ([szimek](https://github.com/szimek) closes [#302](https://github.com/szimek/signature_pad/issues/302)). diff --git a/README.md b/README.md index 42a42b34..ebfe93b6 100644 --- a/README.md +++ b/README.md @@ -30,12 +30,6 @@ You can select a different version at [https://www.jsdelivr.com/package/npm/sign This library is provided as UMD (Universal Module Definition) and ES6 module. -**NOTE** When importing this library in TypeScript, one needs to use the following syntax: -```js -import * as SignaturePad from 'signature_pad'; -``` -For more info why it's needed, check these 2 issues: [TypeScript#13017](https://github.com/Microsoft/TypeScript/issues/13017) and [rollup#1156](https://github.com/rollup/rollup/issues/1156). - ## Usage ### API ``` javascript diff --git a/docs/js/signature_pad.umd.js b/docs/js/signature_pad.umd.js index 3e4f76ac..8f33bfdb 100644 --- a/docs/js/signature_pad.umd.js +++ b/docs/js/signature_pad.umd.js @@ -1,5 +1,5 @@ /*! - * Signature Pad v3.0.0 | https://github.com/szimek/signature_pad + * Signature Pad v3.0.0-beta.1 | https://github.com/szimek/signature_pad * (c) 2018 Szymon Nowak | Released under the MIT license */ diff --git a/package.json b/package.json index f2ac3fa8..491d8cc5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "signature_pad", "description": "Library for drawing smooth signatures.", - "version": "3.0.0", + "version": "3.0.0-beta.1", "homepage": "https://github.com/szimek/signature_pad", "author": { "name": "Szymon Nowak", @@ -10,13 +10,13 @@ }, "license": "MIT", "source": "src/signature_pad.ts", - "dev:main": "dist/signature_pad.development.js", - "main": "dist/signature_pad.js", + "dev:main": "dist/signature_pad.js", + "main": "dist/signature_pad.min.js", "module": "dist/signature_pad.m.js", "umd:main": "dist/signature_pad.umd.js", "types": "dist/types/signature_pad.d.ts", "scripts": { - "build": "del dist && rollup --config && cp dist/signature_pad.umd.js docs/js/", + "build": "del dist && rollup --config && mv dist/src dist/types && cp dist/signature_pad.umd.js docs/js/", "prepublishOnly": "yarn run build", "test": "jest --coverage" }, diff --git a/rollup.config.js b/rollup.config.js index 07735a66..302de28c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -86,20 +86,34 @@ export default [ banner, }, }, + // ES module unminified + { + input: 'src/signature_pad.ts', + plugins: plugins({ + compilerOptions: { + target: 'ES6', + }, + }), + output: { + file: 'dist/signature_pad.m.js', + format: 'es', + banner, + }, + }, // ES module minified { input: 'src/signature_pad.ts', plugins: [ ...plugins({ compilerOptions: { - target: 'ES5', + target: 'ES6', declaration: true, }, }), uglify() ], output: { - file: 'dist/signature_pad.m.js', + file: 'dist/signature_pad.m.min.js', format: 'es', banner, }, diff --git a/tsconfig.json b/tsconfig.json index 8cc952e8..90cbe800 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,6 +13,6 @@ "sourceMap": true, "declaration": false, - "declarationDir": "dist/types" + "declarationDir": "dist" } }