open-index/open-npm huggingface dataset:
npm package: @spektr-ai/client-sdk
Description: spektr Public Client SDK
Author: Ciprian Florescu
Latest version: 1.3.0

# spektr - public client sdk

### evaluateLogicalField(segment, output, context)

- If all rules are `true` and output is show => returns `true`
- If all rules are `true` and output is hide => return `false`
- If not all rules are `true` and output is show => return false
- If not all rules are `true` and output is hide => return `true`

```typescript
import { spektrSdk } from "@spektr-ai/client-sdk";

// Segment from conditional field
const segment = {
    title: "Conditions",
    weight: 100,
    groups: [
      {
        id: "1",
        title: "Rule #1",
        score: 100,
        rule: {
          operator: "contains",
          type: "country",
          groupRoot: true,
          left: "country_residence",
          right: ["DK", "FR"],
        },
      },
    ],
    id: "67b3154320e53146839a6e74",
  }
};

// Context data for evaluation
const context = {
  phone: "1234567890",
  country_residence: "DK",
};

// Evaluate if the conditional field should be shown
const shouldShow = spektrSdk.evaluateConditionalField(
  segment,
  'show',
  context
);
console.log(shouldShow); // true (field should be displayed)

const shouldHide = spektrSdk.evaluateConditionalField(
  segment,
  'hide',
  context
);
console.log(shouldHide); // false (field should be hidden)
```
npm package: @speleotica/frcs2breakout
Description: convert frcs cave survey data to breakout format
Author: Andy Edwards
Latest version: 2.0.0

# @speleotica/frcs2breakout

[![CircleCI](https://circleci.com/gh/speleotica/frcs2breakout.svg?style=svg)](https://circleci.com/gh/speleotica/frcs2breakout)
[![Coverage Status](https://codecov.io/gh/speleotica/frcs2breakout/branch/master/graph/badge.svg)](https://codecov.io/gh/speleotica/frcs2breakout)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![npm version](https://badge.fury.io/js/%40speleotica%2Ffrcs2breakout.svg)](https://badge.fury.io/js/%40speleotica%2Ffrcs2breakout)

Converts data from [FRCS format](https://github.com/speleotica/frcsdata) to [Breakout](https://github.com/jedwards1211/breakout).

# API

```ts
import {
  FrcsPlotFile,
  FrcsSurveyFile,
  FrcsTripSummaryFile,
} from '@speleotica/frcsdata'
import { Length, UnitizedNumber } from '@speleotica/unitized'

type CaveInput = {
  /**
   * Parsed survey file data
   */
  survey: FrcsSurveyFile
  /**
   * Parsed plot file data
   */
  plot?: FrcsPlotFile
  /**
   * Parsed trip summaries file data
   */
  summaries?: FrcsTripSummaryFile
  /**
   * If given, will add survey notes filenames to the output trips
   */
  surveyNotesFilePrefix?: string
  /**
   * The UTM zone of the plot.  If omitted, fixed stations won't be output
   */
  utmZone?: number
  /**
   * Offset to apply to fixed stations from the plot
   */
  zeroReference?: {
    northing: UnitizedNumber<Length>
    easting: UnitizedNumber<Length>
    elevation: UnitizedNumber<Length>
  }
}

export function convertToBreakout(data: Record<string, CaveInput>): MetacaveData
```
npm package: @speleotica/frcs2compass
Description: converts frcsdata to compass data
Author: Andy Edwards
Latest version: 6.0.0

# @speleotica/frcs2compass

[![CircleCI](https://circleci.com/gh/speleotica/frcs2compass.svg?style=svg)](https://circleci.com/gh/speleotica/frcs2compass)
[![Coverage Status](https://codecov.io/gh/speleotica/frcs2compass/branch/master/graph/badge.svg)](https://codecov.io/gh/speleotica/frcs2compass)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![npm version](https://badge.fury.io/js/%40speleotica%2Ffrcs2compass.svg)](https://badge.fury.io/js/%40speleotica%2Ffrcs2compass)

converts frcsdata to compass data

# API

## `convertToDat({ survey: FrcsSurveyFile, summaries?: FrcsTripSummaryFile }): CompassDatFile`

```js
import { convertToDat } from '@speleotica/frcs2compass'
```
npm package: @speleotica/frcs2walls
Description: convert cave survey data from frcs to walls format
Author: Andy Edwards
Latest version: 2.0.0

# @speleotica/frcs2walls

[![CircleCI](https://circleci.com/gh/speleotica/frcs2walls.svg?style=svg)](https://circleci.com/gh/speleotica/frcs2walls)
[![Coverage Status](https://codecov.io/gh/speleotica/frcs2walls/branch/master/graph/badge.svg)](https://codecov.io/gh/speleotica/frcs2walls)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![npm version](https://badge.fury.io/js/%40speleotica%2Ffrcs2walls.svg)](https://badge.fury.io/js/%40speleotica%2Ffrcs2walls)

converts cave survey data in FRCS format to Walls format

# API

## `convertToWalls({ title: string, caves: InputCave[] }): WallsWpjFile`

```js
import { convertToWalls } from '@speleotica/frcs2walls'
```
npm package: @speleotica/frcsdata
Description: parser for Chip Hopper's survey data format used in Fisher Ridge Cave System
Author: Andy Edwards
Latest version: 5.1.1

# @speleotica/frcsdata

[![CircleCI](https://circleci.com/gh/speleotica/frcsdata.svg?style=svg)](https://circleci.com/gh/speleotica/frcsdata)
[![Coverage Status](https://codecov.io/gh/speleotica/frcsdata/branch/master/graph/badge.svg)](https://codecov.io/gh/speleotica/frcsdata)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![npm version](https://badge.fury.io/js/%40speleotica%2Ffrcsdata.svg)](https://badge.fury.io/js/%40speleotica%2Ffrcsdata)

Parser for Chip Hopper's survey data format used in Fisher Ridge Cave System

# Parse function variants

#### AsyncIterable: `parseFrcsXFile(file: string, lines: AsyncIterable<string>): Promise<FrcsXFile>`

These can be imported from the package root (`@speleotica/frcsdata`). The other variants wrap these.

#### String: `parseFrcsXFile(file: string, data: string): Promise<FrcsXFile>`

These can be imported from `@speleotica/frcsdata/string`.

#### Node: `parseFrcsXFile(file: string): Promise<FrcsXFile>`

These can be imported from `@speleotica/frcsdata/node` and read the given file from disk. They require Node >=12.

# File types

I'm not going to document this much right now but there are three types of files:

## Survey Files

These files typically look like `cdata.fr` where the extension is actually an abbrevation of the cave name.

```js
import { parseFrcsSurveyFile } from '@speleotica/frcsdata'
import { parseFrcsSurveyFile } from '@speleotica/frcsdata/node'
import { parseFrcsSurveyFile } from '@speleotica/frcsdata/string'
```

These functions return a `Promise` that resolves to an [`FrcsSurveyFile`](/src/FrcsSurveyFile.ts).

## Trip Summary Files

These files typically look like `STAT_sum.txt`.

```js
import { parseFrcsTripSummaryFile } from '@speleotica/frcsdata'
import { parseFrcsTripSummaryFile } from '@speleotica/frcsdata/node'
import { parseFrcsTripSummaryFile } from '@speleotica/frcsdata/string'
```

These functions return a `Promise` that resolves to an [`FrcsTripSummaryFile`](/src/FrcsTripSummaryFile.ts).

## Plot Files

These files typically look like `FOR008.fr` where the extension is actually an abbrevation of the cave name.

```js
import { parseFrcsPlotFile } from '@speleotica/frcsdata'
import { parseFrcsPlotFile } from '@speleotica/frcsdata/node'
import { parseFrcsPlotFile } from '@speleotica/frcsdata/string'
```

These functions return a `Promise` that resolves to an [`FrcsPlotFile`](/src/FrcsPlotFile.ts).
npm package: @speleotica/utm
Description: utils for working with UTM coordinates
Author: Andy Edwards
Latest version: 1.0.0

# @speleotica/utm

[![CircleCI](https://circleci.com/gh/speleotica/utm.svg?style=svg)](https://circleci.com/gh/speleotica/utm)
[![Coverage Status](https://codecov.io/gh/speleotica/utm/branch/master/graph/badge.svg)](https://codecov.io/gh/speleotica/utm)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![npm version](https://badge.fury.io/js/%40speleotica%2Futm.svg)](https://badge.fury.io/js/%40speleotica%2Futm)

A few utilities for working with Univeral Transverse Mercator coordinates

### `getUTMZone(longitude: number latitude: number): number`

Returns the UTM zone containing the given `longitude` and `latitude` (in degrees)

### `getCentralMeridian(utmZone: number): number`

Returns the longitude of the central meridian of the given `utmZone` (in degrees)
npm package: @speleotica/walls
Description: Walls Cave Survey data I/O
Author: Andy Edwards
Latest version: 1.4.0

# @speleotica/walls

[![CircleCI](https://circleci.com/gh/speleotica/walls.svg?style=svg)](https://circleci.com/gh/speleotica/walls)
[![Coverage Status](https://codecov.io/gh/speleotica/walls/branch/master/graph/badge.svg)](https://codecov.io/gh/speleotica/walls)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![npm version](https://badge.fury.io/js/%40speleotica%2Fwalls.svg)](https://badge.fury.io/js/%40speleotica%2Fwalls)

Types and I/O methods for Walls Cave Survey data file formats

I'm not going to go to much trouble to document it here unless people ask,
the types are pretty self-explanatory:

## [`WallsSrvFile`](/src/srv/WallsSrvFile.ts)

Types and factory functions for AST nodes of `.srv` (survey) files

## [`formatWallsSrvFile`](/src/dat/formatWallsSrvFile.ts)

```js
import { formatWallsSrvFile } from '@speleotica/walls/srv'
```

It takes a `WallsSrvFile`, and optionally an options hash with a `write` function.
If you don't provide `write`, it will return the output as a `string`. Otherwise,
it will call `write` with chunks of data, so you can pass `write` connected to a
file write stream.

## [`WallsWpjFile`](/src/wpj/WallsWpjFile.ts)

Types and factory functions for AST nodes of `.wpj` (project) files

## [`formatWallsWpjFile`](/src/dat/formatWallsWpjFile.ts)

```js
import { formatWallsWpjFile } from '@speleotica/walls/wpj'
```

It takes a `WallsWpjFile`, and optionally an options hash with a `write` function.
If you don't provide `write`, it will return the output as a `string`. Otherwise,
it will call `write` with chunks of data, so you can pass `write` connected to a
file write stream.

## [`writeWallsProject`](/src/node/writeWallsProject.ts)

```js
import { writeWallsProject } from '@speleotica/walls/node'
```

Writes the `.wpj` file and `.srv` files of a project to disk.

### Arguments

#### `wpjPath` (`string`, **required**)

The path to write the project file to

#### `wpj` (`WallsProjectFile`, **required**)

The project file AST. `.srv` files will only be written for `WallsProjectSurvey` nodes with a `content` property.
npm package: @spellbookx/lefthook
Description: Shared Lefthook configurations for common tools (ESLint, Prettier, TypeScript, Vitest, Jest) and multiple package managers (npx, bun, yarn dlx, pnpm dlx).
Author: spellbookx
Latest version: 0.1.0

# @spellbookx/lefthook

Shared Lefthook configurations for common tools and package managers.

## Usage

In your `lefthook.yml`:

```yaml
remote:
  git:
    url: https://github.com/spellbookx/lefthook
    ref: main
  configs:
    - @commit-msg/npx-commitlint.yml
    - @pre-commit/npx-eslint-prettier-tsc.yml
```

### Available Configurations

Replace `npx` with your preferred runner: `npx`, `bunx`, `yarndlx`, `pnpmdlx`.

#### Commit Message
- `@commit-msg/{runner}-commitlint.yml`: Lints commit messages using `commitlint`.

#### Pre-commit
- `@pre-commit/{runner}-eslint.yml`: Runs `eslint --fix`.
- `@pre-commit/{runner}-prettier.yml`: Runs `prettier --write`.
- `@pre-commit/{runner}-eslint-prettier.yml`: Runs both `eslint` and `prettier`.
- `@pre-commit/{runner}-tsc.yml`: Runs `tsc --noEmit`.
- `@pre-commit/{runner}-eslint-prettier-tsc.yml`: Runs all three.

#### Pre-push
- `@pre-push/{runner}-vitest.yml`: Runs `vitest run`.
- `@pre-push/{runner}-jest.yml`: Runs `jest`.

## Runners
- `npx`: Node.js package executor
- `bunx`: Bun's `bun x`
- `yarndlx`: Yarn's `yarn dlx`
- `pnpmdlx`: pnpm's `pnpm dlx`
npm package: @spellcodes/ngrx-compose
Description: Compose your NGRX dispatches and call them all at once
Author: Emanuele Tuttolani
Latest version: 0.1.0

# NGRX Compose

## Quick Start

- `npm i @spellcodes/ngrx-compose`
- Include `NgrxComposeModule` in your module
- Create `store/containers/my-container.container.ts`
- Compose your first container

  ```typescript
  @Injectable({ providedIn: 'root' })
  export class EmployeeContainer {
    employeeListContainer:       ContainerShip<EmployeeListDTO>;
    employeeDetailsContainer:    ContainerShip<EmployeeListDTO>;
    employeeOfTheMonthContainer: ContainerShip<EmployeeOfTheMonthDTO>;

    constructor(
      private readonly ngrxComposeService: NgrxComposeService,
    ) {
      this.employeeListContainer = ({ company }) =>
        this.ngrxComposeService.createContainer(loadEmployeeList({ company }));

      this.employeeDetailsContainer = ({ company }) =>
        this.ngrxComposeService.createContainer(
          loadEmployeeDetails(),
          [
            this.employeeListContainer({ company }),
          ],
        );

      this.employeeOfTheMonthContainer = ({ userId, company }) =>
        this.ngrxComposeService.createContainer(
          loadEmployeeOfTheMonth({ userId }),
          [
            this.employeeDetailsContainer({ company }),
          ]
        );
    }
  }
  ```

- Start using it

  ```typescript
  export class MyComponent implements OnInit {

    constructor(
      private readonly ngrxCmposeService: NgrxComposeService,
      private readonly employeeContainer: EmployeeContainer,
    ) {}

    ngOnInit(): void {
      this.ngrxCmposeService.dispatch(
        this.employeeContainer.employeeOfTheMonth({
          userId: '1337',
          company: 'E Corp'
        }),
      );
    }

  }
  ```

## Usage and API

TODO
npm package: @spellcraft/ui
Description: Static GPT Tailwind generator for Next.js.
Latest version: 0.2.0

<center>
  <h1>UI Spells</h1>

  <b>Static GPT Tailwind generator for Next.js.</b>

  Under development.

  <hr>
</center>

Use GPT-4 to generate Tailwind styles from natural language descriptions.

Generated styles are saved to a JSON cache and injected into the application at
build-time: No production fetch requests, no FOUC.

### Demo

Play with the `useSpell()` hook in a pre-configured Next.js project on [CodeSandbox](https://codesandbox.io/p/sandbox/ui-6uofyc?file=%2FREADME.md%3A10%2C17).

### Usage

<sub>**IMPORTANT:** _You must set the `getStaticProps` export in order to load
your styles from the JSON cache at build-time._</sub>

After following the **Setup** instructions below, you can generate styles using
the `useSpell()` hook, like so:

```tsx
// src/pages/index.tsx
import { useSpell } from "@spellcraft/ui/client";
import { withStylesCache } from "@spellcraft/ui/server";

export default function Home () {
  const styles = useSpell("purple text in small font");

  return (
    <main>
      <span className={styles}>
        hello world
      </span>
    </main>
  );
}

export const getStaticProps = withStylesCache();
```

<sub>**Note:** In production, the hook will not cause a re-render: It is only
used to fetch new styles and add them to the cache in dev mode.</sub>

### Setup

First, ensure you create a `.env` file with your OpenAI API key:

```sh
# .env
OPENAI_API_KEY="YOUR-KEY-HERE"
```

You'll need to configure the following pages to use UI Spells:

1. `pages/_document.tsx`
2. `pages/_app.tsx`
3. `pages/api/spellcraft.ts`

And for every page you use UI Spells, you'll need to ensure `getStaticProps`
exists and is wrapped:

```ts
export const getStaticProps = withStylesCache();
```

**We'll go over how to set this up below.**

---

#### 1. Wrap `_document.tsx` with `withDocument()`:

This adds support for SSR-compatible dynamic Tailwind with `@twind/next`. 

```tsx
// pages/_document.tsx

import { withDocument } from "@spellcraft/ui/document";
export default withDocument();
```

#### 2. Wrap `_app.tsx` with `withApp()`:

This wraps your app with a cache provider and utilities from `@twind/next`.

```tsx
// pages/app.tsx

import { StrictMode } from "react";
import { type AppProps } from "next/app";

import { withApp } from "@spellcraft/ui/client";

export const MyApp = ({ Component, pageProps }: AppProps) => {
  return (
    <StrictMode>
      <Component {...pageProps} />
    </StrictMode>
  );
};

export default withApp(MyApp);
```

#### 3. Add API route to `pages/api/spellcraft.ts`:

This endpoint is used only in development mode to update your styles cache.

When you publish to production, this endpoint will not run, and the styles will
be loaded from the static JSON file at build-time only.

```ts
// pages/api/spellcraft.ts

import { StylesAPI } from "@spellcraft/ui/server";
export default StylesAPI;
```

That's it! 

With `pages/_document.tsx`, `pages/_app.tsx`, and `pages/api/spellcraft.ts`
configured, you're ready to use the `useSpell()` hook.