Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smikodanic/ngboost
Angular boosting libraries.
https://github.com/smikodanic/ngboost
Last synced: 15 days ago
JSON representation
Angular boosting libraries.
- Host: GitHub
- URL: https://github.com/smikodanic/ngboost
- Owner: smikodanic
- Created: 2023-02-27T10:51:01.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-09T13:51:21.000Z (9 months ago)
- Last Synced: 2024-12-19T13:32:15.929Z (21 days ago)
- Language: TypeScript
- Homepage:
- Size: 273 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ngboost
> Angular boosting libraries## List of libraries
- [ngboost-auth](https://www.npmjs.com/package/ngboost-auth) - authentication module
- [ngboost-cookies](https://www.npmjs.com/package/ngboost-cookies) - manipulate with browser cookies## Angular - create NPM library
SUBJECT: How to pack angular code into library which can be published to NPM.### Prerequisites:
$ sudo npm install -g @angular/cli
- nodejs v15+### Procedure:
```bash
$ ng new ngboost --no-create-application
$ cd ngboost
$ ng generate library ngboost-auth
```The projects/ngboost-auth folder is created.
In the /src/ folder place the angular library code.
In file projects/ngboost-auth/src/public-api.ts define what will be exported, for example:
```javascript
export { AuthService } from './auth.service';
export { JwtTokenInterceptor } from './jwtTokenInterceptor.service';
export { IsLoggedService } from './routeGuards/isLogged.service';
export { HasRoleService } from './routeGuards/hasRole.service';
export { AutologinService } from './routeGuards/autoLogin.service';
```Now when all code is ready build it with:
```bash
$ ng build ngboost-auth
```To publish it do:
```bash
$ cd dist/ngboost-auth
$ npm publish
```### Update to new Angular version
```
// update angular
ng update @angular/core@17 @angular/cli@17// re-build every project
ng build ngboost-auth
ng build ngboost-cookies// publish to npm
cd dist/ngboost-auth
npm version minor
npm publishcd dist/ngboost-cookies
npm version minor
npm publish
```