sonamu 0.10.4 → 0.10.6

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 (82) hide show
  1. package/dist/bin/cli.js +206 -187
  2. package/dist/cone/cone-generator.js +3 -9
  3. package/dist/database/knex.d.ts.map +1 -1
  4. package/dist/database/knex.js +2 -2
  5. package/dist/database/puri.d.ts +17 -0
  6. package/dist/database/puri.d.ts.map +1 -1
  7. package/dist/database/puri.js +102 -3
  8. package/dist/migration/code-generation.js +6 -6
  9. package/dist/migration/migrator.d.ts.map +1 -1
  10. package/dist/migration/migrator.js +51 -6
  11. package/dist/ui-web/assets/{index-CDd6xT-F.js → index-D0MHYbxl.js} +2 -2
  12. package/dist/ui-web/assets/index-Dx_JX4aQ.css +1 -0
  13. package/dist/ui-web/index.html +2 -2
  14. package/package.json +2 -2
  15. package/src/bin/cli.ts +283 -282
  16. package/src/cone/cone-generator.ts +2 -18
  17. package/src/database/__tests__/puri.test.ts +183 -0
  18. package/src/database/knex.ts +4 -1
  19. package/src/database/puri.ts +229 -2
  20. package/src/database/puri.types.test-d.ts +56 -0
  21. package/src/migration/code-generation.ts +5 -5
  22. package/src/migration/migrator.ts +81 -7
  23. package/src/skills/AGENTS.md +76 -50
  24. package/src/skills/sonamu/SKILL.md +46 -227
  25. package/src/skills/{sonamu/ai-agents.md → sonamu-ai-agents/SKILL.md} +3 -3
  26. package/src/skills/{sonamu/api.md → sonamu-api/SKILL.md} +3 -2
  27. package/src/skills/{sonamu/auth.md → sonamu-auth/SKILL.md} +9 -4
  28. package/src/skills/{sonamu/auth-plugins.md → sonamu-auth/references/plugins.md} +2 -7
  29. package/src/skills/sonamu-auth/references/user-id-migration-followups.md +192 -0
  30. package/src/skills/{sonamu/auth-migration.md → sonamu-auth/references/user-id-migration.md} +1 -195
  31. package/src/skills/sonamu-config/SKILL.md +203 -0
  32. package/src/skills/{sonamu → sonamu-config/references}/database.md +3 -8
  33. package/src/skills/sonamu-config/references/environments.md +178 -0
  34. package/src/skills/sonamu-config/references/server-options.md +400 -0
  35. package/src/skills/sonamu-entity/SKILL.md +180 -0
  36. package/src/skills/{sonamu/entity-validation-checklist.md → sonamu-entity/references/creation-workflow.md} +117 -8
  37. package/src/skills/sonamu-entity/references/design-guides.md +243 -0
  38. package/src/skills/sonamu-entity/references/field-types.md +170 -0
  39. package/src/skills/sonamu-entity/references/relations-detail.md +245 -0
  40. package/src/skills/{sonamu/entity-relations.md → sonamu-entity/references/relations.md} +1 -258
  41. package/src/skills/{sonamu → sonamu-entity/references}/subset.md +1 -11
  42. package/src/skills/sonamu-fixture/SKILL.md +180 -0
  43. package/src/skills/{sonamu/fixture-cli.md → sonamu-fixture/references/cli-usage.md} +5 -176
  44. package/src/skills/{sonamu → sonamu-fixture/references}/cone.md +4 -14
  45. package/src/skills/sonamu-frontend/SKILL.md +142 -0
  46. package/src/skills/sonamu-frontend/references/components.md +323 -0
  47. package/src/skills/sonamu-frontend/references/examples.md +64 -0
  48. package/src/skills/sonamu-frontend/references/hooks.md +273 -0
  49. package/src/skills/sonamu-frontend/references/runtime.md +165 -0
  50. package/src/skills/{sonamu → sonamu-frontend/references}/scaffolding.md +3 -8
  51. package/src/skills/{sonamu/i18n.md → sonamu-i18n/SKILL.md} +2 -2
  52. package/src/skills/{sonamu/migration.md → sonamu-migration/SKILL.md} +1 -1
  53. package/src/skills/{sonamu/naite.md → sonamu-naite/SKILL.md} +5 -5
  54. package/src/skills/sonamu-query/SKILL.md +48 -0
  55. package/src/skills/sonamu-query/references/model-patterns.md +390 -0
  56. package/src/skills/{sonamu → sonamu-query/references}/model.md +1 -401
  57. package/src/skills/{sonamu → sonamu-query/references}/puri.md +31 -243
  58. package/src/skills/sonamu-query/references/search.md +238 -0
  59. package/src/skills/{sonamu → sonamu-query/references}/upsert.md +1 -6
  60. package/src/skills/{sonamu/tasks.md → sonamu-tasks/SKILL.md} +1 -1
  61. package/src/skills/sonamu-testing/SKILL.md +251 -0
  62. package/src/skills/{sonamu/testing-devrunner.md → sonamu-testing/references/devrunner.md} +4 -9
  63. package/src/skills/sonamu-testing/references/helpers.md +185 -0
  64. package/src/skills/sonamu-testing/references/patterns.md +263 -0
  65. package/src/skills/sonamu-testing/references/pitfalls.md +588 -0
  66. package/src/skills/sonamu-testing/references/quick-start.md +285 -0
  67. package/src/skills/sonamu-testing/references/type-safety.md +172 -0
  68. package/src/skills/sonamu-testing/references/writing-plan.md +375 -0
  69. package/src/skills/{sonamu/vector.md → sonamu-vector/SKILL.md} +1 -1
  70. package/dist/ui-web/assets/index-Dx4ap5i4.css +0 -1
  71. package/src/skills/commands/sonamu-skills.md +0 -20
  72. package/src/skills/project/README.md +0 -19
  73. package/src/skills/project/architecture.md +0 -373
  74. package/src/skills/sonamu/cdd.md +0 -129
  75. package/src/skills/sonamu/config.md +0 -772
  76. package/src/skills/sonamu/create-sonamu.md +0 -208
  77. package/src/skills/sonamu/entity-basic.md +0 -678
  78. package/src/skills/sonamu/framework-change.md +0 -96
  79. package/src/skills/sonamu/frontend.md +0 -915
  80. package/src/skills/sonamu/project-init.md +0 -477
  81. package/src/skills/sonamu/skill-contribution.md +0 -247
  82. package/src/skills/sonamu/testing.md +0 -2163
@@ -1,96 +0,0 @@
1
- ---
2
- name: sonamu-framework-change
3
- description: Criteria for deciding between modifying Sonamu framework source vs. applying project-level workarounds. Includes the @upload parameter pattern. Use when a Sonamu bug or limitation is discovered during project development.
4
- ---
5
-
6
- # Sonamu Framework Change Decision
7
-
8
- Criteria for deciding whether to directly modify the framework or apply a project-level workaround when a framework bug or limitation is discovered.
9
-
10
- ---
11
-
12
- ## Decision rubric
13
-
14
- Evaluate along the following 4 axes:
15
-
16
- | Axis | Project workaround | Framework fix |
17
- | ---------------------- | ------------------------------------------------------------------ | --------------------------------------------------- |
18
- | **Reproduction scope** | Only occurs in specific usage patterns | Occurs regardless of usage pattern |
19
- | **Workaround cost** | Resolved by modifying one place in the project | Workaround must be propagated to all projects |
20
- | **Impact scope** | Uncertain ripple effects on other projects if framework is changed | Change scope is isolated and side effects are clear |
21
- | **Ownership** | The code has a known author and discussion is needed | Bug is clear and a review path is available |
22
-
23
- **Criteria for choosing project workaround**: If 2 or more of the 4 axes lean toward "project workaround", apply the workaround first.
24
-
25
- **Criteria for choosing framework fix**: If the reproduction scope is "any usage pattern" and the workaround cost is high, consider a fix.
26
-
27
- ---
28
-
29
- ## When the decision is unclear → Ask the user
30
-
31
- Do not decide alone if any of the following apply:
32
-
33
- - Reproduction scope is difficult to confirm (unknown usage patterns in other projects)
34
- - The framework owner (e.g. CTO) is clearly identified and recently wrote the code
35
- - The workaround might compromise API semantics
36
-
37
- ```
38
- "This appears to be a framework bug. A project-level workaround is possible,
39
- but a framework fix may be more appropriate. How would you like to proceed?"
40
- ```
41
-
42
- ---
43
-
44
- ## Documentation obligation when applying a workaround
45
-
46
- If a workaround is chosen, record it in the following two places:
47
-
48
- 1. **`knownIssues` in the spec**: bug cause, workaround approach, call pattern, root cause file path
49
- 2. **memory**: if the workaround may be reverted by repeated operations like sync, record a caution note
50
-
51
- ---
52
-
53
- ## Concrete pattern: `@upload` multiple parameters
54
-
55
- ### Problem
56
-
57
- When an `@upload` method has multiple primitive parameters, a `split(':')` bug in `services.template.ts` causes `useUploadMutation` to be generated incorrectly.
58
-
59
- ```typescript
60
- // WRONG — codegen breaks with this pattern
61
- async upload(entity_type: string, entity_id: number, file_type: string)
62
- ```
63
-
64
- Generated result:
65
-
66
- ```typescript
67
- // mutationFn only passes params.params and params.files (entity_id and file_type are missing)
68
- mutationFn: (params: { params: string; ... }) => upload(params.params, params.files)
69
- ```
70
-
71
- ### Fix: wrap in a single object
72
-
73
- ```typescript
74
- // CORRECT — single object parameter
75
- async upload(params: { entity_type: string; entity_id: number; file_type: string })
76
- ```
77
-
78
- The Sonamu backend automatically deserializes nested formData in the form `params[entity_type]` using `qs`, so this has no effect on runtime behavior.
79
-
80
- Call-site pattern:
81
-
82
- ```typescript
83
- uploadMutation.mutate({
84
- params: { entity_type, entity_id, file_type },
85
- files,
86
- });
87
- ```
88
-
89
- **Rule**: If an `@upload` method requires 2 or more parameters, always wrap them in a single object.
90
-
91
- ---
92
-
93
- ## Reference
94
-
95
- - Bug source: `modules/sonamu/src/template/implementations/services.template.ts`
96
- - Related skills: `api.md`, `skill-contribution.md`