@wpmoo/toolkit 0.9.20 → 0.9.22

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/README.md CHANGED
@@ -190,6 +190,17 @@ The unscoped `wpmoo` short alias is optional. If npm returns `E404` or rejects
190
190
  that alias during the publish workflow, the workflow reports a non-blocking
191
191
  warning while keeping the scoped package release valid.
192
192
 
193
+ ### Release candidate rules
194
+
195
+ - **Required release artifacts**: `@wpmoo/toolkit`, `@wpmoo/odoo`, and
196
+ `@wpmoo/odoo-dev` must be publishable at package version `$VERSION` for tag
197
+ `v$VERSION` to count as valid.
198
+ - **Optional artifact**: `wpmoo` at package version `$VERSION` is best-effort only. If npm
199
+ rejects it, the release still succeeds as long as the three required scoped
200
+ packages are valid.
201
+ - **Smoke expectation**: run `npm run smoke:published -- "$VERSION"` after the
202
+ release tag workflow completes.
203
+
193
204
  ## Documentation
194
205
 
195
206
  - [External Resources](docs/external-resources.md)
package/dist/cli.js CHANGED
@@ -280,8 +280,8 @@ async function showStartup(argv, skipUpdateCheck, details) {
280
280
  }
281
281
  console.log();
282
282
  }
283
- async function selectCockpitCommandFromMenu(serviceStatus, moduleCount) {
284
- const selection = await selectCockpitTopLevelMenu({ serviceStatus, moduleCount });
283
+ async function selectCockpitCommandFromMenu(serviceStatus, moduleCount, sourceRepoCount) {
284
+ const selection = await selectCockpitTopLevelMenu({ serviceStatus, moduleCount, sourceRepoCount });
285
285
  if (selection.kind === 'exit') {
286
286
  return 'exit';
287
287
  }
@@ -1453,7 +1453,7 @@ export async function runCli(cliArgv = process.argv.slice(2), cwd = process.cwd(
1453
1453
  };
1454
1454
  while (true) {
1455
1455
  try {
1456
- const command = await selectCockpitCommandFromMenu(serviceStatus, status.kind === 'environment' ? status.moduleCandidateCount : undefined);
1456
+ const command = await selectCockpitCommandFromMenu(serviceStatus, status.kind === 'environment' ? status.moduleCandidateCount : undefined, status.kind === 'environment' ? status.sourceRepoCount : undefined);
1457
1457
  if (command === 'exit') {
1458
1458
  return;
1459
1459
  }
@@ -48,8 +48,13 @@ function serviceDisabledReason(command, serviceStatus) {
48
48
  function moduleDisabledReason(command, moduleCount) {
49
49
  return moduleCount === 0 && moduleDependentCommandIds.has(command.id) ? 'No modules found.' : undefined;
50
50
  }
51
- function disabledReason(command, serviceStatus, moduleCount) {
52
- return serviceDisabledReason(command, serviceStatus) ?? moduleDisabledReason(command, moduleCount);
51
+ function sourceRepoDisabledReason(command, sourceRepoCount) {
52
+ return sourceRepoCount === 0 && command.id === 'add-module' ? 'No source repos found.' : undefined;
53
+ }
54
+ function disabledReason(command, serviceStatus, moduleCount, sourceRepoCount) {
55
+ return (serviceDisabledReason(command, serviceStatus) ??
56
+ moduleDisabledReason(command, moduleCount) ??
57
+ sourceRepoDisabledReason(command, sourceRepoCount));
53
58
  }
54
59
  function disabledError() {
55
60
  return 'This option is disabled and cannot be selected.';
@@ -60,7 +65,7 @@ function commandDisabledValue(reason) {
60
65
  }
61
66
  return reason;
62
67
  }
63
- function categoryChoices(category, index, serviceStatus, moduleCount) {
68
+ function categoryChoices(category, index, serviceStatus, moduleCount, sourceRepoCount) {
64
69
  const choices = [
65
70
  promptSeparator(categoryHeading(category)),
66
71
  ...topLevelCommands
@@ -70,7 +75,7 @@ function categoryChoices(category, index, serviceStatus, moduleCount) {
70
75
  value: command,
71
76
  name: commandName(command),
72
77
  short: command.label,
73
- disabled: commandDisabledValue(disabledReason(command, serviceStatus, moduleCount)),
78
+ disabled: commandDisabledValue(disabledReason(command, serviceStatus, moduleCount, sourceRepoCount)),
74
79
  };
75
80
  }),
76
81
  ];
@@ -103,8 +108,8 @@ function menuDeps(deps = {}) {
103
108
  function isCockpitCommand(value) {
104
109
  return typeof value === 'object' && value !== null && 'id' in value && 'slashAlias' in value;
105
110
  }
106
- function topLevelChoices(serviceStatus, moduleCount) {
107
- return topLevelCategoryOrder.flatMap((category, index) => categoryChoices(category, index, serviceStatus, moduleCount));
111
+ function topLevelChoices(serviceStatus, moduleCount, sourceRepoCount) {
112
+ return topLevelCategoryOrder.flatMap((category, index) => categoryChoices(category, index, serviceStatus, moduleCount, sourceRepoCount));
108
113
  }
109
114
  function defaultCommand(serviceStatus) {
110
115
  if (serviceStatus?.kind === 'running') {
@@ -117,7 +122,7 @@ function defaultCommand(serviceStatus) {
117
122
  }
118
123
  export async function selectCockpitTopLevelMenu(options = {}) {
119
124
  const deps = menuDeps(options);
120
- const choices = topLevelChoices(options.serviceStatus, options.moduleCount);
125
+ const choices = topLevelChoices(options.serviceStatus, options.moduleCount, options.sourceRepoCount);
121
126
  const cancelAction = 'back';
122
127
  const selected = await deps.select({
123
128
  message: '',
@@ -160,3 +160,29 @@ npm test
160
160
  npm run test:coverage
161
161
  npm run build
162
162
  ```
163
+
164
+ ## Coverage watchlist (risk monitoring)
165
+
166
+ The following list is a risk watchlist for Train 2 verification, not a hard gate.
167
+ It uses the full `npm run test:coverage` suite to highlight where changes in
168
+ high-impact runtime files should be reviewed with extra care:
169
+
170
+ - `src/cli.ts`: **watch**: 83.74% line coverage (1458/1741), function coverage
171
+ 92.47% (86/93), branch coverage 80.61% (420/521). This file remains the
172
+ highest-risk surface because it owns direct commands, cockpit dispatch, JSON
173
+ routes, and release-facing error behavior.
174
+ - `src/doctor.ts`: **observe**: 94.48% line coverage (702/743), function
175
+ coverage 95.56% (43/45), branch coverage 86.42% (229/265).
176
+ - `src/module-actions.ts`: **observe**: 96.83% line coverage (519/536),
177
+ function coverage 97.22% (35/36), branch coverage 88.97% (129/145).
178
+ - `src/templates.ts`: **observe**: 99.24% line coverage (262/264), function
179
+ coverage 100.00% (38/38), branch coverage 90.08% (109/121).
180
+ - `src/prompts/index.ts`: **observe**: 95.15% line coverage (294/309),
181
+ function coverage 100.00% (36/36), branch coverage 92.31% (96/104).
182
+
183
+ Train 2 full-suite coverage baseline:
184
+
185
+ - Statements: 92.65% (7304/7883)
186
+ - Branches: 88.24% (2432/2756)
187
+ - Functions: 96.27% (595/618)
188
+ - Lines: 92.65% (7304/7883)
package/docs/handoff.md CHANGED
@@ -42,7 +42,23 @@ npm view "@wpmoo/odoo-dev@$VERSION" version
42
42
  ```
43
43
 
44
44
  `npm view "wpmoo@$VERSION" version` is optional and may report that the short
45
- alias is absent.
45
+ alias is absent. A release is valid when all required scoped packages verify:
46
+
47
+ - `npm view "@wpmoo/toolkit@$VERSION" version`
48
+ - `npm view "@wpmoo/odoo@$VERSION" version`
49
+ - `npm view "@wpmoo/odoo-dev@$VERSION" version`
50
+
51
+ Optional short alias rule:
52
+
53
+ - `wpmoo` may be reported as missing or fail publish without invalidating the
54
+ release candidate. Scoped packages are the supported release artifacts and
55
+ are sufficient to mark the release valid.
56
+
57
+ Suggested smoke check:
58
+
59
+ ```bash
60
+ npm run smoke:published -- "$VERSION"
61
+ ```
46
62
 
47
63
  Current command standard:
48
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wpmoo/toolkit",
3
- "version": "0.9.20",
3
+ "version": "0.9.22",
4
4
  "description": "WPMoo Toolkit for development, staging, and production lifecycle workflows.",
5
5
  "type": "module",
6
6
  "repository": {