Commit Graph

36 Commits

Author SHA1 Message Date
Sebastian Poxhofer c32e2391a0 refactor(linters): add prefer-coerce-object rule (#45493)
Refs #45216

The object counterpart to `prefer-coerce-array`: `x ?? {}` becomes
`coerceObject(x)`. The rule flags a `??` whose default is a bare `{}`
literal, so a populated default or an asserted `({} as Foo)` still
passes; a `x ?? y ?? {}` chain maps onto `coerceObject(x, y)`.

Every hit across `lib/` converted cleanly, so no disable comments were
needed.
2026-08-28 09:27:59 +00:00
Sebastian Poxhofer 97327c3d28 refactor(linters): add prefer-coerce-array rule (#45492)
* refactor(linters): add prefer-coerce-array rule

Refs #45217

`x ?? []` and `coerceArray(x)` say the same thing, but only the second
one is searchable and consistent. The rule flags a `??` whose default is
a bare `[]` literal; a non-empty default or an asserted `([] as Foo[])`
still passes.

Applying it across `lib/` surfaced three spots the helper cannot cover,
which keep `?? []` with a disable comment or a narrower fix:

- `package-files.ts` destructures a tuple, which `coerceArray()` widens
- `generate.spec.ts` defaults `matchAll()`, an iterator rather than an array
- `mise/upgradeable-tooling.ts` declares a `Record` return, so its
  `?? []` fallback was wrong to begin with and becomes `coerceObject()`

* refactor(platform/github): hoist the GHE version header lookup

`Object.entries(...).find()` returns a tuple, and defaulting it with
`?? []` only to destructure the second element reads as an array
default when it is not one. Name the found entry instead, which drops
the `?? []` rather than routing a tuple through `coerceArray()`.
2026-08-28 09:27:58 +00:00
Sebastian Poxhofer 15f4bd8eff chore: migrate from zod/v3 to zod/v4 (#43691)
* chore: migrate from zod/v3 to zod/v4

This commit contains the logic changes

* chore: migrate imports from zod/v3 to zod/v4

This contains import updates and adds explicit record keys as zod/v4 requires these now

* ci: enforce usage of zod/v4
2026-05-30 16:01:58 +00:00
Sebastian Poxhofer 73b90e958b refactor: remove string concetation for production code (#43442)
refactor: prefer templates rather than `+`
2026-05-19 13:31:27 +00:00
Jamie Tanna 2d1e57532f refactor(types): rename lockFile to fileName in ArtifactError (#41631)
As `fileName` makes more sense (as it's not always a lock file we're
updating).

Also, if you set `fileName`, it would never actually output the
filename.

This renames the usages of `lockFile` to `fileName`.

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
2026-03-10 09:57:31 +00:00
renovate[bot] 4a2578d18d build(deps): update dependency zod to v4 (main) (#41225)
* build(deps): update dependency zod to v4

| datasource | package | from    | to    |
| ---------- | ------- | ------- | ----- |
| npm        | zod     | 3.25.76 | 4.3.6 |

* fix: zod migration

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-02-18 07:37:50 +00:00
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00
Jamie Tanna 7c467de395 fix(composer): don't rely on shell semantics for ignoring command failures (#40291)
As reported in #40284, since f430552de4
we've seen Composer failing to update.

We can take advantage of the new `ignoreFailure` option to replace the
usage of shell semantics.
2026-01-08 09:48:50 +00:00
Elaman Imashov a30c55080e fix(composer): Remove composer.lock file for lock file maintenance (#39920)
* Remove composer lock file for lock maintenance.

* Remove try/catch

Co-authored-by: Michael Kriese <michael.kriese@gmx.de>

---------

Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
2025-12-18 13:41:27 +00:00
RahulGautamSingh 76f911041a refactor: use named exports (#39196)
* use named exports

* fix test

* add missing imnport

* fix prettier
2025-11-10 12:00:35 +00:00
Joe Corall fc0395e282 feat(manager/composer): Add support for --with-all-dependencies (-W) (#36902)
Co-authored-by: Simon Morvan <simon.morvan@evolvingweb.com>
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-08-13 12:52:32 +00:00
RahulGautamSingh 80b7cdf1e0 refactor(util): move user env to util folder (#35103) 2025-04-02 10:27:27 +00:00
Stefano Arlandini d0976b49be feat(manager/composer): support updates with minimal changes (#34218)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-03-12 11:20:27 +00:00
RahulGautamSingh 2194142f78 feat(config): support user configured env (#27028)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-02-22 05:05:05 +00:00
Rhys Arkins eaec10d7c8 fix: increase shlex usage 2024-02-19 14:27:38 +01:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
Michael Kriese f0d676242a fix: better branch code coverage (#24276) 2023-09-07 04:39:39 +00:00
Erik Gaal 8b731042d7 fix: include newVersion in composer update command (#24057)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-08-25 12:03:23 +00:00
Jiahao Guo 58748ab6c2 refactor(util): move GitHub token related utils to proper place (#23869) 2023-08-15 14:26:38 +00:00
Sergei Zharinov 664dc808e7 refactor(composer): Use schema for parsing (#21520) 2023-05-07 20:51:20 +00:00
DjordyKoert 62b57aa27c feat: disable setting COMPOSER_AUTH for gitlab (#20634)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-04-17 06:16:02 +00:00
Rhys Arkins 1767f7608b fix: Revert "refactor: safely parse composer files" (#21448) 2023-04-12 14:30:33 +02:00
Jamie Magee 965054d7d4 refactor: safely parse composer files (#21173) 2023-04-08 15:08:07 +00:00
Eric Durand-Tremblay e8a5437cd3 feat(manager/composer): support git-tags hostRules for github.com when updating artifacts (#18004)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
fixes undefined
2023-01-13 13:33:49 +00:00
Michael Kriese 73be295310 feat(core): centralize sidecar image usage (#19545) 2022-12-23 09:45:15 +00:00
Rhys Arkins 7afb7b5348 fix(composer): handle empty git stash pop (#19527) 2022-12-22 17:44:05 +01:00
Rhys Arkins 52d773bb6b feat(composer): stash/unstash before install (#19518) 2022-12-21 17:00:25 +01:00
RahulGautamSingh c56588eaba refactor: convert PlatformmId to union (#18458) 2022-11-01 14:46:09 +00:00
Rhys Arkins ca4025b36b feat(composer): support binarySource=install for php (#18656) 2022-10-29 14:42:00 +00:00
RahulGautamSingh 0151b6a4a9 refactor: reduce debug metadata (#18466)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2022-10-29 12:11:09 +00:00
Rhys Arkins fc605a59c0 fix(composer): Revert "feat(manager/composer): support git-tags hostRules for github.com when updating artifacts" (#17961) 2022-09-25 07:06:44 +03:00
Eric Durand-Tremblay 781b8fbcb7 feat(manager/composer): support git-tags hostRules for github.com when updating artifacts (#16193) 2022-08-30 16:49:01 +03:00
IKEDA Sho 72db89f6e5 refactor: Fix constraint typos (#16879) 2022-08-01 04:02:55 +00:00
Michael Kriese 10302eba68 refactor: fix prefer-nullish-coalescing (#16171) 2022-06-21 12:02:49 +00:00
Michael Kriese f5f06c73be refactor(manager): more strict null checks (#15168) 2022-04-20 06:19:59 +02:00
Rhys Arkins dca3418bbd refactor: lib/modules (#14488)
Moves datasource, manager, platform and versioning code from lib/ into new lib/modules/

BREAKING CHANGE: External tools must update paths to datasource, manager, platform and versioning
2022-03-04 09:04:02 +01:00