open-index/open-npm huggingface dataset:
npm package: @spaas/spaas-utils
Description: - [x] 添加函数的模式固定 - [x] 可以对函数进行增加 test - [ ] 代码 eslint 校验 - [ ] 提交 commit 添加 - [ ] 自动 github flow - [ ] 贡献指南（多人协作） - [ ] doc 生成
Latest version: 0.0.3



## TODO
- [x] 添加函数的模式固定
- [x] 可以对函数进行增加 test
- [ ] 代码 eslint 校验
- [ ] 提交 commit 添加
- [ ] 自动 github flow
- [ ] 贡献指南（多人协作）
- [ ] doc 生成
npm package: @space-arch/nx-plugin-std
Description: Standard Nx plugin for Space Architects workspace
Author: Space Architects
Latest version: 1.7.1

# @space-arch/nx-plugin-std

Space Architects Standard Nx for standard Nx workflows
such as creating packages, initializing config files and frameworks,
building and deploying apps, and so on.

## Installation

```bash
npm install -D @space-arch/nx-plugin-std
# or
pnpm add -D @space-arch/nx-plugin-std
```

## Usage

Add to your `nx.json` plugins array:

```json
{
  "plugins": [
    "@space-arch/nx-plugin-std"
  ]
}
```

## Features

- Custom generators for project scaffolding
- Enhanced executors for specialized build processes
- Workspace automation utilities

## Contributing

This package is part of the [Space Architects monorepo](../../../README.md).
npm package: @space-arch/util-drizzle
Description: Utility functions for Drizzle ORM.
Author: Space Architects
Latest version: 2.0.1

# @space-arch/util-drizzle

Utility functions for Drizzle ORM.

## Installation

```bash
npm install @space-arch/util-drizzle
# or
pnpm add @space-arch/util-drizzle
```

## Features

- 🐻 **Lazy Initialization**: Create Drizzle instances only when needed
- 🆔 **UUIDv7 Support**: Built-in column types for UUIDv7 with automatic generation

## Usage

### Lazy Drizzle

Create a lazily initialized Drizzle instance. Useful for serverless environments where you need to resolve connection details at runtime.

```typescript
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';

import { lazyDrizzle } from '@space-arch/util-drizzle';

const db = lazyDrizzle(
  (url) => drizzle(postgres(url)),
  () => process.env.DATABASE_URL
);

// Before using the db:
process.env['DATABASE_URL'] = await resolveConnectionString();

// Connection is established only when first query is executed
const users = await db.select().from(usersTable);
```

### UUIDv7 Column Types

PostgreSQL `uuid` columns auto-filled with UUIDv7 on insert. Nullable by default — chain `.notNull()` / `.primaryKey()` as you would with drizzle's built-in `uuid()`.

```typescript
import { pgTable } from 'drizzle-orm/pg-core';
import { uuidV7 } from '@space-arch/util-drizzle';

const users = pgTable('users', {
  id:       uuidV7().primaryKey(),           // PK, auto-filled on insert
  tenantId: uuidV7('tenant_id').notNull(),   // required FK
  parentId: uuidV7('parent_id'),             // nullable FK
});
```

The default is applied at insert time by the drizzle runtime — it does NOT emit a SQL `DEFAULT` clause in migrations. For a raw nullable uuid with no auto-default, use drizzle's built-in `uuid()` directly.

## Contributing

This package is part of the [Space Architects monorepo](../../README.md).
npm package: @space-arch/util-ts
Description: TypeScript utilities for Space Architects
Author: Space Architects
Latest version: 2.0.1

# @space-arch/util-ts

TypeScript utility functions and types for Space Architects projects.

## Installation

```bash
npm install @space-arch/util-ts
# or
pnpm add @space-arch/util-ts
```

## Usage

### Type Utilities

#### `Simplify<T>`
Flattens complex intersections and mapped types for better IDE display.

```typescript
import type { Simplify } from '@space-arch/util-ts';

// Before: { name: string } & { age: number } & { city: string }
// After: { name: string; age: number; city: string }
type User = Simplify<{ name: string } & { age: number } & { city: string }>;
```

#### `SimplifyDeep<T>`
Recursively simplifies nested object types.

```typescript
import type { SimplifyDeep } from '@space-arch/util-ts';

type DeepUser = SimplifyDeep<{
  profile: { name: string } & { age: number };
  settings: { theme: string } & { lang: string };
}>;
```

#### `PropValues<T>`
Extracts all possible values from an object's properties.

```typescript
import type { PropValues } from '@space-arch/util-ts';

const Status = { ACTIVE: 'active', INACTIVE: 'inactive' } as const;
type StatusValue = PropValues<typeof Status>; // 'active' | 'inactive'
```

#### `TupleMerge<T>`
Merges all types in a tuple into a single intersection type.

```typescript
import type { TupleMerge } from '@space-arch/util-ts';

type Merged = TupleMerge<[{ a: string }, { b: number }, { c: boolean }]>;
// Result: { a: string; b: number; c: boolean }
```

#### `PropTupleFromArray<T, K>`
Extracts property values from an array of objects as a strongly-typed tuple.

```typescript
import type { PropTupleFromArray } from '@space-arch/util-ts';

const users = [
  { id: '1', name: 'Alice' },
  { id: '2', name: 'Bob' },
] as const;

type UserNames = PropTupleFromArray<typeof users, 'name'>; // ['Alice', 'Bob']
```

### Runtime Functions

#### `propTupleFromArray(arr, key)`
Runtime function that extracts property values from an array of objects.

```typescript
import { propTupleFromArray } from '@space-arch/util-ts';

const users = [
  { id: '1', name: 'Alice' },
  { id: '2', name: 'Bob' },
];

const names = propTupleFromArray(users, 'name'); // ['Alice', 'Bob']
const ids = propTupleFromArray(users, 'id'); // ['1', '2']
```

## Contributing

This package is part of the [Space Architects monorepo](../../README.md).