open-index/open-npm huggingface dataset:
npm package: @grest-ts/common
Description: Common utility functions and types shared across all GG packages
Latest version: 0.0.21

<!-- GREST-TS-BANNER-START -->
> Part of the [grest-ts](https://github.com/grest-ts/grest-ts) framework.
> [Documentation](https://github.com/grest-ts/grest-ts#readme) | [All packages](https://github.com/grest-ts/grest-ts#package-reference)
<!-- GREST-TS-BANNER-END -->

# @grest-ts/common

Common utility functions and types shared across all GG packages.

## Purpose

This package contains utility functions and types that are used across multiple packages in the Grest framework. By consolidating them here, we:
- Eliminate code duplication
- Ensure consistency across packages
- Make maintenance easier
- Reduce package dependencies

## Utilities

### `deepFreeze<T>(obj: T): T`

Recursively freezes an object and all its nested properties, making it immutable.

```typescript
import { deepFreeze } from '@grest-ts/common';

const config = deepFreeze({
  name: 'app',
  settings: {
    debug: true
  }
});

// This will throw an error in strict mode
config.settings.debug = false;
```

### `withTimeout<T>(promise: Promise<T>, timeoutMs: number, errorMessage: string): Promise<T>`

Wraps a promise with a timeout. If the promise doesn't resolve/reject within the specified timeout, the returned promise will reject with an error.

```typescript
import { withTimeout } from '@grest-ts/common';

const result = await withTimeout(
  fetch('https://api.example.com'),
  5000,
  'API request timed out'
);
```

## Types

### `DeepPartial<T>`

Recursively makes all properties of an object optional. Useful for partial matching in tests and validation.

```typescript
import { DeepPartial } from '@grest-ts/common';

interface User {
  id: string;
  profile: {
    name: string;
    email: string;
  };
}

// All properties are optional
const partialUser: DeepPartial<User> = {
  profile: {
    name: 'Alice'
    // email is optional
  }
};
```

## Adding New Utilities

When adding new utilities to this package:

1. Create a new file in `src/` for the utility
2. Export it from `src/index.ts`
3. Add JSDoc comments explaining usage
4. Update this README with examples
5. Ensure the utility is truly reusable across multiple packages
npm package: @grest-ts/file
Description: File abstraction for Grest framework
Latest version: 0.0.14
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

<!-- GREST-TS-BANNER-START -->
> Part of the [grest-ts](https://github.com/grest-ts/grest-ts) framework.
> [Documentation](https://github.com/grest-ts/grest-ts#readme) | [All packages](https://github.com/grest-ts/grest-ts#package-reference)
<!-- GREST-TS-BANNER-END -->
npm package: @grest-ts/testkit-runtime
Description: Component testing library runtime code. 
Latest version: 0.0.21

<!-- GREST-TS-BANNER-START -->
> Part of the [grest-ts](https://github.com/grest-ts/grest-ts) framework.
> [Documentation](https://github.com/grest-ts/grest-ts#readme) | [All packages](https://github.com/grest-ts/grest-ts#package-reference)
<!-- GREST-TS-BANNER-END -->

# @grest-ts/testkit-runtime

Thin runtime component of `@grest-ts/testkit`. Provides the `@mockable` and `@testable` decorators that you add to your service classes. This package is included in production builds but has **zero effect at runtime** — decorators only activate when a test context is present.

You typically don't interact with this package directly beyond applying the decorators.

## `@mockable`

Marks a class so its async methods can be mocked or spied on during tests.

```typescript
import {mockable} from "@grest-ts/testkit-runtime";

@mockable
export class WeatherService {
    async getWeather(city: string): Promise<WeatherData> {
        // real implementation
    }
}
```

In production, calls pass through unchanged. During tests, `@grest-ts/testkit` can intercept calls via `mockOf()` and `spyOn()`.

## `@testable`

Marks a class so tests can invoke its methods directly via `callOn()`, without going through the full API layer.

```typescript
import {mockable, testable} from "@grest-ts/testkit-runtime";

@testable
@mockable
export class WeatherService {
    async getWeather(city: string): Promise<WeatherData> { /* ... */ }
}
```

Instances are automatically registered in the service locator on construction, making them accessible to the test runner.
npm package: @grest-ts/testkit-vitest
Description: Component testing library integration for vitest
Latest version: 0.0.21

<!-- GREST-TS-BANNER-START -->
> Part of the [grest-ts](https://github.com/grest-ts/grest-ts) framework.
> [Documentation](https://github.com/grest-ts/grest-ts#readme) | [All packages](https://github.com/grest-ts/grest-ts#package-reference)
<!-- GREST-TS-BANNER-END -->

# @grest-ts/testkit-vitest

Vitest integration for `@grest-ts/testkit`. This package is configured as a global setup script — it wraps Vitest's `describe`, `test`, `beforeAll`, `afterEach`, and other lifecycle hooks so that the testkit infrastructure (service discovery, IPC, test runner) is automatically initialized and torn down for each test suite.

You don't use this package directly. It is set up by `@grest-ts/testkit` and works behind the scenes.

## What it does

- Wraps `describe`/`test`/`it` globally to manage testkit scopes and context
- Starts an IPC server and local discovery for each top-level `describe` block
- Handles `beforeAll`/`afterEach`/`afterAll` cleanup automatically
- Supports nested `describe` blocks with proper scope branching
- Exports a `./globalSetup` entry point for Vitest configuration
npm package: @grest-ts/trace
Description: Tracing support for GGContext
Latest version: 0.0.21

<!-- GREST-TS-BANNER-START -->
> Part of the [grest-ts](https://github.com/grest-ts/grest-ts) framework.
> [Documentation](https://github.com/grest-ts/grest-ts#readme) | [All packages](https://github.com/grest-ts/grest-ts#package-reference)
<!-- GREST-TS-BANNER-END -->
npm package: @grest-ts/trace-http
Description: Tracing support for GGContext
Latest version: 0.0.21

<!-- GREST-TS-BANNER-START -->
> Part of the [grest-ts](https://github.com/grest-ts/grest-ts) framework.
> [Documentation](https://github.com/grest-ts/grest-ts#readme) | [All packages](https://github.com/grest-ts/grest-ts#package-reference)
<!-- GREST-TS-BANNER-END -->
npm package: @gretzky/darksky-api
Description: Wrapper around the [Dark Sky API](https://darksky.net/dev/docs).
Author: gretzky
Latest version: 0.2.0

# darksky-api

Wrapper around the [Dark Sky API](https://darksky.net/dev/docs).

## Usage

```bash
yarn add @gretzky/darksky-api
// or
npm install --save @gretzky/darksky-api
```

### Methods

This is a single method wrapper around the API where you pass in the appropriate params. The only required keys are `key` (your Dark Sky API key), `latitude`, and `longitude`, and Dark Sky will return the current forecast for the location provided. You can pass a UNIX epoch time string to the `time` param to get the forecast for a specific time at a given location.

See the [API docs](https://darksky.net/dev/docs) for request params.

```ts
import darkskyApi from "darksky-api";

const key = "yoursecretkey";

// get the latest forecast for a given latitude/longitude
const currentForecast = darkskyApi.getForecast({
  key,
  latitude: 43.65806,
  longitude: -70.24417,
  params: {
    exclude: ["minutely", "daily", "hourly"], // returns 'currently', 'alerts', 'flags'
    units: "ca",
  },
});

// or, get the forecast for a given time at a given latitude/longitude
const tomorrowAfternoonForecast = darkskyApi.getForecast({
  key,
  latitude,
  longitude,
  time: 1599053400, // UNIX epoch timestamp. Date object may work
});
```