Skip to content

Library secondary entry-point generation #19070

Open
@klemenoslaj

Description

@klemenoslaj

🚀 Feature request

Command (mark with an x)

  • new
    build
    serve
    test
    e2e
    generate
    add
    update
    lint
    xi18n
    run
    config
    help
    version
    doc

Description

Creating a secondary entry points for libraries is a manual effort with a risk of misconfiguration of unit testing environment.
In order to get a proper coverage report for all the libraries, the following needs to be adjusted:

  • in test.ts the context path should be changed: const context = require.context('../', true, /\.spec\.ts$/);
  • in angular.json the sourceRoot path should be changed: "sourceRoot": "projects/lib-name", (no /src)

Describe the solution you'd like

Create a schematic that generates the secondary entry point for the given library.


I would be happy to provide a PR if this get's greenlit.

Activity

added this to the Backlog milestone on Oct 14, 2020
modified the milestones: Backlog, needsTriage on Feb 2, 2022
angular-robot

angular-robot commented on Feb 2, 2022

@angular-robot
Contributor

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

angular-robot

angular-robot commented on Feb 21, 2022

@angular-robot
Contributor

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

added
feature: insufficient votesLabel to add when the not a sufficient number of votes or comments from unique authors
and removed
feature: votes requiredFeature request which is currently still in the voting phase
on Feb 21, 2022
ertunga

ertunga commented on Jul 16, 2022

@ertunga

I've lost so much time because of this. It always requires manual effort to set things up with secondary entry points or am I missing something? there is ambiguity around folder structure of the library, unit tests stop working, you can't get the desired import path you want when you are consuming the library... I think nx has some generators to help develop libraries with second entry points, something like that can be added to CLI as well.

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

    area: @schematics/angularfeatureIssue that requests a new featurefeature: insufficient votesLabel to add when the not a sufficient number of votes or comments from unique authors

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @klemenoslaj@alan-agius4@ertunga

      Issue actions

        Library secondary entry-point generation · Issue #19070 · angular/angular-cli