@svadmin/create 0.18.0 → 0.20.0
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/README.md +26 -0
- package/dist/index.js +1397 -91
- package/package.json +4 -3
- package/scaffold-manifest.json +11 -11
package/README.md
CHANGED
|
@@ -36,6 +36,32 @@ bun install
|
|
|
36
36
|
bun run dev
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
## Automated Inference CLI / 接口代码推断器
|
|
40
|
+
|
|
41
|
+
Automatically infer ResourceDefinitions, TypeBox schemas, and Svelte 5 CRUD components from REST endpoints, OpenAPI / Swagger specs, GraphQL endpoints (introspection), or local schema/sample files:
|
|
42
|
+
|
|
43
|
+
根据 REST 接口、OpenAPI 规范、GraphQL 端点或本地样本数据自动推导资源定义、TypeBox Schema 及 Svelte 5 完整 CRUD 页面:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Infer from OpenAPI JSON spec URL
|
|
47
|
+
npx @svadmin/create infer --url https://api.example.com/openapi.json --out-dir src/resources --write
|
|
48
|
+
|
|
49
|
+
# Infer from GraphQL endpoint (automatic introspection)
|
|
50
|
+
npx @svadmin/create infer --url https://api.example.com/graphql --out-dir src/resources --write
|
|
51
|
+
|
|
52
|
+
# Infer from REST sample data endpoint
|
|
53
|
+
npx @svadmin/create infer --url https://api.example.com/api/v1/posts --resource posts --out-dir src/resources --write
|
|
54
|
+
|
|
55
|
+
# Infer from local GraphQL SDL or OpenAPI file
|
|
56
|
+
npx @svadmin/create infer --file schema.graphql --out-dir src/resources --write
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Generated artifacts include:
|
|
60
|
+
- `<resource>.resource.ts`: ResourceDefinition with field types, relations, and CRUD capabilities
|
|
61
|
+
- `<resource>.schema.ts`: Sinclair TypeBox schema and static TypeScript types
|
|
62
|
+
- `<resource>/ListPage.svelte`, `<resource>/CreatePage.svelte`, `<resource>/EditPage.svelte`, `<resource>/ShowPage.svelte`: Svelte 5 page components
|
|
63
|
+
- `index.ts`: Barrel export file
|
|
64
|
+
|
|
39
65
|
## Eject Components / 组件弹出
|
|
40
66
|
|
|
41
67
|
Extract internal `@svadmin/ui` components into your project for deep customization:
|