Files
renovate/lib/modules/manager/xcodegen/schema.ts
T
Stefan Ceriu 0ff55d2d34 feat: add XcodeGen manager for Swift package dependencies in project.yml files (#41889)
* feat: add XcodeGen manager for Swift package dependencies in project.yml files

* chore(xcodegen): inline project.yml fixture

* fix(xcodegen): use semver instead of swift versioning

* fix(xcodegen): use glob syntax for manager file pattern

* tests(xcodegen): expect logger is called on invalid packages

* tests(xcodegen): better assert extracted package contents

* chore(xcodegen): simplify regex usage

* chore(xcodegen): log projects without dependencies

* chore(xcodegen): simplify dependency resolving and remove regular expressions in favor of the `detectPlatform` helper function

* chore(xcodegen): use `coerceString` on package versions to simplify testing and improve coverage

* chore(xcodegen): address PR review comments.

---------

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-04-15 15:13:04 +00:00

35 lines
967 B
TypeScript

import { z } from 'zod/v3';
import { LooseRecord, Yaml } from '../../../util/schema-utils/index.ts';
const VersionField = z
.union([z.string(), z.number()])
.optional()
.transform((val) => val?.toString());
const XcodeGenSwiftPackage = z.object({
url: z.string().optional(),
github: z.string().optional(),
path: z.string().optional(),
from: VersionField,
majorVersion: VersionField,
minorVersion: VersionField,
exactVersion: VersionField,
version: VersionField,
minVersion: VersionField,
maxVersion: VersionField,
branch: z.string().optional(),
revision: z.string().optional(),
group: z.string().optional(),
excludeFromProject: z.boolean().optional(),
});
export type XcodeGenSwiftPackage = z.infer<typeof XcodeGenSwiftPackage>;
export const XcodeGenProjectFile = Yaml.pipe(
z.object({
packages: LooseRecord(XcodeGenSwiftPackage).optional(),
}),
);
export type XcodeGenProjectFile = z.infer<typeof XcodeGenProjectFile>;