I created an Angular Library by running:
ng new my-library-lib
cd my-library-lib
ng generate library my-library
This creates an Angular application and within it a folder called "projects" with the library code:
Application code:
- projects
-- my-library
--- src
---- lib
----- <code of the library (components, services)>
---- public_api.ts
--- <config files (ng-package.json, package.json, ...)>
- src
-- <code of the container application>
So having this structure, I don' know how to publish the library in Bitbucket to be consumed by other applications in this way:
package.json:
"my-library": "git+https://bitbucket/.../.../my-library.git#v0.0.1"
I followed a tutorial to create the library and I'm able to use it in the container application. Also I managed to use it in other applications by installing the .tgz created:
"build_lib": "ng build my-library",
"npm_pack_lib": "cd dist/my-library && npm pack",
"package_lib": "npm run build_lib && npm run npm_pack_lib"
The last step is to publish it and tag it to be consumed.