swallowkit 1.0.0-beta.6 → 1.0.0-beta.60

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.
Files changed (296) hide show
  1. package/README.ja.md +86 -177
  2. package/README.md +86 -178
  3. package/dist/__tests__/fixtures.d.ts +12 -0
  4. package/dist/__tests__/fixtures.d.ts.map +1 -1
  5. package/dist/__tests__/fixtures.js +101 -0
  6. package/dist/__tests__/fixtures.js.map +1 -1
  7. package/dist/cli/commands/add-auth.d.ts +15 -0
  8. package/dist/cli/commands/add-auth.d.ts.map +1 -0
  9. package/dist/cli/commands/add-auth.js +790 -0
  10. package/dist/cli/commands/add-auth.js.map +1 -0
  11. package/dist/cli/commands/add-connector.d.ts +20 -0
  12. package/dist/cli/commands/add-connector.d.ts.map +1 -0
  13. package/dist/cli/commands/add-connector.js +163 -0
  14. package/dist/cli/commands/add-connector.js.map +1 -0
  15. package/dist/cli/commands/cosmos-worktree-isolation.d.ts +25 -0
  16. package/dist/cli/commands/cosmos-worktree-isolation.d.ts.map +1 -0
  17. package/dist/cli/commands/cosmos-worktree-isolation.js +124 -0
  18. package/dist/cli/commands/cosmos-worktree-isolation.js.map +1 -0
  19. package/dist/cli/commands/create-model.d.ts +1 -4
  20. package/dist/cli/commands/create-model.d.ts.map +1 -1
  21. package/dist/cli/commands/create-model.js +19 -81
  22. package/dist/cli/commands/create-model.js.map +1 -1
  23. package/dist/cli/commands/dev-seeds.d.ts +62 -0
  24. package/dist/cli/commands/dev-seeds.d.ts.map +1 -0
  25. package/dist/cli/commands/dev-seeds.js +474 -0
  26. package/dist/cli/commands/dev-seeds.js.map +1 -0
  27. package/dist/cli/commands/dev.d.ts +38 -0
  28. package/dist/cli/commands/dev.d.ts.map +1 -1
  29. package/dist/cli/commands/dev.js +733 -155
  30. package/dist/cli/commands/dev.js.map +1 -1
  31. package/dist/cli/commands/index.d.ts +1 -0
  32. package/dist/cli/commands/index.d.ts.map +1 -1
  33. package/dist/cli/commands/index.js +3 -1
  34. package/dist/cli/commands/index.js.map +1 -1
  35. package/dist/cli/commands/init.d.ts +78 -0
  36. package/dist/cli/commands/init.d.ts.map +1 -1
  37. package/dist/cli/commands/init.js +1453 -898
  38. package/dist/cli/commands/init.js.map +1 -1
  39. package/dist/cli/commands/scaffold.d.ts +24 -0
  40. package/dist/cli/commands/scaffold.d.ts.map +1 -1
  41. package/dist/cli/commands/scaffold.js +473 -90
  42. package/dist/cli/commands/scaffold.js.map +1 -1
  43. package/dist/cli/index.d.ts +5 -1
  44. package/dist/cli/index.d.ts.map +1 -1
  45. package/dist/cli/index.js +333 -55
  46. package/dist/cli/index.js.map +1 -1
  47. package/dist/core/config.d.ts +14 -3
  48. package/dist/core/config.d.ts.map +1 -1
  49. package/dist/core/config.js +179 -8
  50. package/dist/core/config.js.map +1 -1
  51. package/dist/core/mock/connector-mock-server.d.ts +101 -0
  52. package/dist/core/mock/connector-mock-server.d.ts.map +1 -0
  53. package/dist/core/mock/connector-mock-server.js +480 -0
  54. package/dist/core/mock/connector-mock-server.js.map +1 -0
  55. package/dist/core/mock/zod-mock-generator.d.ts +14 -0
  56. package/dist/core/mock/zod-mock-generator.d.ts.map +1 -0
  57. package/dist/core/mock/zod-mock-generator.js +163 -0
  58. package/dist/core/mock/zod-mock-generator.js.map +1 -0
  59. package/dist/core/operations/auth-operations.d.ts +61 -0
  60. package/dist/core/operations/auth-operations.d.ts.map +1 -0
  61. package/dist/core/operations/auth-operations.js +272 -0
  62. package/dist/core/operations/auth-operations.js.map +1 -0
  63. package/dist/core/operations/create-model.d.ts +15 -0
  64. package/dist/core/operations/create-model.d.ts.map +1 -0
  65. package/dist/core/operations/create-model.js +185 -0
  66. package/dist/core/operations/create-model.js.map +1 -0
  67. package/dist/core/operations/file-session.d.ts +56 -0
  68. package/dist/core/operations/file-session.d.ts.map +1 -0
  69. package/dist/core/operations/file-session.js +203 -0
  70. package/dist/core/operations/file-session.js.map +1 -0
  71. package/dist/core/operations/provision-operations.d.ts +52 -0
  72. package/dist/core/operations/provision-operations.d.ts.map +1 -0
  73. package/dist/core/operations/provision-operations.js +211 -0
  74. package/dist/core/operations/provision-operations.js.map +1 -0
  75. package/dist/core/operations/runtime.d.ts +37 -0
  76. package/dist/core/operations/runtime.d.ts.map +1 -0
  77. package/dist/core/operations/runtime.js +248 -0
  78. package/dist/core/operations/runtime.js.map +1 -0
  79. package/dist/core/operations/scaffold-apply.d.ts +21 -0
  80. package/dist/core/operations/scaffold-apply.d.ts.map +1 -0
  81. package/dist/core/operations/scaffold-apply.js +57 -0
  82. package/dist/core/operations/scaffold-apply.js.map +1 -0
  83. package/dist/core/operations/scaffold-machine.d.ts +16 -0
  84. package/dist/core/operations/scaffold-machine.d.ts.map +1 -0
  85. package/dist/core/operations/scaffold-machine.js +51 -0
  86. package/dist/core/operations/scaffold-machine.js.map +1 -0
  87. package/dist/core/operations/scaffold-plan.d.ts +43 -0
  88. package/dist/core/operations/scaffold-plan.d.ts.map +1 -0
  89. package/dist/core/operations/scaffold-plan.js +187 -0
  90. package/dist/core/operations/scaffold-plan.js.map +1 -0
  91. package/dist/core/project/agent-instructions.d.ts +29 -0
  92. package/dist/core/project/agent-instructions.d.ts.map +1 -0
  93. package/dist/core/project/agent-instructions.js +159 -0
  94. package/dist/core/project/agent-instructions.js.map +1 -0
  95. package/dist/core/project/artifacts.d.ts +58 -0
  96. package/dist/core/project/artifacts.d.ts.map +1 -0
  97. package/dist/core/project/artifacts.js +179 -0
  98. package/dist/core/project/artifacts.js.map +1 -0
  99. package/dist/core/project/boundaries.d.ts +50 -0
  100. package/dist/core/project/boundaries.d.ts.map +1 -0
  101. package/dist/core/project/boundaries.js +117 -0
  102. package/dist/core/project/boundaries.js.map +1 -0
  103. package/dist/core/project/capabilities.d.ts +58 -0
  104. package/dist/core/project/capabilities.d.ts.map +1 -0
  105. package/dist/core/project/capabilities.js +135 -0
  106. package/dist/core/project/capabilities.js.map +1 -0
  107. package/dist/core/project/drift.d.ts +29 -0
  108. package/dist/core/project/drift.d.ts.map +1 -0
  109. package/dist/core/project/drift.js +188 -0
  110. package/dist/core/project/drift.js.map +1 -0
  111. package/dist/core/project/infra.d.ts +49 -0
  112. package/dist/core/project/infra.d.ts.map +1 -0
  113. package/dist/core/project/infra.js +167 -0
  114. package/dist/core/project/infra.js.map +1 -0
  115. package/dist/core/project/manifest.d.ts +92 -0
  116. package/dist/core/project/manifest.d.ts.map +1 -0
  117. package/dist/core/project/manifest.js +321 -0
  118. package/dist/core/project/manifest.js.map +1 -0
  119. package/dist/core/project/state.d.ts +15 -0
  120. package/dist/core/project/state.d.ts.map +1 -0
  121. package/dist/core/project/state.js +106 -0
  122. package/dist/core/project/state.js.map +1 -0
  123. package/dist/core/project/validation.d.ts +20 -0
  124. package/dist/core/project/validation.d.ts.map +1 -0
  125. package/dist/core/project/validation.js +274 -0
  126. package/dist/core/project/validation.js.map +1 -0
  127. package/dist/core/project/workflows.d.ts +43 -0
  128. package/dist/core/project/workflows.d.ts.map +1 -0
  129. package/dist/core/project/workflows.js +299 -0
  130. package/dist/core/project/workflows.js.map +1 -0
  131. package/dist/core/scaffold/auth-generator.d.ts +63 -0
  132. package/dist/core/scaffold/auth-generator.d.ts.map +1 -0
  133. package/dist/core/scaffold/auth-generator.js +1774 -0
  134. package/dist/core/scaffold/auth-generator.js.map +1 -0
  135. package/dist/core/scaffold/connector-functions-generator.d.ts +41 -0
  136. package/dist/core/scaffold/connector-functions-generator.d.ts.map +1 -0
  137. package/dist/core/scaffold/connector-functions-generator.js +1029 -0
  138. package/dist/core/scaffold/connector-functions-generator.js.map +1 -0
  139. package/dist/core/scaffold/functions-generator.d.ts +7 -1
  140. package/dist/core/scaffold/functions-generator.d.ts.map +1 -1
  141. package/dist/core/scaffold/functions-generator.js +771 -69
  142. package/dist/core/scaffold/functions-generator.js.map +1 -1
  143. package/dist/core/scaffold/model-parser.d.ts +21 -1
  144. package/dist/core/scaffold/model-parser.d.ts.map +1 -1
  145. package/dist/core/scaffold/model-parser.js +243 -43
  146. package/dist/core/scaffold/model-parser.js.map +1 -1
  147. package/dist/core/scaffold/native-schema-generator.d.ts +19 -0
  148. package/dist/core/scaffold/native-schema-generator.d.ts.map +1 -0
  149. package/dist/core/scaffold/native-schema-generator.js +753 -0
  150. package/dist/core/scaffold/native-schema-generator.js.map +1 -0
  151. package/dist/core/scaffold/nextjs-generator.d.ts +8 -0
  152. package/dist/core/scaffold/nextjs-generator.d.ts.map +1 -1
  153. package/dist/core/scaffold/nextjs-generator.js +153 -9
  154. package/dist/core/scaffold/nextjs-generator.js.map +1 -1
  155. package/dist/core/scaffold/openapi-generator.d.ts +3 -0
  156. package/dist/core/scaffold/openapi-generator.d.ts.map +1 -0
  157. package/dist/core/scaffold/openapi-generator.js +190 -0
  158. package/dist/core/scaffold/openapi-generator.js.map +1 -0
  159. package/dist/core/scaffold/ui-generator.d.ts +17 -4
  160. package/dist/core/scaffold/ui-generator.d.ts.map +1 -1
  161. package/dist/core/scaffold/ui-generator.js +174 -34
  162. package/dist/core/scaffold/ui-generator.js.map +1 -1
  163. package/dist/core/verify/index.d.ts +69 -0
  164. package/dist/core/verify/index.d.ts.map +1 -0
  165. package/dist/core/verify/index.js +412 -0
  166. package/dist/core/verify/index.js.map +1 -0
  167. package/dist/database/base-model.d.ts +3 -3
  168. package/dist/database/base-model.js +3 -3
  169. package/dist/index.d.ts +2 -2
  170. package/dist/index.d.ts.map +1 -1
  171. package/dist/index.js +2 -1
  172. package/dist/index.js.map +1 -1
  173. package/dist/machine/contracts.d.ts +24 -0
  174. package/dist/machine/contracts.d.ts.map +1 -0
  175. package/dist/machine/contracts.js +3 -0
  176. package/dist/machine/contracts.js.map +1 -0
  177. package/dist/machine/errors.d.ts +14 -0
  178. package/dist/machine/errors.d.ts.map +1 -0
  179. package/dist/machine/errors.js +42 -0
  180. package/dist/machine/errors.js.map +1 -0
  181. package/dist/machine/index.d.ts +3 -0
  182. package/dist/machine/index.d.ts.map +1 -0
  183. package/dist/machine/index.js +566 -0
  184. package/dist/machine/index.js.map +1 -0
  185. package/dist/mcp/index.d.ts +25 -0
  186. package/dist/mcp/index.d.ts.map +1 -0
  187. package/dist/mcp/index.js +425 -0
  188. package/dist/mcp/index.js.map +1 -0
  189. package/dist/types/index.d.ts +109 -0
  190. package/dist/types/index.d.ts.map +1 -1
  191. package/dist/utils/package-manager.d.ts +5 -2
  192. package/dist/utils/package-manager.d.ts.map +1 -1
  193. package/dist/utils/package-manager.js +30 -9
  194. package/dist/utils/package-manager.js.map +1 -1
  195. package/dist/utils/python-uv.d.ts +21 -0
  196. package/dist/utils/python-uv.d.ts.map +1 -0
  197. package/dist/utils/python-uv.js +111 -0
  198. package/dist/utils/python-uv.js.map +1 -0
  199. package/dist/version.d.ts +2 -0
  200. package/dist/version.d.ts.map +1 -0
  201. package/dist/version.js +49 -0
  202. package/dist/version.js.map +1 -0
  203. package/package.json +9 -5
  204. package/src/__tests__/__snapshots__/functions-generator.test.ts.snap +1139 -0
  205. package/src/__tests__/__snapshots__/nextjs-generator.test.ts.snap +206 -0
  206. package/src/__tests__/__snapshots__/ui-generator.test.ts.snap +532 -0
  207. package/src/__tests__/agent-instructions.test.ts +237 -0
  208. package/src/__tests__/agent-loop-phase34.test.ts +513 -0
  209. package/src/__tests__/auth.test.ts +770 -0
  210. package/src/__tests__/bff-swa-auth.test.ts +275 -0
  211. package/src/__tests__/config.test.ts +295 -0
  212. package/src/__tests__/connector-functions-generator.test.ts +288 -0
  213. package/src/__tests__/connector-mock-server.test.ts +439 -0
  214. package/src/__tests__/connector-model-bff.test.ts +162 -0
  215. package/src/__tests__/cosmos-worktree-isolation.test.ts +149 -0
  216. package/src/__tests__/dev-seeds.test.ts +236 -0
  217. package/src/__tests__/dev.test.ts +296 -0
  218. package/src/__tests__/file-session.test.ts +98 -0
  219. package/src/__tests__/fixtures.ts +184 -0
  220. package/src/__tests__/functions-generator.test.ts +237 -0
  221. package/src/__tests__/init.test.ts +411 -0
  222. package/src/__tests__/jest-globals.d.ts +8 -0
  223. package/src/__tests__/machine.test.ts +371 -0
  224. package/src/__tests__/mcp.test.ts +253 -0
  225. package/src/__tests__/model-parser.test.ts +81 -0
  226. package/src/__tests__/multi-auth.test.ts +160 -0
  227. package/src/__tests__/nextjs-generator.test.ts +105 -0
  228. package/src/__tests__/openapi-generator.test.ts +43 -0
  229. package/src/__tests__/package-manager.test.ts +227 -0
  230. package/src/__tests__/plan-apply.test.ts +499 -0
  231. package/src/__tests__/python-uv.test.ts +48 -0
  232. package/src/__tests__/scaffold.test.ts +302 -0
  233. package/src/__tests__/string-utils.test.ts +75 -0
  234. package/src/__tests__/tsconfig.json +15 -0
  235. package/src/__tests__/ui-generator.test.ts +248 -0
  236. package/src/__tests__/zod-mock-generator.test.ts +132 -0
  237. package/src/cli/commands/add-auth.ts +853 -0
  238. package/src/cli/commands/add-connector.ts +158 -0
  239. package/src/cli/commands/cosmos-worktree-isolation.ts +130 -0
  240. package/src/cli/commands/create-model.ts +62 -0
  241. package/src/cli/commands/dev-seeds.ts +629 -0
  242. package/src/cli/commands/dev.ts +1252 -0
  243. package/src/cli/commands/index.ts +9 -0
  244. package/src/cli/commands/init.ts +3541 -0
  245. package/src/cli/commands/provision.ts +193 -0
  246. package/src/cli/commands/scaffold.ts +1081 -0
  247. package/src/cli/index.ts +350 -0
  248. package/src/core/config.ts +380 -0
  249. package/src/core/mock/connector-mock-server.ts +555 -0
  250. package/src/core/mock/zod-mock-generator.ts +205 -0
  251. package/src/core/operations/auth-operations.ts +360 -0
  252. package/src/core/operations/create-model.ts +191 -0
  253. package/src/core/operations/file-session.ts +222 -0
  254. package/src/core/operations/provision-operations.ts +297 -0
  255. package/src/core/operations/runtime.ts +258 -0
  256. package/src/core/operations/scaffold-apply.ts +106 -0
  257. package/src/core/operations/scaffold-machine.ts +77 -0
  258. package/src/core/operations/scaffold-plan.ts +215 -0
  259. package/src/core/project/agent-instructions.ts +167 -0
  260. package/src/core/project/agent-templates/AGENTS.md +502 -0
  261. package/src/core/project/agent-templates/CLAUDE.md +31 -0
  262. package/src/core/project/agent-templates/azure-functions.instructions.md +22 -0
  263. package/src/core/project/agent-templates/bff-routes.instructions.md +18 -0
  264. package/src/core/project/agent-templates/copilot-instructions.md +27 -0
  265. package/src/core/project/agent-templates/shared-models.instructions.md +72 -0
  266. package/src/core/project/artifacts.ts +205 -0
  267. package/src/core/project/boundaries.ts +170 -0
  268. package/src/core/project/capabilities.ts +193 -0
  269. package/src/core/project/drift.ts +202 -0
  270. package/src/core/project/infra.ts +196 -0
  271. package/src/core/project/manifest.ts +402 -0
  272. package/src/core/project/state.ts +77 -0
  273. package/src/core/project/validation.ts +295 -0
  274. package/src/core/project/workflows.ts +295 -0
  275. package/src/core/scaffold/auth-generator.ts +1824 -0
  276. package/src/core/scaffold/connector-functions-generator.ts +1133 -0
  277. package/src/core/scaffold/functions-generator.ts +972 -0
  278. package/src/core/scaffold/model-parser.ts +854 -0
  279. package/src/core/scaffold/native-schema-generator.ts +904 -0
  280. package/src/core/scaffold/nextjs-generator.ts +382 -0
  281. package/src/core/scaffold/openapi-generator.ts +212 -0
  282. package/src/core/scaffold/ui-generator.ts +1100 -0
  283. package/src/core/verify/index.ts +468 -0
  284. package/src/database/base-model.ts +184 -0
  285. package/src/database/client.ts +140 -0
  286. package/src/database/repository.ts +104 -0
  287. package/src/database/runtime-check.ts +25 -0
  288. package/src/index.ts +27 -0
  289. package/src/machine/contracts.ts +33 -0
  290. package/src/machine/errors.ts +45 -0
  291. package/src/machine/index.ts +690 -0
  292. package/src/mcp/index.ts +423 -0
  293. package/src/types/index.ts +182 -0
  294. package/src/utils/package-manager.ts +246 -0
  295. package/src/utils/python-uv.ts +96 -0
  296. package/src/version.ts +13 -0
package/README.md CHANGED
@@ -2,105 +2,112 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/swallowkit.svg)](https://www.npmjs.com/package/swallowkit)
4
4
  [![npm downloads](https://img.shields.io/npm/dm/swallowkit.svg)](https://www.npmjs.com/package/swallowkit)
5
+ [![VS Code Marketplace](https://img.shields.io/visual-studio-marketplace/v/himanago.swallowkit-vscode?label=VS%20Code%20Extension)](https://marketplace.visualstudio.com/items?itemName=himanago.swallowkit-vscode)
5
6
  [![license](https://img.shields.io/npm/l/swallowkit.svg)](./LICENSE)
6
7
 
7
8
  English | [日本語](./README.ja.md)
8
9
 
9
- **Type-safe schema-driven development toolkit for Next.js applications on Azure**
10
+ Schema-driven application scaffolding for Next.js and Azure.
10
11
 
11
- SwallowKit enables developers to build full-stack Next.js applications with external Azure Functions backends while maintaining end-to-end type safety through shared Zod schemas.
12
+ SwallowKit helps you build maintainable full-stack applications on Azure by using shared Zod schemas as the source of truth. From one schema definition, it can generate frontend forms, BFF routes, Azure Functions backends, OpenAPI contracts, infrastructure templates, and AI-agent-friendly project metadata.
12
13
 
13
- Deploy your Next.js app to Azure Static Web Apps using standalone mode, and connect to independent Azure Functions for backend operations.
14
+ It is designed for developers who want to build Next.js applications on Azure without letting the frontend, backend, database model, validation rules, and deployment configuration drift apart.
14
15
 
15
- Next.js API routes are restricted to use only as BFF (Backend For Frontend), offloading business logic to Azure Functions to provide clear separation between client and server.
16
+ ## 🎯 Why SwallowKit?
16
17
 
17
- Featuring Scaffold functionality to automatically generate CRUD operations from Zod schemas, achieving type-safe integration with Cosmos DB and consistent type definitions and validation.
18
+ AI can generate application code quickly. Frameworks can hide complexity nicely. But production applications still need explicit architecture.
18
19
 
19
- > **Note**: This project is in active development. APIs may change in future versions.
20
+ In a typical full-stack application, the same domain model is repeated across many places:
20
21
 
21
- ## ✨ Key Features
22
+ - frontend form types
23
+ - client-side validation
24
+ - BFF request and response models
25
+ - backend DTOs
26
+ - API contracts
27
+ - database entities
28
+ - seed data
29
+ - infrastructure and deployment configuration
22
30
 
23
- - **🔄 Zod Schema Sharing** - Same schema across frontend, BFF, Azure Functions, and Cosmos DB
24
- - **⚡ CRUD Code Generation** - Auto-generate Azure Functions + Next.js code with `swallowkit scaffold`
25
- - **🛡️ Full Type Safety** - End-to-end TypeScript from client to database
26
- - **🎯 BFF Pattern** - Next.js API Routes as BFF layer with auto-validation and resource inference
27
- - **☁️ Azure Optimized** - Minimal-cost architecture with Static Web Apps + Functions + Cosmos DB
28
- - **🚀 Easy Deployment** - Auto-generated Bicep IaC + CI/CD workflows
29
- - **🤖 AI-Friendly** - Auto-generated instruction files (`AGENTS.md`, `CLAUDE.md`, `.github/copilot-instructions.md`) and layer-specific rules help GitHub Copilot, Claude Code, and OpenAI Codex follow project conventions
31
+ As the application grows, these layers often drift apart. SwallowKit reduces that drift by making the schema explicit and using it to generate the surrounding application structure.
30
32
 
31
- ## 📚 Documentation
33
+ **SwallowKit is not a full-stack framework that hides everything behind magic. It is a scaffolding toolkit that generates readable, editable, and replaceable code.**
32
34
 
33
- Visit the **[SwallowKit Documentation](https://himanago.github.io/swallowkit/)** for the full docs (also available in [日本語](https://himanago.github.io/swallowkit/ja/)).
35
+ ## ✨ What it gives you
34
36
 
35
- - **[CLI Reference](https://himanago.github.io/swallowkit/en/cli-reference)** - All commands in detail
36
- - **[Scaffold Guide](https://himanago.github.io/swallowkit/en/scaffold-guide)** - CRUD code generation
37
- - **[Zod Schema Sharing Guide](https://himanago.github.io/swallowkit/en/zod-schema-sharing-guide)** - Schema design
38
- - **[Deployment Guide](https://himanago.github.io/swallowkit/en/deployment-guide)** - Deploy to Azure
37
+ - **Shared Zod schemas** as the source of truth
38
+ - **CRUD scaffolding** for Next.js, BFF routes, Azure Functions, and UI components
39
+ - **Azure-ready infrastructure** using Bicep
40
+ - **Multi-language Azure Functions** backends (TypeScript, C#, Python)
41
+ - **Local development helpers** and seed data
42
+ - **AI/MCP-friendly** project metadata and commands
43
+ - **VS Code extension** support
39
44
 
40
- ## 🚀 Quick Start
45
+ ## 🏗️ Typical architecture
41
46
 
42
- ### 1. Create Project
47
+ SwallowKit is optimized for applications built with:
43
48
 
44
- ```bash
45
- npx swallowkit init my-app
46
- # or
47
- pnpm dlx swallowkit init my-app
48
- cd my-app
49
- ```
49
+ - Next.js
50
+ - Azure Static Web Apps
51
+ - Azure Functions
52
+ - Azure Cosmos DB
53
+ - Azure Bicep
54
+ - GitHub Actions or Azure Pipelines
50
55
 
51
- The interactive prompts ask for CI/CD provider, Cosmos DB mode, and network settings. You can also specify them as flags to skip prompts entirely:
56
+ The default architecture follows a BFF pattern:
52
57
 
53
- ```bash
54
- # Non-interactive mode (useful for VS Code extensions or automation)
55
- npx swallowkit init my-app --cicd github --cosmos-db-mode serverless --vnet outbound
58
+ ```
59
+ Browser
60
+ |
61
+ Next.js frontend
62
+ |
63
+ Next.js BFF routes
64
+ |
65
+ Azure Functions API
66
+ |
67
+ Azure Cosmos DB
56
68
  ```
57
69
 
58
- | Flag | Values | Description |
59
- |------|--------|-------------|
60
- | `--cicd <provider>` | `github`, `azure`, `skip` | CI/CD provider |
61
- | `--cosmos-db-mode <mode>` | `freetier`, `serverless` | Cosmos DB pricing mode |
62
- | `--vnet <option>` | `outbound`, `none` | Network security |
63
-
64
- Omit any flag to be prompted for that value interactively.
70
+ The BFF layer keeps frontend code simple while allowing backend services, authentication, authorization, and cloud resources to evolve independently.
65
71
 
66
- ### 2. Create Models
72
+ > **Note**: This project is in active development. APIs may change in future versions.
67
73
 
68
- You can create multiple models at once:
74
+ ## 📚 Documentation
69
75
 
70
- ```bash
71
- npx swallowkit create-model category todo
72
- # or
73
- pnpm dlx swallowkit create-model category todo
74
- ```
76
+ Visit the **[SwallowKit Documentation](https://himanago.github.io/swallowkit/)** for the full docs (also available in [日本語](https://himanago.github.io/swallowkit/ja/)).
75
77
 
76
- This generates `shared/models/category.ts` and `shared/models/todo.ts`. Customize them by adding your required fields:
78
+ - **[Getting Started](https://himanago.github.io/swallowkit/en/getting-started)** - First project setup
79
+ - **[Core Concepts](https://himanago.github.io/swallowkit/en/concepts)** - Schema-centric architecture
80
+ - **[Scaffold Guide](https://himanago.github.io/swallowkit/en/scaffold-guide)** - CRUD code generation
81
+ - **[Local Development](https://himanago.github.io/swallowkit/en/dev-guide)** - Dev server, seeds, mock connectors
82
+ - **[Deployment Guide](https://himanago.github.io/swallowkit/en/deployment-guide)** - Deploy to Azure
83
+ - **[AI / MCP Guide](https://himanago.github.io/swallowkit/en/ai-mcp-guide)** - AI-agent integration
84
+ - **[Coding Agent Guide](https://himanago.github.io/swallowkit/en/coding-agent-guide)** - Lifecycle integration, ownership, and external process composition
85
+ - **[Authentication](https://himanago.github.io/swallowkit/en/auth-guide)** - Auth and authorization
86
+ - **[Connectors](https://himanago.github.io/swallowkit/en/connector-guide)** - External data sources
77
87
 
78
- ```typescript
79
- // shared/models/category.ts
80
- import { z } from 'zod';
88
+ ## 🚀 Quick start
81
89
 
82
- export const category = z.object({
83
- id: z.string(),
84
- name: z.string().min(1).max(50),
85
- createdAt: z.string().optional(),
86
- updatedAt: z.string().optional(),
87
- });
90
+ Create a new project:
88
91
 
89
- export type Category = z.infer<typeof category>;
92
+ ```bash
93
+ npx swallowkit init my-app
94
+ cd my-app
90
95
  ```
91
96
 
92
- For parent-child relationships, use **nested schemas** instead of ID references:
97
+ Create a model and customize the schema:
98
+
99
+ ```bash
100
+ npx swallowkit create-model todo
101
+ ```
93
102
 
94
103
  ```typescript
95
104
  // shared/models/todo.ts
96
105
  import { z } from 'zod';
97
- import { category } from './category';
98
106
 
99
107
  export const todo = z.object({
100
108
  id: z.string(),
101
109
  text: z.string().min(1).max(200),
102
110
  completed: z.boolean().default(false),
103
- category: category.optional(), // Nested object (not categoryId)
104
111
  createdAt: z.string().optional(),
105
112
  updatedAt: z.string().optional(),
106
113
  });
@@ -108,139 +115,40 @@ export const todo = z.object({
108
115
  export type Todo = z.infer<typeof todo>;
109
116
  ```
110
117
 
111
- > **Tip**: Nesting preserves type safety and stores related data together in the document, which is natural for Cosmos DB's document model.
112
-
113
- ### 3. Generate CRUD Code
114
-
115
- ```bash
116
- npx swallowkit scaffold shared/models/todo.ts
117
- # or
118
- pnpm dlx swallowkit scaffold shared/models/todo.ts
119
- ```
120
-
121
- This auto-generates:
122
- - ✅ Azure Functions (CRUD endpoints + Cosmos DB bindings)
123
- - ✅ Next.js BFF API Routes (auto-validation + resource inference)
124
- - ✅ React Components (type-safe forms)
125
-
126
- ### 4. Start Development Server
118
+ Generate CRUD code and start the dev server:
127
119
 
128
120
  ```bash
121
+ npx swallowkit scaffold todo
129
122
  npx swallowkit dev
130
- # or
131
- pnpm dlx swallowkit dev
132
- ```
133
-
134
- - Next.js: http://localhost:3000
135
- - Azure Functions: http://localhost:7071
136
-
137
- ### 5. Use from Frontend
138
-
139
- ```typescript
140
- import { api } from '@/lib/api/backend';
141
- import type { Todo } from '@/shared/models/todo';
142
-
143
- // Get all - call BFF endpoint
144
- const todos = await api.get<Todo[]>('/api/todos');
145
-
146
- // Create - validated by backend
147
- const created = await api.post<Todo>('/api/todos', {
148
- text: 'Buy milk',
149
- completed: false
150
- });
151
-
152
- // Update - validated by backend
153
- const updated = await api.put<Todo>('/api/todos/123', { completed: true });
154
-
155
- // Delete
156
- await api.delete('/api/todos/123');
157
- ```
158
-
159
- ## 🏗️ Architecture
160
-
161
- ```
162
- ┌─────────────────────────────────────────────────────────────┐
163
- │ Frontend (React) │
164
- │ - Client Components │
165
- │ - Server Components (SSR) │
166
- └──────────────────────────┬───────────────────────────────────┘
167
- │ api.post('/api/todos', data)
168
- ▼
169
- ┌─────────────────────────────────────────────────────────────┐
170
- │ BFF Layer (Next.js API Routes) │
171
- │ - Auto Schema Validation (Zod) │
172
- │ - Error Handling │
173
- └──────────────────────────┬───────────────────────────────────┘
174
- │ HTTP Request
175
- ▼
176
- ┌─────────────────────────────────────────────────────────────┐
177
- │ Azure Functions (Backend) │
178
- │ - HTTP Triggers (CRUD) │
179
- │ - Zod Validation (Re-check) │
180
- │ - Business Logic │
181
- │ - Cosmos DB Bindings │
182
- └──────────────────────────┬───────────────────────────────────┘
183
- │
184
- ▼
185
- ┌─────────────────────────────────────────────────────────────┐
186
- │ Azure Cosmos DB │
187
- │ - NoSQL Database │
188
- │ - Zod Schema Validation │
189
- └─────────────────────────────────────────────────────────────┘
190
123
  ```
191
124
 
192
- **Key Patterns:**
193
- - **BFF (Backend For Frontend)**: Next.js API Routes proxy to Azure Functions
194
- - **Shared Schemas**: Zod schemas used across frontend, BFF, Functions, and DB
195
- - **Type Safety**: TypeScript types auto-inferred from Zod
196
- - **Managed Identity**: Secure service connections (no connection strings)
125
+ This generates Azure Functions, Next.js BFF routes, and React UI components — all typed from the shared schema.
197
126
 
198
- ## 📦 Prerequisites
127
+ ## 🤖 AI-agent-friendly development
199
128
 
200
- - Node.js 22.x
201
- - **pnpm** (recommended): `corepack enable` or `npm install -g pnpm`
202
- - npm also works — SwallowKit auto-detects the package manager (if pnpm is installed, it is always preferred)
203
- - Azure Cosmos DB Emulator (local development)
204
- - [Official documentation (vNext recommended)](https://learn.microsoft.com/en-us/azure/cosmos-db/emulator-linux)
205
- - Windows: [Download](https://aka.ms/cosmosdb-emulator)
206
- - Docker: `docker run -p 8081:8081 mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator`
129
+ SwallowKit provides machine-readable project metadata and command interfaces so coding agents can inspect the project structure, generate code through official commands, and validate changes without directly rewriting unrelated files.
207
130
 
208
- ## 🚀 Deploy to Azure
131
+ The goal is to make AI-assisted development safer by giving agents explicit architectural boundaries.
209
132
 
210
- Deploy your Next.js app to Azure Static Web Apps using standalone mode, and connect to independent Azure Functions for backend operations.
133
+ ## 📦 Generated project structure
211
134
 
212
- **1. Provision resources (Bicep IaC)**
213
-
214
- ```bash
215
- npx swallowkit provision --resource-group my-app-rg --location japaneast
216
- # or
217
- pnpm dlx swallowkit provision --resource-group my-app-rg --location japaneast
218
135
  ```
219
-
220
- After provisioning, the required CI/CD secret values are displayed in the terminal. Copy them.
221
-
222
- **2. Push code**
223
-
224
- ```bash
225
- git push origin main
136
+ .
137
+ ├── app/ # Next.js pages and BFF API routes
138
+ ├── shared/
139
+ │ └── models/ # Shared Zod schemas (source of truth)
140
+ ├── functions/ # Azure Functions backend
141
+ ├── infra/ # Bicep templates
142
+ ├── lib/ # BFF helpers and scaffold config
143
+ └── .swallowkit/ # SwallowKit project metadata
226
144
  ```
227
145
 
228
- **3. Cancel the auto-triggered CI/CD run** — it will fail because secrets are not registered yet.
146
+ ## 🔗 Status
229
147
 
230
- **4. Register the displayed secret values** in GitHub (Settings → Secrets) or Azure DevOps (Pipelines → Library).
148
+ SwallowKit is under active development. The API, project structure, and generated output may change.
231
149
 
232
- **5. Manually re-run the CI/CD workflow.**
150
+ Feedback, issues, and small example use cases are welcome.
233
151
 
234
- See **[Deployment Guide](https://himanago.github.io/swallowkit/en/deployment-guide)** for details.
235
-
236
- ## License
152
+ ## 📄 License
237
153
 
238
154
  MIT
239
-
240
- ## 🔗 Related Links
241
-
242
- - [Azure Static Web Apps](https://learn.microsoft.com/en-us/azure/static-web-apps/)
243
- - [Azure Functions](https://learn.microsoft.com/en-us/azure/azure-functions/)
244
- - [Azure Cosmos DB](https://learn.microsoft.com/en-us/azure/cosmos-db/)
245
- - [Next.js](https://nextjs.org/)
246
- - [Zod](https://zod.dev/)
@@ -3,10 +3,22 @@ import { ModelInfo } from "../core/scaffold/model-parser";
3
3
  * テスト用の基本的な ModelInfo フィクスチャ
4
4
  */
5
5
  export declare function createBasicModelInfo(overrides?: Partial<ModelInfo>): ModelInfo;
6
+ /**
7
+ * RDB コネクタ (read-only) 付きの ModelInfo フィクスチャ
8
+ */
9
+ export declare function createRdbConnectorModelInfo(overrides?: Partial<ModelInfo>): ModelInfo;
10
+ /**
11
+ * API コネクタ (read-write) 付きの ModelInfo フィクスチャ
12
+ */
13
+ export declare function createApiConnectorModelInfo(overrides?: Partial<ModelInfo>): ModelInfo;
6
14
  /**
7
15
  * 外部キーを含む ModelInfo フィクスチャ
8
16
  */
9
17
  export declare function createModelInfoWithForeignKey(): ModelInfo;
18
+ /**
19
+ * 必須・optional・nullable の外部キーを含む ModelInfo フィクスチャ
20
+ */
21
+ export declare function createModelInfoWithNullableForeignKeys(): ModelInfo;
10
22
  /**
11
23
  * enum フィールドを含む ModelInfo フィクスチャ
12
24
  */
@@ -1 +1 @@
1
- {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/__tests__/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAoB9E;AAED;;GAEG;AACH,wBAAgB,6BAA6B,IAAI,SAAS,CAqBzD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,SAAS,CA0BnD"}
1
+ {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/__tests__/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAqB9E;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAuBrF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CA2BrF;AAED;;GAEG;AACH,wBAAgB,6BAA6B,IAAI,SAAS,CAqBzD;AAED;;GAEG;AACH,wBAAgB,sCAAsC,IAAI,SAAS,CAmClE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,SAAS,CA0BnD"}
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createBasicModelInfo = createBasicModelInfo;
4
+ exports.createRdbConnectorModelInfo = createRdbConnectorModelInfo;
5
+ exports.createApiConnectorModelInfo = createApiConnectorModelInfo;
4
6
  exports.createModelInfoWithForeignKey = createModelInfoWithForeignKey;
7
+ exports.createModelInfoWithNullableForeignKeys = createModelInfoWithNullableForeignKeys;
5
8
  exports.createModelInfoWithEnum = createModelInfoWithEnum;
6
9
  /**
7
10
  * テスト用の基本的な ModelInfo フィクスチャ
@@ -24,9 +27,68 @@ function createBasicModelInfo(overrides) {
24
27
  hasCreatedAt: true,
25
28
  hasUpdatedAt: true,
26
29
  nestedSchemaRefs: [],
30
+ partitionKey: '/id',
27
31
  ...overrides,
28
32
  };
29
33
  }
34
+ /**
35
+ * RDB コネクタ (read-only) 付きの ModelInfo フィクスチャ
36
+ */
37
+ function createRdbConnectorModelInfo(overrides) {
38
+ return createBasicModelInfo({
39
+ name: "User",
40
+ displayName: "User",
41
+ schemaName: "userSchema",
42
+ filePath: "/models/user.ts",
43
+ fields: [
44
+ { name: "id", type: "string", isOptional: false, isArray: false },
45
+ { name: "employeeCode", type: "string", isOptional: false, isArray: false },
46
+ { name: "name", type: "string", isOptional: false, isArray: false },
47
+ { name: "email", type: "string", isOptional: false, isArray: false },
48
+ { name: "department", type: "string", isOptional: true, isArray: false },
49
+ { name: "createdAt", type: "string", isOptional: true, isArray: false },
50
+ { name: "updatedAt", type: "string", isOptional: true, isArray: false },
51
+ ],
52
+ connectorConfig: {
53
+ connector: "mysql",
54
+ operations: ["getAll", "getById"],
55
+ table: "users",
56
+ idColumn: "id",
57
+ },
58
+ ...overrides,
59
+ });
60
+ }
61
+ /**
62
+ * API コネクタ (read-write) 付きの ModelInfo フィクスチャ
63
+ */
64
+ function createApiConnectorModelInfo(overrides) {
65
+ return createBasicModelInfo({
66
+ name: "BacklogIssue",
67
+ displayName: "BacklogIssue",
68
+ schemaName: "backlogIssueSchema",
69
+ filePath: "/models/backlog-issue.ts",
70
+ fields: [
71
+ { name: "id", type: "string", isOptional: false, isArray: false },
72
+ { name: "projectId", type: "string", isOptional: false, isArray: false },
73
+ { name: "issueKey", type: "string", isOptional: false, isArray: false },
74
+ { name: "summary", type: "string", isOptional: false, isArray: false },
75
+ { name: "description", type: "string", isOptional: true, isArray: false },
76
+ { name: "createdAt", type: "string", isOptional: true, isArray: false },
77
+ { name: "updatedAt", type: "string", isOptional: true, isArray: false },
78
+ ],
79
+ connectorConfig: {
80
+ connector: "backlog",
81
+ operations: ["getAll", "getById", "create", "update"],
82
+ endpoints: {
83
+ getAll: "GET /issues",
84
+ getById: "GET /issues/{id}",
85
+ create: "POST /issues",
86
+ update: "PATCH /issues/{id}",
87
+ },
88
+ },
89
+ ...overrides,
90
+ });
91
+ }
30
92
  /**
31
93
  * 外部キーを含む ModelInfo フィクスチャ
32
94
  */
@@ -52,6 +114,45 @@ function createModelInfoWithForeignKey() {
52
114
  ],
53
115
  });
54
116
  }
117
+ /**
118
+ * 必須・optional・nullable の外部キーを含む ModelInfo フィクスチャ
119
+ */
120
+ function createModelInfoWithNullableForeignKeys() {
121
+ return createBasicModelInfo({
122
+ name: "Coupon",
123
+ displayName: "Coupon",
124
+ schemaName: "couponSchema",
125
+ filePath: "/models/coupon.ts",
126
+ fields: [
127
+ { name: "id", type: "string", isOptional: false, isArray: false },
128
+ {
129
+ name: "requiredUserId",
130
+ type: "string",
131
+ isOptional: false,
132
+ isArray: false,
133
+ isForeignKey: true,
134
+ referencedModel: "RequiredUser",
135
+ },
136
+ {
137
+ name: "optionalUserId",
138
+ type: "string",
139
+ isOptional: true,
140
+ isArray: false,
141
+ isForeignKey: true,
142
+ referencedModel: "OptionalUser",
143
+ },
144
+ {
145
+ name: "nullableUserId",
146
+ type: "string",
147
+ isOptional: false,
148
+ isNullable: true,
149
+ isArray: false,
150
+ isForeignKey: true,
151
+ referencedModel: "NullableUser",
152
+ },
153
+ ],
154
+ });
155
+ }
55
156
  /**
56
157
  * enum フィールドを含む ModelInfo フィクスチャ
57
158
  */
@@ -1 +1 @@
1
- {"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../src/__tests__/fixtures.ts"],"names":[],"mappings":";;AAKA,oDAoBC;AAKD,sEAqBC;AAKD,0D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K;aACf;YACD,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;YACxE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;SACzE;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * SwallowKit Add-Auth コマンド
3
+ * 認証認可基盤ファイルを生成する
4
+ */
5
+ interface AddAuthOptions {
6
+ provider?: string;
7
+ scheme?: string;
8
+ /** SWA の許可する identity provider (例: ['github'])。未指定時は ['aad']。 */
9
+ allowedProviders?: string[];
10
+ }
11
+ export declare function generateSwaAuthContext(allowedProviders?: string[]): string;
12
+ export declare function addAuthProviderToRootLayout(layout: string): string;
13
+ export declare function addAuthCommand(options: AddAuthOptions): Promise<void>;
14
+ export {};
15
+ //# sourceMappingURL=add-auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-auth.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/add-auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA+CH,UAAU,cAAc;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AA8HD,wBAAgB,sBAAsB,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CA0C1E;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAclE;AAwBD,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,iBAoJ3D"}