-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to contribute, how do you build a linkable lib? #509
Comments
I ended up using a convoluted process of making a change, npm run build:lib, "git subtree split" out the dist/angular-token/ folder, pushing that to the master of a my-angular-token repo and linking to that. So (as far as I can remember this is how I did it, you may need to play around with the general idea if this doesn't work straight off...) git clone the repo locally Change the remote to an empty github repo of your own, e.g.: Make your changes then build and commit
Don't push anything yet, instead split out a subtree of the local repo to a branch for the dist files, and then push that to the remote (as master if wish, which is what I am doing here)
You can then link to your repo in package.json like this: I couldn't for the life of me figure out how to get that subtree branch to pull any subsequent changes to the master dist files after any new changes/builds. So I ended up just blowing the local subtree branch out of the water and redoing the subtree split after new changes. Almost certainly my lack of knowledge showing here, but any clearer advice about to contribute/test the lib would be useful. |
I'm submitting a...
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
Browser:
Others:
The text was updated successfully, but these errors were encountered: