open-index/open-npm huggingface dataset:
npm package: @socketsupply/tonic
Description: A component framework.
Author: socketsupply
Latest version: 15.1.2

![tonic](https://raw.githubusercontent.com/socketsupply/tonic/master/readme-tonic.png)

<p align="center">
  https://tonicframework.dev
</p>
<br/>
<br/>
Tonic is a low profile component framework for the web. It's one file, less than 3kb gzipped and has no dependencies. It's designed to be used with modern Javascript and is compatible with all modern browsers and built on top of the Web Components.

## Installation

```sh
npm install @socketsupply/tonic
```

## Usage

```js
import Tonic from '@socketsupply/tonic'

class MyGreeting extends Tonic {
  render () {
    return this.html`<div>Hello, World.</div>`
  }
}

Tonic.add(MyGreeting, 'my-greeting')
```

After adding your Javascript to your HTML, you can use your component anywhere.

```html
<html>
  <head>
    <script src="my-greeting.js"></script>
  </head>
  <body>
    <my-greeting></my-greeting>
  </body>
</html>
```

# Useful links
- [Tonic components](https://github.com/socketsupply/components)
- [Migration from the early versions of Tonic](./MIGRATION.md)
- [API](./API.md)
- [Troubleshooting](./HELP.md)

Copyright (c) 2023 Socket Supply Co.

MIT License
npm package: @sockety/buffers
Description: Create ultra fast functions (faster than native) for reading continuous buffers
Author: Dawid Rusnak
Latest version: 1.0.6

# @sockety/buffers - fast continuous buffers reader and writer

## Description

TODO

## Installation

You may install this package from [NPM repository](https://www.npmjs.com/package/@sockety/buffers), via `npm install @sockety/buffers` or `yarn add @sockety/buffers`.

## Usage

TODO
npm package: @sockety/uuid
Description: Fast UUID generator, with purpose of transferring through buffers and lazy access
Author: Dawid Rusnak
Latest version: 1.0.3

# @sockety/uuid - fast UUID v4 as buffers and strings

## Description

This package is meant to handle UUIDs in the [Sockety](https://www.npmjs.com/package/sockety) library. It's ultra-fast, and aims into simple and fast integration with buffers and strings.

## Installation

You may install this package from [NPM repository](https://www.npmjs.com/package/@sockety/uuid), via `npm install @sockety/uuid` or `yarn add @sockety/uuid`.

## Usage

```js
import { generateUuid, isValidUuidString, isValidUuidBuffer, readUuidToString, readUuid } from '@sockety/uuid';

// Generate new UUID object
const uuidInstance = generateUuid();

// Build string representation
const uuidString = uuidInstance.toString();

// Write it to buffer
const buffer = Buffer.alloc(16);
uuidInstance.write(buffer);

// You may write it in the middle of the buffer too:
// const buffer = Buffer.alloc(36);
// uuidInstance.write(buffer, 10); (10,26)

// Read it from buffer
const uuidInstanceFromBuffer = readUuid(buffer);
const uuidStringFromBuffer = readUuidToString(buffer);

// You may read it from middle of the buffer too:
// const uuidInstanceFromBuffer = readUuid(buffer, 10);
// const uuidStringFromBuffer = readUuidToString(buffer, 10);

// Validate the UUID
isValidUuidString(uuidString); // true
isValidUuidString(uuidStringFromBuffer); // true
isValidUuidBuffer(buffer); // true

// You may validate the UUID in the middle of the buffer too:
// isValidUuidString(uuidStringFromBuffer, 10);
```

## Alternatives

Most of the time you should be fine with native [`crypto.randomUUID`](https://nodejs.org/api/crypto.html#cryptorandomuuidoptions) in Node.js.

Unless you're not working with buffers, it may be not worth to use `@sockety/uuid` as another extra dependency.

This `@sockety/uuid` package will use only 16 bytes to store UUID, as it's using its binary representation.
Using `buffer.write(crypto.randomUUID())` will use 36 bytes, as it will store string representation in the buffer.

## Benchmarks

Benchmarks ran internally, to compare the difference.

Generally, it has similar speed for generating UUIDs as `crypto.randomUUID`, but is much faster with handling buffers.
Additionally, it's using fewer bytes in the buffer then.

| Description                        | `crypto.randomUUID`   | `@sockety/uuid`                  |
|------------------------------------|-----------------------|----------------------------------|
| Generate UUID string               | `13,787,701 ops/s`    | `14,285,222 ops/s` (0.1x faster) |
| Generate UUID buffer               | `2,002,230 ops/s`     | `10,485,028 ops/s` (5.2x faster) |
| Generate UUID to existing buffer   | `2,325,965 ops/s`     | `20,427,191 ops/s` (8.7x faster) |
| Read UUID string from buffer       | `8,173,617 ops/s`     | `26,221,765 ops/s` (3.2x faster) |
| Read UUID string from buffer slice | `5,171,186 ops/s`     | `29,517,143 ops/s` (5.7x faster) |
npm package: @sockudo/client
Description: Sockudo JavaScript client full port on Bun + Oxc + Vite(Rolldown)
Latest version: 1.1.0

# @sockudo/client

Modernized `pusher-js`-compatible client for Sockudo.

This package keeps the familiar Pusher client API while shipping modern runtime targets:
- Web
- Node.js
- Web Worker
- React Native

## Install

```bash
npm install @sockudo/client
```

or

```bash
bun add @sockudo/client
```

## Runtime Imports

Use the entrypoint that matches your runtime:

```ts
// Browser / default
import Pusher from "@sockudo/client";

// Filter helper entrypoint
import { Filter } from "@sockudo/client/filter";

// With encryption
import PusherEncrypted from "@sockudo/client/with-encryption";

// Worker
import WorkerPusher from "@sockudo/client/worker";

// Worker with encryption
import WorkerEncrypted from "@sockudo/client/worker/with-encryption";

// React Native
import ReactNativePusher from "@sockudo/client/react-native";
```

The package also exposes runtime-aware fields in `package.json` (`main`, `browser`, `react-native`, `exports`) so bundlers can resolve correctly.

## Quick Start

```ts
import Pusher from "@sockudo/client";

const pusher = new Pusher("app-key", {
  wsHost: "your-sockudo-host",
  wsPort: 6001,
  wssPort: 6001,
  forceTLS: true,
  enabledTransports: ["ws", "wss"],
});

const channel = pusher.subscribe("public-updates");
channel.bind("message", (payload: unknown) => {
  console.log(payload);
});
```

## Features

- Pusher-compatible client surface
- WebSocket-first connection strategy
- Fetch-first auth/timeline integrations
- ESM-first package outputs
- Runtime-specific builds for web/node/worker/react-native

## React Native Notes

- React Native build output is `dist/react-native/pusher.js`
- Package exposes both:
  - root `react-native` resolution
  - explicit `@sockudo/client/react-native` subpath
- `@react-native-community/netinfo` is an optional peer dependency

## Development

### Requirements

- Bun `>=1.0.0`
- Node.js `>=22`

### Commands

```bash
# typecheck + lint + tests
bun run check

# typecheck only
bun run typecheck

# lint
bun run lint

# format
bun run format
bun run format:check

# tests
bun test
bun run test:watch

# builds
bun run build
bun run build:all
```

## Release Process

This repo uses GitHub Actions for CI/CD and changelogs.

### CI

- Workflow: `.github/workflows/ci.yml`
- Runs on push to `main` and pull requests
- Executes:
  - `bun run check`
  - `bun run build:all`

### Changelog + Versioning

- Workflow: `.github/workflows/release-please.yml`
- Uses Release Please to open/update a Release PR
- Generates and updates:
  - `CHANGELOG.md`
  - `package.json` version
  - git tag on release merge

### npm Publish

- Workflow: `.github/workflows/publish-npm.yml`
- Triggers on:
  - `release.published`
  - manual dispatch
- Publishes `@sockudo/client` with npm provenance

Required repo secret:
- `NPM_TOKEN`

## Repository

- GitHub: `https://github.com/sockudo/sockudo-js`
- npm: `https://www.npmjs.com/package/@sockudo/client`
npm package: @sockudo/ws-darwin-x64
Description: Ultra-fast WebSocket library for Node.js - 17% faster than alternatives, matching uWebSockets performance
Author: Diaconu Radu-Mihai
Latest version: 1.6.10

# `@sockudo/ws-darwin-x64`

This is the **x86_64-apple-darwin** binary for `@sockudo/ws`
npm package: @sockudo/ws-linux-arm64-gnu
Description: Ultra-fast WebSocket library for Node.js - 17% faster than alternatives, matching uWebSockets performance
Author: Diaconu Radu-Mihai
Latest version: 1.6.10

# `@sockudo/ws-linux-arm64-gnu`

This is the **aarch64-unknown-linux-gnu** binary for `@sockudo/ws`
npm package: @sockudo/ws-linux-x64-gnu
Description: Ultra-fast WebSocket library for Node.js - 17% faster than alternatives, matching uWebSockets performance
Author: Diaconu Radu-Mihai
Latest version: 1.6.10

# `@sockudo/ws-linux-x64-gnu`

This is the **x86_64-unknown-linux-gnu** binary for `@sockudo/ws`
npm package: @sockudo/ws-win32-arm64-msvc
Description: Ultra-fast WebSocket library for Node.js - 17% faster than alternatives, matching uWebSockets performance
Author: Diaconu Radu-Mihai
Latest version: 1.6.10

# `@sockudo/ws-win32-arm64-msvc`

This is the **aarch64-pc-windows-msvc** binary for `@sockudo/ws`
npm package: @sockudo/ws-win32-x64-msvc
Description: Ultra-fast WebSocket library for Node.js - 17% faster than alternatives, matching uWebSockets performance
Author: Diaconu Radu-Mihai
Latest version: 1.6.10

# `@sockudo/ws-win32-x64-msvc`

This is the **x86_64-pc-windows-msvc** binary for `@sockudo/ws`
npm package: @socnik/eslint-config-vitest
Description: Custom config preset for eslint-config-vitest ESLint plugin
Author: Nikita
Latest version: 0.0.1

# ESLint Config Vitest

Strict config for [`eslint-plugin-vitest`](https://github.com/veritem/eslint-plugin-vitest). You can see config in [`src/index.js`](https://github.com/socnik/eslint-config-vitest/tree/main/src/index.js).

## Usage

**This config uses [flat config format](https://eslint.org/blog/2022/08/new-config-system-part-2), so ESLint v9+ required.**

Install packages:

```shell
npx nypm add -D eslint eslint-plugin-vitest @socnik/eslint-config-vitest
```

Add to your ESLint config:

```js
// ...
import vitest from 'eslint-plugin-vitest'
import { vitestConfig } from '@socnik/eslint-config-vitest'
// ...

export default [
  // ...
  {
    ...vitestConfig, // Add Vitest rules preset. Add onto top!
    name: 'Vitest tests',
    files: ['src/**/*.test.ts'],
    plugins: {
      vitest, // Add Vitest plugin
    },
    rules: {
      'vitest/prefer-todo': 'off', // Override rules if you want to change something
    },
  },
  // ...
]
```
npm package: @socnik/my-prettier-config
Description: This is my favorite prettier config for my projects
Author: Nikita
Latest version: 1.0.6

# My Prettier Config

<a href="https://github.com/prettier">
   <p align="center">
    <img
     src="https://raw.githubusercontent.com/prettier/prettier-logo/master/images/prettier-wide-dark.svg"
     alt="Prettier Banner"
    >
   </p>
</a>

My preferred [Prettier config](https://prettier.io) which i use between my projects.

I recommend using this config with my [Editoconfig template](https://github.com/socnik/my-editorconfig). They are fully compatible between themselves.

This config is in the [`.prettierrc.json`](https://github.com/socnik/my-prettier-config/tree/main/.prettierrc.json) file.

## Usage

### Stage 0

Install `prettier` and `@socnik/my-prettier-config` packages:

```shell
npx nypm add -D prettier @socnik/my-prettier-config
```

### Stage 1

Add config to your `package.json`:

```jsonc
// package.json

{
  "name": "my-cool-library",
  "version": "9000.0.1",
  // ...
  "prettier": "@socnik/my-prettier-config", // <- Add this line
}
```

### Stage 2 _(Optional)_

Install [`Prettier` VSCode extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) from marketplace.

### Stage 3

Add your package manager lockfile to `.prettierignore`:

```ignore
# .prettierignore

# Pnpm
pnpm-lock.yaml

# Npm
package-lock.json
```

### Stage 4a _(optional)_

Setup VSCode environment with workspace configuration:

```jsonc
// .vscode/extensions.json

{
  "recommendations": [
    // ...
    "esbenp.prettier-vscode",
    // ...
  ],
}
```

```jsonc
// .vscode/settings.json

{
  // Prettier
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,
}
```

### Stage 4b _(optional)_

Setup VSCode environment with [`Devcontainer configuration`](https://code.visualstudio.com/docs/devcontainers/containers):

```jsonc
// .devcontainer/devcontainer.json

{
  // ...
  "customizations": {
    "vscode": {
      "settings": {
        // Prettier
        "editor.defaultFormatter": "esbenp.prettier-vscode",
        "editor.formatOnSave": true,
      },
      "extensions": ["esbenp.prettier-vscode"],
    },
  },
}
```

### Stage 5 _(optional)_

Setup Editorconfig with my config. If you want to do it, follow the instructions in [socnik/my-editorconfig](https://github.com/socnik/my-editorconfig#readme) repository.

### Stage 6

Enjoy 🚀!
npm package: @socnik/randifyjs
Description: Simple ts/js library for generating random values.
Author: Nikita
Latest version: 0.0.2

# RandifyJS

This is library for generate random numbers in JavaScript. Written on TypeScript.

_I not will accept PRs for this repository._

## How To Use?

### Random methods reference

#### `rand`

```ts
declare function rand(min: number, max: number, step: number = 1): number
```

Return random value between min and max with step (default 1).

Examples:

```ts
rand(0, 10, 2) // possible return values: 0, 2, 4, 6, 8, 10
rand(0, 3) // possible return values: 0, 1, 2, 3
```

#### `shuffle`

```ts
declare function shuffle<T>(sequence: T[]): T[]
```

Shuffle array of any values.

#### `choices`

```ts
declare function choices<T>(sequence: T[], choicesNumber: number): T[] | null
```

Random choice specified number of the values from an array. Return `null` if array empty.

#### `choice`

```ts
declare function choice<T>(sequence: T[]): T | null
```

Same as `choices`, but return only one number.

### Random class API

For simple generating random value you can use only methods from `Random methods reference`. But for advanced use (for example if you want get random numbers from your backend), you need use `Random` or `AsyncRandom` APIs.

`Random` is class. All simple methods as `rand` or `shuffle` exports from the default instance of the `Random` class. You can see this in the `defaultInstance.ts` file.

`Random` class takes one argument - `RandomSource`. But what is `RandomSource`? `RandomSource` - object with `getRandomValue()` method. This method should return a value between `0` and `1`. This is TypeScript type declaration of it:

```ts
type RandomSource = {
  getRandomValue(): number
}
```

You can create a custom `RandomSource` with your own `getRandomValue` function. Default `RandomSource` (the same as the default instance of the `Random` class) uses `Math.random()`:

```ts
const defaultRandomSource: RandomSource = {
  getRandomValue: () => Math.random(),
}
```

### `AsyncRandom` class API

If the operation of getting random values (between `0` and `1`) is async you need to use the `AsyncRandom` API.

This is the same as the `Random` class, but all methods return promises. And you should use `AsyncRandomSource`. This is the TypeScript declaration for it:

```ts
type AsyncRandomSource = {
  getRandomValue(): Promise<number>
}
```
npm package: @socnik/vite-tsconfig
Description: Base TypeScript Config for Vite projects
Author: Nikita
Latest version: 1.0.2

# Vite TSConfig

**Base TypeScript Config for Vite projects.**

## Quick Start

First, install `@socnik/vite-tsconfig` package:

```shell
npx nypm add -D @socnik/vite-tsconfig
```

And add it to your TSConfig:

```jsonc
{
  "extends": "@socnik/vite-tsconfig",
  // ...
}
```

## TSConfig-s list

- [`tsconfig.json`](https://github.com/socnik/vite-tsconfig/blob/main/tsconfig.json) - base TSConfig for your Vite projects
- [`tsconfig.dom.json`](https://github.com/socnik/vite-tsconfig/blob/main/tsconfig.dom.json) - TSConfig optimized for DOM
- [`tsconfig.vue.json`](https://github.com/socnik/vite-tsconfig/blob/main/tsconfig.vue.json) - TSConfig optimized for DOM+Vue
npm package: @socnik/wordle-engine
Description: Implementation of Wordle game engine with JavaScript
Author: Nikita
Latest version: 0.0.2

# Wordle Engine

Implementation of Wordle game engine with JavaScript.

## Installation

```bash
pnpm add @socnik/wordle-engine # Pnpm
npm install @socnik/wordle-engine # Npm
```

## Docs

### Tile state

Core type of this library - `LetterGuessingState`. It represents color of tile in Wordle game.

- none - white
- almost - yellow
- right - green
- wrong - gray

#### Type definition:

```typescript
type LetterGuessingState = 'none' | 'almost' | 'right' | 'wrong'
```

### Board API

Allows create Wordle game board state.

#### `defineBoard`

Create new board with specified size. Board state - 2D matrix with tile state objects. Tile state have two properties:

- `letter` - tile letter
- `guessingState` - one value from `LetterGuessingState` type.

##### Tile state type definition:

```typescript
type BoardTileState = {
  letter: string
  guessingState: LetterGuessingState
}
```

### `diffWords`

Compare words with Wordle game rules and return array with result. Every array item has one of this values:
`'almost' | 'right' | 'wrong'`.

#### Example:

```typescript
diffWords('abcd', 'dbcf')
// Result: ['wrong', 'right', 'right', 'almost']
```

_More docs come soon..._
npm package: @socon/hub-nodejs
Description: A lightweight, fast Typescript interface for Socon Hubs. Designed to work with [Hubble](https://github.com/soconxyz/hubble/) and any other Hub that implements the [Socon protocol](https://github.com/soconxyz/protocol).
Latest version: 1.0.2

# @socon/hub-nodejs

A lightweight, fast Typescript interface for Socon Hubs. Designed to work with [Hubble](https://github.com/soconxyz/hubble/) and any other Hub that implements the [Socon protocol](https://github.com/soconxyz/protocol).

## Features

- Call any Hub endpoint from a NodeJS environment.
- Serializes and deserializes Socon protobufs into Javascript objects.
- Has helpers to create and sign Socon messages.
- Written entirely in TypeScript, with strict types for safety.

Read the [documentation](https://github.com/soconxyz/hubble/tree/main/packages/hub-nodejs/docs), see more [examples](https://github.com/soconxyz/hubble/tree/main/packages/hub-nodejs/examples) or get started with the guide below.

## Installation

Install @socon/hub-nodejs with the package manager of your choice

```bash
npm install @socon/hub-nodejs
yarn add @socon/hub-nodejs
pnpm install @socon/hub-nodejs
```
npm package: @socotra/jwt
Description: Tools for working w/ account credentials (and JWTs)
Latest version: 1.0.0

# jwt

Tools for working w/ account credentials (and JWTs)

Demo:

```
# brew install nodejs ## if necessary
npx @socotra/jwt -- inspect --login
# clean info, interactive prompts
```

## dev

A `Dockerfile` is included to enable quick smoke checking.

The `Makefile` is used to test and publish the `npm` module.

Ensure you have NodeJS installed and run `make` to get started.
npm package: @socrater/x-ui
Description: X-UI represents a set of standards to build scalable UI using X-Framework by BlueLibs
Latest version: 0.0.3

<h1 align="center">BlueLibs X-UI</h1>

<p align="center">
  <a href="https://travis-ci.org/bluelibs/x-ui">
    <img src="https://api.travis-ci.org/bluelibs/x-ui.svg?branch=master" />
  </a>
  <a href="https://coveralls.io/github/bluelibs/x-ui?branch=master">
    <img src="https://coveralls.io/repos/github/bluelibs/x-ui/badge.svg?branch=master" />
  </a>
</p>

This is the X-Framework of handling password authentication blended with GraphQL.

## Install

```bash
npm install --save @bluelibs/x-ui
```

## [Documentation](./DOCUMENTATION.md)

[Click here to go to the documentation](./DOCUMENTATION.md)

## Support

This package is part of [BlueLibs](https://www.bluelibs.com) family. If you enjoy this work please show your support by starring [the main package](https://github.com/cuuminh10/kaviar). If not, let us know what can we do to deserve it, [our feedback form is here](https://forms.gle/DTMg5Urgqey9QqLFA)
npm package: @socrater/x-ui-admin
Description: The administration interface built for speed.
Latest version: 1.0.8

<h1 align="center">BlueLibs SECURITY-MONGO-BUNDLE</h1>

<p align="center">
  <a href="https://travis-ci.org/bluelibs/xui">
    <img src="https://api.travis-ci.org/bluelibs/xui.svg?branch=master" />
  </a>
  <a href="https://coveralls.io/github/bluelibs/xui?branch=master">
    <img src="https://coveralls.io/repos/github/bluelibs/xui/badge.svg?branch=master" />
  </a>
</p>

This is the X-Framework of handling password authentication blended with GraphQL.

## Install

```bash
npm install --save @bluelibs/x-ui-admin
```

## [Documentation](./DOCUMENTATION.md)

[Click here to go to the documentation](./DOCUMENTATION.md)

## Support

This package is part of [BlueLibs](https://www.bluelibs.com) family. If you enjoy this work please show your support by starring [the main package](https://github.com/cuuminh10/kaviar). If not, let us know what can we do to deserve it, [our feedback form is here](https://forms.gle/DTMg5Urgqey9QqLFA)
npm package: @soda-gql/babel-transformer
Description: Babel AST transformer for soda-gql
Author: Shota Hatada
Latest version: 0.10.2
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @soda-gql/babel-transformer

Core Babel transformation logic for soda-gql. This package provides the AST transformation functionality used by `@soda-gql/babel-plugin`.

## Status

**Internal package** - This package is used internally by soda-gql plugins and is not intended for direct use by end users.

## Purpose

This package provides:

1. **Babel AST transformation** - Transforms `gql.default()` calls to `gqlRuntime.getOperation()` calls
2. **Source map support** - Generates and chains source maps for debugging
3. **Import management** - Handles import rewrites and cleanup

## Used By

- `@soda-gql/babel-plugin` - Babel plugin for build-time transformation
- `@soda-gql/vite-plugin` - Vite plugin (uses Babel internally)
- `@soda-gql/metro-plugin` - Metro plugin for React Native
- `@soda-gql/webpack-plugin` - Webpack plugin (Babel-based loader)

## API

### createBabelTransformer

Creates a transformer instance for transforming source files using Babel.

```typescript
import { createBabelTransformer } from "@soda-gql/babel-transformer";

const transformer = createBabelTransformer({
  artifact: builderArtifact,
  config: resolvedConfig,
  sourceMap: true, // optional
});

const result = transformer.transform({
  sourceCode: source,
  sourcePath: "/path/to/file.ts",
  inputSourceMap: existingSourceMap, // optional
});

if (result.transformed) {
  const { sourceCode, sourceMap } = result;
  // Use transformed code and source map
}
```

### transform

One-shot transform function for transforming a single file.

```typescript
import { transform } from "@soda-gql/babel-transformer";

const result = transform({
  sourceCode: source,
  sourcePath: "/path/to/file.ts",
  artifact: builderArtifact,
  config: resolvedConfig,
  sourceMap: true, // optional
});
```

## Related Packages

- [@soda-gql/babel-plugin](../babel-plugin) - Babel plugin wrapper
- [@soda-gql/builder](../builder) - Static analysis and artifact generation
- [@soda-gql/plugin-common](../plugin-common) - Shared plugin utilities

## License

MIT
npm package: @soda-gql/codegen
Description: GraphQL schema code generation for soda-gql
Author: Shota Hatada
Latest version: 0.12.6

# @soda-gql/codegen

[![npm version](https://img.shields.io/npm/v/@soda-gql/codegen.svg)](https://www.npmjs.com/package/@soda-gql/codegen)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Multi-schema GraphQL code generation engine for soda-gql.

## Installation

```bash
bun add -D @soda-gql/codegen
```

> **Note**: This package is typically used indirectly via [@soda-gql/cli](../cli). Direct usage is only needed for advanced integration scenarios.

## Overview

This package provides the code generation engine that transforms GraphQL schemas into type-safe TypeScript modules. It supports:

- Multiple schema configurations
- Custom scalar definitions
- Runtime adapter integration
- Incremental generation

## Programmatic Usage

For advanced use cases where you need to integrate code generation into your own build pipeline:

```typescript
import { runCodegen } from "@soda-gql/codegen";

const result = await runCodegen({
  outPath: "./src/graphql-system/index.ts",
  format: "json",
  schemas: {
    default: {
      schema: ["./schema.graphql"],
      inject: {
        scalars: "./scalars.ts",
      },
    },
  },
});

if (result.isErr()) {
  console.error("Code generation failed:", result.error);
} else {
  console.log("Code generation successful");
}
```

## Features

- **Multi-Schema Support**: Generate modules for multiple GraphQL schemas in a single run
- **Type Safety**: Full TypeScript type generation from GraphQL schema
- **Custom Scalars**: Support for custom scalar type definitions
- **Error Handling**: Type-safe error handling using neverthrow

## Related Packages

- [@soda-gql/cli](../cli) - Command-line interface (recommended for most users)
- [@soda-gql/config](../config) - Configuration management
- [@soda-gql/core](../core) - Core types and utilities

## License

MIT
npm package: @soda-gql/common
Description: Shared utilities for soda-gql packages
Author: Shota Hatada
Latest version: 0.14.2

# @soda-gql/common

[![npm version](https://img.shields.io/npm/v/@soda-gql/common.svg)](https://www.npmjs.com/package/@soda-gql/common)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Shared utilities and types for the soda-gql ecosystem.

## Installation

```bash
bun add @soda-gql/common
```

> **Note**: This package is primarily used internally by other soda-gql packages. Direct usage is only needed for advanced integration scenarios.

## Overview

This package provides shared utilities used across the soda-gql ecosystem:

- Portable utilities for cross-environment compatibility
- Canonical ID generation and parsing
- Path building utilities
- Zod validation helpers

## Exports

### Main Entry (`@soda-gql/common`)

Common types and utilities:

```typescript
import { ... } from "@soda-gql/common";
```

### Portable (`@soda-gql/common/portable`)

Cross-environment utilities:

```typescript
import { ... } from "@soda-gql/common/portable";
```

### Canonical ID (`@soda-gql/common/canonical-id`)

Canonical ID generation and parsing:

```typescript
import { createCanonicalId, parseCanonicalId } from "@soda-gql/common/canonical-id";

// Create a canonical ID
const id = createCanonicalId("/path/to/file.ts", "userQuery");
// Result: "/path/to/file.ts::userQuery"

// Parse a canonical ID
const parsed = parseCanonicalId(id);
// Result: { filePath: "/path/to/file.ts", astPath: "userQuery" }
```

### Utils (`@soda-gql/common/utils`)

General utility functions:

```typescript
import { ... } from "@soda-gql/common/utils";
```

### Zod (`@soda-gql/common/zod`)

Zod validation helpers:

```typescript
import { ... } from "@soda-gql/common/zod";
```

### Scheduler (Effect System)

Generator-based effect system for scheduling sync and async operations:

```typescript
import {
  createSyncScheduler,
  createAsyncScheduler,
  PureEffect,
  DeferEffect,
  ParallelEffect,
  YieldEffect,
} from "@soda-gql/common";

// Sync usage
const syncScheduler = createSyncScheduler();
const result = syncScheduler.run(function* () {
  const a = yield* new PureEffect(1).run();
  const b = yield* new PureEffect(2).run();
  return a + b;
});

// Async usage with parallel effects
const asyncScheduler = createAsyncScheduler();
const asyncResult = await asyncScheduler.run(function* () {
  const data = yield* new DeferEffect(fetchData()).run();
  yield* new YieldEffect().run(); // Yield to event loop
  return processData(data);
});
```

### Test Utilities (`@soda-gql/common/test`)

Shared test utilities for soda-gql packages (internal use):

```typescript
import { createTempDir, TestSuite } from "@soda-gql/common/test";
```

## Related Packages

- [@soda-gql/core](../core) - Core types and utilities
- [@soda-gql/builder](../builder) - Static analysis engine

## License

MIT
npm package: @soda-gql/formatter
Description: GraphQL document formatter for soda-gql
Author: Shota Hatada
Latest version: 0.12.6

# @soda-gql/formatter

GraphQL document formatter for soda-gql. This package formats generated GraphQL documents for better readability.

## Features

- **Consistent formatting** - Produces clean, readable GraphQL output
- **SWC-based parsing** - Fast parsing using SWC
- **Optional integration** - Used by CLI when available

## Installation

```bash
npm install @soda-gql/formatter
# or
bun add @soda-gql/formatter
```

## Usage

The formatter is typically used through the CLI:

```bash
soda-gql format
```

### Programmatic Usage

```typescript
import { format, needsFormat } from "@soda-gql/formatter";

// Format a source file
const result = format({
  sourceCode: source,
  filePath: "/path/to/file.ts", // optional, used for TSX detection
});

if (result.isOk()) {
  const { modified, sourceCode } = result.value;
  if (modified) {
    // Source was formatted
    console.log(sourceCode);
  }
}

// Check if formatting is needed (useful for pre-commit hooks)
const needsFormatting = needsFormat({ sourceCode: source });
if (needsFormatting.isOk() && needsFormatting.value) {
  console.log("File needs formatting");
}
```

## Requirements

- Node.js >= 18
- `@swc/core` >= 1.0.0 (peer dependency)

## Related Packages

- [@soda-gql/cli](../cli) - Command-line interface
- [@soda-gql/codegen](../codegen) - Code generation

## License

MIT
npm package: @soda-gql/protocol-proxy
Description: Thin proxy binaries for soda-gql LSP — resolves project-local @soda-gql/lsp at runtime
Author: Shota Hatada
Latest version: 0.14.2

# @soda-gql/protocol-proxy

Thin proxy binary for integrating soda-gql's LSP server with [Claude Code](https://claude.com/claude-code).

## What it does

`@soda-gql/protocol-proxy` resolves the project-local `@soda-gql/lsp` package at runtime, similar to how `typescript-language-server` delegates to the project-local TypeScript. This ensures version consistency between the server and your project's soda-gql dependencies.

### Binaries

- **`soda-gql-lsp-proxy`** — LSP proxy. Handles the LSP connection and `initialize` handshake, then delegates all language features to project-local `@soda-gql/lsp`.

## Installation

```bash
npm install -g @soda-gql/protocol-proxy
```

Your project must also have `@soda-gql/lsp` as a dependency:

```bash
bun add -D @soda-gql/lsp
```

## Claude Code Plugin

The proxy binary is configured in the soda-gql Claude Code plugin:
- LSP server via `.claude-plugin/marketplace.json`

After installing the plugin via `/plugin` in Claude Code, restart the session to activate.

## Related Packages

- [@soda-gql/lsp](../lsp) — Full LSP server with all language features
- [@soda-gql/core](../core) — Core GraphQL query generation

## License

MIT
npm package: @soda-gql/runtime
Description: Minimal runtime for soda-gql operations
Author: Shota Hatada
Latest version: 0.12.6

# @soda-gql/runtime

[![npm version](https://img.shields.io/npm/v/@soda-gql/runtime.svg)](https://www.npmjs.com/package/@soda-gql/runtime)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Runtime utilities for soda-gql zero-runtime GraphQL operations.

## Installation

```bash
bun add @soda-gql/runtime
```

## Overview

This package provides the minimal runtime needed to execute soda-gql GraphQL operations. It includes:

- Operation registry for storing compiled GraphQL documents
- Runtime utilities for operation retrieval
- Minimal footprint for production builds

## Usage

### With Build-Time Transformation

When using soda-gql with a build plugin (Babel, TypeScript, Vite, etc.), the runtime is automatically integrated:

```typescript
// Your source code
import { gql } from "@/graphql-system";

export const userQuery = gql.default(({ query }) =>
  query("GetUser")`($id: ID!) {
    user(id: $id) {
      id
      name
    }
  }`(),
);

// After transformation (automatically handled by build plugin)
import { gqlRuntime } from "@soda-gql/runtime";

export const userQuery = gqlRuntime.getOperation("GetUser");
```

## API Reference

### `gqlRuntime`

The main runtime object for operation management:

```typescript
import { gqlRuntime } from "@soda-gql/runtime";

// Get an operation by name
const operation = gqlRuntime.getOperation("GetUser");
```

## Zero-Runtime Philosophy

This package is designed to have minimal impact on bundle size:

- Operations are registered at build time
- No heavy dependencies
- Tree-shakeable exports

## Related Packages

- [@soda-gql/core](../core) - Core types and utilities
- [@soda-gql/babel](../babel) - Babel transformer and plugin
- [@soda-gql/tsc](../tsc) - TypeScript transformer and plugin

## License

MIT
npm package: @soda-gql/swc
Description: SWC-based native transformer for soda-gql
Author: Shota Hatada
Latest version: 0.14.2

# @soda-gql/swc

High-performance native transformer for soda-gql using SWC and Rust. This package provides the fastest transformation option for large codebases.

## Features

- **Native performance** - Rust-based NAPI module for maximum speed
- **Source map chaining** - Merges with upstream source maps
- **Per-file artifact filtering** - Minimizes serialization overhead
- **Cross-platform support** - macOS, Linux, and Windows binaries

## Installation

```bash
npm install @soda-gql/swc
# or
bun add @soda-gql/swc
```

## Usage

This package is typically used through higher-level plugins:

- `@soda-gql/webpack-plugin` - Uses SWC transformer when available
- Direct usage in custom build pipelines

### Direct Usage

```typescript
import { createTransformer } from "@soda-gql/swc";

// createTransformer is async (loads native module)
const transformer = await createTransformer({
  artifact: builderArtifact,
  config: resolvedConfig,
  sourceMap: true, // optional
});

// transform is synchronous after initialization
const result = transformer.transform({
  sourceCode: source,
  sourcePath: "/path/to/file.ts",
  inputSourceMap: existingSourceMap, // optional
});

if (result.transformed) {
  const { sourceCode, sourceMap, errors } = result;
  // Use transformed code and source map
}
```

## Platform Support

The following platforms are supported with pre-built binaries:

| Platform | Architecture | Package |
|----------|--------------|---------|
| macOS | ARM64 | `@soda-gql/swc-darwin-arm64` |
| macOS | x64 | `@soda-gql/swc-darwin-x64` |
| Linux | x64 (glibc) | `@soda-gql/swc-linux-x64-gnu` |
| Linux | x64 (musl) | `@soda-gql/swc-linux-x64-musl` |
| Windows | x64 | `@soda-gql/swc-win32-x64-msvc` |

Platform-specific packages are installed automatically as optional dependencies.

## Requirements

- Node.js >= 18
- `@swc/core` >= 1.0.0 (peer dependency)

## Related Packages

- [@soda-gql/babel](../babel) - Babel-based alternative
- [@soda-gql/webpack-plugin](../webpack-plugin) - Webpack integration
- [@soda-gql/builder](../builder) - Static analysis and artifact generation

## License

MIT
npm package: @soda-gql/swc-transformer
Description: SWC-based native transformer for soda-gql
Author: Shota Hatada
Latest version: 0.10.2
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @soda-gql/swc-transformer

High-performance native transformer for soda-gql using SWC and Rust. This package provides the fastest transformation option for large codebases.

## Features

- **Native performance** - Rust-based NAPI module for maximum speed
- **Source map chaining** - Merges with upstream source maps
- **Per-file artifact filtering** - Minimizes serialization overhead
- **Cross-platform support** - macOS, Linux, and Windows binaries

## Installation

```bash
npm install @soda-gql/swc-transformer
# or
bun add @soda-gql/swc-transformer
```

## Usage

This package is typically used through higher-level plugins:

- `@soda-gql/webpack-plugin` - Uses SWC transformer when available
- Direct usage in custom build pipelines

### Direct Usage

```typescript
import { createTransformer } from "@soda-gql/swc-transformer";

// createTransformer is async (loads native module)
const transformer = await createTransformer({
  artifact: builderArtifact,
  config: resolvedConfig,
  sourceMap: true, // optional
});

// transform is synchronous after initialization
const result = transformer.transform({
  sourceCode: source,
  sourcePath: "/path/to/file.ts",
  inputSourceMap: existingSourceMap, // optional
});

if (result.transformed) {
  const { sourceCode, sourceMap, errors } = result;
  // Use transformed code and source map
}
```

## Platform Support

The following platforms are supported with pre-built binaries:

| Platform | Architecture | Package |
|----------|--------------|---------|
| macOS | ARM64 | `@soda-gql/swc-transformer-darwin-arm64` |
| macOS | x64 | `@soda-gql/swc-transformer-darwin-x64` |
| Linux | x64 (glibc) | `@soda-gql/swc-transformer-linux-x64-gnu` |
| Linux | x64 (musl) | `@soda-gql/swc-transformer-linux-x64-musl` |
| Windows | x64 | `@soda-gql/swc-transformer-win32-x64-msvc` |

Platform-specific packages are installed automatically as optional dependencies.

## Requirements

- Node.js >= 18
- `@swc/core` >= 1.0.0 (peer dependency)

## Related Packages

- [@soda-gql/babel-transformer](../babel-transformer) - Babel-based alternative
- [@soda-gql/webpack-plugin](../webpack-plugin) - Webpack integration
- [@soda-gql/builder](../builder) - Static analysis and artifact generation

## License

MIT
npm package: @soda-gql/tools
Description: Development tools for soda-gql: CLI, codegen, typegen, and formatter
Author: Shota Hatada
Latest version: 0.14.2

# @soda-gql/tools

Consolidated development tools for soda-gql: CLI, code generation, type generation, and formatting.

## Installation

```bash
bun add -D @soda-gql/tools
```

## Subpath Exports

This package exposes functionality through subpath exports (no root `"."` export):

| Export | Description |
|--------|-------------|
| `@soda-gql/tools/codegen` | GraphQL schema code generation |
| `@soda-gql/tools/typegen` | Prebuilt type generation from tagged templates |
| `@soda-gql/tools/formatter` | GraphQL field selection formatting |

## CLI Binary

The `soda-gql` CLI binary is provided by this package:

```bash
# Generate typed runtime entry from schema
bun run soda-gql codegen schema

# Generate prebuilt types
bun run soda-gql typegen

# Format field selections
bun run soda-gql format

# Run diagnostics
bun run soda-gql doctor
```

## Migration from Previous Packages

This package consolidates several previously separate packages. If upgrading from an earlier version:

| Before | After |
|--------|-------|
| `@soda-gql/cli` | `@soda-gql/tools` (CLI binary) |
| `@soda-gql/codegen` | `@soda-gql/tools/codegen` |
| `@soda-gql/typegen` | `@soda-gql/tools/typegen` |
| `@soda-gql/formatter` | `@soda-gql/tools/formatter` |
| `@soda-gql/runtime` | `@soda-gql/core/runtime` |

### Update Steps

1. Remove old packages and install `@soda-gql/tools`:
   ```bash
   bun remove @soda-gql/cli @soda-gql/codegen @soda-gql/typegen @soda-gql/formatter @soda-gql/runtime
   bun add -D @soda-gql/tools
   ```

2. Update imports:
   ```ts
   // Before
   import { generate } from "@soda-gql/codegen";
   import { createRegistry } from "@soda-gql/runtime";

   // After
   import { generate } from "@soda-gql/tools/codegen";
   import { createRegistry } from "@soda-gql/core/runtime";
   ```

## License

MIT
npm package: @soda-gql/tsc-transformer
Description: TypeScript AST transformer for soda-gql
Author: Shota Hatada
Latest version: 0.10.2
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @soda-gql/tsc-transformer

Core TypeScript transformation logic for soda-gql. This package extracts the AST transformation functionality used by `@soda-gql/tsc-plugin` and provides conformance tests for other plugin implementations.

## Status

**Internal package** - This package is used internally by soda-gql plugins and is not intended for direct use by end users.

## Purpose

This package provides:

1. **Shared transformation logic** - The core AST transformation that converts `gql.default()` calls to runtime registrations
2. **Conformance test cases** - Test fixtures and utilities for verifying plugin implementations match expected behavior
3. **TypeScript AST utilities** - Helpers for import management and code generation

## Used By

- `@soda-gql/tsc-plugin` - TypeScript compiler plugin
- `@soda-gql/babel-plugin` - Babel transformation plugin (for test conformance)

## API

### createTransformer

Creates a TypeScript transformer that processes soda-gql files.

```typescript
import { createTransformer } from "@soda-gql/tsc-transformer";
import type { BuilderArtifact } from "@soda-gql/builder";
import type { ResolvedSodaGqlConfig } from "@soda-gql/config";
import * as ts from "typescript";

const transformer = createTransformer({
  compilerOptions: ts.getDefaultCompilerOptions(),
  config: resolvedConfig,
  artifact: builderArtifact,
});

// Use in a TypeScript transformer factory
const result = transformer.transform({
  sourceFile,
  context: transformationContext,
});
```

### createAfterStubTransformer

Creates a post-transformation step that cleans up stub imports.

```typescript
import { createAfterStubTransformer } from "@soda-gql/tsc-transformer";
```

### TypeScriptEnv

Type definition for the TypeScript-specific environment.

```typescript
type TypeScriptEnv = {
  readonly sourceFile: ts.SourceFile;
  readonly context: ts.TransformationContext;
};
```

## License

MIT
npm package: @soda-gql/vite-plugin
Description: Vite plugin for soda-gql
Author: Shota Hatada
Latest version: 0.14.2

# @soda-gql/vite-plugin

Vite plugin for soda-gql. Transforms soda-gql DSL to runtime calls during development and build.

## Features

- **Zero-config setup** - Works out of the box with soda-gql config
- **HMR support** - Hot module replacement for GraphQL operations
- **Fast rebuilds** - Incremental artifact updates

## Installation

```bash
npm install @soda-gql/vite-plugin
# or
bun add @soda-gql/vite-plugin
```

## Usage

Add the plugin to your Vite config:

```typescript
// vite.config.ts
import { defineConfig } from "vite";
import { sodaGqlPlugin } from "@soda-gql/vite-plugin";

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

## Configuration

The plugin automatically loads configuration from `soda-gql.config.ts`.

### Plugin Options

```typescript
sodaGqlPlugin({
  // Use a specific config file
  configPath: "./custom-config.ts",

  // Filter which files to transform
  include: ["src/**/*.ts"],
  exclude: ["**/*.test.ts"],
});
```

## How It Works

1. **Build phase** - The plugin uses `@soda-gql/builder` to analyze source files and generate artifacts
2. **Transform phase** - Uses `@soda-gql/babel` to replace `gql.default()` calls with `gqlRuntime.getOperation()` calls
3. **Watch mode** - Automatically rebuilds artifacts when GraphQL files change
4. **Internal module stubbing** - graphql-system and inject modules are stubbed with `export {};` in the bundle

## Requirements

- Vite 5.x or 6.x
- Node.js >= 18

## Related Packages

- [@soda-gql/webpack-plugin](../webpack-plugin) - Webpack integration
- [@soda-gql/metro-plugin](../metro-plugin) - React Native/Expo integration
- [@soda-gql/babel](../babel) - Babel transformer and plugin

## License

MIT
npm package: @soda-pro/layout
Description: ```bash npm install
Latest version: 0.1.0

# @soda-protocol/soda-layout

## Getting Started

```bash
npm install

npm run test
# or
yarn test
```

## Obligation

```vim
obligation:  {
  wallet: 'HDRL6fpRmYSn36YWaWJaR6zhU6BYqjaWcybGTeABQQkz',
  collaterals: [
    {
      reserve: '77DiqgiVTh5bw4KLX63UJ5xRYqKhrAiNpjaayanmwjZr',
      depositAmount: '137.65' // depositAmount
    },
    {
      reserve: 'DpHSScW5Q7DhfvDHeCLg6jMZuuQfv8y4sqZKpRAoQ4xN',
      depositAmount: '14.25' // depositAmount
    }
  ],
  loans: [
    {
      reserve: '5cY7qV7Pb28xJdiCkwt28r6qUhV2gbvsvhk8cpUuwDwZ',
      borrowAmount: '0.10' // borrowAmount
    },
    {
      reserve: 'GmP9qCoekpdAVVLWdurwwAHGqsXsPrWwLDr2Q8gi5Pdm',
      borrowAmount: '1.00' // borrowAmount
    },
    {
      reserve: '9BpSWydxoGVvkaWYzd7sucmVNkDXcaQZtPyvknZH1tkP',
      borrowAmount: '1.20' // borrowAmount
    }
  ]
}

```

## Reserves

```vim
'8ToWR4dEWvEop6kMPAQYBi6t7UquDb27M7W11BKeyM9J' => {
    version: 1,
    lastUpdate: { slot: 112732747n, stale: false },
    manager: PublicKey {
      _bn: <BN: fe57c05ced879807a924132ba4a429b6d355754942acda9c9752af2d770f0779>
    },
    tokenConfig: { mintPubkey: [PublicKey], supplyAccount: [PublicKey], decimal: 8 },
    oracleInfo: { price: [BigNumber], oracleConfig: [Object] },
    collateralInfo: {
      sotokenMintPubkey: [PublicKey],
      totalMint: 3201362673n,
      collateralConfig: [Object]
    },
    liquidityInfo: {
      enable: true,
      available: 1477585497n,
      flashLoanFee: 0n,
      accBorrowRateWads: [BigNumber],
      borrowedAmountWads: [BigNumber],
      insuranceWads: [BigNumber],
      config: [Object]
    },
    rateModel: {
      offset: 0n,
      optimal: 200000000000000000n,
      kink: 75,
      max: 1000000000000000000n
    },
    padding: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 206 more bytes>,
    depositRate: '6.20', // depositRate
    borrowRate: '14.37' // borrowRate
  }
```
npm package: @soda-sync/app-sdk
Description: SodaSync App SDK
Author: Julian Finkler
Latest version: 4.0.1

# SodaSync App SDK

This is the SodaSync App SDK. Check out the developer documentation:
https://docs.soda-sync.com/docs/developer/tutorial/access

In the most regular use cases you don't need to install this package manually, it's automatically installed by
creating the project with [@soda-sync/devkit](https://www.npmjs.com/package/@soda-sync/devkit)
npm package: @soda/get-current-script
Description: get the current executing script, with polyfills for IE9+ and Firefox
Author: Haoqun Jiang
Latest version: 1.0.2

# @soda/get-current-script ![CI](https://github.com/sodatea/get-current-script/workflows/CI/badge.svg)

It is basically a function that returns `document.currentScript` but with support for IE9-11, thanks to https://github.com/amiller-gh/currentScript-polyfill.

It also works around a [Firefox issue](https://bugzilla.mozilla.org/show_bug.cgi?id=1620505) when the script is called in a microtask, which makes `document.currentScript` unusable in a webpack dynamic-imported chunk.

It is shipped as a utility function rather than a polyfill, because we can't easily tell if the `document.currentScript` is returning `null` due to the Firefox issue or because it's running in an event handler / a callback.

The implementation here may not adhere strictly to `document.currentScript` spec when called in async code or in a callback. In these situations the spec calls for `document.currentScript` to return `null`. However, for the grand majority of your `document.currentScript` needs, this utility will do the job!

## Usage

```sh
npm i @soda/get-current-script
```

```js
const getCurrentScript = require('@soda/get-current-script')
const script = getCurrentScript() // the current executing <script> element
```