Commit fd00eb1
fix: aio app deploy fails when packages: {} is declared (#233)
* fix: skip dist check and guard ow.package when packages is empty
When a manifest declares `packages: {}` the build step produces no
output so the dist directory is never created. The existing dist check
was throwing "missing files in dist/…, maybe you forgot to build your
actions?" even though there was nothing to build.
* deploy-actions.js: gate the dist check on `hasAnyActions` — only
validate the build directory when at least one package actually
defines actions. Two tests cover both branches of `pkg.actions || {}`
(empty packages and package with no actions key), keeping 100%
branch coverage on deploy-actions.js.
* utils.js (replacePackagePlaceHolder): guard the `packageNames[0]`
assignment so an empty packages object no longer clobbers `ow.package`
with `undefined`.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: warn when packages is empty instead of silently deploying a no-op
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* remove em dash
* fix: throw missing-files error when build dir exists but is empty
The dist-existence check had an operator-precedence bug:
`!fs.readdirSync(dist).length === 0` parses as `(!length) === 0`,
which is always false, so the empty-build-directory branch never
fired. Correct it to `fs.readdirSync(dist).length === 0` so a dist
directory that exists but contains no built actions now raises the
"missing files" error as intended. Adds a test covering that branch.
* fix: skip deploy as a no-op when no packages are declared
When the manifest declares `packages: {}` (e.g. only to trigger database
auto-provisioning), deployActions previously fell through to a full sync
against an empty manifest, which undeploys every previously-deployed
entity for the project. Return early instead so an empty manifest is a
true no-op that leaves existing entities untouched. `aio app undeploy`
remains the explicit way to remove everything.
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Patrick Russell <parussel@adobe.com>1 parent 86eba0a commit fd00eb1
4 files changed
Lines changed: 76 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
61 | 71 | | |
| 72 | + | |
| 73 | + | |
62 | 74 | | |
| 75 | + | |
63 | 76 | | |
64 | | - | |
| 77 | + | |
65 | 78 | | |
66 | 79 | | |
67 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2104 | 2104 | | |
2105 | 2105 | | |
2106 | 2106 | | |
2107 | | - | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
2108 | 2110 | | |
2109 | 2111 | | |
2110 | 2112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
580 | 588 | | |
581 | 589 | | |
582 | 590 | | |
583 | 591 | | |
584 | 592 | | |
585 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
586 | 604 | | |
587 | 605 | | |
588 | 606 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3097 | 3097 | | |
3098 | 3098 | | |
3099 | 3099 | | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
0 commit comments