Commit Graph

51 Commits

Author SHA1 Message Date
renovate[bot] 9d74625d93 build(deps): update dependency prettier to v3.9.6 (main) (#45815)
* build(deps): update dependency prettier to v3.9.6

| datasource | package  | from  | to    |
| ---------- | -------- | ----- | ----- |
| npm        | prettier | 3.8.1 | 3.9.6 |

* chore: prettier fixes

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@mend.io>
2026-09-09 13:50:03 +00:00
Sanjay Doppalapudi dad0b03b00 fix(manager/npm): run npm install twice during lock file maintenance (#45542)
Lock file maintenance deletes package-lock.json and regenerates it from
scratch, and a single npm install pass can produce a lock file that is out
of sync with package.json, so npm ci rejects the branch. Always run the
install command a second time for lock file maintenance, mirroring the
existing double run for remediations, instead of relying on users opting
in to the npmInstallTwice postUpdateOption. Because branch creation and
rebase share the same lock file generation path, this covers both.
2026-09-02 19:59:02 +00:00
Sebastian Poxhofer e0cec3dc95 refactor(lint): add types-location rule and enable it for lib/modules (#45497)
feat(lint): add `types-location` rule and enable it for `lib/modules`

Reviewers consistently ask for exported types to be moved into a
colocated `types.ts`. Add a `renovate/types-location` oxlint rule that
reports `export interface` / `export type` declarations outside such a
file, and turn it on across `lib/modules`.

Re-exports (`export type { X }`, `export type *`), file-local types, and
values (enums, classes, functions) are left alone. `schema.ts` files and
`schema/` directories are excluded via config, matching how
`zod-schema-location` is configured — inferred types belong next to the
schema they are derived from.

Relocating the 87 existing violations means:

- new `types.ts` files for the modules that had none
- `terragrunt/common.ts` folded into its `types.ts`, as it held nothing
  else
- `RangeBound` in `versioning/gradle/compare.ts` un-exported, since only
  a file-local interface referenced it
- `bazel-module/parser/fragments.ts` split from its inferred types, which
  now live in `parser/types.ts` and infer through a namespace import so
  each schema keeps its merged name
2026-08-27 19:52:09 +00:00
Sebastian Poxhofer a473e73b3e fix(linters): forbid inert counts in v8 coverage-ignore comments (#45287)
Adds a custom oxlint rule renovate/v8-ignore-no-count that flags the
count form '/* v8 ignore next <N> */'. The count is not honored by
vitest's ast-v8-to-istanbul hint parser, which captures only the
keyword (if/else/next/file); 'next' always exempts exactly the next
AST node. Trailing counts therefore suggest a line range that is never
applied and mislead readers.

The rule is autofixable (drops the count, preserving actual behavior)
and has been applied to all existing occurrences.
2026-08-22 11:25:31 +00:00
Sebastian Poxhofer a1971afa78 fix(linters): add linting rule to enforce usage of our regEx utility (#44690)
* ci(linter): add renovate/require-regex-util rule

Adds a custom oxlint rule that flags raw RegExp usage in lib/
production code: any `new RegExp(...)` call and any regex literal
that is not the direct first argument of `regEx(...)`. The regEx()
helper from lib/util/regex.ts uses the RE2 engine for ReDoS-safe
matching and caches compiled patterns. lib/util/regex.ts itself is
exempt.

The rule is disabled for **/*.spec.ts, test/**, and tools/** via
config overrides, because vitest APIs such as expect.stringMatching
need bare RegExp instances (a past commit reverted regEx() there).

Severity is set to "warn" instead of "error": the repo currently has
197 pre-existing violations (above the agreed mechanical-fix
threshold of 80), and a number of them are deliberately
RE2-incompatible patterns (lookahead/lookbehind/named backreferences,
see TODO #12872/#12875 markers in e.g. lib/modules/versioning/rez/
pattern.ts and lib/modules/manager/dockerfile/extract.ts) that need
per-site judgment before they can be wrapped in regEx() or suppressed
with a justified disable comment. No violation fixes are included in
this commit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci(linter): enforce renovate/require-regex-util at error

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor: use regEx() for regex literals and RegExp construction in lib

Burn down all renovate/require-regex-util violations (197):

- wrap RE2-compatible regex literals and RegExp constructions in regEx()
- rewrite lookaround patterns where behavior is provably preserved:
  goproxy separator split, sbt-package link extraction, leiningen
  comment stripping and keyword search, npm GitHub owner validation
  (unit-count bound replaced by an explicit length check)
- keep native RegExp with disable comments where RE2 cannot be used:
  moo / good-enough-parser lexer patterns (moo rejects RE2 instances),
  MigrationsService propertyName (matched via isRegExp, which RE2
  instances fail), rez named backreferences and lookaheads, GitHub
  markdown link negative lookbehind, emoji astral-plane matching
- drop stale TODO #12875 comments for patterns current re2 handles

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor: reduce require-regex-util disable comments

Rewrite the github massage-markdown-links URL regex to capture an
optional `api.` prefix in a named group (skipped in code) instead of
relying on a negative lookbehind, so both the base and global variants
can use regEx()/RE2 and their two disable comments are removed. Add
spec cases for api-prefixed URLs that match the URL shape.

Consolidate the four related line disables in rez/pattern.ts (bound and
range patterns emulating Python conditional patterns via named
backreferences and lookaheads, which RE2 cannot express) into a single
block disable/enable pair, matching the treatment of the lexer files.

Disable comment count drops from 13 to 8.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(datasource/sbt-package): use named capture group in link regex

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(manager/cake): restore original multiLineComment regex spelling

The [^] -> [\\s\\S] rewrite was only needed for an RE2 wrap that was
later reverted; keep the diff minimal.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(datasource/go): skip empty GOPROXY segments

The switch from a lookahead split to a capture-group split (needed because
RE2 has no lookahead support) changed how empty GOPROXY segments parse:
`a|,b` yielded `{ url: ',', fallback: '|' }` before and
`{ url: '', fallback: ',' }` after. The comma fallback only continues on
404/410, so a failing proxy ahead of an empty segment silently stopped the
lookup instead of falling through to the remaining proxies.

Empty segments carry no url to query, so drop them.

* refactor(datasource/go): use isTruthy for empty segment filter

* fix(datasource/go): filter empty segments before mapping

Filtering after the map broke the contextual typing from the
GoproxyItem[] annotation, widening fallback to string.

* refactor(platform/github): use regEx() for merge queue query stripping

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-14 14:30:46 +00:00
Johannes Feichtner 0779ae8d06 fix(manager/npm): skip --before flag when .npmrc contains min-release-age (#43187) 2026-05-09 12:04:35 +00:00
Johannes Feichtner 77758459e9 feat(manager/npm): pass --before to npm install when minimumReleaseAge is set (#42552)
* feat(manager/npm): pass --before to npm install when minimumReleaseAge is set

* fix tests

* replace regex with `ini` parse
2026-05-07 13:14:48 +00:00
Michael Kriese 6804768a1a feat(npm): support pnpm workspace file overrides (#42247)
* feat(npm): support pnpm workspace file overrides

* chore: fix comment

* refactor: use types

* feat(npm/pnpm): update overrides in workspace file

* test: fix test

* chore: fix coverage
2026-04-08 12:01:31 +00:00
Jamie Tanna a74da77801 fix(manager/npm): revert passing --before to npm install when minimumReleaseAge is set (#42198)
Revert "feat(manager/npm): pass --before to npm install when minimumReleaseAg…"

This reverts commit c4d5697775.
2026-03-27 12:36:03 +00:00
Johannes Feichtner c4d5697775 feat(manager/npm): pass --before to npm install when minimumReleaseAge is set (#42051)
* feat(manager/npm): pass --before to npm install when minimumReleaseAge is set

* use logger metadata

* Apply suggestion from @viceice

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

---------

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-03-27 09:46:02 +00:00
Jamie Tanna bc82cff059 feat(managers/npm): allow specifying toolSettings.nodeMaxMemory (#40957)
* feat(managers/npm): allow specifying `toolSettings.nodeMaxMemory`

As noted in #40942, we're seeing an increase in memory usage across
`pnpm` and `yarn` users in Mend-hosted apps.

To allow limiting the maximum memory that any `node` child processes
will use, we can add a new `toolSettings.nodeMaxMemory` to (hopefully)
mitigate this.

Similar to the `toolSettings.jvmMaxMemory`, the self-hosted
administrator can set a maximum, which cannot be exceeded by repo-level
configuration.

* fixup! feat(managers/npm): allow specifying `toolSettings.nodeMaxMemory`
2026-03-05 12:56:02 +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
Michael Kriese 050ac8d23b chore: better code coverage (#39518) 2025-11-25 15:01:54 +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
RahulGautamSingh 98eef7e82d fix: skip npm installation if no constraint specified (#38974)
* only install npm if pinned version found

* only extract npm constraint from lockfile-version<3

* remove redundant log

* add test

* revert test removal
2025-11-07 19:03:21 +00:00
Rhys Arkins 266e52813d feat(manager/npm): npmInstallTwice (#37532)
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
2025-08-18 19:40:29 +00:00
Michael Kriese 14fe4c3811 chore(npm): fix coverage reporting (#37401) 2025-08-08 13:12:04 +00:00
Anne Stellingwerf 59de985bb2 fix(managers): quote more manager commands (#36163) 2025-05-27 13:58:40 +00:00
RahulGautamSingh 80b7cdf1e0 refactor(util): move user env to util folder (#35103) 2025-04-02 10:27:27 +00:00
Trent Mick 5bdaf47eeb fix(npm): don't break on npm workspace dir with a period (#30483) 2024-07-30 18:24:28 +00:00
renovate[bot] 1a1e1acc23 chore(deps): update dependency typescript to v5.5.3 (#29906)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-07-20 20:38:33 +00:00
Michael Kriese b357e4d21c fix(npm): don't delete lockfiles early (#28472) 2024-04-18 06:22:03 +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
fastman 5fdf4fc503 fix(npm): use lockfileVersion from npm-shrinkwrap (#26726) 2024-01-19 12:44:49 +00:00
Rhys Arkins 08be9b8ad2 fix(npm): use lockfileVersion to determine npm version (#25820) 2023-11-16 15:51:34 +00:00
Rhys Arkins 16b3862821 fix(npm): better detect workspace packages (#25692) 2023-11-10 19:29:10 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
Jeldrik Hanschke e0f9266a50 feat(manager/npm): Optimize npm dedupe option (#25466)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2023-11-01 16:15:17 +00:00
RahulGautamSingh d81494ab13 fix: improve branch code coverage (#24339) 2023-09-17 06:56:34 +00:00
Rhys Arkins 804114f716 fix(npm): handle null lockfile after update (#23658) 2023-09-06 09:37:03 +00:00
Rhys Arkins 36e2b328bb chore: update types reference 2023-08-15 11:31:15 +02:00
Mads Jon Nielsen bc192665d7 fix(npm): package-lock.json v3 root project out of sync with package.json (#23495)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2023-08-03 11:58:50 +00:00
renovate[bot] fe739befbf chore(deps): update linters to v6 (major) (#23325)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-08-02 15:07:49 +00:00
Adam Setch 2159444ee1 refactor: use minimatch util (#23549) 2023-07-26 07:51:10 +00:00
Michael Kriese 2d23e16b1e feat(manager/npm): extract contraints again on post-update (#23131) 2023-07-19 05:30:13 +00:00
Rhys Arkins 85ae416bc5 fix: separate extractedConstraints from constraints (#22823) 2023-06-17 09:29:23 +00:00
renovate[bot] 58aa841d69 build(deps): update dependency minimatch to v9 (#21923)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-05-02 13:00:40 +00:00
RahulGautamSingh 012c0ac2fe feat: npm workspaces (#21274)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-04-27 12:42:25 +00:00
Michael Kriese 73be295310 feat(core): centralize sidecar image usage (#19545) 2022-12-23 09:45:15 +00:00
Rhys Arkins d1d6febd2e fix(npm): use nvmrc from lock file dir (#18978)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-11-18 06:13:09 +00:00
Michael Kriese be316c5d0b feat(manager/npm): full npm buildpack support (#16976)
* feat(manager/npm): full npm buildpack support

* chore: fix test
2022-08-05 16:13:59 +00:00
Sergei Zharinov e4dbd4ad49 fix(ci): Restrict template expressions (#16834)
* fix(ci): Restrict template expressions

* Fix

* Fix

* Fix
2022-07-30 16:28:31 +02:00
Michael Kriese e5c6f38d75 refactor: enable strict checks (#16168)
* refactor:  enable strict checks

* chore: revert changes

* chore: fix tsconfig
2022-06-21 13:00:21 +02:00
Michael Kriese 0a582d31c7 refactor: fix nullable types (#16156)
* refactor: fix nullable types

* chore: revert changes

* chore: fix lint comments

* chore: revert changes
2022-06-20 16:15:40 +00:00
Michael Kriese 0180fddb37 feat(npm): use updated node for artifacts (#15527) 2022-05-11 05:19:35 +00:00
Michael Kriese 9f53724d90 feat(manager:npm): use local fs api (#15294) 2022-04-25 15:41:10 +02:00
Michael Kriese 868ebbef63 refactor(manager): final strict null checks (#15185)
* refactor(manager): final strict null checks

* refactor: fix type issues

* test: fix mocking
2022-04-20 08:40:20 +02:00
Martin Herndl 35b6ee220d refactor(npm): extract lockfile parsing (#14720) 2022-03-22 04:48:25 +01:00
Martin Herndl 53d376eb8d fix(npm): massage lockfile with rangeStrategy=update-lockfile (#14586)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2022-03-16 09:17:47 +00:00
Nicolas Hansse 7cdc15ec38 chore(npm): fix typo (#14575) 2022-03-08 16:52:25 +01:00