@wpmoo/odoo 0.8.57 → 0.8.58
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/scaffold.js +31 -4
- package/dist/templates.js +60 -38
- package/package.json +1 -1
package/dist/scaffold.js
CHANGED
|
@@ -22,6 +22,33 @@ function validateScaffoldOptions(options) {
|
|
|
22
22
|
}
|
|
23
23
|
export function generatedFiles(options) {
|
|
24
24
|
const safeOptions = validateScaffoldOptions(options);
|
|
25
|
+
const sourceDirReadmes = [
|
|
26
|
+
{
|
|
27
|
+
path: 'odoo/custom/src/private/README.md',
|
|
28
|
+
title: 'private',
|
|
29
|
+
body: 'Project-owned/private addon repositories go here.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
path: 'odoo/custom/src/oca/README.md',
|
|
33
|
+
title: 'oca',
|
|
34
|
+
body: 'OCA repositories go here, for example server-tools, web, queue.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
path: 'odoo/custom/src/external/README.md',
|
|
38
|
+
title: 'external',
|
|
39
|
+
body: 'Non-OCA third-party, vendor, and community addon repositories go here.',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
path: 'odoo/custom/patches/README.md',
|
|
43
|
+
title: 'patches',
|
|
44
|
+
body: 'Local patches for upstream/vendor/OCA repositories go here.',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
path: 'odoo/custom/manifests/README.md',
|
|
48
|
+
title: 'manifests',
|
|
49
|
+
body: 'Manifest/lock/list files for external sources and pinned revisions go here.',
|
|
50
|
+
},
|
|
51
|
+
];
|
|
25
52
|
const files = [
|
|
26
53
|
{ path: markerPath, content: renderEnvironmentMetadata(safeOptions) },
|
|
27
54
|
{ path: 'moo', content: renderMooDelegationScript(), mode: 0o755 },
|
|
@@ -32,10 +59,10 @@ export function generatedFiles(options) {
|
|
|
32
59
|
];
|
|
33
60
|
return [
|
|
34
61
|
...files,
|
|
35
|
-
{
|
|
36
|
-
path:
|
|
37
|
-
content: renderPlaceholder(
|
|
38
|
-
},
|
|
62
|
+
...sourceDirReadmes.map((readme) => ({
|
|
63
|
+
path: readme.path,
|
|
64
|
+
content: renderPlaceholder(readme.title, readme.body),
|
|
65
|
+
})),
|
|
39
66
|
];
|
|
40
67
|
}
|
|
41
68
|
async function writeGeneratedFiles(target, files) {
|
package/dist/templates.js
CHANGED
|
@@ -22,46 +22,62 @@ function hasSourceRepos(options) {
|
|
|
22
22
|
}
|
|
23
23
|
function repositoryLayout(options) {
|
|
24
24
|
const sourceRepoRows = hasSourceRepos(options)
|
|
25
|
-
? options.sourceRepos
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
│
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
│ ├──
|
|
36
|
-
│
|
|
37
|
-
├──
|
|
38
|
-
│ ├──
|
|
39
|
-
│
|
|
40
|
-
│
|
|
41
|
-
│ └──
|
|
42
|
-
|
|
43
|
-
├──
|
|
44
|
-
│
|
|
45
|
-
│
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
├──
|
|
49
|
-
│ └──
|
|
50
|
-
│ └──
|
|
51
|
-
|
|
25
|
+
? options.sourceRepos
|
|
26
|
+
.map((repo, index) => {
|
|
27
|
+
const connector = index === options.sourceRepos.length - 1 ? '└──' : '├──';
|
|
28
|
+
return `│ │ │ ${connector} ${repo.path}/ # Project-owned addon source repository`;
|
|
29
|
+
})
|
|
30
|
+
.join('\n')
|
|
31
|
+
: '│ │ │ └── (add project-owned repos with ./moo add-repo)';
|
|
32
|
+
return `${options.devRepo}/ # Development environment root
|
|
33
|
+
├── compose.yaml # Base Docker Compose file
|
|
34
|
+
├── compose/ # Compose overlays for each workflow
|
|
35
|
+
│ ├── dev.yaml # Local development services
|
|
36
|
+
│ ├── debug.yaml # Debug tooling and debug-friendly settings
|
|
37
|
+
│ ├── test.yaml # Test runner services and test database setup
|
|
38
|
+
│ ├── stage.yaml # Staging-like deployment overlay
|
|
39
|
+
│ ├── prod.yaml # Production deployment overlay
|
|
40
|
+
│ ├── proxy.yaml # Reverse proxy / edge routing overlay
|
|
41
|
+
│ └── tools.yaml # Optional maintenance and helper tools
|
|
42
|
+
├── config/ # Runtime configuration mounted into containers
|
|
43
|
+
│ ├── odoo/ # Odoo server configuration
|
|
44
|
+
│ │ ├── odoo.conf # Main Odoo configuration file
|
|
45
|
+
│ │ └── requirements.txt # Extra Python dependencies for the Odoo container
|
|
46
|
+
│ └── logrotate/ # Log rotation configuration
|
|
47
|
+
│ └── odoo # Logrotate rules for Odoo logs
|
|
48
|
+
├── resources/ # Container-side helper resources
|
|
49
|
+
│ └── odoo/ # Resources specific to the Odoo service
|
|
50
|
+
│ └── entrypoint.sh # Container startup script that discovers addons
|
|
51
|
+
├── moo # Local command hub shortcut
|
|
52
|
+
├── scripts/ # Shell scripts used by the local command hub
|
|
53
|
+
├── odoo/ # Odoo workspace data and custom source tree
|
|
54
|
+
│ └── custom/ # Custom addon layer for this environment
|
|
55
|
+
│ ├── src/ # Source repository checkout root
|
|
56
|
+
│ │ ├── private/ # Project-owned/private addon repositories
|
|
52
57
|
${sourceRepoRows}
|
|
53
|
-
├──
|
|
54
|
-
│
|
|
55
|
-
│
|
|
56
|
-
|
|
57
|
-
├──
|
|
58
|
-
|
|
58
|
+
│ │ ├── oca/ # OCA addon repositories
|
|
59
|
+
│ │ └── external/ # Non-OCA third-party addon repositories
|
|
60
|
+
│ ├── patches/ # Local patches for upstream repositories
|
|
61
|
+
│ └── manifests/ # Source manifests, locks, and pinned revisions
|
|
62
|
+
├── docs/ # Project-specific documentation
|
|
63
|
+
│ ├── appstore-release.md # Odoo App Store release checklist and notes
|
|
64
|
+
│ └── compose.md # Compose layout and operations reference
|
|
65
|
+
├── .env.example # Template for local environment variables
|
|
66
|
+
├── README.md # This environment overview
|
|
67
|
+
└── AGENTS.md # Agent instructions for this environment`;
|
|
59
68
|
}
|
|
60
69
|
function sourceRepoDocs(options) {
|
|
61
70
|
if (!hasSourceRepos(options)) {
|
|
62
71
|
return `This environment was scaffolded without source repository submodules.
|
|
63
72
|
Add source repositories later from the cockpit or with \`npx @wpmoo/odoo add-repo\`.
|
|
64
|
-
They
|
|
73
|
+
They can be organized under:
|
|
74
|
+
|
|
75
|
+
\`odoo/custom/src/private\` for project-owned/private addon repositories,
|
|
76
|
+
\`odoo/custom/src/oca\` for OCA repositories, and
|
|
77
|
+
\`odoo/custom/src/external\` for non-OCA third-party repositories.
|
|
78
|
+
|
|
79
|
+
Pinned external manifests and local patches should live under
|
|
80
|
+
\`odoo/custom/manifests\` and \`odoo/custom/patches\` respectively.`;
|
|
65
81
|
}
|
|
66
82
|
return options.sourceRepos
|
|
67
83
|
.map((repo) => `### ${repo.path}
|
|
@@ -78,6 +94,9 @@ Submodule path:
|
|
|
78
94
|
odoo/custom/src/private/${repo.path}
|
|
79
95
|
\`\`\`
|
|
80
96
|
|
|
97
|
+
Note: If this repository is an OCA or third-party source, place it under
|
|
98
|
+
\`odoo/custom/src/oca\` or \`odoo/custom/src/external\` according to your policy.
|
|
99
|
+
|
|
81
100
|
Expected addon layout:
|
|
82
101
|
|
|
83
102
|
\`\`\`text
|
|
@@ -154,7 +173,7 @@ function environmentKind() {
|
|
|
154
173
|
return 'Docker Compose';
|
|
155
174
|
}
|
|
156
175
|
function repoDuplicationNote() {
|
|
157
|
-
return 'Keep
|
|
176
|
+
return 'Keep source repositories under the relevant source directory (`private`, `oca`, or `external`); the Compose entrypoint exposes discovered addons through `/mnt/wpmoo-addons`.';
|
|
158
177
|
}
|
|
159
178
|
function verificationCommand(options) {
|
|
160
179
|
const firstAddon = allAddons(options)[0] ?? options.product;
|
|
@@ -180,7 +199,8 @@ Set WPMOO_ENV=stage or WPMOO_ENV=prod only after providing production-grade secr
|
|
|
180
199
|
If copied from the standalone resource, additional compose notes are in
|
|
181
200
|
\`docs/compose.md\`.
|
|
182
201
|
|
|
183
|
-
Source repositories stay under \`odoo/custom/src/private\` when
|
|
202
|
+
Source repositories stay under \`odoo/custom/src/{private,oca,external}\` when
|
|
203
|
+
configured. At
|
|
184
204
|
container startup, \`entrypoint.sh\` scans those repositories for addons and
|
|
185
205
|
exposes them through \`/mnt/wpmoo-addons\`.
|
|
186
206
|
|
|
@@ -553,7 +573,8 @@ export function renderReadme(options) {
|
|
|
553
573
|
Private ${environmentKind()} development environment for the ${title} product.
|
|
554
574
|
|
|
555
575
|
This folder owns the development environment only. Product source code lives
|
|
556
|
-
in source repository submodules under \`odoo/custom/src/private
|
|
576
|
+
in source repository submodules under \`odoo/custom/src/private\`,
|
|
577
|
+
\`odoo/custom/src/oca\`, or \`odoo/custom/src/external\` when source
|
|
557
578
|
repositories are connected.
|
|
558
579
|
|
|
559
580
|
## Repository Layout
|
|
@@ -603,7 +624,8 @@ export function renderAgents(options) {
|
|
|
603
624
|
? options.sourceRepos.map((repo) => `- \`${repo.path}\`: \`${repo.url}\``).join('\n')
|
|
604
625
|
: '- No source repositories are configured yet.';
|
|
605
626
|
const sourceLayout = hasSourceRepos(options)
|
|
606
|
-
? `Product repositories are Git submodules
|
|
627
|
+
? `Product repositories are Git submodules. They are listed under the private
|
|
628
|
+
source directory below for this environment:
|
|
607
629
|
|
|
608
630
|
\`\`\`text
|
|
609
631
|
${options.sourceRepos.map((repo) => `odoo/custom/src/private/${repo.path}`).join('\n')}
|