ShellRS
ShellRS 是一款免费开源的 SSH 客户端,使用 Rust 编写:主机管理、终端、WinSCP 风格的 SFTP 与端口转发,全部在一个 GPU 渲染窗口中,支持 macOS、Windows 和 Linux。
AI 翻译
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗The community-supported Storybook framework for Astro. Build, test, and document your Astro components in Storybook's interactive environment.
Website: storybook-astro.org · npm: @storybook-astro/framework · GitHub: storybook-astro
Add Storybook to an existing Astro project.
npm install -D storybook @storybook/builder-vite @storybook-astro/framework
The
@storybook-astro/rendererpackage is installed automatically as a dependency of@storybook-astro/framework— no separate install is needed.
If you'll add framework integrations, install each one's Astro integration and Storybook renderer too. They are optional peer dependencies, so npm doesn't install them for you, and storybook build fails without them. For React:
npm install -D @astrojs/react @storybook/react @vitejs/plugin-react react react-dom
See Installation for the packages each integration needs.
Create .storybook/main.js:
export default {
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
framework: {
name: '@storybook-astro/framework',
options: {},
},
};
Create .storybook/preview.js:
const preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};
export default preview;
Add scripts to package.json:
"scripts": {
"dev": "storybook dev -p 6006",
"build": "storybook build"
}
// Card.stories.jsx
import Card from './Card.astro';
export default {
title: 'Components/Card',
component: Card,
};
export const Default = {
args: {
title: 'My Card Title',
content: 'Card content goes here',
},
};
export const Highlighted = {
args: {
title: 'Featured Card',
content: 'This card is highlighted',
highlight: true,
},
};
npm run dev
Note:
npm create storybook@latestdoes not yet recognize Astro as a framework. Use the manual setup above instead.
All options below are passed under framework.options in .storybook/main.js. See the Configuration Reference for the full list.
To use non-Astro framework components (React, Vue, Svelte, etc.) inside your stories, add integrations:
import { react, vue, svelte, preact, solid, alpinejs } from '@storybook-astro/framework/integrations';
export default {
framework: {
name: '@storybook-astro/framework',
options: {
integrations: [
react({ include: ['**/react/**'] }),
vue(),
svelte(),
preact({ include: ['**/preact/**'] }),
solid({ include: ['**/solid/**'] }),
alpinejs({ entrypoint: './.storybook/alpine-entrypoint.js' }),
],
},
},
};
Note:
includepatterns use recursive globs (**) to match components in nested directories (e.g.solid/Counter/Counter.tsx). A non-recursive glob like**/solid/*would fail to match files in subdirectories.
storybook build supports two Astro render modes:
static (default): pre-renders Astro stories into astro-prerendered-stories.json and serves without a render serverserver: builds storybook-static and a standalone Astro render server in storybook-serverexport default {
framework: {
name: '@storybook-astro/framework',
options: {
renderMode: 'server',
server: {
serverUrl: 'https://storybook-render.example.com',
authToken: process.env.STORYBOOK_ASTRO_SERVER_TOKEN,
authHeader: 'authorization',
},
},
},
};
For token-based auth in server mode, you can also use runtime env/global values: STORYBOOK_ASTRO_SERVER_URL, STORYBOOK_ASTRO_SERVER_TOKEN, and STORYBOOK_ASTRO_SERVER_AUTH_HEADER.
Story args and slots are sanitized before they reach the Astro Container, using conservative HTML defaults. By default only slots are sanitized (slots: ['**']); args are left untouched unless you opt specific paths in.
export default {
framework: {
name: '@storybook-astro/framework',
options: {
sanitization: {
// opt specific arg paths into sanitization
args: ['content', 'items.*.description'],
// sanitize all slots (the default)
slots: ['**'],
},
},
},
};
To turn sanitization off entirely, set sanitization: { enabled: false }. See the Sanitization guide for details.
Per-story rules let you run setup and replace modules for matching stories. For HTTP mocking with MSW, install msw in your project and wire it up inside the rules file:
export default {
framework: {
name: '@storybook-astro/framework',
options: {
storyRules: '.storybook/story-rules.ts',
},
},
};
// .storybook/story-rules.ts
import { HttpResponse, http } from 'msw';
import { setupServer } from 'msw/node';
import { defineStoryRules } from '@storybook-astro/framework/node';
const server = setupServer();
let isListening = false;
function getMswServer() {
if (!isListening) {
server.listen({ onUnhandledRequest: 'bypass' });
isListening = true;
}
return server;
}
export default defineStoryRules({
rules: [
{
match: 'components-profile-card--*',
use: ({ mock }) => {
const server = getMswServer();
server.use(
http.get('/api/user', () => {
return HttpResponse.json({ name: 'Storybook User' });
})
);
mock('~/lib/feature-flags', './mocks/feature-flags.ts');
return () => {
server.resetHandlers();
};
},
},
],
});
composeStories and Vitest setupThis tracks Astro's built-in framework features and their compatibility status.
<style> blocks, compiled and scoped by your installed Astro versionclient:load, client:only, etc. for framework componentsstorybook build with build-time pre-rendering of Astro component storiesastro:assets (Image Optimization) — works in components but requires a fallback approach for stories due to module resolution. Components can accept both ImageMetadata and string URLs to maintain compatibility.astro.config.* are resolved through their providers and loaded as @font-face CSS. The runtime exports (fontData, experimental_getFontFileURL) are still stubs, and preload links and fallback metrics aren't generated. See the roadmap.Any help is highly appreciated! Contributions are welcome. See AGENTS.md for guidance on AI-assisted development and deeper architecture notes.
This repository is a Yarn workspaces monorepo. To develop against it locally:
Clone the repository:
git clone https://github.com/storybook-astro/storybook-astro.git
cd storybook-astro
Install dependencies (requires Node 20.16.0+, 22.19.0+, or 24.0.0+):
yarn install
Run Storybook from an integration example:
yarn workspace @storybook-astro/integration-astro6 dev
Build a static Storybook:
yarn workspace @storybook-astro/integration-astro6 build
Serve the built output:
yarn workspace @storybook-astro/integration-astro6 serve
Run tests (validates component rendering and framework integration health):
yarn test
storybook-astro/
├── packages/
│ └── @storybook-astro/
│ ├── framework/ # Framework package
│ │ ├── src/
│ │ │ ├── integrations/ # Framework integrations
│ │ │ ├── middleware.ts # SSR handler + createAstro compat
│ │ │ ├── preset.ts # Storybook config
│ │ │ ├── portable-stories.ts # composeStories for testing
│ │ │ ├── testing.ts # Testing runtime APIs (composeStories, renderStory)
│ │ │ ├── vitest/ # Vitest config helpers (defineConfig)
│ │ │ ├── vitePluginAstroComponentMarker.ts # Astro component detection (5–7)
│ │ │ ├── vitePluginAstroBuildPrerender.ts # Build-time pre-rendering
│ │ │ ├── vitePluginAstroFonts.ts # Astro Font Provider resolution
│ │ │ ├── viteStorybookAstroMiddlewarePlugin.ts # Render request handling (dev)
│ │ │ └── viteStorybookRendererFallbackPlugin.ts
│ │ └── package.json
│ └── renderer/ # Client renderer
│ ├── src/
│ │ ├── render.tsx # Rendering logic + framework delegation
│ │ └── preset.ts # Preview setup
│ └── package.json
├── lib/
│ └── vitest-setup.ts # Vitest setup file
├── src/
│ └── components/ # Example components
├── vitest.config.ts # Test configuration
├── .storybook/ # Storybook configuration
└── package.json # Root package
The project ships two packages:
@storybook-astro/framework (server)Integrates Astro with Storybook's build system: configures Vite to handle .astro files, sets up an Astro Container that renders components server-side on demand, manages UI framework renderers, and handles module resolution for Astro's runtime.
@storybook-astro/renderer (client)Runs inside Storybook's preview iframe: detects component types, sends render requests to the framework middleware over Vite's HMR channel, injects the returned HTML into the canvas, applies scoped styles, and executes client scripts. For non-Astro framework components it delegates to the framework-specific renderer.
Dev mode (storybook dev): the renderer detects Astro components via the isAstroComponentFactory flag, sends a render request to the dev-server middleware over HMR, and the middleware renders the component with the Container API. The returned HTML is injected into the canvas and client scripts run for hydration. Non-Astro framework components are delegated to their framework renderer before storyFn() is called, which avoids orphaned reactive effects.
Static build (storybook build): because Astro components require server-side rendering, the build pre-renders each story at build time using an internal Vite SSR server with the Container API. The pre-rendered HTML is attached to each story export and the client runtime uses it directly. As a result, changing Astro story args via the Controls panel has no effect in static builds (framework component stories remain fully interactive).
For the detailed compatibility layers and implementation notes, see AGENTS.md.
See the Roadmap guide for a consolidated view of planned features, improvements, and known limitations.
This project is based on storybook-astro by Sławek Kołodziej, which pioneered the approach of using Astro's Container API to render Astro components within Storybook.
MIT