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.
- package/dist/api/base-frame.d.ts +2 -0
- package/dist/api/base-frame.d.ts.map +1 -1
- package/dist/api/base-frame.js +8 -1
- package/dist/api/decorators.js +1 -1
- package/dist/api/sonamu.js +1 -1
- package/dist/bin/cli.js +195 -187
- package/dist/cone/cone-generator.js +3 -9
- package/dist/database/base-model.js +2 -2
- package/dist/database/knex.d.ts.map +1 -1
- package/dist/database/knex.js +2 -2
- package/dist/database/puri.d.ts +17 -0
- package/dist/database/puri.d.ts.map +1 -1
- package/dist/database/puri.js +102 -3
- package/dist/entity/entity-manager.js +1 -1
- package/dist/index.js +3 -3
- package/dist/migration/code-generation.js +6 -6
- package/dist/migration/migrator.d.ts.map +1 -1
- package/dist/migration/migrator.js +52 -7
- package/dist/migration/slack-confirm.js +1 -1
- package/dist/naite/naite-reporter.js +1 -1
- package/dist/syncer/checksum.js +1 -1
- package/dist/syncer/code-generator.js +1 -1
- package/dist/syncer/entity-operations.js +1 -1
- package/dist/syncer/syncer-actions.js +1 -1
- package/dist/syncer/syncer.js +1 -1
- package/dist/ui-web/assets/{index-BLX4zN8c.js → index-D0MHYbxl.js} +1 -1
- package/dist/ui-web/assets/index-Dx_JX4aQ.css +1 -0
- package/dist/ui-web/index.html +2 -2
- package/dist/utils/formatter.js +1 -1
- package/package.json +3 -3
- package/src/api/base-frame.ts +14 -1
- package/src/bin/cli.ts +268 -280
- package/src/cone/cone-generator.ts +2 -18
- package/src/database/__tests__/puri.test.ts +183 -0
- package/src/database/knex.ts +4 -1
- package/src/database/puri.ts +229 -2
- package/src/database/puri.types.test-d.ts +56 -0
- package/src/migration/code-generation.ts +5 -5
- package/src/migration/migrator.ts +81 -7
- package/src/skills/AGENTS.md +76 -50
- package/src/skills/sonamu/SKILL.md +46 -227
- package/src/skills/{sonamu/ai-agents.md → sonamu-ai-agents/SKILL.md} +3 -3
- package/src/skills/{sonamu/api.md → sonamu-api/SKILL.md} +3 -2
- package/src/skills/{sonamu/auth.md → sonamu-auth/SKILL.md} +9 -4
- package/src/skills/{sonamu/auth-plugins.md → sonamu-auth/references/plugins.md} +2 -7
- package/src/skills/sonamu-auth/references/user-id-migration-followups.md +192 -0
- package/src/skills/{sonamu/auth-migration.md → sonamu-auth/references/user-id-migration.md} +1 -195
- package/src/skills/sonamu-config/SKILL.md +203 -0
- package/src/skills/{sonamu → sonamu-config/references}/database.md +3 -8
- package/src/skills/sonamu-config/references/environments.md +178 -0
- package/src/skills/sonamu-config/references/server-options.md +400 -0
- package/src/skills/sonamu-entity/SKILL.md +180 -0
- package/src/skills/{sonamu/entity-validation-checklist.md → sonamu-entity/references/creation-workflow.md} +117 -8
- package/src/skills/sonamu-entity/references/design-guides.md +243 -0
- package/src/skills/sonamu-entity/references/field-types.md +170 -0
- package/src/skills/sonamu-entity/references/relations-detail.md +245 -0
- package/src/skills/{sonamu/entity-relations.md → sonamu-entity/references/relations.md} +1 -258
- package/src/skills/{sonamu → sonamu-entity/references}/subset.md +1 -11
- package/src/skills/sonamu-fixture/SKILL.md +180 -0
- package/src/skills/{sonamu/fixture-cli.md → sonamu-fixture/references/cli-usage.md} +5 -176
- package/src/skills/{sonamu → sonamu-fixture/references}/cone.md +4 -14
- package/src/skills/sonamu-frontend/SKILL.md +142 -0
- package/src/skills/sonamu-frontend/references/components.md +323 -0
- package/src/skills/sonamu-frontend/references/examples.md +64 -0
- package/src/skills/sonamu-frontend/references/hooks.md +273 -0
- package/src/skills/sonamu-frontend/references/runtime.md +165 -0
- package/src/skills/{sonamu → sonamu-frontend/references}/scaffolding.md +3 -8
- package/src/skills/{sonamu/i18n.md → sonamu-i18n/SKILL.md} +2 -2
- package/src/skills/{sonamu/migration.md → sonamu-migration/SKILL.md} +1 -1
- package/src/skills/{sonamu/naite.md → sonamu-naite/SKILL.md} +5 -5
- package/src/skills/sonamu-query/SKILL.md +48 -0
- package/src/skills/sonamu-query/references/model-patterns.md +390 -0
- package/src/skills/{sonamu → sonamu-query/references}/model.md +1 -401
- package/src/skills/{sonamu → sonamu-query/references}/puri.md +31 -243
- package/src/skills/sonamu-query/references/search.md +238 -0
- package/src/skills/{sonamu → sonamu-query/references}/upsert.md +1 -6
- package/src/skills/{sonamu/tasks.md → sonamu-tasks/SKILL.md} +1 -1
- package/src/skills/sonamu-testing/SKILL.md +251 -0
- package/src/skills/{sonamu/testing-devrunner.md → sonamu-testing/references/devrunner.md} +4 -9
- package/src/skills/sonamu-testing/references/helpers.md +185 -0
- package/src/skills/sonamu-testing/references/patterns.md +263 -0
- package/src/skills/sonamu-testing/references/pitfalls.md +588 -0
- package/src/skills/sonamu-testing/references/quick-start.md +285 -0
- package/src/skills/sonamu-testing/references/type-safety.md +172 -0
- package/src/skills/sonamu-testing/references/writing-plan.md +375 -0
- package/src/skills/{sonamu/vector.md → sonamu-vector/SKILL.md} +1 -1
- package/dist/ui-web/assets/index-Dx4ap5i4.css +0 -1
- package/src/skills/commands/sonamu-skills.md +0 -20
- package/src/skills/project/README.md +0 -19
- package/src/skills/project/architecture.md +0 -373
- package/src/skills/sonamu/cdd.md +0 -129
- package/src/skills/sonamu/config.md +0 -772
- package/src/skills/sonamu/create-sonamu.md +0 -208
- package/src/skills/sonamu/entity-basic.md +0 -678
- package/src/skills/sonamu/framework-change.md +0 -96
- package/src/skills/sonamu/frontend.md +0 -915
- package/src/skills/sonamu/project-init.md +0 -477
- package/src/skills/sonamu/skill-contribution.md +0 -247
- 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)
|