@cfp-studio/plugin-solid 0.0.0-stage → 14.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +48 -2
- package/dist/index.d.mts +5799 -0
- package/dist/index.mjs +1 -0
- package/package.json +46 -3
- package/preview/index.tsx +73 -0
- package/preview/tsconfig.json +9 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Zenc Labs Pty Ltd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,49 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @cfp-studio/plugin-solid
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SolidJS 框架的 CFP Studio 插件,支持 Solid 组件/Story 静态分析、属性/类型提取、预览渲染、CSF/Storybook 兼容等。
|
|
4
|
+
|
|
5
|
+
## 特性
|
|
6
|
+
|
|
7
|
+
- 自动检测并适配 SolidJS 1.x 项目
|
|
8
|
+
- 支持 Solid 组件/Story 的批量静态分析与属性/类型提取
|
|
9
|
+
- 兼容 CSF/Storybook 规范,支持 args/参数提取
|
|
10
|
+
- 支持 preview 目录下自定义 Wrapper、错误边界
|
|
11
|
+
- 内置丰富的 E2E/单元测试用例
|
|
12
|
+
|
|
13
|
+
## 架构与工作原理
|
|
14
|
+
|
|
15
|
+
- 通过 `FrameworkPluginFactory` 实现插件注册与兼容性检测
|
|
16
|
+
- 使用 `createTypeAnalyzer` 进行 TS/JSX 类型分析,支持特殊类型适配
|
|
17
|
+
- `crawlFile` 支持单文件批量组件/Story 爬取,自动生成可预览 ID
|
|
18
|
+
- `preview/` 目录下为前端渲染入口,支持自定义 Wrapper、错误边界
|
|
19
|
+
- 支持多种 Solid 工程模板(apps/ 下有多种测试工程)
|
|
20
|
+
|
|
21
|
+
## 主要 API/模块
|
|
22
|
+
|
|
23
|
+
- `src/index.ts`:插件主入口,注册工厂与分析器
|
|
24
|
+
- `src/crawl-file.ts`:单文件批量组件/Story 爬取
|
|
25
|
+
- `src/analyze.ts`:属性/类型/JSX 结构分析
|
|
26
|
+
- `preview/index.tsx`:前端渲染入口
|
|
27
|
+
- `tests/`、`apps/`:丰富的测试与模板
|
|
28
|
+
|
|
29
|
+
## 用法示例
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { solidFrameworkPlugin } from "@cfp-studio/plugin-solid";
|
|
33
|
+
// 传入 core/Previewer 或 createChromelessWorkspace 等集成
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 依赖
|
|
37
|
+
|
|
38
|
+
- `solid-js`、`vite-plugin-solid`、`@cfp-studio/*`、`typescript`、`vite`
|
|
39
|
+
- 测试:`vitest`、`@playwright/test`
|
|
40
|
+
|
|
41
|
+
## 构建
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
pnpm build
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 许可证
|
|
48
|
+
|
|
49
|
+
MIT
|