Skip to content

Trying to contribute, how do you build a linkable lib? #509

@colmben

Description

@colmben

I'm submitting a...

  • Regression (a behavior that used to work and stopped working in a new release)
  • Bug report
  • Performance issue
  • Feature request
  • Documentation issue or request
  • Other... Please describe:

Current behavior

I am trying to test a small change that will enable the forgotten password flow to work correctly. To do that I am trying to link to a fork on github (using something like this in my package.json:

"angular-token": "git+https://github.com/colmben/angular-token.git#fixBranch",

)

I have tried a few different ways but I can't get the repo to build in a way that is linkable like this, due to the way the repo is structured with the example app in root and the actual lib in projects/angular-token.

If I build:lib, I get files in a root dist folder. I can commit this (which is the way to create a repo that is directly linkable as above) but when I npm install the repo it gives me an entry for angular-token-app instead of angular-token and that entry doesn't seem to give me access to AngularTokenService/AngularTokenModule in app.modules.

I have gone as far as using git subtree split to create a repo from /projects/angular-token, with the dist copied in from the root dir. This actually works locally but Heroku (where I am trying to test the issue) says it can't resolve angular-token.

Could any share how they are testing changes? The fix is only testable on a real server so I can't just play around with the local node_modules.

Environment

Angular-Token version: 7.1.0-rc.0
Angular version: 8.2.2

Bundler

  • Angular CLI (Webpack)
  • Webpack
  • SystemJS

Browser:

  • Chrome (desktop) version XX
  • Chrome (Android) version XX
  • Chrome (iOS) version XX
  • Firefox version XX
  • Safari (desktop) version XX
  • Safari (iOS) version XX
  • IE version XX
  • Edge version XX

Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions