open-index/open-npm huggingface dataset:
npm package: @smartbug/data-access-layer
Description: 📦 @smartbug/data-access-layer
Latest version: 0.0.6

📦 @smartbug/data-access-layer

The Data Access Layer (DAL) library provides a standard way to connect Angular applications to REST APIs.
It abstracts common CRUD operations (findAll, findById, save, update, deleteById) into a reusable APIRepository class.

✨ Features

✅ Standardized API access layer for Angular apps

✅ Built on Angular HttpClient

✅ Uses environment configs from @smartbug/environment

✅ Extendable with custom repositories

✅ Fully typed with generics

📦 Installation

    npm install @smartbug/data-access-layer @smartbug/environment

🔧 Setup

Import the provider in your app.config.ts or module:

    import { provideDataAccess } from '@smartbug/data-access-layer';

    export const appConfig: ApplicationConfig = {
      providers: [
        provideDataAccess()
      ]
    };

Configure environment via @smartbug/environment:

    import { provideEnvironment } from '@smartbug/environment';

    bootstrapApplication(AppComponent, {
      providers: [
        provideEnvironment({
          host: 'http://localhost',
          production: false,
          contexts: {
            api: { name: 'api', port: 8000 }
          }
        })
      ]
    });

🏗️ Usage
1. Create a Repository

Extend APIRepository<T> to define your domain model:

    import { Injectable } from '@angular/core';
    import { APIRepository } from '@smartbug/data-access-layer';
    
    export interface User {
      id: string;
      name: string;
      email: string;
    }
    
    @Injectable({ providedIn: 'root' })
    export class UserRepository extends APIRepository<User> {
      protected readonly name = 'users';
    
      override parse(response: ApiResponse<User>): User[] {
        return response.data ?? [];
      }
    }

2. Use in Components or Services

        import { Component, inject, OnInit } from '@angular/core';
        import { UserRepository } from './user.repository';
      
        @Component({
          selector: 'app-users',
          template: `
            <ul>
              <li *ngFor="let user of users">{{ user.name }} ({{ user.email }})</li>
            </ul>
          `
        })

        export class UsersComponent implements OnInit {
        private readonly repo = inject(UserRepository);
        users: any[] = [];
      
        ngOnInit() {
          this.repo.findAll().subscribe(data => {
            this.users = data;
          });
        }
      }
npm package: @smartbug/environment
Description: 📦 @smartbug/environment
Latest version: 0.0.3

📦 @smartbug/environment

The Environment Library provides a centralized way to manage runtime configuration in Angular applications.
It helps you define API contexts, hosts, and production flags, making it easy to switch between environments (dev, staging, prod).

✨ Features

✅ Define environment configuration in one place

✅ Typed with Environment, Context, and Contexts interfaces

✅ Injectable EnvironmentService for runtime access

✅ Works seamlessly with @smartbug/data-access-layer



📦 Installation

    npm install @smartbug/environment

🔧 Setup

   Provide the environment configuration at app bootstrap:


    import { provideEnvironment } from '@smartbug/environment';
    import { bootstrapApplication } from '@angular/platform-browser';
    import { AppComponent } from './app/app.component';
    
    bootstrapApplication(AppComponent, {
      providers: [
        provideEnvironment({
          host: 'http://localhost',
          production: false,
          contexts: {
            api: { name: 'api', port: 8000 }
          }
        })
      ]
    });

🏗️ Usage

Inject the Service

    import { Component, inject } from '@angular/core';
    import { EnvironmentService } from '@smartbug/environment';
    
    @Component({
      selector: 'app-root',
      template: `
        <h1>Environment Info</h1>
        <p>Host: {{ host }}</p>
        <p>Production: {{ isProd }}</p>
      `
    })
    export class AppComponent {
      private readonly env = inject(EnvironmentService);
    
      host = this.env.getHost();
      isProd = this.env.isProduction();
    }


EnvironmentService

Method	Description

    getContext(name)	Returns a specific context by name
    getContexts()	Returns all defined contexts
    getHost()	Returns the host string (e.g. http://api)
    isProduction()	Returns true if running in production mode

⚖️ License

MIT © SmartBug Labs
npm package: @smartbug/error-interceptor
Description: This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.0.
Latest version: 0.0.2

# ErrorInterceptor

This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.0.

## Code scaffolding

Angular CLI includes powerful code scaffolding tools. To generate a new component, run:

```bash
ng generate component component-name
```

For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:

```bash
ng generate --help
```

## Building

To build the library, run:

```bash
ng build error-interceptor
```

This command will compile your project, and the build artifacts will be placed in the `dist/` directory.

### Publishing the Library

Once the project is built, you can publish your library by following these steps:

1. Navigate to the `dist` directory:
   ```bash
   cd dist/error-interceptor
   ```

2. Run the `npm publish` command to publish your library to the npm registry:
   ```bash
   npm publish
   ```

## Running unit tests

To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:

```bash
ng test
```

## Running end-to-end tests

For end-to-end (e2e) testing, run:

```bash
ng e2e
```

Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.

## Additional Resources

For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.