open-index/open-npm huggingface dataset:
npm package: @svackages/sveltekit-hook-redirect
Description: ![svackage logo](https://raw.githubusercontent.com/svackages/persistent-store/main/logo.png)
Latest version: 0.0.1

![svackage logo](https://raw.githubusercontent.com/svackages/persistent-store/main/logo.png)

![npm version](https://img.shields.io/npm/v/@svackages/sveltekit-hook-redirect)
![license](https://img.shields.io/github/license/svackages/sveltekit-hook-redirect)
# sveltekit-hook-redirect
⚠ This might change a bit with SvelteKit 1.0 ⚠

A sveltekit hook that makes redirects easy 👍

## Features ✨
- Fully typed
- Simple string redirects (e.g. `/about` => `/about-new`)
- Absolute redirects (e.g. `/blog` => `https://blog.my-fancy.page`)
- Choose your redirect type (e.g. `MovedPermanently = 301`)
- More complex regex redirects (e.g. `/products/{id}` => `/products-new/{id}/details`)
- Mix and match both types

## How to use
### Simple string redirects
```typescript
import { RedirectHook, type StringRedirects } from "@svackages/sveltekit-hook-redirect";
import type { Handle } from "@sveltejs/kit";

const redirects: StringRedirects = {
    '/about': {
        to: '/about-new',
        code: 301,
    },
    '/temporary-redirect': {
        to: '/',
    },
}

export const handle: Handle = ({ event, resolve }) => RedirectHook({ event, resolve, redirects });
```
```javascript
import { StringRedirects } from "@svackages/sveltekit-hook-redirect";

/** @type {import(@svackages/sveltekit-hook-redirect).StringRedirects} */
const redirects = {
    '/about': {
        to: '/about-new',
        code: 301,
    },
    '/temporary-redirect': {
        to: '/',
    },
}

/** @type {import('@sveltejs/kit').Handle} */
export const handle = ({ event, resolve }) => RedirectHook({ event, resolve, redirects });
```
### With Regex Matcher
```typescript
import { RedirectHook, type StringRedirects } from "@svackages/sveltekit-hook-redirect";
import type { Handle } from "@sveltejs/kit";

const matchers: RegexRedirect[] = [
    {
        fromMatcher: /^\/products\/(\d+)$/,
        to: '/products-new/$1',
        replace: true,
    },
    {
        fromMatcher: /^\/blog.*/,
        to: 'https://dev.to/dreitzner',
        code: 307,
    },
]

export const handle: Handle = ({ event, resolve }) => RedirectHook({ event, resolve, matchers });
```
```javascript
import { RedirectHook } from "@svackages/sveltekit-hook-redirect";

/** @type {import(@svackages/sveltekit-hook-redirect).RegexRedirect[]} */
const matchers = [
    {
        fromMatcher: /^\/products\/(\d+)$/,
        to: '/products-new/$1',
        replace: true,
    },
    {
        fromMatcher: /^\/blog.*/,
        to: 'https://dev.to/dreitzner',
        code: 307,
    },
]

/** @type {import('@sveltejs/kit').Handle} */
export const handle = ({ event, resolve }) => RedirectHook({ event, resolve, matchers });
```
npm package: @svackages/sveltkit-hook-html-minifier
Description: ![svackage logo](https://raw.githubusercontent.com/svackages/persistent-store/main/logo.png)
Latest version: 0.0.2

![svackage logo](https://raw.githubusercontent.com/svackages/persistent-store/main/logo.png)

![npm version](https://img.shields.io/npm/v/@svackages/sveltkit-hook-html-minifier)
![license](https://img.shields.io/github/license/svackages/sveltkit-hook-html-minifier)
# sveltkit-hook-html-minifier
⚠ This might change a bit with SvelteKit 1.0 ⚠

A sveltkit hook that wrapps [html-minifier](https://www.npmjs.com/package/html-minifier)

## How to use
### Single hook
```javascript
import { htmlMinifierHook } from "@svackages/sveltkit-hook-html-minifier";

/** @type {import('@sveltejs/kit').Handle} */
export const handle = htmlMinifierHook;
```
```typescript
import { htmlMinifierHook } from "@svackages/sveltkit-hook-html-minifier";
import type { Handle } from "@sveltejs/kit";

export const handle: Handle = htmlMinifierHook;
```
### Single hook with options
```javascript
import { htmlMinifierHook } from "@svackages/sveltkit-hook-html-minifier";
import { prerendering } from '$app/environment';

const minifierOptions = {
    removeAttributeQuotes: true,
};

/** @type {import('@sveltejs/kit').Handle} */
export const handle = ({ event, resolve }) => htmlMinifierHook({ event, resolve, minifierOptions, prerendering});
```
```typescript
import { htmlMinifierHook } from "@svackages/sveltkit-hook-html-minifier";
import { prerendering } from '$app/environment';
import type { Handle } from "@sveltejs/kit";

const minifierOptions = {
    removeAttributeQuotes: true,
};

export const handle: Handle = ({ event, resolve }) => htmlMinifierHook({ event, resolve, minifierOptions, prerendering});
```
### Sequence
```javascript
import { sequence } from '@sveltejs/kit/hooks';
import { htmlMinifierHook } from "@svackages/sveltkit-hook-html-minifier";

// Add htmlMinifierHook at the end
/** @type {import('@sveltejs/kit').Handle} */
export const handle: Handle = sequence(someOtherHook, htmlMinifierHook);
```
```typescript
import { sequence } from '@sveltejs/kit/hooks';
import { htmlMinifierHook } from "@svackages/sveltkit-hook-html-minifier";
import type { Handle } from "@sveltejs/kit";

// Add htmlMinifierHook at the end
export const handle: Handle = sequence(someOtherHook, htmlMinifierHook);
```

## Default Options
```javascript
const defaultMinifierOptions = {
	collapseBooleanAttributes: true,
	collapseWhitespace: true,
	conservativeCollapse: true,
	decodeEntities: true,
	html5: true,
	ignoreCustomComments: [/^#/],
	minifyCSS: true,
	minifyJS: false,
	removeAttributeQuotes: true,
	removeComments: true,
	removeOptionalTags: true,
	removeRedundantAttributes: true,
	removeScriptTypeAttributes: true,
	removeStyleLinkTypeAttributes: true,
	sortAttributes: true,
	sortClassName: true,
};
```

To see all options take a look at [the html-minifier docs](https://www.npmjs.com/package/html-minifier#options-quick-reference)
npm package: @svackages/truncate
Description: ![svackage logo](https://raw.githubusercontent.com/svackages/persistent-store/main/logo.png)
Latest version: 1.0.0

![svackage logo](https://raw.githubusercontent.com/svackages/persistent-store/main/logo.png)

![npm version](https://img.shields.io/npm/v/@svackages/truncate)
![license](https://img.shields.io/github/license/svackages/truncate)

# Truncate Action

An easy action to truncate multiline text in an element with fixed height.

- fully typed
- add your own symbol at the end
- updates on resize

Install: `npm install @svackages/truncate`

```html
<script>
    import truncate from "@svackages/truncate";
</script>
<p
    use:truncate>
    Some very long text that needs to be shorter 🩳.
</p>
<p
    use:truncate={' (read more)'}>
    Use your own symbol that should be displayed at the end of your truncation
</p>

```

## REPL

https://svelte.dev/repl/0f18e3915e334214a61a84fd2dbd8bda?version=3.44.2
npm package: @svadmin/create
Description: Scaffolding tool for svadmin projects
Author: zuohuadong
Latest version: 0.11.2

# @svadmin/create

The official scaffolding CLI for `headless-admin-svelte` (svadmin).

Quickly bootstrap a completely configured, headless admin panel project built on Svelte 5, Shadcn Svelte, and TanStack Query.

## Quick Start

```bash
npx @svadmin/create@latest my-admin-app
# or
bunx @svadmin/create@latest my-admin-app
```

Follow the interactive prompts to:
1. Name your project.
2. Choose a default Data Provider (Simple REST, Supabase, GraphQL, or Custom).
3. Choose an Auth Provider (Mock, JWT, Supabase, or None).

## What's Included

The generated project is pre-configured with:
- **SvelteKit** + **Vite** (Svelte 5 Runes)
- **Tailwind CSS** + **Shadcn Svelte** UI components
- **@svadmin/core**: The headless business logic and hooks (useTable, useForm, useAuth, etc.)
- **@svadmin/ui**: Beautiful default dashboard UI, standalone CRUD buttons, and data tables.
- Pre-wired **TanStack Query** for client-state management.

## Start Developing

Once scaffolded, `cd` into your directory, install dependencies, and start the development server:

```bash
cd my-admin-app
bun install
bun run dev
```

## Eject Components / 组件弹出

Extract internal `@svadmin/ui` components into your project for deep customization:

将 `@svadmin/ui` 内部组件提取到你的项目中，实现深度定制：

```bash
# Eject all components / 弹出全部组件
npx @svadmin/create eject

# Eject specific components / 弹出指定组件
npx @svadmin/create eject Layout Header Sidebar
```

Ejected files are placed in `src/components/svadmin/`. Then pass them via the `components` prop:

弹出的文件会放到 `src/components/svadmin/` 目录，然后通过 `components` prop 传入：

```svelte
<script lang="ts">
  import CustomLayout from './components/svadmin/Layout.svelte';
</script>

<AdminApp components={{ Layout: CustomLayout }} {dataProvider} {resources} />
```

### Available Components / 可弹出的组件

`Layout` · `Sidebar` · `Header` · `LoginPage` · `AutoTable` · `AutoForm` · `ShowPage` · `ProfilePage` · `StatsCard` · `AuditLogDrawer` · `LiveIndicator` · `CommandPalette` · `AICommandBar` · `ChatDialog` · `PasswordInput` · `BooleanField` · `FieldRenderer` · `MarkdownRenderer` · `AnomalyBadge` · `Toast` · `ConfirmDialog` · `TooltipButton` · `Breadcrumbs` · `ConfigErrorScreen` · `DevTools`

## Development

```bash
# Sync template from /example
bun src/sync-template.ts

# Build CLI (for npm publishing)
bun run build
```
npm package: @svadmin/graphql
Description: GraphQL DataProvider for svadmin
Latest version: 0.9.5

# @svadmin/graphql

Generic GraphQL DataProvider for `svadmin`.

Because GraphQL APIs do not share a universal convention for CRUD operations (unlike REST), this generic provider requires you to pass your GraphQL queries and mutations via the `meta.query` property in svadmin hooks.

## Installation

```bash
bun add @svadmin/graphql graphql-request graphql
```

## Basic Usage

Initialize the provider with a `GraphQLClient`:

```typescript
import { AdminApp } from '@svadmin/ui';
import { createGraphQLDataProvider } from '@svadmin/graphql';
import { GraphQLClient } from 'graphql-request';

const client = new GraphQLClient('https://your-graphql-endpoint/graphql', {
  headers: {
    Authorization: `Bearer YOUR_TOKEN`,
  },
});

const dataProvider = createGraphQLDataProvider({ client });
```

## Using Hooks with GraphQL

Pass your `gql` queries into the `meta` prop of your hooks.

### Fetching a List (`useList` / `useTable`)

```typescript
import { useTable } from '@svadmin/core';
import { gql } from 'graphql-request';

const POSTS_QUERY = gql`
  query GetPosts($limit: Int, $offset: Int) {
    posts(limit: $limit, offset: $offset) {
      id
      title
      content
    }
    posts_aggregate {
      aggregate {
        count
      }
    }
  }
`;

// In your Svelte component
const table = useTable({
  resource: 'posts',
  meta: {
    query: POSTS_QUERY
  }
});
```

*(Note: If your API returns data in a deeply nested structure like `posts_aggregate.aggregate.count`, you may need to wrap this provider or map the response in your data hook overrides).*

### Creating a Record (`useCreate` / `useForm`)

```typescript
import { useForm } from '@svadmin/core';
import { gql } from 'graphql-request';

const CREATE_POST_MUTATION = gql`
  mutation CreatePost($title: String!, $content: String!) {
    insert_posts_one(object: {title: $title, content: $content}) {
      id
      title
    }
  }
`;

const form = useForm({
  resource: 'posts',
  action: 'create',
  meta: {
    query: CREATE_POST_MUTATION
  }
});
```