sonamu 0.8.24 → 0.8.26
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/dist/api/__tests__/config.test.js +189 -0
- package/dist/api/config.d.ts.map +1 -1
- package/dist/api/config.js +7 -2
- package/dist/api/sonamu.d.ts.map +1 -1
- package/dist/api/sonamu.js +14 -10
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +2 -1
- package/dist/auth/knex-adapter.d.ts +23 -0
- package/dist/auth/knex-adapter.d.ts.map +1 -0
- package/dist/auth/knex-adapter.js +163 -0
- package/dist/auth/plugins/wrappers/admin.d.ts +2 -2
- package/dist/bin/__tests__/ts-loader-register.test.js +45 -0
- package/dist/bin/cli.js +47 -9
- package/dist/bin/ts-loader-register.js +3 -29
- package/dist/bin/ts-loader-registration.d.ts +2 -0
- package/dist/bin/ts-loader-registration.d.ts.map +1 -0
- package/dist/bin/ts-loader-registration.js +42 -0
- package/dist/cone/cone-generator.js +3 -3
- package/dist/database/puri-subset.test-d.js +9 -1
- package/dist/database/puri-subset.types.d.ts +1 -1
- package/dist/database/puri-subset.types.d.ts.map +1 -1
- package/dist/database/puri-subset.types.js +1 -1
- package/dist/testing/fixture-generator.js +5 -5
- package/dist/ui/ai-client.js +2 -2
- package/dist/ui/api.d.ts.map +1 -1
- package/dist/ui/api.js +14 -14
- package/dist/ui/cdd-service.d.ts +15 -18
- package/dist/ui/cdd-service.d.ts.map +1 -1
- package/dist/ui/cdd-service.js +246 -222
- package/dist/ui/cdd-types.d.ts +41 -68
- package/dist/ui/cdd-types.d.ts.map +1 -1
- package/dist/ui/cdd-types.js +2 -2
- package/dist/ui-web/assets/index-CKo0Z2Iu.css +1 -0
- package/dist/ui-web/assets/{index-CxiydzeC.js → index-DK-2aacv.js} +83 -83
- package/dist/ui-web/index.html +2 -2
- package/package.json +6 -2
- package/src/api/__tests__/config.test.ts +225 -0
- package/src/api/config.ts +10 -4
- package/src/api/sonamu.ts +16 -13
- package/src/auth/index.ts +1 -0
- package/src/auth/knex-adapter.ts +208 -0
- package/src/bin/__tests__/ts-loader-register.test.ts +62 -0
- package/src/bin/cli.ts +52 -9
- package/src/bin/ts-loader-register.ts +2 -32
- package/src/bin/ts-loader-registration.ts +55 -0
- package/src/cone/cone-generator.ts +2 -2
- package/src/database/puri-subset.test-d.ts +102 -0
- package/src/database/puri-subset.types.ts +1 -1
- package/src/skills/commands/sonamu-skills.md +20 -0
- package/src/skills/sonamu/SKILL.md +179 -137
- package/src/skills/sonamu/ai-agents.md +69 -69
- package/src/skills/sonamu/api.md +147 -147
- package/src/skills/sonamu/auth-migration.md +220 -220
- package/src/skills/sonamu/auth-plugins.md +83 -83
- package/src/skills/sonamu/auth.md +106 -106
- package/src/skills/sonamu/cdd.md +65 -200
- package/src/skills/sonamu/cone.md +138 -138
- package/src/skills/sonamu/config.md +191 -191
- package/src/skills/sonamu/create-sonamu.md +66 -66
- package/src/skills/sonamu/database.md +158 -158
- package/src/skills/sonamu/entity-basic.md +292 -293
- package/src/skills/sonamu/entity-relations.md +246 -246
- package/src/skills/sonamu/entity-validation-checklist.md +124 -124
- package/src/skills/sonamu/fixture-cli.md +231 -231
- package/src/skills/sonamu/framework-change.md +37 -37
- package/src/skills/sonamu/frontend.md +223 -223
- package/src/skills/sonamu/i18n.md +82 -82
- package/src/skills/sonamu/migration.md +77 -77
- package/src/skills/sonamu/model.md +222 -222
- package/src/skills/sonamu/naite.md +86 -86
- package/src/skills/sonamu/project-init.md +228 -228
- package/src/skills/sonamu/puri.md +122 -122
- package/src/skills/sonamu/scaffolding.md +154 -154
- package/src/skills/sonamu/skill-contribution.md +124 -124
- package/src/skills/sonamu/subset.md +46 -46
- package/src/skills/sonamu/tasks.md +82 -82
- package/src/skills/sonamu/testing-devrunner.md +147 -147
- package/src/skills/sonamu/testing.md +673 -673
- package/src/skills/sonamu/upsert.md +79 -79
- package/src/skills/sonamu/vector.md +67 -67
- package/src/testing/fixture-generator.ts +4 -4
- package/src/ui/ai-client.ts +1 -1
- package/src/ui/api.ts +18 -17
- package/src/ui/cdd-service.ts +264 -254
- package/src/ui/cdd-types.ts +40 -75
- package/dist/ui-web/assets/index-BrQKU3j9.css +0 -1
- package/src/skills/sonamu/workflow.md +0 -317
|
@@ -1,82 +1,82 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sonamu-framework-change
|
|
3
|
-
description: Sonamu
|
|
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
4
|
---
|
|
5
5
|
|
|
6
|
-
# Sonamu Framework
|
|
6
|
+
# Sonamu Framework Change Decision
|
|
7
7
|
|
|
8
|
-
|
|
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
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Decision rubric
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Evaluate along the following 4 axes:
|
|
15
15
|
|
|
16
|
-
|
|
|
16
|
+
| Axis | Project workaround | Framework fix |
|
|
17
17
|
|----|-------------|----------------|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
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
22
|
|
|
23
|
-
|
|
23
|
+
**Criteria for choosing project workaround**: If 2 or more of the 4 axes lean toward "project workaround", apply the workaround first.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
**Criteria for choosing framework fix**: If the reproduction scope is "any usage pattern" and the workaround cost is high, consider a fix.
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## When the decision is unclear → Ask the user
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Do not decide alone if any of the following apply:
|
|
32
32
|
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
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
36
|
|
|
37
37
|
```
|
|
38
|
-
"
|
|
39
|
-
|
|
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
40
|
```
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## Documentation obligation when applying a workaround
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
If a workaround is chosen, record it in the following two places:
|
|
47
47
|
|
|
48
|
-
1.
|
|
49
|
-
2. **memory**:
|
|
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
50
|
|
|
51
51
|
---
|
|
52
52
|
|
|
53
|
-
##
|
|
53
|
+
## Concrete pattern: `@upload` multiple parameters
|
|
54
54
|
|
|
55
|
-
###
|
|
55
|
+
### Problem
|
|
56
56
|
|
|
57
|
-
`@upload`
|
|
57
|
+
When an `@upload` method has multiple primitive parameters, a `split(':')` bug in `services.template.ts` causes `useUploadMutation` to be generated incorrectly.
|
|
58
58
|
|
|
59
59
|
```typescript
|
|
60
|
-
// WRONG —
|
|
60
|
+
// WRONG — codegen breaks with this pattern
|
|
61
61
|
async upload(entity_type: string, entity_id: number, file_type: string)
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Generated result:
|
|
65
65
|
```typescript
|
|
66
|
-
// mutationFn
|
|
66
|
+
// mutationFn only passes params.params and params.files (entity_id and file_type are missing)
|
|
67
67
|
mutationFn: (params: { params: string; ... }) => upload(params.params, params.files)
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
###
|
|
70
|
+
### Fix: wrap in a single object
|
|
71
71
|
|
|
72
72
|
```typescript
|
|
73
|
-
// CORRECT —
|
|
73
|
+
// CORRECT — single object parameter
|
|
74
74
|
async upload(params: { entity_type: string; entity_id: number; file_type: string })
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
Sonamu
|
|
77
|
+
The Sonamu backend automatically deserializes nested formData in the form `params[entity_type]` using `qs`, so this has no effect on runtime behavior.
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
Call-site pattern:
|
|
80
80
|
```typescript
|
|
81
81
|
uploadMutation.mutate({
|
|
82
82
|
params: { entity_type, entity_id, file_type },
|
|
@@ -84,11 +84,11 @@ uploadMutation.mutate({
|
|
|
84
84
|
})
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
**Rule**: If an `@upload` method requires 2 or more parameters, always wrap them in a single object.
|
|
88
88
|
|
|
89
89
|
---
|
|
90
90
|
|
|
91
|
-
##
|
|
91
|
+
## Reference
|
|
92
92
|
|
|
93
|
-
-
|
|
94
|
-
-
|
|
93
|
+
- Bug source: `modules/sonamu/src/template/implementations/services.template.ts`
|
|
94
|
+
- Related skills: `api.md`, `skill-contribution.md`
|