@wpmoo/odoo 0.8.69 → 0.9.1

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 (47) hide show
  1. package/bin/wpmoo.js +10 -0
  2. package/package.json +11 -45
  3. package/LICENSE +0 -22
  4. package/README.md +0 -510
  5. package/dist/addons-yaml.js +0 -59
  6. package/dist/args.js +0 -259
  7. package/dist/cli.js +0 -996
  8. package/dist/cockpit/command-palette.js +0 -23
  9. package/dist/cockpit/command-registry.js +0 -91
  10. package/dist/cockpit/daily-prompts.js +0 -177
  11. package/dist/cockpit/menu.js +0 -96
  12. package/dist/cockpit/safety.js +0 -22
  13. package/dist/compose-layout.js +0 -118
  14. package/dist/daily-actions.js +0 -190
  15. package/dist/doctor.js +0 -519
  16. package/dist/environment-context.js +0 -10
  17. package/dist/environment-version.js +0 -5
  18. package/dist/environment.js +0 -136
  19. package/dist/external-assets.js +0 -153
  20. package/dist/external-templates.js +0 -86
  21. package/dist/git.js +0 -98
  22. package/dist/github.js +0 -87
  23. package/dist/help.js +0 -151
  24. package/dist/menu-navigation.js +0 -67
  25. package/dist/module-actions.js +0 -114
  26. package/dist/odoo-versions.js +0 -1
  27. package/dist/path-validation.js +0 -50
  28. package/dist/prompt-copy.js +0 -8
  29. package/dist/prompt-repositories.js +0 -34
  30. package/dist/prompts/index.js +0 -149
  31. package/dist/repo-actions.js +0 -158
  32. package/dist/repo-url.js +0 -27
  33. package/dist/repository-preflight.js +0 -46
  34. package/dist/safe-reset.js +0 -217
  35. package/dist/scaffold.js +0 -161
  36. package/dist/source-actions.js +0 -65
  37. package/dist/source-manifest.js +0 -338
  38. package/dist/status.js +0 -239
  39. package/dist/templates.js +0 -749
  40. package/dist/types.js +0 -1
  41. package/dist/update-check.js +0 -106
  42. package/dist/version.js +0 -19
  43. package/docs/assets/patreon-donate.png +0 -0
  44. package/docs/assets/wpmoo-banner.png +0 -0
  45. package/docs/external-resources.md +0 -136
  46. package/docs/generated-environment-verification.md +0 -140
  47. package/docs/handoff.md +0 -29
package/bin/wpmoo.js ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import { runCli } from '@wpmoo/toolkit';
3
+
4
+ console.error('Package renamed: @wpmoo/odoo is now @wpmoo/toolkit. Use: npx @wpmoo/toolkit');
5
+
6
+ runCli().catch((error) => {
7
+ const message = error instanceof Error ? error.message : String(error);
8
+ console.error(message);
9
+ process.exit(1);
10
+ });
package/package.json CHANGED
@@ -1,62 +1,28 @@
1
1
  {
2
2
  "name": "@wpmoo/odoo",
3
- "version": "0.8.69",
4
- "description": "WPMoo Tool for Odoo development, staging, and production lifecycle workflows.",
3
+ "version": "0.9.1",
4
+ "description": "Legacy compatibility package for the WPMoo Toolkit CLI.",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/wpmoo-org/wpmoo-odoo.git"
8
+ "url": "git+https://github.com/wpmoo-org/wpmoo-toolkit.git",
9
+ "directory": "packages/odoo-compat"
9
10
  },
10
- "homepage": "https://github.com/wpmoo-org/wpmoo-odoo",
11
+ "homepage": "https://github.com/wpmoo-org/wpmoo-toolkit",
11
12
  "bugs": {
12
- "url": "https://github.com/wpmoo-org/wpmoo-odoo/issues"
13
+ "url": "https://github.com/wpmoo-org/wpmoo-toolkit/issues"
13
14
  },
14
- "readmeFilename": "README.md",
15
- "main": "./dist/cli.js",
16
- "exports": "./dist/cli.js",
17
- "keywords": [
18
- "odoo",
19
- "odoo development",
20
- "odoo cli",
21
- "odoo lifecycle",
22
- "odoo dev workflow",
23
- "odoo staging workflow",
24
- "odoo production workflow",
25
- "odoo docker",
26
- "odoo docker compose",
27
- "odoo skills"
28
- ],
15
+ "license": "MIT",
29
16
  "bin": {
30
- "wpmoo": "dist/cli.js"
17
+ "wpmoo": "bin/wpmoo.js"
31
18
  },
32
19
  "files": [
33
- "dist",
34
- "docs/assets",
35
- "docs/*.md"
20
+ "bin"
36
21
  ],
37
22
  "engines": {
38
23
  "node": ">=20.17"
39
24
  },
40
- "scripts": {
41
- "prebuild": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
42
- "build": "tsc -p tsconfig.build.json",
43
- "release:check": "bash scripts/release-check.sh",
44
- "smoke:published": "bash scripts/smoke-published.sh",
45
- "test": "vitest run",
46
- "test:coverage": "vitest run --coverage",
47
- "typecheck": "tsc -p tsconfig.json --noEmit"
48
- },
49
25
  "dependencies": {
50
- "@inquirer/prompts": "^8.4.3",
51
- "@inquirer/search": "^4.1.9",
52
- "@inquirer/select": "^5.1.5",
53
- "execa": "^9.6.0"
54
- },
55
- "devDependencies": {
56
- "@types/node": "^24.0.0",
57
- "@vitest/coverage-v8": "^3.2.4",
58
- "typescript": "^5.8.0",
59
- "vitest": "^3.0.0"
60
- },
61
- "license": "MIT"
26
+ "@wpmoo/toolkit": "0.9.1"
27
+ }
62
28
  }
package/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 WPMoo.org
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
package/README.md DELETED
@@ -1,510 +0,0 @@
1
- ![WPMoo Tool for Odoo development workflows](docs/assets/wpmoo-banner.png)
2
-
3
- [![CI](https://img.shields.io/github/actions/workflow/status/wpmoo-org/wpmoo-odoo/ci.yml?branch=main&label=CI&style=flat-square)](https://github.com/wpmoo-org/wpmoo-odoo/actions/workflows/ci.yml) [![GitHub](https://img.shields.io/badge/GitHub-181717?logo=github&style=flat-square)](https://github.com/wpmoo-org/wpmoo-odoo) [![npm](https://img.shields.io/npm/v/@wpmoo/odoo?label=npm&logo=npm&style=flat-square&color=blue)](https://www.npmjs.com/package/@wpmoo/odoo) [![coverage](https://img.shields.io/codecov/c/github/wpmoo-org/wpmoo-odoo?branch=main&label=coverage&logo=codecov&style=flat-square&color=blue)](https://codecov.io/gh/wpmoo-org/wpmoo-odoo) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](LICENSE) [![WPMoo Tool](https://img.shields.io/badge/WPMoo-Tool-714B67?style=flat-square)](https://github.com/wpmoo-org/wpmoo-odoo) [![Buy Me a Coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-FFDD00?logo=buymeacoffee&logoColor=000000&style=flat-square)](https://www.buymeacoffee.com/cangir) [![Patreon](https://img.shields.io/badge/Patreon-Support-F96854?logo=patreon&logoColor=white&style=flat-square)](https://www.patreon.com/wpmoo)
4
-
5
- # WPMoo Tool
6
-
7
- WPMoo Tool is a development-first CLI for creating and operating Docker Compose based environments for Odoo, with source repositories managed as Git submodules.
8
-
9
- It gives Odoo teams a repeatable environment layout, a guided cockpit for daily work, direct commands for automation, and recovery tools that refresh generated files without touching product source code.
10
-
11
- WPMoo Tool is an independent project and is not affiliated with, endorsed by, or sponsored by Odoo S.A. Odoo is a trademark of Odoo S.A.
12
-
13
- ## Development Status
14
-
15
- > [!IMPORTANT]
16
- > **Pre-1.0 active development:** WPMoo Tool has not reached `1.0.0` yet. Until the `1.0.0` release, use it as a preview tool for evaluation, local trials, and feedback rather than a dependency for critical production workflows. Setup conventions and command behavior may still change between pre-1.0 releases.
17
-
18
- ## Why WPMoo Tool
19
-
20
- - Create a local Odoo development environment from a dev repository and one or more source repositories.
21
- - Keep product source repositories under `odoo/custom/src/private`, `odoo/custom/src/oca`, or `odoo/custom/src/external` as Git submodules pinned to the selected Odoo branch.
22
- - Copy Docker Compose resources from the standalone `wpmoo-org/odoo-docker-compose` resource instead of embedding large runtime assets in the TypeScript package.
23
- - Optionally copy project-local Agent Skills from `wpmoo-org/odoo-skills` into generated environments.
24
- - Use either a guided terminal cockpit or direct CLI commands for the same lifecycle tasks.
25
-
26
- ## Requirements
27
-
28
- - Node.js `>=20.17`
29
- - Git
30
- - Docker and Docker Compose for generated environment runtime commands
31
- - GitHub CLI (`gh`) is optional. Use it for repository discovery, repository creation, and deeper diagnostics.
32
-
33
- The wizard currently offers Odoo `19.0`, `18.0`, `17.0`, and `16.0`. Generated
34
- environments now use the compact compose layout (`compose.yaml` with
35
- `compose/<env>.yaml` overlays). Legacy root-level
36
- `docker-compose_<version>.yml` layouts are still supported for compatibility.
37
-
38
- Set up GitHub CLI only when you want WPMoo to discover your personal account and organizations or create missing repositories from the interactive wizard:
39
-
40
- ```bash
41
- brew install gh
42
- gh auth login
43
- ```
44
-
45
- ## Quick Start
46
-
47
- Run the guided wizard from a workspace directory:
48
-
49
- ```bash
50
- npx @wpmoo/odoo
51
- ```
52
-
53
- If the current directory is not already a WPMoo environment, the CLI opens the create flow. It asks for the product slug, Odoo version, and environment folder. Choose any environment folder; the default is `./<product>_dev`.
54
-
55
- After folder selection, connect Git/GitHub to use repository URLs. Choose local-only setup to skip Git/GitHub connection and source repo prompts. Add source repositories later from the cockpit (`Repositories` -> `add-repo`) or `npx @wpmoo/odoo add-repo`.
56
-
57
- For non-interactive usage with repository URLs:
58
-
59
- Direct `create` commands keep the existing repo URL options; use `--target <path>` to choose a custom folder.
60
-
61
- ```bash
62
- npx @wpmoo/odoo create \
63
- --product odoo_sample_module \
64
- --odoo-version 19.0 \
65
- --dev-repo-url https://github.com/example-org/odoo_sample_module_dev.git \
66
- --source-repo-url https://github.com/example-org/odoo_sample_module.git \
67
- --init-empty-repos
68
- ```
69
-
70
- Add multiple source repositories by repeating `--source-repo-url`:
71
-
72
- ```bash
73
- npx @wpmoo/odoo create \
74
- --product odoo_sample_module \
75
- --dev-repo-url https://github.com/example-org/odoo_sample_module_dev.git \
76
- --source-repo-url https://github.com/example-org/odoo_sample_module.git \
77
- --source-addons odoo_sample_module,odoo_sample_module_portal \
78
- --source-repo-url git@github.com:example-org/odoo_sample_module_reports.git \
79
- --source-path odoo_sample_module_reports \
80
- --source-addons odoo_sample_module_reports
81
- ```
82
-
83
- Preview planned files and commands without writing:
84
-
85
- ```bash
86
- npx @wpmoo/odoo create \
87
- --product odoo_sample_module \
88
- --dev-repo-url https://github.com/example-org/odoo_sample_module_dev.git \
89
- --source-repo-url https://github.com/example-org/odoo_sample_module.git \
90
- --dry-run
91
- ```
92
-
93
- ## The Cockpit
94
-
95
- Run the package with no command inside a generated environment:
96
-
97
- ```bash
98
- npx @wpmoo/odoo
99
- ```
100
-
101
- The cockpit starts with a fast environment status summary, then opens a compact menu designed for repeated local work:
102
-
103
- ```text
104
- Command palette /
105
- Services
106
- Modules
107
- Database
108
- Diagnostics
109
- Repositories
110
- Maintenance
111
- Exit
112
- ```
113
-
114
- The UI is intentionally practical rather than decorative:
115
-
116
- - `Command palette /` searches slash commands such as `/test`, `/logs`, `/doctor`, and `/safe-reset`.
117
- - Category menus group related tasks for scanability: services, modules, database, diagnostics, repositories, and maintenance.
118
- - `Esc` returns from category menus to the top-level cockpit.
119
- - Empty states explain the next action, such as adding a source repo before selecting a module.
120
- - Risky commands such as stopping services, resetting databases, restoring snapshots, removing repos, removing modules, and safe reset ask for explicit confirmation.
121
- - Guided prompts collect common arguments for daily actions, including module names, database names, test modes, tags, snapshot names, and POT output paths.
122
-
123
- ## Cockpit Command Map
124
-
125
- | Category | Commands |
126
- | --- | --- |
127
- | Services | `start`, `stop`, `restart`, `logs`, `shell` |
128
- | Modules | `install`, `update`, `test`, `lint`, `pot`, `add-module`, `remove-module` |
129
- | Database | `psql`, `snapshot`, `restore-snapshot`, `resetdb` |
130
- | Diagnostics | `status`, `doctor` |
131
- | Repositories | `add-repo`, `remove-repo` |
132
- | Maintenance | `safe-reset` |
133
-
134
- Every cockpit action maps to a direct command, or to an equivalent management command such as `/safe-reset` mapping to `reset`, for scripting and repeatable terminal workflows.
135
-
136
- ## Direct Commands
137
-
138
- ```bash
139
- npx @wpmoo/odoo --help
140
- npx @wpmoo/odoo --version
141
-
142
- npx @wpmoo/odoo status
143
- npx @wpmoo/odoo status --json
144
- npx @wpmoo/odoo doctor
145
- npx @wpmoo/odoo doctor --json
146
- npx @wpmoo/odoo doctor --fix
147
- npx @wpmoo/odoo source list --json
148
- npx @wpmoo/odoo add-repo --repo-url https://github.com/example-org/odoo_sample_module_reports.git
149
- npx @wpmoo/odoo remove-repo --repo odoo_sample_module_reports
150
- npx @wpmoo/odoo add-module --repo odoo_sample_module --module odoo_sample_module_base --source-type private
151
- npx @wpmoo/odoo remove-module --repo odoo_sample_module --module odoo_sample_module_base --source-type private
152
- npx @wpmoo/odoo reset --dry-run
153
- npx @wpmoo/odoo reset
154
-
155
- npx @wpmoo/odoo start
156
- npx @wpmoo/odoo stop
157
- npx @wpmoo/odoo restart
158
- npx @wpmoo/odoo logs odoo
159
- npx @wpmoo/odoo shell
160
- npx @wpmoo/odoo psql postgres
161
-
162
- npx @wpmoo/odoo install sale devel
163
- npx @wpmoo/odoo update sale devel
164
- npx @wpmoo/odoo test sale --db devel --mode update --tags /sale
165
- npx @wpmoo/odoo lint
166
- npx @wpmoo/odoo pot sale devel i18n/sale.pot
167
-
168
- npx @wpmoo/odoo resetdb devel sale
169
- npx @wpmoo/odoo snapshot devel before-update
170
- npx @wpmoo/odoo restore-snapshot --dry-run before-update devel
171
- npx @wpmoo/odoo restore-snapshot before-update devel
172
- ```
173
-
174
- Daily action commands must be run from a generated environment root containing `.wpmoo/odoo.json`. They delegate to fixed scripts under `./scripts`; they do not search parent directories or run arbitrary script names.
175
-
176
- ## Generated Environment Layout
177
-
178
- A generated environment is a separate Git repository, usually named `<product>_dev`, but the wizard and `--target` can use any folder. Product source code stays in child source repositories.
179
-
180
- ```text
181
- odoo_sample_module_dev/
182
- |-- .wpmoo/
183
- | `-- odoo.json
184
- |-- .env.example
185
- |-- AGENTS.md
186
- |-- README.md
187
- |-- compose.yaml
188
- |-- compose/
189
- | |-- dev.yaml
190
- | |-- stage.yaml
191
- | `-- prod.yaml
192
- |-- config/
193
- | `-- odoo/
194
- | `-- odoo.conf
195
- |-- docs/
196
- | |-- appstore-release.md
197
- | `-- compose.md
198
- |-- resources/
199
- | `-- odoo/
200
- | `-- entrypoint.sh
201
- |-- moo
202
- |-- odoo/
203
- | `-- custom/
204
- | `-- src/
205
- | |-- private/
206
- | |-- oca/
207
- | `-- external/
208
- `-- scripts/
209
- ```
210
-
211
- Development uses `compose.yaml` plus `compose/dev.yaml` by default. Set
212
- `WPMOO_ENV=stage` or `WPMOO_ENV=prod` only after providing production-grade
213
- secrets and volumes.
214
-
215
- The metadata file `.wpmoo/odoo.json` records the product slug, selected Odoo version, dev repo URL, source repos, engine, external resource refs, ports, and template configuration. Status, doctor, daily actions, and safe reset use that metadata instead of guessing from the filesystem.
216
-
217
- ## Daily `./moo` Commands
218
-
219
- Generated environments include a local `./moo` dispatcher. It is the shortest path for everyday Compose and Odoo work:
220
-
221
- ```bash
222
- cp .env.example .env
223
-
224
- ./moo start
225
- ./moo logs odoo
226
- ./moo shell
227
- ./moo psql postgres
228
- ./moo restart
229
- ./moo stop
230
-
231
- ./moo install sale devel
232
- ./moo update sale devel
233
- ./moo test sale --db devel --mode update --tags /sale
234
- ./moo lint
235
- ./moo pot sale devel i18n/sale.pot
236
-
237
- ./moo snapshot devel before-update
238
- ./moo restore-snapshot --dry-run before-update devel
239
- ./moo restore-snapshot before-update devel
240
- ./moo resetdb devel sale
241
- ```
242
-
243
- `restore-snapshot --dry-run` validates the selected snapshot and prints the
244
- restore plan without changing the database or filestore. Generated environments
245
- also support `WPMOO_SNAPSHOT_RETENTION_COUNT` for pruning old snapshot files.
246
- When `WPMOO_ENV=stage` or `WPMOO_ENV=prod`, destructive database actions such
247
- as `resetdb` and real `restore-snapshot` require `WPMOO_ALLOW_DESTRUCTIVE=1`.
248
-
249
- Use `npx @wpmoo/odoo ...` for package/operator commands such as `create`, `add-repo`, `remove-repo`, `add-module`, `remove-module`, `status`, `doctor`, and `reset`. Use `./moo ...` inside a generated environment for local daily Compose commands.
250
-
251
- ## Repository and Module Management
252
-
253
- Add a source repository after local-only setup from the cockpit or direct command:
254
-
255
- ```bash
256
- npx @wpmoo/odoo add-repo \
257
- --repo-url https://github.com/example-org/odoo_sample_module_reports.git \
258
- --init-empty-repos
259
- ```
260
-
261
- Pin source repositories to dedicated source directories:
262
-
263
- ```bash
264
- npx @wpmoo/odoo add-repo \
265
- --repo-url https://github.com/OCA/sale-workflow.git \
266
- --source-type oca
267
-
268
- npx @wpmoo/odoo add-repo \
269
- --repo-url https://github.com/example-org/odoo_external_tool.git \
270
- --source-type external
271
- ```
272
-
273
- GitHub CLI is optional for repository setup. When it is available and authenticated, the interactive flow can:
274
-
275
- - detect the owner or organization from the current environment;
276
- - suggest repository URLs;
277
- - check whether the repository is accessible;
278
- - create inaccessible repositories after confirmation;
279
- - initialize empty repositories with the selected Odoo branch.
280
-
281
- Add a minimal Odoo module skeleton to a source repository:
282
-
283
- For module actions, `--source-type` selects the source directory (`private`, `oca`, or `external`). Default is `private`.
284
-
285
- ```bash
286
- npx @wpmoo/odoo add-module \
287
- --repo odoo_sample_module \
288
- --module odoo_sample_module_base \
289
- --source-type oca
290
- ```
291
-
292
- Remove a module registration while keeping files:
293
-
294
- ```bash
295
- npx @wpmoo/odoo remove-module \
296
- --repo odoo_sample_module \
297
- --module odoo_sample_module_base \
298
- --source-type oca
299
- ```
300
-
301
- Delete module files as well:
302
-
303
- ```bash
304
- npx @wpmoo/odoo remove-module \
305
- --repo odoo_sample_module \
306
- --module odoo_sample_module_base \
307
- --delete-files
308
- ```
309
-
310
- Remove a source repository submodule:
311
-
312
- ```bash
313
- npx @wpmoo/odoo remove-repo --repo odoo_sample_module_reports
314
- ```
315
-
316
- WPMoo refuses to remove a source repo submodule when that submodule has uncommitted changes.
317
-
318
- Generated environments also keep a deterministic source manifest at
319
- `odoo/custom/manifests/sources.yaml`. It mirrors source submodules from
320
- `.wpmoo/odoo.json` and `.gitmodules`, including source type, path, URL, branch,
321
- and addon boundaries.
322
-
323
- Inspect configured sources:
324
-
325
- ```bash
326
- npx @wpmoo/odoo source list
327
- npx @wpmoo/odoo source list --json
328
- ```
329
-
330
- Regenerate the manifest and metadata from the current metadata/gitmodule state:
331
-
332
- ```bash
333
- npx @wpmoo/odoo source sync
334
- npx @wpmoo/odoo source sync --json
335
- ```
336
-
337
- `source add` and `source remove` are direct aliases for the same repository
338
- operations:
339
-
340
- ```bash
341
- npx @wpmoo/odoo source add \
342
- --repo-url https://github.com/OCA/server-tools.git \
343
- --source-type oca
344
-
345
- npx @wpmoo/odoo source remove --repo server-tools --source-type oca
346
- ```
347
-
348
- ## Status, Doctor, and Recovery
349
-
350
- `status` is fast and offline. It reads local metadata and files only:
351
-
352
- ```bash
353
- npx @wpmoo/odoo status
354
- npx @wpmoo/odoo status --json
355
- ```
356
-
357
- It reports whether the environment is detected, which Odoo version is selected, how many source repos are configured, how many module candidates are present, which core files are missing, and the recommended next action.
358
-
359
- For automation and VS Code cockpit integration, all of these commands also support
360
- `--json`:
361
-
362
- ```bash
363
- npx @wpmoo/odoo status --json
364
- npx @wpmoo/odoo source list --json
365
- npx @wpmoo/odoo source sync --json
366
- npx @wpmoo/odoo doctor --json
367
- ```
368
-
369
- JSON output is optional; human-readable output remains the default.
370
-
371
- `doctor` performs deeper checks:
372
-
373
- ```bash
374
- npx @wpmoo/odoo doctor
375
- ```
376
-
377
- It validates metadata, engine support, selected compose files, source repo paths,
378
- source manifest consistency, daily scripts, `.env` settings, Docker CLI access,
379
- Docker Compose access, GitHub CLI authentication when available, and PostgreSQL
380
- 18 compatibility in compose mount targets (for mounts to
381
- `/var/lib/postgresql/data` or `/var/lib/postgresql/18/docker`).
382
-
383
- Use `doctor --fix` for safe file-level repairs. It can normalize PostgreSQL 18
384
- mount targets and regenerate `odoo/custom/manifests/sources.yaml` from
385
- metadata plus `.gitmodules`, then it runs doctor again and reports any remaining
386
- manual issues.
387
-
388
- Safe reset refreshes generated environment files without deleting product source code:
389
-
390
- ```bash
391
- npx @wpmoo/odoo reset --dry-run
392
- npx @wpmoo/odoo reset
393
- ```
394
-
395
- Safe reset updates generated files such as `.wpmoo/odoo.json`, `moo`,
396
- `.gitignore`, `.env.example`, generated docs, compose assets, and optional
397
- Agent Skills. Compose overlays like `compose.yaml` and `compose/dev.yaml` are
398
- also refreshed from the current compose template source.
399
-
400
- Use `reset --dry-run` first when you want a deterministic preview of refreshed
401
- files and cleanup warnings without writing to the environment.
402
-
403
- It does not touch source repo folders under
404
- `odoo/custom/src/private`, module source code, Git history, remotes, or
405
- branches. It also preserves local runtime artifacts and custom source layout
406
- content:
407
-
408
- - `.env`, `data`, and `backups`
409
- - `odoo/custom/src/oca`, `odoo/custom/src/external`, `odoo/custom/patches`,
410
- `odoo/custom/manifests`, and their existing contents
411
-
412
- Legacy compose template paths from older scaffolds can remain
413
- (`docs/assets/`, `test/`, `.github/`) until you remove them manually.
414
-
415
- Recommended recovery pattern:
416
-
417
- ```bash
418
- ./moo snapshot devel before-reset
419
- npx @wpmoo/odoo reset --dry-run
420
- npx @wpmoo/odoo reset
421
- npx @wpmoo/odoo doctor --fix
422
- ./moo restore-snapshot --dry-run before-reset devel
423
- ./moo restore-snapshot before-reset devel
424
- ```
425
-
426
- ## External Resources
427
-
428
- WPMoo Tool keeps the package small by copying external resources into generated environments:
429
-
430
- ```text
431
- gh:wpmoo-org/odoo-docker-compose
432
- gh:wpmoo-org/odoo-skills
433
- ```
434
-
435
- Use the default resources:
436
-
437
- ```bash
438
- npx @wpmoo/odoo create \
439
- --product odoo_sample_module \
440
- --source-repo-url https://github.com/example-org/odoo_sample_module.git \
441
- --agent-skills-template
442
- ```
443
-
444
- Pin external resource refs:
445
-
446
- ```bash
447
- npx @wpmoo/odoo create \
448
- --product odoo_sample_module \
449
- --source-repo-url https://github.com/example-org/odoo_sample_module.git \
450
- --compose-template-ref v0.1.0 \
451
- --agent-skills-template \
452
- --agent-skills-template-ref v0.1.0
453
- ```
454
-
455
- Use local resource clones while developing the resource packages:
456
-
457
- ```bash
458
- git clone https://github.com/wpmoo-org/odoo-docker-compose ../odoo-docker-compose
459
- git clone https://github.com/wpmoo-org/odoo-skills ../odoo-skills
460
-
461
- npx @wpmoo/odoo create \
462
- --engine compose \
463
- --compose-template-url ../odoo-docker-compose \
464
- --agent-skills-template \
465
- --agent-skills-template-url ../odoo-skills \
466
- --product odoo_sample_module \
467
- --source-repo-url https://github.com/example-org/odoo_sample_module.git
468
- ```
469
-
470
- More detail: [External Resources](docs/external-resources.md).
471
-
472
- ## Verification
473
-
474
- Run local package checks from the repository root:
475
-
476
- ```bash
477
- npm run typecheck
478
- npm test
479
- npm run test:coverage
480
- npm run build
481
- ```
482
-
483
- Generated environment behavior is covered by the operator-facing matrix in [Generated Environment Verification](docs/generated-environment-verification.md).
484
-
485
- ## Release
486
-
487
- The normal release path uses the repository helper and GitHub Actions trusted publishing:
488
-
489
- ```bash
490
- npm run release:check
491
- npm run typecheck
492
- npm test
493
- npm run build
494
- VERSION="$(node -p "require('./package.json').version")"
495
- git tag -a "v$VERSION" -m "Release v$VERSION"
496
- git push origin "v$VERSION"
497
- ```
498
-
499
- If `npm run release:check` bumps `package.json` and `package-lock.json`, commit and push that version bump first, then rerun the release check before tagging. Publishing is handled by the `Publish` workflow after the tag is pushed.
500
-
501
- ## Sponsoring
502
-
503
- Support ongoing WPMoo development through recurring or one-time sponsorship:
504
-
505
- <a href="https://www.buymeacoffee.com/cangir">
506
- <img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me a Coffee" width="250">
507
- </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
508
- <a href="https://www.patreon.com/wpmoo">
509
- <img src="docs/assets/patreon-donate.png" alt="Support WPMoo on Patreon" width="250">
510
- </a>
@@ -1,59 +0,0 @@
1
- function escapeRegExp(value) {
2
- return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
3
- }
4
- function ensureFinalNewline(value) {
5
- return value.endsWith('\n') ? value : `${value}\n`;
6
- }
7
- function yamlList(items) {
8
- return items.map((item) => ` - ${item}`).join('\n');
9
- }
10
- function renderSourceRepoBlock(repo) {
11
- return `private/${repo.path}:\n${yamlList(repo.addons)}\n`;
12
- }
13
- export function addSourceRepoToAddonsYaml(content, repo) {
14
- const blockPattern = new RegExp(`^private/${escapeRegExp(repo.path)}:\\s*$`, 'm');
15
- if (blockPattern.test(content)) {
16
- return content;
17
- }
18
- const base = ensureFinalNewline(content.trimEnd());
19
- return `${base}\n${renderSourceRepoBlock(repo)}`;
20
- }
21
- export function removeSourceRepoFromAddonsYaml(content, repoPath) {
22
- const blockPattern = new RegExp(`(^|\\n)private/${escapeRegExp(repoPath)}:\\n(?:[ \\t].*(?:\\n|$))*`, 'g');
23
- const updated = content
24
- .replace(blockPattern, (match, prefix) => (prefix === '\n' && match.endsWith('\n') ? '\n' : ''))
25
- .replace(/\n{3,}/g, '\n\n');
26
- return ensureFinalNewline(updated.trimEnd());
27
- }
28
- function sourceRepoBlockPattern(repoPath) {
29
- return new RegExp(`(^private/${escapeRegExp(repoPath)}:\\n)((?:[ \\t].*(?:\\n|$))*)`, 'm');
30
- }
31
- function parseYamlListItems(blockBody) {
32
- return blockBody
33
- .split('\n')
34
- .map((line) => line.trim().match(/^-\s+(.+)$/)?.[1]?.trim())
35
- .filter((item) => Boolean(item));
36
- }
37
- export function addModuleToSourceRepoInAddonsYaml(content, repoPath, moduleName) {
38
- const blockPattern = sourceRepoBlockPattern(repoPath);
39
- const match = content.match(blockPattern);
40
- if (!match) {
41
- return addSourceRepoToAddonsYaml(content, { path: repoPath, addons: [moduleName] });
42
- }
43
- const addons = parseYamlListItems(match[2]);
44
- if (addons.includes(moduleName)) {
45
- return content;
46
- }
47
- const replacement = `${match[1]}${yamlList([...addons, moduleName])}\n`;
48
- return content.replace(blockPattern, replacement);
49
- }
50
- export function removeModuleFromSourceRepoInAddonsYaml(content, repoPath, moduleName) {
51
- const blockPattern = sourceRepoBlockPattern(repoPath);
52
- const match = content.match(blockPattern);
53
- if (!match) {
54
- return content;
55
- }
56
- const addons = parseYamlListItems(match[2]).filter((addon) => addon !== moduleName);
57
- const replacement = `${match[1]}${addons.length ? `${yamlList(addons)}\n` : ''}`;
58
- return ensureFinalNewline(content.replace(blockPattern, replacement).trimEnd());
59
- }