open-index/open-npm huggingface dataset:
npm package: @publishfx/publish-hooks
Description: A collection of reusable React hooks for the Publish platform.
Latest version: 1.1.1

# Publish Hooks Library

A collection of reusable React hooks for the Publish platform.

## Overview

This package provides a set of custom React hooks designed to handle common functionality and logic needed across the Publish platform. These hooks encapsulate state management, side effects, and other cross-cutting concerns.

## Setup

Install the dependencies:

```bash
pnpm install
```

## Development

Build the library:

```bash
pnpm build
```

Build the library in watch mode for development:

```bash
pnpm dev
```

## Available Hooks

### useAuth

A hook for handling authentication state and operations.

```jsx
import { useAuth } from '@moonton/publish-hooks';

function MyComponent() {
  const isAuth = useAuth(moduleAuthority, module，operation);
  
  // Implementation details...
}
```

## Adding New Hooks

1. Create your hook in the `src` directory
2. Export it in `src/index.ts`
3. Document its usage in this README

## Peer Dependencies

This package requires the following peer dependencies:
- react (>=18.3.1)
- react-dom (>=18.3.1)
npm package: @publishfx/publish-utils
Description: Utility functions for the Publish platform.
Latest version: 1.2.0

# Publish Utils Library

Utility functions for the Publish platform.

## Overview

This package contains utility functions and helpers used across the Publish platform. These utilities cover common tasks such as data processing, time range calculations, and other shared logic.

## Setup

Install the dependencies:

```bash
pnpm install
```

## Development

Build the library:

```bash
pnpm build
```

Build the library in watch mode for development:

```bash
pnpm dev
```

## Utilities

### getDrillDownTimeRange

A function for calculating time ranges for drill-down analysis.

```js
import { getDrillDownTimeRange } from '@moonton/publish-utils';

const timeRange = getDrillDownTimeRange(startDate, endDate);
```

## Adding New Utilities

1. Create your utility function in the `src` directory
2. Export it in `src/index.ts`
3. Document its usage in this README

## Build Output

The library is compiled to ESM format and outputs type definitions. The built files are located in the `dist` directory.