Git Product home page Git Product logo

Comments (8)

LayZeeDK avatar LayZeeDK commented on June 4, 2024 1

What bothers me is adding another mandatory dependency to the library. I'm not 100% sure about this, but let me take a look first, I haven't used this library myself.

You could add a sub-module in a sub-folder by adding a package.json file like this one:

{
  "name": "ngx-date-fns/tz",
  "private": true,
  "ngPackage": {
    "lib": {
      "entryFile": "./src/public-api.ts"
    }
  },
  "peerDependencies": {
    "@angular/common": ">=8",
    "@angular/core": ">=8",
    "date-fns": ">=2",
    "date-fns-tz": ">=2"
  }
}

from ngx-date-fns.

LayZeeDK avatar LayZeeDK commented on June 4, 2024 1

Example here: https://github.com/ng-packagr/ng-packagr/blob/master/integration/samples/secondary/sub-module/package.json

from ngx-date-fns.

LayZeeDK avatar LayZeeDK commented on June 4, 2024 1

Docs here: https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md

from ngx-date-fns.

joanllenas avatar joanllenas commented on June 4, 2024

Hi @vhdirk, thanks for your suggestion.
What bothers me is adding another mandatory dependency to the library. I'm not 100% sure about this, but let me take a look first, I haven't used this library myself.

from ngx-date-fns.

joanllenas avatar joanllenas commented on June 4, 2024

Thank's @LayZeeDK,
I had no idea this could be done. Researching right know 👍

from ngx-date-fns.

joanllenas avatar joanllenas commented on June 4, 2024

I also found this very detailed article: https://medium.com/tunaiku-tech/creating-secondary-entry-points-for-your-angular-library-1d5c0e95600a
I will look into all of this more thoroughly next weekend.

from ngx-date-fns.

joanllenas avatar joanllenas commented on June 4, 2024

Hey, It's been a long time since this was posted and there hasn't been much interest in this. I'm closing the issue.
Thanks!

from ngx-date-fns.

LayZeeDK avatar LayZeeDK commented on June 4, 2024

As it turns out, having dependencies in a secondary entry point isn't supported by any package managers so it wouldn't have made a difference. There are ways to mark peer dependencies as optional in the primary entry point's package.json file though.

from ngx-date-fns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.