From 6b91d86384ae9bf6555042e53bb909f517d38105 Mon Sep 17 00:00:00 2001 From: Libor M Date: Thu, 9 Nov 2023 08:45:38 +0100 Subject: [PATCH] Revert "Merge branch 'master' into master" This reverts commit da8b5ca10ae19fe516808783789de15895d94cbf, reversing changes made to 82920c612a527da58a66c1c9398f08b02e3b6078. --- README.md | 13 +------ lib/font_factory.js | 2 +- lib/line_wrapper.js | 2 +- package.json | 15 ++++---- rollup.config.js | 4 +- yarn.lock | 89 +++++++++++++++++++++++++++------------------ 6 files changed, 68 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index 49357bbda..7df2b50f9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,4 @@ -# Fork of PDFKit [![npm][npm_img]][npm_url] - -[npm_img]: https://img.shields.io/npm/v/@foliojs-fork/pdfkit.svg?colorB=0E7FBF -[npm_url]: https://www.npmjs.com/package/@foliojs-fork/pdfkit +# PDFKit A JavaScript PDF generation library for Node and the browser. @@ -19,17 +16,11 @@ folder. You can also try out an interactive in-browser demo of PDFKit [here](http://pdfkit.org/demo/browser.html). -## Why fork? - -Because PDFKit require up-to-date these dependencies: -- [foliojs-fork/fontkit](https://github.com/foliojs-fork/fontkit) (see [Why fork?](https://github.com/foliojs-fork/fontkit#why-fork)) -- [foliojs-fork/linebreak](https://github.com/foliojs-fork/linebreak) (see [Why fork?](https://github.com/foliojs-fork/linebreak#why-fork)) - ## Installation Installation uses the [npm](http://npmjs.org/) package manager. Just type the following command after installing npm. - npm install @foliojs-fork/pdfkit + npm install pdfkit ## Features diff --git a/lib/font_factory.js b/lib/font_factory.js index a5772799a..cfb743671 100644 --- a/lib/font_factory.js +++ b/lib/font_factory.js @@ -1,5 +1,5 @@ import fs from 'fs'; -import fontkit from '@foliojs-fork/fontkit'; +import fontkit from 'fontkit'; import StandardFont from './font/standard'; import EmbeddedFont from './font/embedded'; diff --git a/lib/line_wrapper.js b/lib/line_wrapper.js index 0f70536bd..b1e05a3e4 100644 --- a/lib/line_wrapper.js +++ b/lib/line_wrapper.js @@ -1,5 +1,5 @@ import { EventEmitter } from 'events'; -import LineBreaker from '@foliojs-fork/linebreak'; +import LineBreaker from 'linebreak'; class LineWrapper extends EventEmitter { constructor(document, options) { diff --git a/package.json b/package.json index 2335ca74e..6e2bf2f42 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@foliojs-fork/pdfkit", + "name": "pdfkit", "description": "A PDF generation library for Node.js", "keywords": [ "pdf", @@ -19,9 +19,9 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/foliojs-fork/pdfkit.git" + "url": "https://github.com/foliojs/pdfkit.git" }, - "bugs": "https://github.com/foliojs-fork/pdfkit/issues", + "bugs": "https://github.com/foliojs/pdfkit/issues", "devDependencies": { "@babel/core": "^7.11.6", "@babel/plugin-external-helpers": "^7.10.4", @@ -49,14 +49,15 @@ }, "dependencies": { "crypto-js": "^4.2.0", - "@foliojs-fork/fontkit": "^1.9.1", - "@foliojs-fork/linebreak": "^1.1.1", + "fontkit": "^1.8.1", + "linebreak": "^1.0.2", "png-js": "^1.0.0" }, "scripts": { "prepublishOnly": "npm run build", - "build": "rollup -c", - "browserify-example": "browserify examples/browserify/browser.js > examples/browserify/bundle.js", "pdf-guide": "node docs/generate.js", + "build": "rollup -c && browserify --standalone PDFDocument --ignore crypto --ignore iconv-lite js/pdfkit.js > js/pdfkit.standalone.js", + "browserify-example": "browserify examples/browserify/browser.js > examples/browserify/bundle.js", + "pdf-guide": "node docs/generate.js", "website": "node docs/generate_website.js", "publish-website": "node docs/publish_website.js", "docs": "npm run pdf-guide && npm run website && npm run browserify-example", diff --git a/rollup.config.js b/rollup.config.js index bdbba9081..54a194cbe 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -6,9 +6,9 @@ const external = [ 'stream', 'fs', 'zlib', - '@foliojs-fork/fontkit', + 'fontkit', 'events', - '@foliojs-fork/linebreak', + 'linebreak', 'png-js', 'crypto-js', 'saslprep' diff --git a/yarn.lock b/yarn.lock index 58fa25f94..95c548ac0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1222,36 +1222,6 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@foliojs-fork/fontkit@^1.9.1": - version "1.9.1" - resolved "https://registry.yarnpkg.com/@foliojs-fork/fontkit/-/fontkit-1.9.1.tgz#8124649168eb5273f580f66697a139fb5041296b" - integrity sha512-U589voc2/ROnvx1CyH9aNzOQWJp127JGU1QAylXGQ7LoEAF6hMmahZLQ4eqAcgHUw+uyW4PjtCItq9qudPkK3A== - dependencies: - "@foliojs-fork/restructure" "^2.0.2" - brfs "^2.0.0" - brotli "^1.2.0" - browserify-optional "^1.0.1" - clone "^1.0.4" - deep-equal "^1.0.0" - dfa "^1.2.0" - tiny-inflate "^1.0.2" - unicode-properties "^1.2.2" - unicode-trie "^2.0.0" - -"@foliojs-fork/linebreak@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@foliojs-fork/linebreak/-/linebreak-1.1.1.tgz#93ecd695b7d2bb0334b9481058c3e610e019a4eb" - integrity sha512-pgY/+53GqGQI+mvDiyprvPWgkTlVBS8cxqee03ejm6gKAQNsR1tCYCIvN9FHy7otZajzMqCgPOgC4cHdt4JPig== - dependencies: - base64-js "1.3.1" - brfs "^2.0.2" - unicode-trie "^2.0.0" - -"@foliojs-fork/restructure@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@foliojs-fork/restructure/-/restructure-2.0.2.tgz#73759aba2aff1da87b7c4554e6839c70d43c92b4" - integrity sha512-59SgoZ3EXbkfSX7b63tsou/SDGzwUEK6MuB5sKqgVK1/XE0fxmpsOb9DQI8LXW3KfGnAjImCGhhEb7uPPAUVNA== - "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -2234,10 +2204,10 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base64-js@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" - integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== +base64-js@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978" + integrity sha1-EQHpVE9KdrG8OybUUsqW16NeeXg= base64-js@^1.0.2, base64-js@^1.1.2: version "1.3.0" @@ -2387,7 +2357,7 @@ browserify-des@^1.0.0: inherits "^2.0.1" safe-buffer "^5.1.2" -browserify-optional@^1.0.1: +browserify-optional@^1.0.0, browserify-optional@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/browserify-optional/-/browserify-optional-1.0.1.tgz#1e13722cfde0d85f121676c2a72ced533a018869" integrity sha1-HhNyLP3g2F8SFnbCpyztUzoBiGk= @@ -3785,6 +3755,23 @@ flatted@^2.0.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== +fontkit@^1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/fontkit/-/fontkit-1.8.1.tgz#ae77485376f1096b45548bf6ced9a07af62a7846" + integrity sha512-BsNCjDoYRxmNWFdAuK1y9bQt+igIxGtTC9u/jSFjR9MKhmI00rP1fwSvERt+5ddE82544l0XH5mzXozQVUy2Tw== + dependencies: + babel-runtime "^6.26.0" + brfs "^2.0.0" + brotli "^1.2.0" + browserify-optional "^1.0.1" + clone "^1.0.4" + deep-equal "^1.0.0" + dfa "^1.2.0" + restructure "^0.5.3" + tiny-inflate "^1.0.2" + unicode-properties "^1.2.2" + unicode-trie "^0.3.0" + for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -5186,6 +5173,15 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +linebreak@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/linebreak/-/linebreak-1.0.2.tgz#4b5781733e9a9eb2849dba2f963e47c887f8aa06" + integrity sha512-bJwSRsJeAmaZYnkcwl5sCQNfSDAhBuXxb6L27tb+qkBRtUQSSTUa5bcgCPD6hFEkRNlpWHfK7nFMmcANU7ZP1w== + dependencies: + base64-js "0.0.8" + brfs "^2.0.2" + unicode-trie "^1.0.0" + lines-and-columns@^1.1.6: version "1.2.4" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" @@ -6407,6 +6403,13 @@ resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +restructure@^0.5.3: + version "0.5.4" + resolved "https://registry.yarnpkg.com/restructure/-/restructure-0.5.4.tgz#f54e7dd563590fb34fd6bf55876109aeccb28de8" + integrity sha1-9U591WNZD7NP1r9Vh2EJrsyyjeg= + dependencies: + browserify-optional "^1.0.0" + ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -7271,6 +7274,22 @@ unicode-property-aliases-ecmascript@^1.0.4: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57" integrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== +unicode-trie@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/unicode-trie/-/unicode-trie-0.3.1.tgz#d671dddd89101a08bac37b6a5161010602052085" + integrity sha1-1nHd3YkQGgi6w3tqUWEBBgIFIIU= + dependencies: + pako "^0.2.5" + tiny-inflate "^1.0.0" + +unicode-trie@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unicode-trie/-/unicode-trie-1.0.0.tgz#f649afdca127135edb55ca0ad7c8c60656d92ad1" + integrity sha512-v5raLKsobbFbWLMoX9+bChts/VhPPj3XpkNr/HbqkirXR1DPk8eo9IYKyvk0MQZFkaoRsFj2Rmaqgi2rfAZYtA== + dependencies: + pako "^0.2.5" + tiny-inflate "^1.0.0" + unicode-trie@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/unicode-trie/-/unicode-trie-2.0.0.tgz#8fd8845696e2e14a8b67d78fa9e0dd2cad62fec8"