Skip to content

Enhancement Suggestion for exports and dependencies #193

Description

Been getting these conflicts and errors when using the pomljs package.

objc[66263]: Class GNotificationCenterDelegate is implemented in both /<projectpath>/node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.42.dylib (0x133449a28) and /opt/homebrew/Cellar/glib/2.84.1/lib/libgio-2.0.0.dylib (0x131bfc6c0). This may cause spurious casting failures and mysterious crashes. One of the duplicates must be removed or renamed.
Warning: Cannot polyfill `Path2D`, rendering may be broken: "Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /<projectpath>/node_modules/path2d-polyfill/package.json".

The first issue is the same as what was referenced in #168

It would be nice to make the sharp, pdfjs-dist, canvas packages optional peer dependencies or update those packages. You could also split out the image and pdf processing into separate packages or restructure the exports, eg:

import { read, write } from 'pomljs/core';
import { readPDF } from 'pomljs/pdf';

There are developers who don't need these features as they only need to process text and with how the current exports are structured consuming projects can't tree-shake unused dependencies.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions