open-index/open-npm huggingface dataset:
npm package: @goodhood/chargebee
Description: Chargebee components
Author: Good Hood GmbH
Latest version: 1.7.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@goodhood/chargebee`

> React chargebee components (Chargebee SDK https://www.chargebee.com/checkout-portal-docs/api.html)

## Install

```
npm i @goodhood/chargebee
```

Install peer dependencies
```
npm i react // v16.x.x
npm i react-load-script // v0.x.x
npm i prop-types // v15.x.x
npm i @babel/runtime // v7.x.x
```

## Usage:

```js
import {
  Action,
  PortalLink,
  Checkout,
  SECTION_INVOICES,
  SECTION_EDIT_SUBSCRIPTION,
  SECTION_BILLING_ADDRESS,
} from '@goodhood/chargebee';
```

# API

## Action
```jsx
import { Action } from '@goodhood/chargebee';

const App = () => (
  <Action
    {/* Your site name */}
    site="site-name"

    {/* If true onCall won't be called on click */}
    disabled={true || false}

    {/* Will be called on element click. Receives chargebee instance as an argument */}
    onCall={(chargebeeInstance, ChargebeeAPI) => {}}
  />
);
```

## PortalLink
```jsx
import { PortalLink, SECTION_INVOICES } from '@goodhood/chargebee';

const App = () => (
  // Inherits Action component props
  <PortalLink
    {/* Section in the customer portal */}
    section={SECTION_INVOICES}

    {/* Should return a promise that resolves a portal session object */}
    onSessionGet={() => Promise.resolve({ id: '', token: '' })}

    {/* Will be called once the portal is closed by the end user */}
    onClose={() => {}}
  />
);
```

## Checkout
```jsx
import { Checkout } from '@goodhood/chargebee';

const App = () => (
  // Inherits Action component props
  <Checkout
    {/* Should return a promise, that will resolve a hosted page object */}
    onHostedPageGet={() => Promise.resolve({ id: '', url: '' })}

    {/* Will be called once the checkout page is loaded */}
    onLoaded={() => {}}

    {/* Will be called everytime an user navigates from one step to another.
      * String values for currentStep see cb-checkout at 
      * {@link https://www.chargebee.com/docs/2.0/gtm.html} */}
    onStep={(currentStep) => {}}

    {/* This function will be called once the portal is closed by the end user */}
    onClose={() => {}}

    {/* Will be called when a successful checkout happens. */}
    onSuccess={() => {}}

    {/* Will be called if the promise passed in onHostedPageGet causes an error */}
    onError={() => {}}
  />
);
```

# Development

## Preview

- Set chargebee site in root package `config/local.js` file (see `config/default.js`)
- `npm run start`
- Visit http://localhost:3000

## Add a new component

- Create `src/*/index.jsx`
  - Default exports will be re-exported with the chargebee name
  - Named exports will be re-exported as they are (watch out for collisions)
    ```js
    // src/chargebee/index.jsx
    export const PortalLink = () => {};
    export const Action = () => {};

    // usage
    import { PortalLink, Action } from '@goodhood/chargebee';
    ```
- Create `src/*/index.stories.jsx`
  - Preview will take it up automatically
npm package: @goodhood/components
Description: A collection of React Nebenan UI Components
Author: Good Hood GmbH
Latest version: 10.1.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@goodhood/components`

> A collection of React Nebenan UI Components

- [Preview](https://goodhood-eu.github.io/goodhood/packages/components/preview/)

## Preview

- `npm run start`
- Visit http://localhost:3000

## Usage

- Import `nebenan-ui-ki` globally
```scss
  @import "nebenan-ui-kit/styles"
```

- Import `scss` styles globally
```scss
  @import "@goodhood/components/styles"
```

- Import components e.g.
```js
  import { Logo } from "@goodhood/components";
```

## Add a new component

- Create `src/*/index.jsx`
    - Default exports will be re-exported with the components name
    - Named exports will be re-exported as they are (watch out for collisions)
        ```js
        // src/micro_helmet/index.jsx
        export const MicroHelmetProvider = 123;
        export default 666;
      
        // usage
        import { MicroHelmet, MicroHelmetProvider } from '@goodhood/components';
      ```
- Create `src/*/index.stories.jsx`
    - Preview will take it up automatically
npm package: @goodhood/inputs-minimal
Description: Nebenan inputs package
Author: Good Hood GmbH
Latest version: 1.7.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@goodhood/inputs-minimal`
Collection of dumb input components. Uses the [nebenan design system](https://www.figma.com/file/PBPtYOEh3AvPce2CsnzcgL/%E2%AC%A1-Design-System?node-id=143%3A177) as single source of truth.
- [Preview](https://goodhood-eu.github.io/goodhood/packages/inputs-minimal/preview/#/)

## Preview

- `npm run start`
- Visit http://localhost:3000

## Usage

- Import styles globally
```scss
  @import "@goodhood/inputs-minimal/styles"
```

- Import components e.g.
```js
  import { TextField } from "@goodhood/inputs-minimal"
```

## Add a new component

- Create `src/*/index.jsx`
  - Default exports will be re-exported with the components name
  - Named exports will be re-exported as they are (watch out for collisions)
      ```js
      // src/micro_helmet/index.jsx
      export const MicroHelmetProvider = 123;
      export default 666;
    
      // usage
      import { MicroHelmet, MicroHelmetProvider } from 'packages/inputs-minimal';
    ```
- Create `src/*/index.stories.jsx`
  - Preview will take it up automatically
npm package: @goodie-ts/cache
Description: Compile-time caching decorators and interceptor for goodie-ts
Latest version: 2.0.0

# @goodie-ts/cache

In-memory caching for [goodie-ts](https://github.com/GOOD-Code-ApS/goodie) via decorators. Built on the AOP interceptor chain in `@goodie-ts/core`.

## Install

```bash
pnpm add @goodie-ts/cache
```

## Overview

Declarative caching using `@Cacheable`, `@CacheEvict`, and `@CachePut` decorators. Cache entries are stored in-memory with optional TTL. Includes stampede protection for concurrent async calls.

## Decorators

| Decorator | Description |
|-----------|-------------|
| `@Cacheable(cacheName, { ttlMs? })` | Return cached value if present, otherwise execute and cache |
| `@CacheEvict(cacheName, { allEntries? })` | Execute method, then evict from cache |
| `@CachePut(cacheName, { ttlMs? })` | Always execute method, then cache the result |

## Usage

```typescript
import { Cacheable, CacheEvict } from '@goodie-ts/cache';
import { Singleton } from '@goodie-ts/core';

@Singleton()
class UserService {
  @Cacheable('users', { ttlMs: 60_000 })
  async findAll() {
    return db.selectFrom('users').selectAll().execute();
  }

  @CacheEvict('users', { allEntries: true })
  async create(name: string) {
    return db.insertInto('users').values({ name }).execute();
  }
}
```

## Setup

No plugin configuration needed — `@goodie-ts/cache` ships pre-scanned components and AOP config in `components.json`. The transformer auto-discovers them at build time.

## License

[MIT](https://github.com/GOOD-Code-ApS/goodie/blob/main/LICENSE)
npm package: @goodie-ts/cli
Description: CLI for goodie-ts compile-time dependency injection
Latest version: 2.1.0

# @goodie-ts/cli

CLI for [goodie-ts](https://github.com/GOOD-Code-ApS/goodie) compile-time dependency injection.

## Install

```bash
pnpm add -D @goodie-ts/cli
```

**Requires Node.js >= 22.13** (for recursive `fs.watch` on Linux).

## Overview

Runs the goodie-ts transformer from the command line. Use it as a standalone code generation step, or with `--watch` for continuous rebuilds during development. This is the recommended way to integrate goodie-ts into non-Vite projects.

## Usage

```bash
# One-shot generation
goodie generate

# With library scanning and config inlining
goodie generate --scan @goodie-ts --config-dir config

# Custom paths
goodie generate --tsconfig tsconfig.app.json --output src/generated/Context.ts

# Watch mode — rebuild on .ts changes
goodie generate --watch

# Watch a specific directory
goodie generate --watch --watch-dir src
```

## Options

| Flag | Default | Description |
|------|---------|-------------|
| `--tsconfig` | `tsconfig.json` | Path to tsconfig.json |
| `--output` | `src/__generated__/context.ts` | Output file path |
| `--scan` | — | Comma-separated npm scopes to scan for library components (e.g. `@goodie-ts,@acme`) |
| `--config-dir` | — | Directory containing JSON config files for build-time config inlining |
| `--watch` | `false` | Watch for changes and rebuild |
| `--watch-dir` | `.` (cwd) | Directory to watch (recursive) |

## Programmatic API

```typescript
import { runTransform, logOutcome, watchAndRebuild } from '@goodie-ts/cli';

// One-shot
const outcome = runTransform({
  tsConfigPath: './tsconfig.json',
  outputPath: './src/AppContext.generated.ts',
});
logOutcome(outcome);

// Watch
const handle = watchAndRebuild({
  tsConfigPath: './tsconfig.json',
  outputPath: './src/AppContext.generated.ts',
  watchDir: './src',
});
// handle.close() to stop
```

## Library Mode

When using `--mode library`, the CLI runs `transformLibrary()` to serialize component definitions to `components.json`. If the generation produces components but your `package.json` is missing the `"goodie": { "components": "..." }` field, the CLI will warn you to add it so consumers can discover your library's components.

## package.json integration

```json
{
  "scripts": {
    "generate": "goodie generate",
    "generate:watch": "goodie generate --watch"
  }
}
```

## License

[MIT](https://github.com/GOOD-Code-ApS/goodie/blob/main/LICENSE)
npm package: @goodie-ts/core
Description: Runtime dependency injection container for goodie-ts
Latest version: 2.0.0

# @goodie-ts/core

Runtime dependency injection container for [goodie-ts](https://github.com/GOOD-Code-ApS/goodie).

## Install

```bash
pnpm add @goodie-ts/core
```

## Overview

This package provides the runtime container that resolves pre-built `ComponentDefinition[]` arrays generated by [`@goodie-ts/transformer`](https://www.npmjs.com/package/@goodie-ts/transformer). No reflection, no scanning — just a fast topological sort and lazy instantiation.

## Key Exports

- **`ApplicationContext`** — DI container with `create()`, `get()`, `getAsync()`, `getAll()`, `close()`
- **`Goodie` / `GoodieBuilder`** — Bootstrap builder: `Goodie.build(definitions).start()`
- **`InjectionToken<T>`** — Typed token for interfaces, primitives, and generics
- **`ComponentDefinition<T>`** — Component descriptor with token, scope, factory, dependencies, and metadata
- **`buildInterceptorChain`** — AOP runtime: chains `MethodInterceptor` instances around a method
- **`wrapBeforeAdvice` / `wrapAfterAdvice`** — Adapt `BeforeAdvice` / `AfterAdvice` into `MethodInterceptor`
- **`MethodInterceptor`, `InvocationContext`** — AOP type contracts for interceptors
## Usage

```typescript
import { Goodie } from '@goodie-ts/core';
import { definitions } from './AppContext.generated.js';

const app = await Goodie.build(definitions).start();
const userService = app.context.get(UserService);

// When done:
await app.context.close();
```

## API

- `ApplicationContext.create(defs, options?)` — async factory, evaluates conditional rules (`@ConditionalOnProperty`, `@ConditionalOnEnv`, `@ConditionalOnMissingComponent`) at runtime, then topo-sorts and validates the dependency graph
- `ctx.get(token)` — synchronous lookup (throws for unresolved async components)
- `ctx.getAsync(token)` — always safe for async factories
- `ctx.getAll(token)` — returns all components registered under a token
- `ctx.close()` — tears down the context

All missing dependency errors include fuzzy matching suggestions ("Did you mean: UserService?"), `requiredBy` context, and hints when a component was excluded by a conditional rule.

## License

[MIT](https://github.com/GOOD-Code-ApS/goodie/blob/main/LICENSE)
npm package: @goodie-ts/decorators
Description: Stage 3 decorators for goodie-ts compile-time dependency injection
Latest version: 0.5.3
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @goodie-ts/decorators

Stage 3 decorators for [goodie-ts](https://github.com/GOOD-Code-ApS/goodie) compile-time dependency injection.

## Install

```bash
pnpm add @goodie-ts/decorators
```

## Overview

Provides the decorators you use to annotate your classes. These attach metadata via `Symbol.metadata` which the transformer reads at build time — they do **not** wire anything at runtime. No `reflect-metadata` required.

## Decorators

| Decorator | Target | Description |
|-----------|--------|-------------|
| `@Singleton()` | class | Singleton-scoped bean |
| `@Injectable()` | class | Prototype-scoped bean (new instance per lookup) |
| `@Named(name)` | class | Qualifier for disambiguation |
| `@Eager()` | class | Instantiate at startup instead of on first access |
| `@Module({ imports? })` | class | Groups `@Provides` factory methods |
| `@Provides()` | method | Marks a method in a `@Module` as a bean factory |
| `@Inject(qualifier?)` | accessor field | Field injection |
| `@Optional()` | accessor field | Marks a field as optional (resolves to `undefined` if missing) |
| `@Value(key, { default? })` | accessor field | Injects a config value by key |
| `@PostConstruct()` | method | Called after bean construction and field injection |
| `@PreDestroy()` | method | Called during `ApplicationContext.close()` |
| `@PostProcessor()` | class | Marks bean as a `BeanPostProcessor` |

## Usage

```typescript
import { Singleton, Inject, Optional } from '@goodie-ts/decorators';

@Singleton()
class UserService {
  @Inject() accessor userRepo!: UserRepository;
  @Optional() accessor logger?: Logger;

  getUsers() { return this.userRepo.findAll(); }
}
```

> **Note:** `@Inject` and `@Optional` require the `accessor` keyword — Stage 3 decorators do not support parameter decorators.

## License

[MIT](https://github.com/GOOD-Code-ApS/goodie/blob/main/LICENSE)
npm package: @goodie-ts/http
Description: Abstract HTTP layer for goodie-ts — controllers, route decorators, Request/Response types
Latest version: 2.0.0

# @goodie-ts/http

Abstract HTTP layer for [goodie-ts](https://github.com/GOOD-Code-ApS/goodie). Framework-agnostic controllers, route decorators, and typed request/response abstractions.

## Install

```bash
pnpm add @goodie-ts/http
```

## Overview

Provides the HTTP abstractions that adapters (like `@goodie-ts/hono`) build on. The transformer plugin scans `@Controller` classes at build time and generates route metadata — no runtime scanning.

`@Controller` implicitly registers the class as a singleton component — no need to add `@Singleton`.

## Decorators

| Decorator | Description |
|-----------|-------------|
| `@Controller(basePath)` | Marks a class as an HTTP controller with a base path |
| `@Get(path)` | HTTP GET route |
| `@Post(path)` | HTTP POST route |
| `@Put(path)` | HTTP PUT route |
| `@Delete(path)` | HTTP DELETE route |
| `@Patch(path)` | HTTP PATCH route |
| `@Status(code)` | Sets a default response status code on a route method |

## Usage

```typescript
import { Controller, Get, Post, Delete, Status, Response } from '@goodie-ts/http';

@Controller('/api/todos')
class TodoController {
  @Get('/')
  async getAll() {
    return this.todoService.findAll();
  }

  @Post('/')
  @Status(201)
  async create(body: CreateTodoRequest) {
    return this.todoService.create(body);
  }

  @Delete('/:id')
  async delete(id: string) {
    await this.todoService.delete(id);
    return Response.noContent();
  }
}
```

## Parameter Binding

Controller method parameters are bound automatically using implicit binding:

| Parameter type | Binding |
|---------------|---------|
| Path variable (name matches route param) | Path parameter |
| Primitive type | Query parameter |
| `HttpContext` | Per-request context (headers, cookies, query, params, URL) |
| Non-primitive type (POST/PUT/PATCH) | Request body |

## Response Types

| Return type | Behavior |
|------------|----------|
| `Response<T>` | Typed response with status, headers, and body |
| `undefined` / `null` | 204 No Content |
| Any other value | Serialized as JSON with 200 OK (or `@Status` code) |

`Response<T>` provides static factories: `ok()`, `created()`, `noContent()`, `status()`, and a fluent `.header()` method.

## Extension Points

| Abstract class | Purpose |
|---------------|---------|
| `ExceptionHandler` | Maps exceptions to HTTP responses |
| `HttpServerFilter` | ANT-style pattern-matched middleware |
| `BodyValidator` | Hook for body validation before controller invocation |
| `AbstractServerBootstrap` | Base for adapter-specific server startup |

## Peer Dependencies

- `@goodie-ts/core` >= 1.0.0

## License

[MIT](https://github.com/GOOD-Code-ApS/goodie/blob/main/LICENSE)
npm package: @goodie-ts/logging
Description: Logging support for goodie-ts — @Log decorator, MDC, and Logger interface
Latest version: 2.0.0

# @goodie-ts/logging

Method logging for [goodie-ts](https://github.com/GOOD-Code-ApS/goodie) — `@Log` decorator and `LoggerFactory` static API. Built on the AOP interceptor chain in `@goodie-ts/core`.

## Install

```bash
pnpm add @goodie-ts/logging
```

## Overview

Two approaches: **AOP** (`@Log`) for automatic entry/exit logging, and **imperative** (`LoggerFactory.getLogger()`) for manual logging. Both share the same backend and can be used together.

## AOP Logging

```typescript
import { Log } from '@goodie-ts/logging';
import { Singleton } from '@goodie-ts/core';

@Singleton()
class UserService {
  @Log()
  async findAll() { /* logged automatically */ }

  @Log({ level: 'debug', logArgs: true })
  async findById(id: string) { /* args included in log */ }
}
```

## Imperative Logging

```typescript
import { LoggerFactory } from '@goodie-ts/logging';
import { Singleton } from '@goodie-ts/core';

@Singleton()
class OrderService {
  private static readonly log = LoggerFactory.getLogger(OrderService);

  async create(order: Order) {
    OrderService.log.info('Creating order', { orderId: order.id });
    // ...
  }
}
```

## Custom Logger (pino, winston, etc.)

```typescript
import { LoggerFactory } from '@goodie-ts/logging';
import pino from 'pino';

const pinoLogger = pino();
LoggerFactory.setFactory((name) => ({
  debug: (msg, meta) => pinoLogger.child({ name }).debug(meta, msg),
  info: (msg, meta) => pinoLogger.child({ name }).info(meta, msg),
  warn: (msg, meta) => pinoLogger.child({ name }).warn(meta, msg),
  error: (msg, meta) => pinoLogger.child({ name }).error(meta, msg),
}));
```

## MDC (Mapped Diagnostic Context)

```typescript
import { MDC } from '@goodie-ts/logging';

// In middleware:
MDC.run(new Map([['traceId', crypto.randomUUID()]]), async () => {
  // All logs within this context include traceId
  await next();
});
```

## Setup

No plugin configuration needed — `@goodie-ts/logging` ships pre-scanned components and AOP config in `components.json`. The transformer auto-discovers them at build time.

## License

[MIT](https://github.com/GOOD-Code-ApS/goodie/blob/main/LICENSE)
npm package: @goodie-ts/security
Description: Authentication and authorization for goodie-ts
Latest version: 2.0.0

# @goodie-ts/security

Authentication and authorization for [goodie-ts](https://github.com/GOOD-Code-ApS/goodie).

## Install

```bash
pnpm add @goodie-ts/security
```

## Overview

Provides a two-layer security model: `SecurityFilter` authenticates requests via user-defined `SecurityProvider` implementations, and `@Secured` enforces role-based authorization via AOP.

## Decorators

| Decorator | Description |
|-----------|-------------|
| `@Secured()` | Require any authenticated user (class or method level) |
| `@Secured('admin')` | Require a specific role |
| `@Secured(['admin', 'editor'])` | Require any of the listed roles |
| `@Anonymous()` | Exempt a method from class-level `@Secured` |

## Usage

```typescript
import { Controller, Get } from '@goodie-ts/http';
import { Secured, Anonymous, SecurityProvider, SECURITY_PROVIDER, Principal } from '@goodie-ts/security';
import { Singleton } from '@goodie-ts/core';

// Implement your own authentication
@Singleton({ token: SECURITY_PROVIDER })
class JwtSecurityProvider extends SecurityProvider {
  async authenticate(context: HttpContext): Promise<Principal | undefined> {
    const token = context.headers.get('authorization')?.replace('Bearer ', '');
    if (!token) return undefined;
    return verifyToken(token); // { name, roles, attributes }
  }
}

@Controller('/api/admin')
@Secured('admin')
class AdminController {
  @Get('/dashboard')
  async dashboard() {
    return { stats: '...' };
  }

  @Get('/public')
  @Anonymous()
  async publicEndpoint() {
    return { info: 'visible to all' };
  }
}
```

## Security Context

Access the authenticated principal anywhere via `SecurityContext`:

```typescript
import { SecurityContext } from '@goodie-ts/security';

const principal = SecurityContext.current(); // Principal | undefined
```

## Setup

No plugin configuration needed — `@goodie-ts/security` ships pre-scanned components and a transformer plugin in `components.json`. The transformer auto-discovers them at build time.

## Peer Dependencies

- `@goodie-ts/core` >= 1.0.0
- `@goodie-ts/http` >= 1.0.0

## License

[MIT](https://github.com/GOOD-Code-ApS/goodie/blob/main/LICENSE)
npm package: @goodie-ts/vite-plugin
Description: Vite plugin for goodie-ts compile-time dependency injection
Latest version: 2.0.0

# @goodie-ts/vite-plugin

Vite plugin for [goodie-ts](https://github.com/GOOD-Code-ApS/goodie) compile-time dependency injection.

## Install

```bash
pnpm add -D @goodie-ts/vite-plugin
```

## Overview

Runs the goodie-ts transformer automatically during Vite builds and re-runs on HMR when `.ts` files change. This is the recommended way to integrate goodie-ts into your project.

## Usage

```typescript
// vite.config.ts
import { defineConfig } from 'vite';
import { diPlugin } from '@goodie-ts/vite-plugin';

export default defineConfig({
  plugins: [diPlugin()],
});
```

## Options

```typescript
diPlugin({
  tsConfigPath: 'tsconfig.json',              // default
  outputPath: 'src/AppContext.generated.ts',   // default
  include: ['src/**/*.ts'],                    // source file globs
  debounceMs: 100,                             // HMR rebuild debounce
  configDir: 'config',                         // JSON config file directory
});
```

### `configDir`

When set, the generated code loads JSON config files (`default.json`, `{NODE_ENV}.json`) from this directory at startup. Config values are flattened to dot-separated keys and merged with `process.env`. See `@goodie-ts/core` for `loadConfigFiles()` details.

## Behavior

- **`buildStart`** — full transform, fails the build on errors
- **`handleHotUpdate`** — debounced rebuild on `.ts` changes, logs errors without crashing (better DX in dev)
- The generated output file is excluded from HMR triggers to prevent infinite rebuild loops

## License

[MIT](https://github.com/GOOD-Code-ApS/goodie/blob/main/LICENSE)