@webpieces/rules-config 0.4.981 → 0.4.983

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.
@@ -303,10 +303,12 @@ snapshots are never loaded as active summaries; a new PR requires its own author
303
303
  The numbers in a `--delete-*` flag are the numbers printed on the SAME run — wp-cleanup renumbers
304
304
  from a fresh scan every time, and a number past the end of the block stops the run rather than
305
305
  deleting the wrong ref. An explicit flag always beats the terminal sniff.
306
- 8. **`pnpm wp-push-dev`** — publish a **disposable copy** of this branch so a shared dev environment can
307
- build it. No PR, no build gate, and your feature branch is never moved. See below.
308
- 9. **`pnpm wp-finish-push-dev`** — finalize a dev composition after you resolved its conflicts. Only
309
- needed on the conflict path; a clean `pnpm wp-push-dev --resolve` finalizes itself.
306
+ 8. **`pnpm wp-push-dev`** — check this branch against `origin/dev`, build it, then publish a **disposable
307
+ copy** of it so a shared dev environment can build it. No PR, and your feature branch is never moved.
308
+ See below.
309
+ 9. **`pnpm wp-finish-push-dev`** — finish after you resolved the conflicts `wp-push-dev` stopped on. Only
310
+ needed on the conflict path; a clean run finalizes itself.
311
+ 10. **`pnpm wp-build-dev`** — the same check against `origin/dev` and the same build, WITHOUT publishing.
310
312
 
311
313
  ## Publishing to the shared dev server (no PR, nothing lands on main)
312
314
 
@@ -315,11 +317,57 @@ to `origin/main`, merges every published copy, builds the composed tree, and for
315
317
  Nobody ever checks it out, so the wipe is a non-event, and it can never be stale.
316
318
 
317
319
  ```bash
318
- pnpm wp-push-dev # publish this branch as dev-include/<your-branch>
320
+ pnpm wp-push-dev # check against origin/dev, build, publish this branch as dev-include/<your-branch>
321
+ pnpm wp-build-dev # the same check and build, publishing nothing
319
322
  pnpm wp-push-dev --list # what is currently in the pool
320
323
  pnpm wp-push-dev --remove # take your branch back out (this is the rollback)
321
324
  ```
322
325
 
326
+ **What `wp-push-dev` does before it publishes.** It fetches `origin/dev`, merges it into a THROWAWAY
327
+ branch (`<your-branch>DevResolve`, never your branch), and runs `commands.push-dev.buildCommand` on the
328
+ merged tree. Only when the merge is clean (or you resolved it) and that build is green does it publish.
329
+ So a conflict or a broken build is found on your machine, in a minute, instead of after the shared
330
+ composition fails. The build output goes to a log file; read the `FullLog :` path it prints rather than
331
+ re-running it.
332
+
333
+ **What it publishes is never that merge.** The copy is your branch exactly as it is, plus — only when
334
+ something conflicted — ONE commit holding the files you resolved. A copy that contained `dev` would carry
335
+ every other copy's history, and a later `--remove` of one of them would leave it on dev through yours.
336
+
337
+ **`commands.push-dev.buildCommand` has no default.** Configure the dev-scoped build in
338
+ `webpieces.config.json` (it should build only what differs from `origin/dev`, so it stays fast):
339
+
340
+ ```json
341
+ "commands": { "push-dev": { "buildCommand": "pnpm nx affected --target=ci --base=origin/dev --head=HEAD" } }
342
+ ```
343
+
344
+ Without it, `wp-push-dev` and `wp-build-dev` refuse before touching anything and print that entry. When
345
+ `origin/dev` does not exist yet (the very first composition), `wp-push-dev` publishes unchecked.
346
+
347
+ `--remove` deletes `dev-include/<your-branch>` **and then** pushes a content-free marker
348
+ `dev-remove/<your-branch>` at the `origin/main` tip. The marker push is the rebuild signal: a deletion
349
+ alone can only be heard by a workflow's `on: delete:`, which GitHub cannot filter by branch, so every
350
+ branch deletion in the repo would start a dev-deploy run. If the marker push fails, the command stops
351
+ and says so — your copy is already gone, but `dev` was **not** rebuilt; follow what it prints.
352
+
353
+ The three names come from `pr-gate.devDeploy` in `webpieces.config.json` — `branchNamespace`
354
+ (default `dev-include`), `devBranch` (default `dev`) and `removeNamespace` (default `dev-remove`) —
355
+ substitute them below if the repo overrides any.
356
+
357
+ **The contract the repo's dev workflow implements** (this is the consumer's CI, not webpieces):
358
+
359
+ ```yaml
360
+ on:
361
+ push:
362
+ branches: ['main', 'dev-include/**', 'dev-remove/**']
363
+ # no `delete:` trigger — it cannot be filtered by branch, so every deletion in the repo would start a run
364
+ ```
365
+
366
+ On a `dev-remove/**` push the workflow deletes that marker ref, then runs the ordinary rebuild: reset
367
+ `dev` to `origin/main`, merge every remaining `dev-include/*` copy, build, force-push. A workflow still
368
+ listening on `on: delete:` keeps working too, because `--remove` still deletes the copy — add the
369
+ `dev-remove/**` trigger first, upgrade webpieces, then drop `delete:`.
370
+
323
371
  **The cardinal rule, and the reason a COPY exists at all:** your feature branch is the PR head, so it
324
372
  must **never** acquire another developer's commits — landing that PR would ship their unreviewed work to
325
373
  production. Conflict resolutions therefore live on the throwaway copy, never on your branch. After any
@@ -351,6 +399,15 @@ in. Nothing here is blocked: they are read-only git queries plus `gh run list|wa
351
399
  composition may have excluded yours. Question 1 is the one that answers for *your* code; question 2 only
352
400
  tells you the machinery finished. Answer them in that order, and report both.
353
401
 
402
+ ### When `wp-push-dev` stops on a conflict
403
+
404
+ It stops on the THROWAWAY branch and lists the files. Resolve them, `git add` each one, then:
405
+
406
+ ```bash
407
+ pnpm wp-finish-push-dev # commits, runs the dev build, publishes
408
+ pnpm wp-finish-push-dev --abort # or throw it all away
409
+ ```
410
+
354
411
  ### When two branches conflict in the composition
355
412
 
356
413
  CI will name the branch you conflict with. Compose locally, so what you resolve is what CI will build:
@@ -358,13 +415,16 @@ CI will name the branch you conflict with. Compose locally, so what you resolve
358
415
  ```bash
359
416
  pnpm wp-push-dev --resolve # merge every OTHER copy, in CI's order
360
417
  pnpm wp-push-dev --resolve <their-branch> # or just the one CI named
361
- # clean → it publishes the copy itself; you are done
418
+ # clean → nothing to publish: CI already composes your copy as it is
362
419
  # CONFLICT → it stops on a THROWAWAY branch and lists the files
363
420
  # resolve them, `git add` each one, then:
364
421
  pnpm wp-finish-push-dev # commits, resumes the queue, publishes
365
422
  pnpm wp-finish-push-dev --abort # or throw it all away
366
423
  ```
367
424
 
425
+ Either way, what is published is your copy plus ONE commit holding the resolved files — never a merge of
426
+ the other copies.
427
+
368
428
  While a resolve is half-finished the other `wp-*` commands refuse (you are parked on a throwaway branch,
369
429
  not your feature branch). The block message lists exactly which ones and how to get out.
370
430
 
@@ -375,7 +435,9 @@ them; neither is blocked.
375
435
  ### If your copy already holds a resolution
376
436
 
377
437
  `wp-push-dev` **refuses** rather than force-pushing over commits the copy has and your branch does not —
378
- that is somebody's real conflict resolution, and it exists only there, by design. Two ways forward:
438
+ that is somebody's real work, and it exists only there, by design. (A resolution commit `wp-push-dev`
439
+ recorded itself is the exception: the next publish re-checks against dev and records it again, so it is
440
+ replaced without asking.) Two ways forward:
379
441
 
380
442
  - `pnpm wp-push-dev --rebase-resolution` — replay it on top of your new commits (keeps the work)
381
443
  - `pnpm wp-push-dev --force` — discard it (somebody re-resolves the composition afterwards)