mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-25 23:11:31 +00:00
0ff55d2d34
* 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>
35 lines
967 B
TypeScript
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>;
|