sonamu 0.10.5 → 0.10.7

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 (99) hide show
  1. package/dist/api/base-frame.d.ts +2 -0
  2. package/dist/api/base-frame.d.ts.map +1 -1
  3. package/dist/api/base-frame.js +8 -1
  4. package/dist/api/decorators.js +1 -1
  5. package/dist/api/sonamu.js +1 -1
  6. package/dist/bin/cli.js +195 -187
  7. package/dist/cone/cone-generator.js +3 -9
  8. package/dist/database/base-model.js +2 -2
  9. package/dist/database/knex.d.ts.map +1 -1
  10. package/dist/database/knex.js +2 -2
  11. package/dist/database/puri.d.ts +17 -0
  12. package/dist/database/puri.d.ts.map +1 -1
  13. package/dist/database/puri.js +102 -3
  14. package/dist/entity/entity-manager.js +1 -1
  15. package/dist/index.js +3 -3
  16. package/dist/migration/code-generation.js +6 -6
  17. package/dist/migration/migrator.d.ts.map +1 -1
  18. package/dist/migration/migrator.js +52 -7
  19. package/dist/migration/slack-confirm.js +1 -1
  20. package/dist/naite/naite-reporter.js +1 -1
  21. package/dist/syncer/checksum.js +1 -1
  22. package/dist/syncer/code-generator.js +1 -1
  23. package/dist/syncer/entity-operations.js +1 -1
  24. package/dist/syncer/syncer-actions.js +1 -1
  25. package/dist/syncer/syncer.js +1 -1
  26. package/dist/ui-web/assets/{index-BLX4zN8c.js → index-D0MHYbxl.js} +1 -1
  27. package/dist/ui-web/assets/index-Dx_JX4aQ.css +1 -0
  28. package/dist/ui-web/index.html +2 -2
  29. package/dist/utils/formatter.js +1 -1
  30. package/package.json +3 -3
  31. package/src/api/base-frame.ts +14 -1
  32. package/src/bin/cli.ts +268 -280
  33. package/src/cone/cone-generator.ts +2 -18
  34. package/src/database/__tests__/puri.test.ts +183 -0
  35. package/src/database/knex.ts +4 -1
  36. package/src/database/puri.ts +229 -2
  37. package/src/database/puri.types.test-d.ts +56 -0
  38. package/src/migration/code-generation.ts +5 -5
  39. package/src/migration/migrator.ts +81 -7
  40. package/src/skills/AGENTS.md +76 -50
  41. package/src/skills/sonamu/SKILL.md +46 -227
  42. package/src/skills/{sonamu/ai-agents.md → sonamu-ai-agents/SKILL.md} +3 -3
  43. package/src/skills/{sonamu/api.md → sonamu-api/SKILL.md} +3 -2
  44. package/src/skills/{sonamu/auth.md → sonamu-auth/SKILL.md} +9 -4
  45. package/src/skills/{sonamu/auth-plugins.md → sonamu-auth/references/plugins.md} +2 -7
  46. package/src/skills/sonamu-auth/references/user-id-migration-followups.md +192 -0
  47. package/src/skills/{sonamu/auth-migration.md → sonamu-auth/references/user-id-migration.md} +1 -195
  48. package/src/skills/sonamu-config/SKILL.md +203 -0
  49. package/src/skills/{sonamu → sonamu-config/references}/database.md +3 -8
  50. package/src/skills/sonamu-config/references/environments.md +178 -0
  51. package/src/skills/sonamu-config/references/server-options.md +400 -0
  52. package/src/skills/sonamu-entity/SKILL.md +180 -0
  53. package/src/skills/{sonamu/entity-validation-checklist.md → sonamu-entity/references/creation-workflow.md} +117 -8
  54. package/src/skills/sonamu-entity/references/design-guides.md +243 -0
  55. package/src/skills/sonamu-entity/references/field-types.md +170 -0
  56. package/src/skills/sonamu-entity/references/relations-detail.md +245 -0
  57. package/src/skills/{sonamu/entity-relations.md → sonamu-entity/references/relations.md} +1 -258
  58. package/src/skills/{sonamu → sonamu-entity/references}/subset.md +1 -11
  59. package/src/skills/sonamu-fixture/SKILL.md +180 -0
  60. package/src/skills/{sonamu/fixture-cli.md → sonamu-fixture/references/cli-usage.md} +5 -176
  61. package/src/skills/{sonamu → sonamu-fixture/references}/cone.md +4 -14
  62. package/src/skills/sonamu-frontend/SKILL.md +142 -0
  63. package/src/skills/sonamu-frontend/references/components.md +323 -0
  64. package/src/skills/sonamu-frontend/references/examples.md +64 -0
  65. package/src/skills/sonamu-frontend/references/hooks.md +273 -0
  66. package/src/skills/sonamu-frontend/references/runtime.md +165 -0
  67. package/src/skills/{sonamu → sonamu-frontend/references}/scaffolding.md +3 -8
  68. package/src/skills/{sonamu/i18n.md → sonamu-i18n/SKILL.md} +2 -2
  69. package/src/skills/{sonamu/migration.md → sonamu-migration/SKILL.md} +1 -1
  70. package/src/skills/{sonamu/naite.md → sonamu-naite/SKILL.md} +5 -5
  71. package/src/skills/sonamu-query/SKILL.md +48 -0
  72. package/src/skills/sonamu-query/references/model-patterns.md +390 -0
  73. package/src/skills/{sonamu → sonamu-query/references}/model.md +1 -401
  74. package/src/skills/{sonamu → sonamu-query/references}/puri.md +31 -243
  75. package/src/skills/sonamu-query/references/search.md +238 -0
  76. package/src/skills/{sonamu → sonamu-query/references}/upsert.md +1 -6
  77. package/src/skills/{sonamu/tasks.md → sonamu-tasks/SKILL.md} +1 -1
  78. package/src/skills/sonamu-testing/SKILL.md +251 -0
  79. package/src/skills/{sonamu/testing-devrunner.md → sonamu-testing/references/devrunner.md} +4 -9
  80. package/src/skills/sonamu-testing/references/helpers.md +185 -0
  81. package/src/skills/sonamu-testing/references/patterns.md +263 -0
  82. package/src/skills/sonamu-testing/references/pitfalls.md +588 -0
  83. package/src/skills/sonamu-testing/references/quick-start.md +285 -0
  84. package/src/skills/sonamu-testing/references/type-safety.md +172 -0
  85. package/src/skills/sonamu-testing/references/writing-plan.md +375 -0
  86. package/src/skills/{sonamu/vector.md → sonamu-vector/SKILL.md} +1 -1
  87. package/dist/ui-web/assets/index-Dx4ap5i4.css +0 -1
  88. package/src/skills/commands/sonamu-skills.md +0 -20
  89. package/src/skills/project/README.md +0 -19
  90. package/src/skills/project/architecture.md +0 -373
  91. package/src/skills/sonamu/cdd.md +0 -129
  92. package/src/skills/sonamu/config.md +0 -772
  93. package/src/skills/sonamu/create-sonamu.md +0 -208
  94. package/src/skills/sonamu/entity-basic.md +0 -678
  95. package/src/skills/sonamu/framework-change.md +0 -96
  96. package/src/skills/sonamu/frontend.md +0 -915
  97. package/src/skills/sonamu/project-init.md +0 -477
  98. package/src/skills/sonamu/skill-contribution.md +0 -247
  99. package/src/skills/sonamu/testing.md +0 -2163
@@ -1,208 +0,0 @@
1
- ---
2
- name: create-sonamu
3
- description: pnpm create sonamu CLI option reference. Use when creating a new project.
4
- ---
5
-
6
- # create-sonamu CLI
7
-
8
- ## Basic Usage
9
-
10
- ```bash
11
- pnpm create sonamu [project-name]
12
- ```
13
-
14
- ## Quick Create (Recommended)
15
-
16
- Use all options with default values:
17
-
18
- ```bash
19
- pnpm create sonamu [project-name] --yes
20
- ```
21
-
22
- ## CLI Options
23
-
24
- ### General Options
25
-
26
- | Option | Description | Default |
27
- | --------------- | ----------------------------------- | ------- |
28
- | `--yes`, `-y` | Use all options with default values | - |
29
- | `--skip-pnpm` | Skip pnpm install | false |
30
- | `--skip-docker` | Skip Docker setup | false |
31
- | `--pnpm y/n` | Whether to install pnpm | y |
32
- | `--docker y/n` | Whether to configure Docker | y |
33
-
34
- ### Docker/DB Options
35
-
36
- | Option | Description | Default |
37
- | ------------------ | ------------------- | -------------------------- |
38
- | `--docker-project` | Docker project name | `[project-name]-docker` |
39
- | `--container-name` | Container name | `[project-name]-container` |
40
- | `--db-name` | Database name | `[project-name]` |
41
- | `--db-user` | DB user | `postgres` |
42
- | `--db-password` | DB password | `1234` |
43
-
44
- ## Usage Examples
45
-
46
- ### Quick create with defaults
47
-
48
- ```bash
49
- pnpm create sonamu my_project --yes
50
- ```
51
-
52
- ### Create without Docker
53
-
54
- ```bash
55
- pnpm create sonamu my_project --skip-docker
56
- ```
57
-
58
- ### Custom DB configuration
59
-
60
- ```bash
61
- pnpm create sonamu my_project \
62
- --db-name my_db \
63
- --db-user admin \
64
- --db-password secret123
65
- ```
66
-
67
- ### Fully custom
68
-
69
- ```bash
70
- pnpm create sonamu my_project \
71
- --docker-project my-docker \
72
- --container-name my-container \
73
- --db-name my_database \
74
- --db-user postgres \
75
- --db-password 1234
76
- ```
77
-
78
- ## Generated Structure
79
-
80
- ```
81
- [project-name]/
82
- ├── packages/
83
- │ ├── api/
84
- │ │ ├── src/
85
- │ │ │ ├── application/ # Entity, Model, API
86
- │ │ │ ├── migrations/
87
- │ │ │ └── sonamu.config.ts
88
- │ │ ├── database/
89
- │ │ │ └── docker-compose.yml
90
- │ │ └── .env
91
- │ └── web/
92
- │ └── src/
93
- ├── pnpm-workspace.yaml
94
- └── package.json
95
- ```
96
-
97
- ## Next Steps After Creation
98
-
99
- 1. Start the DB container (if Docker was configured)
100
-
101
- ```bash
102
- cd [project-name]/packages/api/
103
- pnpm docker:up
104
- ```
105
-
106
- > If a port conflict error occurs → see `database.md`
107
-
108
- 2. Sync Skills
109
-
110
- ```bash
111
- cd [project-name]/packages/api
112
- pnpm sonamu skills sync
113
- ```
114
-
115
- > Will fail if sonamu is an npm version. See "Sonamu Link Setup" below.
116
-
117
- To create a new **project-local** skill file (in `.claude/skills/local/`):
118
-
119
- ```bash
120
- pnpm sonamu skills create <name>
121
- ```
122
-
123
- This creates `.claude/skills/local/<name>.md` with a frontmatter skeleton. Use it to document project-specific conventions or troubleshooting notes that aren't appropriate for the shared Sonamu skills.
124
-
125
- 3. Start the dev server
126
-
127
- ```bash
128
- cd [project-name]/packages/api
129
- pnpm dev
130
- ```
131
-
132
- 4. Proceed to Entity design → see `entity-basic.md`
133
-
134
- ## Sonamu Link Setup
135
-
136
- **Skills sync only works when sonamu is referenced as a local link.**
137
-
138
- ### How to check
139
-
140
- Check the sonamu dependency in `packages/api/package.json`:
141
-
142
- ```json
143
- // ✓ Link reference (Skills sync possible)
144
- "sonamu": "link:/path/to/sonamu/modules/sonamu"
145
-
146
- // ✗ npm version (Skills sync not available)
147
- "sonamu": "^0.7.47"
148
- ```
149
-
150
- ### How to change to a link
151
-
152
- 1. Change the sonamu version to a link in `packages/api/package.json`:
153
-
154
- ```json
155
- "dependencies": {
156
- "sonamu": "link:/path/to/sonamu/modules/sonamu"
157
- }
158
- ```
159
-
160
- 2. Run `pnpm install`
161
-
162
- 3. Run `pnpm sonamu skills sync` again
163
-
164
- ### Link path examples
165
-
166
- | sonamu location | Link path |
167
- | ------------------------- | ------------------------------------------ |
168
- | `~/Development/sonamu` | `link:~/Development/sonamu/modules/sonamu` |
169
- | Same directory as project | `link:../../sonamu/modules/sonamu` |
170
-
171
- ## Renaming the Project (when creating a new project)
172
-
173
- After generating the project, you need to replace the "Sonamu" text in the frontend with your project name.
174
-
175
- **4 files to update:**
176
-
177
- 1. **`packages/web/index.html`** - Browser tab title
178
-
179
- ```html
180
- <title>{project-name}</title>
181
- ```
182
-
183
- 2. **`packages/web/src/routes/__root.tsx`** - TanStack Router head configuration (most important!)
184
-
185
- ```typescript
186
- head: () => ({
187
- meta: [{ title: "{project-name}" }],
188
- }),
189
- ```
190
-
191
- **Important:** If you don't update `__root.tsx`, the title will revert to "Sonamu" on HMR!
192
-
193
- 3. **`packages/web/src/routes/index.tsx`** - Main page title
194
-
195
- ```tsx
196
- <h1 className="text-2xl font-bold mb-4">Welcome to {project - name}</h1>
197
- ```
198
-
199
- 4. **`packages/web/src/components/Sidebar.tsx`** - Sidebar app name
200
-
201
- ```typescript
202
- const title = isAdmin ? "Admin" : "{project-name}";
203
- ```
204
-
205
- **How to verify:**
206
-
207
- - Check that the project name is shown in the browser tab
208
- - Confirm that the tab title does not change on file save via HMR (if it does, `__root.tsx` is missing)