Files
renovate/lib/modules/manager/proto/upgradeable-tooling.ts
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

114 lines
2.8 KiB
TypeScript

import { GithubReleasesDatasource } from '../../datasource/github-releases/index.ts';
import { GithubTagsDatasource } from '../../datasource/github-tags/index.ts';
import { NodeVersionDatasource } from '../../datasource/node-version/index.ts';
import { NpmDatasource } from '../../datasource/npm/index.ts';
import { RubyVersionDatasource } from '../../datasource/ruby-version/index.ts';
import { RustVersionDatasource } from '../../datasource/rust-version/index.ts';
import * as semverVersioning from '../../versioning/semver/index.ts';
import type { ToolingDefinition } from './types.ts';
/**
* Maps proto built-in tool names to Renovate datasource configurations.
* @see https://moonrepo.dev/docs/proto/config
*/
export const protoTooling: Record<string, ToolingDefinition> = {
bun: {
config: {
packageName: 'oven-sh/bun',
datasource: GithubReleasesDatasource.id,
extractVersion: '^bun-v(?<version>\\S+)',
},
},
deno: {
config: {
packageName: 'denoland/deno',
datasource: GithubReleasesDatasource.id,
extractVersion: '^v(?<version>\\S+)',
},
},
gh: {
config: {
packageName: 'cli/cli',
datasource: GithubReleasesDatasource.id,
extractVersion: '^v(?<version>\\S+)',
},
},
go: {
config: {
packageName: 'golang/go',
datasource: GithubTagsDatasource.id,
extractVersion: '^go(?<version>\\S+)',
},
},
moon: {
config: {
packageName: 'moonrepo/moon',
datasource: GithubReleasesDatasource.id,
extractVersion: '^v(?<version>\\S+)',
},
},
node: {
config: {
packageName: 'node',
datasource: NodeVersionDatasource.id,
},
},
npm: {
config: {
packageName: 'npm',
datasource: NpmDatasource.id,
},
},
pnpm: {
config: {
packageName: 'pnpm',
datasource: NpmDatasource.id,
},
},
poetry: {
config: {
packageName: 'python-poetry/poetry',
datasource: GithubReleasesDatasource.id,
},
},
proto: {
config: {
packageName: 'moonrepo/proto',
datasource: GithubReleasesDatasource.id,
extractVersion: '^v(?<version>\\S+)',
},
},
python: {
config: {
packageName: 'python/cpython',
datasource: GithubTagsDatasource.id,
extractVersion: '^v(?<version>\\S+)',
},
},
ruby: {
config: {
packageName: 'ruby-version',
datasource: RubyVersionDatasource.id,
versioning: semverVersioning.id,
},
},
rust: {
config: {
packageName: 'rust',
datasource: RustVersionDatasource.id,
},
},
uv: {
config: {
packageName: 'astral-sh/uv',
datasource: GithubReleasesDatasource.id,
},
},
yarn: {
config: {
packageName: '@yarnpkg/cli',
datasource: NpmDatasource.id,
},
},
};