UNPKG

@halospv3/hce.shared-config

Version:

Automate commit message quality, changelogs, and CI/CD releases. Exports a semantic-release shareable configuration deserialized from this package's '.releaserc.yml'. Shared resources for .NET projects are also distributed with this package.

255 lines 10.8 kB
import { type Scope, type Type } from 'arktype'; import { NugetProjectProperties } from './NugetProjectProperties.js'; declare const msbuildEvaluationOutput: Type<{ Properties?: Record<string, string> | undefined; Items?: Record<string, { [x: string]: string | undefined; Identity: string; FullPath: string; RootDir: string; Filename: string; Extension: string; RelativeDir: string; Directory: string; RecursiveDir: string; ModifiedTime: string; CreatedTime: string; AccessedTime: string; DefiningProjectFullPath: string; DefiningProjectDirectory: string; DefiningProjectName: string; DefiningProjectExtension: string; SubType?: string; TargetFrameworkIdentifier?: string | undefined; TargetPlatformMoniker?: string | undefined; CopyUpToDateMarker?: string | undefined; TargetPlatformIdentifier?: string | undefined; TargetFrameworkVersion?: string | undefined; ReferenceAssembly?: string | undefined; }[]> | undefined; TargetResults?: Record<string, { Result: 'Success'; Items: { [x: string]: string | undefined; Identity: string; FullPath: string; RootDir: string; Filename: string; Extension: string; RelativeDir: string; Directory: string; RecursiveDir: string; ModifiedTime: string; CreatedTime: string; AccessedTime: string; DefiningProjectFullPath: string; DefiningProjectDirectory: string; DefiningProjectName: string; DefiningProjectExtension: string; SubType?: string | undefined; TargetFrameworkIdentifier?: string | undefined; TargetPlatformMoniker?: string | undefined; CopyUpToDateMarker?: string | undefined; TargetPlatformIdentifier?: string | undefined; TargetFrameworkVersion?: string | undefined; ReferenceAssembly?: string | undefined; }[]; } | { Result: 'Failure'; Items: never[]; }> | undefined; }>; export declare class MSBuildEvaluationOutput { /** * @param rawMSBuildEvaluation The output of a CLI MSBuild project evaluation. * May be the UTF-8 string-encoded JSON or the object decoded from that JSON. */ constructor(rawMSBuildEvaluation: Parameters<typeof JSON.parse>[0] | Parameters<typeof msbuildEvaluationOutput.from>[0]); /** * The specified properties and their values as evaluated by MSBuild Core. * `-getProperty:{propertyName,...}` */ Properties?: typeof msbuildEvaluationOutput.infer.Properties; /** * The specified items and their values and associated metadata as evaluated * by MSBuild Core. * `-getItem:{itemName,...}` */ Items?: typeof msbuildEvaluationOutput.infer.Items; /** * The specified Targets and their output values as evaluated by MSBuild * Core. * `-getTargetResult:{targetName,...}` */ TargetResults?: typeof msbuildEvaluationOutput.infer.TargetResults; } export declare const EvaluationOptions: Type<{ FullName: string; Property: { MSBuildProjectFullPath?: string | undefined; AssemblyName?: string | undefined; BaseIntermediateOutputPath?: string | undefined; BaseOutputPath?: string | undefined; Description?: string | undefined; IntermediateOutput?: string | undefined; OutDir?: string | undefined; OutputPath?: string | undefined; Version?: string | undefined; VersionPrefix?: string | undefined; VersionSuffix?: string | undefined; TargetFramework?: string | undefined; TargetFrameworks?: string | undefined; RuntimeIdentifier?: string | undefined; RuntimeIdentifiers?: string | undefined; }; Targets: readonly string[] | string[]; GetItem: readonly string[] | string[]; GetProperty: readonly string[] | string[]; GetTargetResult: readonly string[] | string[]; }>; export declare class MSBuildProject { /** * Properties for multi-targeting `dotnet publish` outputs. * These are included in {@link NPPGetterNames.InstanceGettersRecursive}. */ static readonly MatrixProperties: readonly string[]; /** * Creates an instance of MSBuildProject. * @param opts The order-independent arguments for this constructor. * Properties may be added or moved around in this definition without * breaking compatibility. * @param opts.fullPath The full path of the MSBuild project's file. This * should have a '.csproj', '.fsproj', or '.vbproj' file extension. * @param opts.projTargets A list of MSBuild Targets supported by the project. * @param opts.evaluation The output of an MSBuild project evaluation. This * comprises MSBuild Properties, Items, and Target results. */ constructor(opts: { fullPath: string; projTargets: string[]; evaluation: MSBuildEvaluationOutput; }); readonly Items: Readonly<Required<MSBuildEvaluationOutput>['Items']>; readonly Properties: Readonly<NugetProjectProperties>; readonly Targets: readonly string[]; /** * Allows appending subsequent target results. */ readonly TargetResults: Required<MSBuildEvaluationOutput>['TargetResults'][]; /** * @param projectPath The full path of the project file or its directory. A * relative path may be passed, but will resolve relative to the current * working directory. * @param includeNonPublic Include conventionally internal/private MSBuild * targets in the result. * @returns A string array of the project's MSBuild targets. * @todo consider 'file' of -targets[:file] * Prints a list of available targets without executing the * actual build process. By default the output is written to * the console window. If the path to an output file * is provided that will be used instead. * (Short form: -ts) * Example: * -ts:out.txt */ static GetTargets(projectPath: string, includeNonPublic?: boolean): Promise<string[]>; /** * Evaluate {@link Items}, {@link Properties}, and {@link TargetResults}, * returning them as an instance of {@link MSBuildProject}.\ * Note: MSBuild will probably fail if Restore is skipped and another * target is specified. If you choose Pack, you must do ['Restore', 'Pack']. * @param options The result of {@link EvaluationOptions.from}. * @returns A promised {@link MSBuildProject} instance. * @throws {Error} if the exec command fails -OR- the JSON parse fails -OR- * MSBuildProject's constructor fails. * @see {@link PackableProjectsToMSBuildProjects} for most use-cases. */ static Evaluate(options: typeof EvaluationOptions.inferOut): Promise<MSBuildProject>; /** * Evaluate multiple project paths with some default Evaluate options. * @async * @param projectsToPackAndPush An array of MSBuild projects' full file * paths. If a path is a directory, files in that directory are filtered for * `.csproj`, `.fsproj`, and `.vbproj` project files. * See https://github.com/dotnet/sdk/blob/497f334b2862bdf98b30c00ede2fd259ea5f624d/src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluationResult.cs#L19-L32.\ * @returns A promised array of {@link MSBuildProject} instances. * All known MSBuild and NuGet properties are evaluated. * If applicable, a project's "Pack" target is evaluated. */ static PackableProjectsToMSBuildProjects(projectsToPackAndPush: string[]): Promise<Promise<MSBuildProject>[]>; static fromJSON(json: string): MSBuildProject; } /** * ArkType type definitions for internal usage, but may be re-used elsewhere * @internal */ export declare const _InternalMSBuildEvaluationTypes: Scope<{ msbuildEvaluationOutput: { Properties?: Record<string, string> | undefined; Items?: Record<string, { [x: string]: string | undefined; Identity: string; FullPath: string; RootDir: string; Filename: string; Extension: string; RelativeDir: string; Directory: string; RecursiveDir: string; ModifiedTime: string; CreatedTime: string; AccessedTime: string; DefiningProjectFullPath: string; DefiningProjectDirectory: string; DefiningProjectName: string; DefiningProjectExtension: string; SubType?: string | undefined; TargetFrameworkIdentifier?: string | undefined; TargetPlatformMoniker?: string | undefined; CopyUpToDateMarker?: string | undefined; TargetPlatformIdentifier?: string | undefined; TargetFrameworkVersion?: string | undefined; ReferenceAssembly?: string | undefined; }[]> | undefined; TargetResults?: Record<string, { Result: 'Success'; Items: { [x: string]: string | undefined; Identity: string; FullPath: string; RootDir: string; Filename: string; Extension: string; RelativeDir: string; Directory: string; RecursiveDir: string; ModifiedTime: string; CreatedTime: string; AccessedTime: string; DefiningProjectFullPath: string; DefiningProjectDirectory: string; DefiningProjectName: string; DefiningProjectExtension: string; SubType?: string | undefined; TargetFrameworkIdentifier?: string | undefined; TargetPlatformMoniker?: string | undefined; CopyUpToDateMarker?: string | undefined; TargetPlatformIdentifier?: string | undefined; TargetFrameworkVersion?: string | undefined; ReferenceAssembly?: string | undefined; }[]; } | { Result: 'Failure'; Items: never[]; }> | undefined; }; }>; /** * Use this in your catch statement or .catch call to return `undefined` when * MSBuild error CSC2012 (e.g. "file in use by another process") is reported. * @param error Probably an Error object * @returns `undefined` if CSC2012 (file in use by another process) occurs */ export declare function catchCsc2012(error: unknown): undefined; export {}; //# sourceMappingURL=MSBuildProject.d.ts.map