diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index a2f21aa..7642457 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -52,6 +52,8 @@ jobs: node-version: 16 - name: Install dependencies run: npm ci + - name: Build commonjs + run: npm run build:cjs - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 07e6e47..8225baa 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /node_modules +/dist diff --git a/package-lock.json b/package-lock.json index c7bad72..f996678 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0-development", "license": "MIT", "dependencies": { - "pdf2json": "3.0.1" + "pdf2json": "3.1.3" }, "devDependencies": { "@semantic-release/changelog": "^6.0.1", @@ -21,6 +21,7 @@ "eslint-plugin-prettier": "^4.0.0", "execa": "^6.1.0", "prettier": "2.6.1", + "rollup": "^4.19.1", "semantic-release": "^19.0.2" }, "engines": { @@ -278,6 +279,214 @@ "@octokit/openapi-types": "^11.2.0" } }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.1.tgz", + "integrity": "sha512-XzqSg714++M+FXhHfXpS1tDnNZNpgxxuGZWlRG/jSj+VEPmZ0yg6jV4E0AL3uyBKxO8mO3xtOsP5mQ+XLfrlww==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.1.tgz", + "integrity": "sha512-thFUbkHteM20BGShD6P08aungq4irbIZKUNbG70LN8RkO7YztcGPiKTTGZS7Kw+x5h8hOXs0i4OaHwFxlpQN6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.1.tgz", + "integrity": "sha512-8o6eqeFZzVLia2hKPUZk4jdE3zW7LCcZr+MD18tXkgBBid3lssGVAYuox8x6YHoEPDdDa9ixTaStcmx88lio5Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.1.tgz", + "integrity": "sha512-4T42heKsnbjkn7ovYiAdDVRRWZLU9Kmhdt6HafZxFcUdpjlBlxj4wDrt1yFWLk7G4+E+8p2C9tcmSu0KA6auGA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.1.tgz", + "integrity": "sha512-MXg1xp+e5GhZ3Vit1gGEyoC+dyQUBy2JgVQ+3hUrD9wZMkUw/ywgkpK7oZgnB6kPpGrxJ41clkPPnsknuD6M2Q==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.1.tgz", + "integrity": "sha512-DZNLwIY4ftPSRVkJEaxYkq7u2zel7aah57HESuNkUnz+3bZHxwkCUkrfS2IWC1sxK6F2QNIR0Qr/YXw7nkF3Pw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.1.tgz", + "integrity": "sha512-C7evongnjyxdngSDRRSQv5GvyfISizgtk9RM+z2biV5kY6S/NF/wta7K+DanmktC5DkuaJQgoKGf7KUDmA7RUw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.1.tgz", + "integrity": "sha512-89tFWqxfxLLHkAthAcrTs9etAoBFRduNfWdl2xUs/yLV+7XDrJ5yuXMHptNqf1Zw0UCA3cAutkAiAokYCkaPtw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.1.tgz", + "integrity": "sha512-PromGeV50sq+YfaisG8W3fd+Cl6mnOOiNv2qKKqKCpiiEke2KiKVyDqG/Mb9GWKbYMHj5a01fq/qlUR28PFhCQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.1.tgz", + "integrity": "sha512-/1BmHYh+iz0cNCP0oHCuF8CSiNj0JOGf0jRlSo3L/FAyZyG2rGBuKpkZVH9YF+x58r1jgWxvm1aRg3DHrLDt6A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.1.tgz", + "integrity": "sha512-0cYP5rGkQWRZKy9/HtsWVStLXzCF3cCBTRI+qRL8Z+wkYlqN7zrSYm6FuY5Kd5ysS5aH0q5lVgb/WbG4jqXN1Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.1.tgz", + "integrity": "sha512-XUXeI9eM8rMP8aGvii/aOOiMvTs7xlCosq9xCjcqI9+5hBxtjDpD+7Abm1ZhVIFE1J2h2VIg0t2DX/gjespC2Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.1.tgz", + "integrity": "sha512-V7cBw/cKXMfEVhpSvVZhC+iGifD6U1zJ4tbibjjN+Xi3blSXaj/rJynAkCFFQfoG6VZrAiP7uGVzL440Q6Me2Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.1.tgz", + "integrity": "sha512-88brja2vldW/76jWATlBqHEoGjJLRnP0WOEKAUbMcXaAZnemNhlAHSyj4jIwMoP2T750LE9lblvD4e2jXleZsA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.1.tgz", + "integrity": "sha512-LdxxcqRVSXi6k6JUrTah1rHuaupoeuiv38du8Mt4r4IPer3kwlTo+RuvfE8KzZ/tL6BhaPlzJ3835i6CxrFIRQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.1.tgz", + "integrity": "sha512-2bIrL28PcK3YCqD9anGxDxamxdiJAxA+l7fWIwM5o8UqNy1t3d1NdAweO2XhA0KTDJ5aH1FsuiT5+7VhtHliXg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@semantic-release/changelog": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.1.tgz", @@ -590,6 +799,12 @@ "node": ">= 10" } }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, "node_modules/@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", @@ -6664,25 +6879,25 @@ } }, "node_modules/pdf2json": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/pdf2json/-/pdf2json-3.0.1.tgz", - "integrity": "sha512-1pNsakC8F+OuFS72U+ZI0u8J/voPYYDYHj/0B/7ywYUm3w0QurkDBy3pH35kzygjgmJJVHk2a9I6gBswFF8hQQ==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/pdf2json/-/pdf2json-3.1.3.tgz", + "integrity": "sha512-cGP2MIz7v+w/b4vgg0OPKqhT21L/CZ73+RNmXKbKjgtnVJt2e00AqI6NZyMTp6GL6sY+r0NJOZb9gL3g37yuew==", "bundleDependencies": [ "@xmldom/xmldom" ], "dependencies": { - "@xmldom/xmldom": "^0.8.6" + "@xmldom/xmldom": "^0.8.10" }, "bin": { - "pdf2json": "bin/pdf2json" + "pdf2json": "bin/pdf2json.js" }, "engines": { - "node": ">=14.18.0", - "npm": ">=8.12.1" + "node": ">=18.12.1", + "npm": ">=8.19.2" } }, "node_modules/pdf2json/node_modules/@xmldom/xmldom": { - "version": "0.8.6", + "version": "0.8.10", "inBundle": true, "license": "MIT", "engines": { @@ -7148,6 +7363,41 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rollup": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.19.1.tgz", + "integrity": "sha512-K5vziVlg7hTpYfFBI+91zHBEMo6jafYXpkMlqZjg7/zhIG9iHqazBf4xz9AVdjS9BruRn280ROqLI7G3OFRIlw==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.19.1", + "@rollup/rollup-android-arm64": "4.19.1", + "@rollup/rollup-darwin-arm64": "4.19.1", + "@rollup/rollup-darwin-x64": "4.19.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.19.1", + "@rollup/rollup-linux-arm-musleabihf": "4.19.1", + "@rollup/rollup-linux-arm64-gnu": "4.19.1", + "@rollup/rollup-linux-arm64-musl": "4.19.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.19.1", + "@rollup/rollup-linux-riscv64-gnu": "4.19.1", + "@rollup/rollup-linux-s390x-gnu": "4.19.1", + "@rollup/rollup-linux-x64-gnu": "4.19.1", + "@rollup/rollup-linux-x64-musl": "4.19.1", + "@rollup/rollup-win32-arm64-msvc": "4.19.1", + "@rollup/rollup-win32-ia32-msvc": "4.19.1", + "@rollup/rollup-win32-x64-msvc": "4.19.1", + "fsevents": "~2.3.2" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -8378,6 +8628,118 @@ "@octokit/openapi-types": "^11.2.0" } }, + "@rollup/rollup-android-arm-eabi": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.1.tgz", + "integrity": "sha512-XzqSg714++M+FXhHfXpS1tDnNZNpgxxuGZWlRG/jSj+VEPmZ0yg6jV4E0AL3uyBKxO8mO3xtOsP5mQ+XLfrlww==", + "dev": true, + "optional": true + }, + "@rollup/rollup-android-arm64": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.1.tgz", + "integrity": "sha512-thFUbkHteM20BGShD6P08aungq4irbIZKUNbG70LN8RkO7YztcGPiKTTGZS7Kw+x5h8hOXs0i4OaHwFxlpQN6A==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-arm64": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.1.tgz", + "integrity": "sha512-8o6eqeFZzVLia2hKPUZk4jdE3zW7LCcZr+MD18tXkgBBid3lssGVAYuox8x6YHoEPDdDa9ixTaStcmx88lio5Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-x64": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.1.tgz", + "integrity": "sha512-4T42heKsnbjkn7ovYiAdDVRRWZLU9Kmhdt6HafZxFcUdpjlBlxj4wDrt1yFWLk7G4+E+8p2C9tcmSu0KA6auGA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.1.tgz", + "integrity": "sha512-MXg1xp+e5GhZ3Vit1gGEyoC+dyQUBy2JgVQ+3hUrD9wZMkUw/ywgkpK7oZgnB6kPpGrxJ41clkPPnsknuD6M2Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm-musleabihf": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.1.tgz", + "integrity": "sha512-DZNLwIY4ftPSRVkJEaxYkq7u2zel7aah57HESuNkUnz+3bZHxwkCUkrfS2IWC1sxK6F2QNIR0Qr/YXw7nkF3Pw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-gnu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.1.tgz", + "integrity": "sha512-C7evongnjyxdngSDRRSQv5GvyfISizgtk9RM+z2biV5kY6S/NF/wta7K+DanmktC5DkuaJQgoKGf7KUDmA7RUw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-musl": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.1.tgz", + "integrity": "sha512-89tFWqxfxLLHkAthAcrTs9etAoBFRduNfWdl2xUs/yLV+7XDrJ5yuXMHptNqf1Zw0UCA3cAutkAiAokYCkaPtw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.1.tgz", + "integrity": "sha512-PromGeV50sq+YfaisG8W3fd+Cl6mnOOiNv2qKKqKCpiiEke2KiKVyDqG/Mb9GWKbYMHj5a01fq/qlUR28PFhCQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-riscv64-gnu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.1.tgz", + "integrity": "sha512-/1BmHYh+iz0cNCP0oHCuF8CSiNj0JOGf0jRlSo3L/FAyZyG2rGBuKpkZVH9YF+x58r1jgWxvm1aRg3DHrLDt6A==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-s390x-gnu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.1.tgz", + "integrity": "sha512-0cYP5rGkQWRZKy9/HtsWVStLXzCF3cCBTRI+qRL8Z+wkYlqN7zrSYm6FuY5Kd5ysS5aH0q5lVgb/WbG4jqXN1Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-gnu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.1.tgz", + "integrity": "sha512-XUXeI9eM8rMP8aGvii/aOOiMvTs7xlCosq9xCjcqI9+5hBxtjDpD+7Abm1ZhVIFE1J2h2VIg0t2DX/gjespC2Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-musl": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.1.tgz", + "integrity": "sha512-V7cBw/cKXMfEVhpSvVZhC+iGifD6U1zJ4tbibjjN+Xi3blSXaj/rJynAkCFFQfoG6VZrAiP7uGVzL440Q6Me2Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-arm64-msvc": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.1.tgz", + "integrity": "sha512-88brja2vldW/76jWATlBqHEoGjJLRnP0WOEKAUbMcXaAZnemNhlAHSyj4jIwMoP2T750LE9lblvD4e2jXleZsA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-ia32-msvc": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.1.tgz", + "integrity": "sha512-LdxxcqRVSXi6k6JUrTah1rHuaupoeuiv38du8Mt4r4IPer3kwlTo+RuvfE8KzZ/tL6BhaPlzJ3835i6CxrFIRQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-x64-msvc": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.1.tgz", + "integrity": "sha512-2bIrL28PcK3YCqD9anGxDxamxdiJAxA+l7fWIwM5o8UqNy1t3d1NdAweO2XhA0KTDJ5aH1FsuiT5+7VhtHliXg==", + "dev": true, + "optional": true + }, "@semantic-release/changelog": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.1.tgz", @@ -8608,6 +8970,12 @@ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, + "@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, "@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", @@ -12959,15 +13327,15 @@ "dev": true }, "pdf2json": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/pdf2json/-/pdf2json-3.0.1.tgz", - "integrity": "sha512-1pNsakC8F+OuFS72U+ZI0u8J/voPYYDYHj/0B/7ywYUm3w0QurkDBy3pH35kzygjgmJJVHk2a9I6gBswFF8hQQ==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/pdf2json/-/pdf2json-3.1.3.tgz", + "integrity": "sha512-cGP2MIz7v+w/b4vgg0OPKqhT21L/CZ73+RNmXKbKjgtnVJt2e00AqI6NZyMTp6GL6sY+r0NJOZb9gL3g37yuew==", "requires": { - "@xmldom/xmldom": "^0.8.6" + "@xmldom/xmldom": "^0.8.10" }, "dependencies": { "@xmldom/xmldom": { - "version": "0.8.6", + "version": "0.8.10", "bundled": true } } @@ -13294,6 +13662,32 @@ "glob": "^7.1.3" } }, + "rollup": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.19.1.tgz", + "integrity": "sha512-K5vziVlg7hTpYfFBI+91zHBEMo6jafYXpkMlqZjg7/zhIG9iHqazBf4xz9AVdjS9BruRn280ROqLI7G3OFRIlw==", + "dev": true, + "requires": { + "@rollup/rollup-android-arm-eabi": "4.19.1", + "@rollup/rollup-android-arm64": "4.19.1", + "@rollup/rollup-darwin-arm64": "4.19.1", + "@rollup/rollup-darwin-x64": "4.19.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.19.1", + "@rollup/rollup-linux-arm-musleabihf": "4.19.1", + "@rollup/rollup-linux-arm64-gnu": "4.19.1", + "@rollup/rollup-linux-arm64-musl": "4.19.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.19.1", + "@rollup/rollup-linux-riscv64-gnu": "4.19.1", + "@rollup/rollup-linux-s390x-gnu": "4.19.1", + "@rollup/rollup-linux-x64-gnu": "4.19.1", + "@rollup/rollup-linux-x64-musl": "4.19.1", + "@rollup/rollup-win32-arm64-msvc": "4.19.1", + "@rollup/rollup-win32-ia32-msvc": "4.19.1", + "@rollup/rollup-win32-x64-msvc": "4.19.1", + "@types/estree": "1.0.5", + "fsevents": "~2.3.2" + } + }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", diff --git a/package.json b/package.json index 304bec3..1446adc 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,9 @@ "type": "module", "version": "0.0.0-development", "description": "Read text and parse tables from PDF files. Supports tabular data with automatic column detection, and rule-based parsing.", - "main": "index.js", + "main": "dist/index.cjs", + "module": "./index.js", + "typings": "./index.d.ts", "scripts": { "prettier:print": "prettier --list-different \"./**/*.js\" \"./**/*.md\"", "prettier:check": "npm run -s prettier:print 1>&2; exit $(npm run -s prettier:print | wc -l)", @@ -12,7 +14,8 @@ "test:update": "ava --update-snapshots", "test": "ava", "lint": "eslint .", - "semantic-release": "semantic-release" + "semantic-release": "semantic-release", + "build:cjs": "rollup index.js --file dist/index.cjs --format cjs" }, "repository": { "type": "git", @@ -39,7 +42,7 @@ }, "homepage": "https://github.com/adrienjoly/npm-pdfreader", "dependencies": { - "pdf2json": "3.0.1" + "pdf2json": "3.1.3" }, "devDependencies": { "@semantic-release/changelog": "^6.0.1", @@ -51,7 +54,8 @@ "eslint-plugin-prettier": "^4.0.0", "execa": "^6.1.0", "prettier": "2.6.1", - "semantic-release": "^19.0.2" + "semantic-release": "^19.0.2", + "rollup": "^4.19.1" }, "engines": { "node": ">=14" diff --git a/test/snapshots/test.js.md b/test/snapshots/test.js.md index b03a742..646d5f9 100644 --- a/test/snapshots/test.js.md +++ b/test/snapshots/test.js.md @@ -33,7 +33,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: 0.32553125, text: 'Hello "world"', w: 6.138, @@ -54,7 +54,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: NaN, text: 'Value:', w: 2.666, @@ -75,7 +75,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: NaN, text: '4', w: 0.5, @@ -96,7 +96,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: 0.32553125, text: 'c1', w: 0.944, @@ -117,7 +117,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: 0.32553125, text: 'c2', w: 0.944, @@ -138,7 +138,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: 0.32553125, text: 'c3', w: 0.944, @@ -159,7 +159,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: NaN, text: '1', w: 0.5, @@ -180,7 +180,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: NaN, text: '2.3', w: 1.25, @@ -201,7 +201,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: NaN, text: 'hello', w: 2, @@ -222,7 +222,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: NaN, text: 'world', w: 2.333, @@ -243,7 +243,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: NaN, text: 'Values:', w: 3.055, @@ -264,7 +264,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: NaN, text: '1', w: 0.5, @@ -285,7 +285,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: NaN, text: '2', w: 0.5, @@ -306,7 +306,7 @@ Generated by [AVA](https://avajs.dev). ], }, ], - oc: undefined, + clr: 0, sw: NaN, text: '3', w: 0.5, @@ -359,7 +359,7 @@ Generated by [AVA](https://avajs.dev). 'Date', 'V8', 'npm', - 'NODE_MODULE_VERSION[1]', + 'NODE_MODULE_VERSION [1]', ], [ 'Node.js 17.1.0', @@ -369,7 +369,7 @@ Generated by [AVA](https://avajs.dev). '8.1.2', '102', 'Downloads', - 'Changelog', + ' Changelog ', 'Docs', ], [ @@ -380,7 +380,7 @@ Generated by [AVA](https://avajs.dev). '8.1.0', '102', 'Downloads', - 'Changelog', + ' Changelog ', 'Docs', ], [ @@ -391,7 +391,7 @@ Generated by [AVA](https://avajs.dev). '8.1.0', '102', 'Downloads', - 'Changelog', + ' Changelog ', 'Docs', ], [ @@ -402,7 +402,7 @@ Generated by [AVA](https://avajs.dev). '8.5.0', '93', 'Downloads', - 'Changelog', + ' Changelog ', 'Docs', ], [ @@ -413,7 +413,7 @@ Generated by [AVA](https://avajs.dev). '8.5.0', '93', 'Downloads', - 'Changelog', + ' Changelog ', 'Docs', ], [ @@ -424,7 +424,7 @@ Generated by [AVA](https://avajs.dev). '8.3.1', '93', 'Downloads', - 'Changelog', + ' Changelog ', 'Docs', ], [ @@ -435,7 +435,7 @@ Generated by [AVA](https://avajs.dev). '8.1.2', '93', 'Downloads', - 'Changelog', + ' Changelog ', 'Docs', ], [ @@ -446,7 +446,7 @@ Generated by [AVA](https://avajs.dev). '8.1.2', '93', 'Downloads', - 'Changelog', + ' Changelog ', 'Docs', ], [ @@ -457,7 +457,7 @@ Generated by [AVA](https://avajs.dev). '8.1.0', '93', 'Downloads', - 'Changelog', + ' Changelog ', 'Docs', ], [ @@ -468,7 +468,7 @@ Generated by [AVA](https://avajs.dev). '8.1.0', '93', 'Downloads', - 'Changelog', + ' Changelog ', 'Docs', ], ] @@ -503,7 +503,6 @@ Generated by [AVA](https://avajs.dev). 4.555 16.423 left 0 2␊ 4.555 18.01 left 0 3␊ file = undefined␊ - Warning: Setting up fake worker.␊ page = 1␊ 4.555 5.154 left 6 Hello "world"␊ 4.555 7.174 left 2 Value:␊ diff --git a/test/snapshots/test.js.snap b/test/snapshots/test.js.snap index da2ec1e..711cbc8 100644 Binary files a/test/snapshots/test.js.snap and b/test/snapshots/test.js.snap differ