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,61 +1,61 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-sonamu
|
|
3
|
-
description: pnpm create sonamu CLI
|
|
3
|
+
description: pnpm create sonamu CLI option reference. Use when creating a new project.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# create-sonamu CLI
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Basic Usage
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
pnpm create sonamu [
|
|
11
|
+
pnpm create sonamu [project-name]
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Quick Create (Recommended)
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Use all options with default values:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
pnpm create sonamu [
|
|
19
|
+
pnpm create sonamu [project-name] --yes
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
## CLI
|
|
22
|
+
## CLI Options
|
|
23
23
|
|
|
24
|
-
###
|
|
24
|
+
### General Options
|
|
25
25
|
|
|
26
|
-
|
|
|
26
|
+
| Option | Description | Default |
|
|
27
27
|
|------|------|--------|
|
|
28
|
-
| `--yes`, `-y` |
|
|
29
|
-
| `--skip-pnpm` | pnpm install
|
|
30
|
-
| `--skip-docker` | Docker
|
|
31
|
-
| `--pnpm y/n` |
|
|
32
|
-
| `--docker y/n` |
|
|
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
33
|
|
|
34
|
-
### Docker/DB
|
|
34
|
+
### Docker/DB Options
|
|
35
35
|
|
|
36
|
-
|
|
|
36
|
+
| Option | Description | Default |
|
|
37
37
|
|------|------|--------|
|
|
38
|
-
| `--docker-project` | Docker
|
|
39
|
-
| `--container-name` |
|
|
40
|
-
| `--db-name` |
|
|
41
|
-
| `--db-user` | DB
|
|
42
|
-
| `--db-password` | DB
|
|
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
43
|
|
|
44
|
-
##
|
|
44
|
+
## Usage Examples
|
|
45
45
|
|
|
46
|
-
###
|
|
46
|
+
### Quick create with defaults
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
49
|
pnpm create sonamu my_project --yes
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
###
|
|
52
|
+
### Create without Docker
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
55
|
pnpm create sonamu my_project --skip-docker
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
### DB
|
|
58
|
+
### Custom DB configuration
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
61
|
pnpm create sonamu my_project \
|
|
@@ -64,7 +64,7 @@ pnpm create sonamu my_project \
|
|
|
64
64
|
--db-password secret123
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
###
|
|
67
|
+
### Fully custom
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
70
|
pnpm create sonamu my_project \
|
|
@@ -75,10 +75,10 @@ pnpm create sonamu my_project \
|
|
|
75
75
|
--db-password 1234
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
##
|
|
78
|
+
## Generated Structure
|
|
79
79
|
|
|
80
80
|
```
|
|
81
|
-
[
|
|
81
|
+
[project-name]/
|
|
82
82
|
├── packages/
|
|
83
83
|
│ ├── api/
|
|
84
84
|
│ │ ├── src/
|
|
@@ -94,95 +94,95 @@ pnpm create sonamu my_project \
|
|
|
94
94
|
└── package.json
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
##
|
|
97
|
+
## Next Steps After Creation
|
|
98
98
|
|
|
99
|
-
1. DB
|
|
99
|
+
1. Start the DB container (if Docker was configured)
|
|
100
100
|
```bash
|
|
101
|
-
cd [
|
|
101
|
+
cd [project-name]/packages/api/
|
|
102
102
|
pnpm docker:up
|
|
103
103
|
```
|
|
104
|
-
>
|
|
104
|
+
> If a port conflict error occurs → see `database.md`
|
|
105
105
|
|
|
106
|
-
2. Skills
|
|
106
|
+
2. Sync Skills
|
|
107
107
|
```bash
|
|
108
|
-
cd [
|
|
108
|
+
cd [project-name]/packages/api
|
|
109
109
|
pnpm sonamu skills sync
|
|
110
110
|
```
|
|
111
|
-
> sonamu
|
|
111
|
+
> Will fail if sonamu is an npm version. See "Sonamu Link Setup" below.
|
|
112
112
|
|
|
113
|
-
3.
|
|
113
|
+
3. Start the dev server
|
|
114
114
|
```bash
|
|
115
|
-
cd [
|
|
115
|
+
cd [project-name]/packages/api
|
|
116
116
|
pnpm dev
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
4. Entity
|
|
119
|
+
4. Proceed to Entity design → see `entity-basic.md`
|
|
120
120
|
|
|
121
|
-
## Sonamu
|
|
121
|
+
## Sonamu Link Setup
|
|
122
122
|
|
|
123
|
-
**Skills
|
|
123
|
+
**Skills sync only works when sonamu is referenced as a local link.**
|
|
124
124
|
|
|
125
|
-
###
|
|
125
|
+
### How to check
|
|
126
126
|
|
|
127
|
-
`packages/api/package.json
|
|
127
|
+
Check the sonamu dependency in `packages/api/package.json`:
|
|
128
128
|
|
|
129
129
|
```json
|
|
130
|
-
// ✓
|
|
130
|
+
// ✓ Link reference (Skills sync possible)
|
|
131
131
|
"sonamu": "link:/path/to/sonamu/modules/sonamu"
|
|
132
132
|
|
|
133
|
-
// ✗ npm
|
|
133
|
+
// ✗ npm version (Skills sync not available)
|
|
134
134
|
"sonamu": "^0.7.47"
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
###
|
|
137
|
+
### How to change to a link
|
|
138
138
|
|
|
139
|
-
1. `packages/api/package.json
|
|
139
|
+
1. Change the sonamu version to a link in `packages/api/package.json`:
|
|
140
140
|
```json
|
|
141
141
|
"dependencies": {
|
|
142
142
|
"sonamu": "link:/path/to/sonamu/modules/sonamu"
|
|
143
143
|
}
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
2. `pnpm install`
|
|
146
|
+
2. Run `pnpm install`
|
|
147
147
|
|
|
148
|
-
3. `pnpm sonamu skills sync`
|
|
148
|
+
3. Run `pnpm sonamu skills sync` again
|
|
149
149
|
|
|
150
|
-
###
|
|
150
|
+
### Link path examples
|
|
151
151
|
|
|
152
|
-
| sonamu
|
|
152
|
+
| sonamu location | Link path |
|
|
153
153
|
|------------|----------|
|
|
154
154
|
| `~/Development/sonamu` | `link:~/Development/sonamu/modules/sonamu` |
|
|
155
|
-
|
|
|
155
|
+
| Same directory as project | `link:../../sonamu/modules/sonamu` |
|
|
156
156
|
|
|
157
|
-
##
|
|
157
|
+
## Renaming the Project (when creating a new project)
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
After generating the project, you need to replace the "Sonamu" text in the frontend with your project name.
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
**4 files to update:**
|
|
162
162
|
|
|
163
|
-
1. **`packages/web/index.html`** -
|
|
163
|
+
1. **`packages/web/index.html`** - Browser tab title
|
|
164
164
|
```html
|
|
165
|
-
<title>{
|
|
165
|
+
<title>{project-name}</title>
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
2. **`packages/web/src/routes/__root.tsx`** - TanStack Router head
|
|
168
|
+
2. **`packages/web/src/routes/__root.tsx`** - TanStack Router head configuration (most important!)
|
|
169
169
|
```typescript
|
|
170
170
|
head: () => ({
|
|
171
|
-
meta: [{ title: "{
|
|
171
|
+
meta: [{ title: "{project-name}" }],
|
|
172
172
|
}),
|
|
173
173
|
```
|
|
174
|
-
|
|
174
|
+
**Important:** If you don't update `__root.tsx`, the title will revert to "Sonamu" on HMR!
|
|
175
175
|
|
|
176
|
-
3. **`packages/web/src/routes/index.tsx`** -
|
|
176
|
+
3. **`packages/web/src/routes/index.tsx`** - Main page title
|
|
177
177
|
```tsx
|
|
178
|
-
<h1 className="text-2xl font-bold mb-4">Welcome to {
|
|
178
|
+
<h1 className="text-2xl font-bold mb-4">Welcome to {project-name}</h1>
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
-
4. **`packages/web/src/components/Sidebar.tsx`** -
|
|
181
|
+
4. **`packages/web/src/components/Sidebar.tsx`** - Sidebar app name
|
|
182
182
|
```typescript
|
|
183
|
-
const title = isAdmin ? "Admin" : "{
|
|
183
|
+
const title = isAdmin ? "Admin" : "{project-name}";
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
186
|
+
**How to verify:**
|
|
187
|
+
- Check that the project name is shown in the browser tab
|
|
188
|
+
- Confirm that the tab title does not change on file save via HMR (if it does, `__root.tsx` is missing)
|