@halospv3/hce.shared-config 3.4.8 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [3.5.0](https://github.com/HaloSPV3/HCE.Shared/compare/v3.4.8...v3.5.0) (2026-04-03)
2
+
3
+ ### Features
4
+
5
+ * add commit-analyzer types ([6728493](https://github.com/HaloSPV3/HCE.Shared/commit/6728493243c490285dfe33f5ae1fca6ae76847f1)), closes [#662](https://github.com/HaloSPV3/HCE.Shared/issues/662)
6
+
7
+ ## [3.5.0-develop.1](https://github.com/HaloSPV3/HCE.Shared/compare/v3.4.8...v3.5.0-develop.1) (2026-04-03)
8
+
9
+ ### Features
10
+
11
+ * add commit-analyzer types ([6728493](https://github.com/HaloSPV3/HCE.Shared/commit/6728493243c490285dfe33f5ae1fca6ae76847f1)), closes [#662](https://github.com/HaloSPV3/HCE.Shared/issues/662)
12
+
1
13
  ## [3.4.8](https://github.com/HaloSPV3/HCE.Shared/compare/v3.4.7...v3.4.8) (2026-03-27)
2
14
 
3
15
  ### Bug Fixes
@@ -1 +1 @@
1
- {"version":3,"file":"MSBuildProject.d.mts","names":[],"sources":["../../src/dotnet/MSBuildProject.ts"],"mappings":";;;;cA2EM,uBAAA,EAAyB,IAAA;EAC7B,UAAA,GAAa,MAAA;EACb,KAAA,GAAQ,MAAA;IAAA;IAEN,QAAA;IACA,QAAA;IACA,OAAA;IACA,QAAA;IACA,SAAA;IACA,WAAA;IACA,SAAA;IACA,YAAA;IACA,YAAA;IACA,WAAA;IACA,YAAA;IACA,uBAAA;IACA,wBAAA;IACA,mBAAA;IACA,wBAAA;IACA,OAAA;IACA,yBAAA;IACA,qBAAA;IACA,kBAAA;IACA,wBAAA;IACA,sBAAA;IACA,iBAAA;EAAA;EAEF,aAAA,GAAgB,MAAA;IACd,MAAA;IACA,KAAA;MAAA;MAEE,QAAA;MACA,QAAA;MAC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,aACC,OAAA;;;;;;;;;;;;SAyBiB,QAAA,CAClB,OAAA,SAAgB,iBAAA,CAAkB,QAAA,GACjC,OAAA,CAAQ,cAAA;;;;;;;;;;;;SAiHS,iCAAA,CAClB,qBAAA,aACC,OAAA,CAAQ,OAAA,CAAQ,cAAA;EAAA,OAwFL,QAAA,CAAS,IAAA,WAAe,cAAA;AAAA;;;;;cAsD3B,+BAAA,EAAiC,KAAA;EAC5C,uBAAA;IACE,UAAA,GAAa,MAAA;IACb,KAAA,GAAQ,MAAA;MAAA;MAEN,QAAA;MACA,QAAA;MACA,OAAA;MACA,QAAA;MACA,SAAA;MACA,WAAA;MACA,SAAA;MACA,YAAA;MACA,YAAA;MACA,WAAA;MACA,YAAA;MACA,uBAAA;MACA,wBAAA;MACA,mBAAA;MACA,wBAAA;MACA,OAAA;MACA,yBAAA;MACA,qBAAA;MACA,kBAAA;MACA,wBAAA;MACA,sBAAA;MACA,iBAAA;IAAA;IAEF,aAAA,GAAgB,MAAA;MACd,MAAA;MACA,KAAA;QAAA;QAEE,QAAA;QACA,QAAA;QACA,OAAA;QACA,QAAA;QACA,SAAA;QACA,WAAA;QACA,SAAA;QACA,YAAA;QACA,YAAA;QACA,WAAA;QACA,YAAA;QACA,uBAAA;QACA,wBAAA;QACA,mBAAA;QACA,wBAAA;QACA,OAAA;QACA,yBAAA;QACA,qBAAA;QACA,kBAAA;QACA,wBAAA;QACA,sBAAA;QACA,iBAAA;MAAA;IAAA;MAGF,MAAA;MACA,KAAA;IAAA;EAAA;AAAA;;;;;;;iBAsBU,UAAA,CAAW,KAAA;;;;;;;;;iBA6CX,YAAA,CAAa,KAAA"}
1
+ {"version":3,"file":"MSBuildProject.d.mts","names":[],"sources":["../../src/dotnet/MSBuildProject.ts"],"mappings":";;;;cA2EM,uBAAA,EAAyB,IAAA;EAC7B,UAAA,GAAa,MAAA;EACb,KAAA,GAAQ,MAAA;IAAA;IAEN,QAAA;IACA,QAAA;IACA,OAAA;IACA,QAAA;IACA,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A;;;;;;;iBAsBU,UAAA,CAAW,KAAA;;;;;;;;;iBA8CX,YAAA,CAAa,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"MSBuildProject.mjs","names":[],"sources":["../../src/dotnet/MSBuildProject.ts"],"sourcesContent":["import { type, type Scope, type Type } from 'arktype';\nimport { warn } from 'node:console';\nimport { type Dirent } from 'node:fs';\nimport { readdir, realpath, stat } from 'node:fs/promises';\n// eslint-disable-next-line unicorn/import-style\nimport * as path from 'node:path';\nimport { setTimeout } from 'node:timers/promises';\nimport { CaseInsensitiveMap } from '../CaseInsensitiveMap.ts';\nimport { execAsync } from '../utils/execAsync.ts';\nimport { isError } from '../utils/isError.ts';\nimport { MSBuildProjectProperties } from './MSBuildProjectProperties.ts';\nimport {\n NPPGetterNames,\n NugetProjectProperties,\n} from './NugetProjectProperties.ts';\n\n/**\n * See [MSBuild well-known item metadata](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-well-known-item-metadata).\n * Additional string-type properties may be present (e.g. `{ SubType: \"designer\" }`).\n */\nconst interface_ItemMetadataBuiltIn = type({\n '[string]': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\ConsoleApp1.dll\" */\n Identity: 'string',\n /** @example \"Designer\" */\n 'SubType?': 'string',\n /** @example \".NETCoreApp\" */\n 'TargetFrameworkIdentifier?': 'string',\n 'TargetPlatformMoniker?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\obj\\\\Debug\\\\net6.0\\\\ConsoleApp1.csproj.CopyComplete\" */\n 'CopyUpToDateMarker?': 'string',\n 'TargetPlatformIdentifier?': 'string',\n /** @example \"6.0\" */\n 'TargetFrameworkVersion?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\obj\\\\Debug\\\\net6.0\\\\ref\\\\ConsoleApp1.dll\" */\n 'ReferenceAssembly?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\ConsoleApp1.dll\" */\n FullPath: 'string',\n /** @example \"c:\\\\\" */\n RootDir: 'string',\n /** @example \"ConsoleApp1\" */\n Filename: 'string',\n /** @example \".dll\" */\n Extension: 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\\" */\n RelativeDir: 'string',\n /** @example \"source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\\" */\n Directory: 'string',\n RecursiveDir: 'string',\n /** @example \"2023-11-30 13:38:06.5084339\" */\n ModifiedTime: 'string',\n /** @example \"2023-11-30 13:38:06.9308716\" */\n CreatedTime: 'string',\n /** @example \"2023-11-30 13:38:06.9318732\" */\n AccessedTime: 'string',\n /** @example \"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Preview\\\\MSBuild\\\\Current\\\\Bin\\\\amd64\\\\Microsoft.Common.CurrentVersion.targets\" */\n DefiningProjectFullPath: 'string',\n /** @example \"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Preview\\\\MSBuild\\\\Current\\\\Bin\\\\amd64\\\\\" */\n DefiningProjectDirectory: 'string',\n /** @example \"Microsoft.Common.CurrentVersion\" */\n DefiningProjectName: 'string',\n /** @example \".targets\" */\n DefiningProjectExtension: 'string',\n});\n\nconst targetSuccess = type({\n Result: '\\'Success\\'',\n Items: interface_ItemMetadataBuiltIn.array(),\n});\n\nconst targetFailure = type({\n Result: '\\'Failure\\'',\n Items: 'never[]',\n});\n\nconst msbuildEvaluationOutput: Type<{\n Properties?: Record<string, string> | undefined;\n Items?: Record<string, {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[]> | undefined;\n TargetResults?: Record<string, {\n Result: 'Success';\n Items: {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[];\n } | {\n Result: 'Failure';\n Items: never[];\n }> | undefined;\n}> = type({\n 'Properties?': type({ '[string]': 'string' }),\n 'Items?': type({ '[string]': interface_ItemMetadataBuiltIn.array() }),\n 'TargetResults?': type({ '[string]': targetSuccess.or(targetFailure) }),\n});\n\nexport class MSBuildEvaluationOutput {\n /**\n * @param rawMSBuildEvaluation The output of a CLI MSBuild project evaluation.\n * May be the UTF-8 string-encoded JSON or the object decoded from that JSON.\n */\n constructor(rawMSBuildEvaluation: Parameters<typeof JSON.parse>[0] | Parameters<typeof msbuildEvaluationOutput.from>[0]) {\n /** `.assert` instead of `.from` to allow `unknown` JSON.parse return type */\n const knownObject = msbuildEvaluationOutput.assert(typeof rawMSBuildEvaluation === 'string' ? JSON.parse(rawMSBuildEvaluation) : rawMSBuildEvaluation);\n\n this.Properties = knownObject.Properties;\n this.Items = knownObject.Items;\n this.TargetResults = knownObject.TargetResults;\n }\n\n /**\n * The specified properties and their values as evaluated by MSBuild Core.\n * `-getProperty:{propertyName,...}`\n */\n Properties?: typeof msbuildEvaluationOutput.infer.Properties;\n /**\n * The specified items and their values and associated metadata as evaluated\n * by MSBuild Core.\n * `-getItem:{itemName,...}`\n */\n Items?: typeof msbuildEvaluationOutput.infer.Items;\n /**\n * The specified Targets and their output values as evaluated by MSBuild\n * Core.\n * `-getTargetResult:{targetName,...}`\n */\n TargetResults?: typeof msbuildEvaluationOutput.infer.TargetResults;\n}\n\nexport const EvaluationOptions: Type<{\n FullName: string;\n Property: {\n MSBuildProjectFullPath?: string | undefined;\n AssemblyName?: string | undefined;\n BaseIntermediateOutputPath?: string | undefined;\n BaseOutputPath?: string | undefined;\n Description?: string | undefined;\n IntermediateOutput?: string | undefined;\n OutDir?: string | undefined;\n OutputPath?: string | undefined;\n Version?: string | undefined;\n VersionPrefix?: string | undefined;\n VersionSuffix?: string | undefined;\n TargetFramework?: string | undefined;\n TargetFrameworks?: string | undefined;\n RuntimeIdentifier?: string | undefined;\n RuntimeIdentifiers?: string | undefined;\n };\n Targets: readonly string[] | string[];\n GetItem: readonly string[] | string[];\n GetProperty: readonly string[] | string[];\n GetTargetResult: readonly string[] | string[];\n}> = Object.freeze(\n type({\n /**\n * The project file's full path.\n */\n FullName: 'string',\n /**\n * User-defined Properties and their values.\n * { Configuration: \"Release\" } will cause the MSBuild to first set the\n * Configuration property to Release before evaluating the project\n * or the project's Target(s).\n * ```txt\n * -property:<n>=<v> Set or override these project-level properties. <n> is\n * the property name, and <v> is the property value. Use a\n * semicolon or a comma to separate multiple properties, or\n * specify each property separately. (Short form: -p)\n * Example:\n * -property:WarningLevel=2;OutDir=bin\\Debug\\\n * ```\n */\n Property: type({ '[string]': 'string' })\n .as<{ -readonly [P in keyof MSBuildProjectProperties]: MSBuildProjectProperties[P] }>()\n .partial(),\n /**\n * The MSBuild Targets to run for evaluation. [\"Pack\"] is recommended.\n * Property values may be changed by Targets such as those provided by\n * dependencies.\n *\n * ```txt\n * -target:<targets> Build these targets in this project. Use a semicolon or a\n * comma to separate multiple targets, or specify each\n * target separately. (Short form: -t)\n * Example:\n * -target:Resources;Compile\n * ```\n * @default []\n */\n Targets: type.string.array().readonly().or('string[]'),\n /**\n * MSBuild Items to evaluate. `[\"Compile\"]` will result in the MSBuild output\n * including {@link MSBuild}\n */\n GetItem: type.string.array().readonly().or('string[]'),\n GetProperty: type.string.array().readonly().or('string[]'),\n GetTargetResult: type.string.array().readonly().or('string[]'),\n }),\n);\n\nexport class MSBuildProject {\n /**\n * Properties for multi-targeting `dotnet publish` outputs.\n * These are included in {@link NPPGetterNames.InstanceGettersRecursive}.\n */\n public static readonly MatrixProperties: readonly string[] = Object.freeze([\n 'TargetFramework',\n 'TargetFrameworks',\n 'RuntimeIdentifier',\n 'RuntimeIdentifiers',\n ]);\n\n /**\n * Creates an instance of MSBuildProject.\n * @param opts The order-independent arguments for this constructor.\n * Properties may be added or moved around in this definition without\n * breaking compatibility.\n * @param opts.fullPath The full path of the MSBuild project's file. This\n * should have a '.csproj', '.fsproj', or '.vbproj' file extension.\n * @param opts.projTargets A list of MSBuild Targets supported by the project.\n * @param opts.evaluation The output of an MSBuild project evaluation. This\n * comprises MSBuild Properties, Items, and Target results.\n */\n public constructor(opts: {\n fullPath: string;\n projTargets: string[];\n evaluation: MSBuildEvaluationOutput;\n }) {\n this.Items = opts.evaluation.Items ?? {};\n this.Properties = new NugetProjectProperties(\n opts.fullPath,\n new CaseInsensitiveMap<string, string>(\n Object.entries(opts.evaluation.Properties ?? {}),\n ),\n );\n this.Targets = opts.projTargets;\n this.TargetResults\n = opts.evaluation.TargetResults === undefined\n ? []\n : [opts.evaluation.TargetResults];\n }\n\n readonly Items: Readonly<Required<MSBuildEvaluationOutput>['Items']>;\n readonly Properties: Readonly<NugetProjectProperties>;\n readonly Targets: readonly string[];\n /**\n * Allows appending subsequent target results.\n */\n readonly TargetResults: Required<MSBuildEvaluationOutput>['TargetResults'][];\n\n /**\n * @param projectPath The full path of the project file or its directory. A\n * relative path may be passed, but will resolve relative to the current\n * working directory.\n * @param includeNonPublic Include conventionally internal/private MSBuild\n * targets in the result.\n * @returns A string array of the project's MSBuild targets.\n * @todo consider 'file' of -targets[:file]\n * Prints a list of available targets without executing the\n * actual build process. By default the output is written to\n * the console window. If the path to an output file\n * is provided that will be used instead.\n * (Short form: -ts)\n * Example:\n * -ts:out.txt\n */\n static async GetTargets(\n projectPath: string,\n includeNonPublic = false,\n ): Promise<string[]> {\n return execAsync(`dotnet msbuild ${projectPath} -targets`, true)\n .then((v) => {\n const targets = v.stdout\n .split('\\n')\n .filter((v, index) => v !== '' && index !== 0)\n .map(v => v.replaceAll('\\r', ''))\n .sort((a, b) => a.localeCompare(b));\n return includeNonPublic\n ? targets\n : targets.filter(v => !v.startsWith('_'));\n });\n }\n\n /**\n * Evaluate {@link Items}, {@link Properties}, and {@link TargetResults},\n * returning them as an instance of {@link MSBuildProject}.\\\n * Note: MSBuild will probably fail if Restore is skipped and another\n * target is specified. If you choose Pack, you must do ['Restore', 'Pack'].\n * @param options The result of {@link EvaluationOptions.from}.\n * @returns A promised {@link MSBuildProject} instance.\n * @throws {Error} if the exec command fails -OR- the JSON parse fails -OR-\n * MSBuildProject's constructor fails.\n * @see {@link PackableProjectsToMSBuildProjects} for most use-cases.\n */\n public static async Evaluate(\n options: typeof EvaluationOptions.inferOut,\n ): Promise<MSBuildProject> {\n if (\n options.GetProperty.length === 0\n && options.GetItem.length === 0\n && options.GetTargetResult.length === 0\n ) {\n throw new Error(\n 'No MSBuild Property, Item, or TargetResult queries were provided.',\n );\n }\n // reminder: args containing spaces and semi-colons MUST be quote-enclosed!\n options.FullName = MSBuildProjectProperties.GetFullPath(options.FullName);\n const _pairs = Object.entries(options.Property).filter(p => typeof p[1] === 'string');\n const property\n = _pairs.length === 0\n ? ''\n : `-p:\"${_pairs.map(pair => pair[0] + '=' + pair[1]).join(';')}\"`;\n const target\n = options.Targets.length === 0\n ? ''\n : `\"-t:${options.Targets.join(';')}\"`;\n const getItem\n = options.GetItem.length === 0\n ? ''\n : `-getItem:\"${options.GetItem.join(',')}\"`;\n const getProperty\n = options.GetProperty.length === 0\n ? ''\n : `-getProperty:\"${options.GetProperty.join(',')}\"`;\n const getTargetResult\n = options.GetTargetResult.length === 0\n ? ''\n : `-getTargetResult:\"${options.GetTargetResult.join(',')}\"`;\n const cmdLine = [\n 'dotnet',\n 'msbuild',\n `\"${options.FullName}\"`,\n '-restore',\n property,\n target,\n getItem,\n getProperty,\n getTargetResult,\n ]\n .filter(v => v !== '')\n .join(' ');\n let stdio: Awaited<ReturnType<typeof execAsync>> | undefined = undefined;\n // may throw\n while (stdio === undefined) {\n stdio = await setTimeout(\n 1000,\n execAsync(cmdLine, true),\n )\n .then(async p => await p)\n .catch<undefined>(catchEBUSY);\n }\n\n // todo: consider -getResultOutputFile:file\n // Redirect output from get* into a file.\n //\n // Example:\n // -getProperty:Bar -getResultOutputFile:Biz.txt\n // This writes the value of property Bar into Biz.txt.\n\n /**\n * The following issues have triggered this code path:\n * - BaseIntermediateOutputPath must use Unix path separators ('/') on all\n * platforms. Even Windows. Otherwise, MSBuild/dotnet will error-exit with\n * \"The BaseIntermediateOutputPath must end with a trailing slash\".\n */\n if (stdio.stdout.startsWith('MSBuild version')) {\n warn(stdio.stdout);\n throw new Error(\n 'dotnet msbuild was expected to output JSON, but output its version header instead.',\n );\n }\n\n let rawOutput: ConstructorParameters<typeof MSBuildEvaluationOutput>[0];\n if (stdio.stdout.startsWith('{')) {\n /** stdout is JSON string */\n rawOutput = stdio.stdout;\n }\n else if (options.GetProperty.length > 0 && options.GetProperty[0] !== undefined) {\n rawOutput = {\n Properties: {\n [options.GetProperty[0]]: String(JSON.parse(stdio.stdout)),\n },\n };\n }\n else {\n throw new Error('Dotnet/MSBuild evaluation output is not a string nor JSON object or array.');\n }\n\n const evaluation = new MSBuildEvaluationOutput(rawOutput);\n\n return new MSBuildProject({\n fullPath: options.FullName,\n projTargets: await MSBuildProject.GetTargets(options.FullName),\n evaluation,\n });\n }\n\n /**\n * Evaluate multiple project paths with some default Evaluate options.\n * @async\n * @param projectsToPackAndPush An array of MSBuild projects' full file\n * paths. If a path is a directory, files in that directory are filtered for\n * `.csproj`, `.fsproj`, and `.vbproj` project files.\n * See https://github.com/dotnet/sdk/blob/497f334b2862bdf98b30c00ede2fd259ea5f624d/src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluationResult.cs#L19-L32.\\\n * @returns A promised array of {@link MSBuildProject} instances.\n * All known MSBuild and NuGet properties are evaluated.\n * If applicable, a project's \"Pack\" target is evaluated.\n */\n public static async PackableProjectsToMSBuildProjects(\n projectsToPackAndPush: string[],\n ): Promise<Promise<MSBuildProject>[]> {\n const dirEntriesPromise = toDirEntries(typeof projectsToPackAndPush === 'string' ? [projectsToPackAndPush] : projectsToPackAndPush);\n const projectPromises: Promise<MSBuildProject>[] = await dirEntriesPromise\n .then(\n (direntArray: Dirent[]) =>\n direntArray.map(element => convertDirentToMSBuildProject(element)),\n );\n return projectPromises;\n\n /**\n * Map an array of filesystem paths to {@link Dirent} instances representing project files.\n * @param projectsToPackAndPush An array of MSBuild projects' full file\n * paths. If a path is a directory, files in that directory are filtered for\n * `.csproj`, `.fsproj`, and `.vbproj` project files. See\n * https://github.com/dotnet/sdk/blob/497f334b2862bdf98b30c00ede2fd259ea5f624d/src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluationResult.cs#L19-L32.\\\n * @returns An promised array of Dirent instances for discovered project files.\n */\n async function toDirEntries(\n projectsToPackAndPush: string[],\n ): Promise<Dirent[]> {\n const dirEntries: (Dirent | Dirent[])[] = await Promise.all(\n projectsToPackAndPush.map(async (proj) => {\n proj = await realpath(makeAbsolute(proj));\n const stats = await stat(proj);\n let entries: Dirent[];\n\n if (stats.isFile()) {\n entries = await readdir(path.dirname(proj), { withFileTypes: true });\n const dirent: Dirent | undefined = entries.find(v =>\n path.join(\n // condition required for compatibility. `.path` was deprecated, but `.parentPath` is not available in our node minversion\n ('path' in v ? v.path as string | undefined : undefined) ?? (v as unknown as Omit<typeof v, 'path'> & { parentPath: string }).parentPath,\n v.name,\n ) === proj,\n );\n if (dirent)\n return dirent;\n else\n throw new Error(\n `file \"${proj}\" not found. It may have been moved or deleted.`,\n );\n }\n if (!stats.isDirectory())\n throw new Error(`\"${proj}\" is not a file or directory`);\n\n entries = await readdir(proj, { withFileTypes: true });\n return entries.filter(v =>\n v.isFile()\n && (v.name.endsWith('.csproj') || v.name.endsWith('.fsproj') || v.name.endsWith('.vbproj')),\n );\n }),\n );\n\n return dirEntries.flat();\n }\n\n /**\n * Map a {@link Dirent} instance to an {@link MSBuildProject} instance.\n * @param dirent A {@link Dirent} instance. This instance should be an MSBuild project file.\n * @returns An instance of {@link MSBuildProject} evaluated with the `Pack` target result, if applicable. Evaluated properties will be those whose names are returned by {@link NPPGetterNames.InstanceGettersRecursive}.\n */\n async function convertDirentToMSBuildProject(dirent: Dirent): Promise<MSBuildProject> {\n const fullPath = path.join(\n // condition required for compatibility. `.path` was deprecated, but `.parentPath` is not available in our node minversion\n ('path' in dirent ? dirent.path as string | undefined : undefined) ?? (dirent as unknown as Omit<typeof dirent, 'path'> & { parentPath: string }).parentPath,\n dirent.name,\n );\n const projTargets: Promise<string[]> = MSBuildProject.GetTargets(fullPath);\n const evalTargets = await projTargets.then(v =>\n v.includes('Pack') ? ['Pack'] : [],\n );\n // this might be too long for a command line. What was it on Windows?\n // 2^15 (32,768) character limit for command lines?\n const getProperties = NPPGetterNames.InstanceGettersRecursive;\n\n return await MSBuildProject.Evaluate(\n EvaluationOptions.from({\n FullName: fullPath,\n GetItem: [],\n GetProperty: getProperties,\n GetTargetResult: [],\n Property: {},\n Targets: evalTargets,\n }),\n );\n }\n }\n\n public static fromJSON(json: string): MSBuildProject {\n const parsed = T_PseudoMSBPInstance.assert(JSON.parse(json));\n\n type.true.assert(\n Reflect.setPrototypeOf(parsed, MSBuildProject.prototype),\n );\n type.true.assert(\n Reflect.setPrototypeOf(parsed.Properties, NugetProjectProperties.prototype),\n );\n parsed.Properties = T_NPP.assert(parsed.Properties);\n return T_MSBuildProject.assert(parsed);\n }\n}\n\nconst T_MSBuildProject = type.instanceOf(MSBuildProject);\nconst T_NPP = type.instanceOf(NugetProjectProperties);\nconst T_PseudoMSBPInstance = type({\n Items: type({\n '[string]': type({\n '[string]': 'string',\n Identity: 'string',\n FullPath: 'string',\n RootDir: 'string',\n Filename: 'string',\n Extension: 'string',\n RelativeDir: 'string',\n Directory: 'string',\n RecursiveDir: 'string',\n ModifiedTime: 'string',\n CreatedTime: 'string',\n AccessedTime: 'string',\n DefiningProjectFullPath: 'string',\n DefiningProjectDirectory: 'string',\n DefiningProjectName: 'string',\n DefiningProjectExtension: 'string',\n 'SubType?': ' string | undefined',\n 'TargetFrameworkIdentifier?': 'string | undefined',\n 'TargetPlatformMoniker?': 'string | undefined',\n 'CopyUpToDateMarker?': 'string | undefined',\n 'TargetPlatformIdentifier?': 'string | undefined',\n 'TargetFrameworkVersion?': 'string | undefined',\n 'ReferenceAssembly?': 'string | undefined',\n }).array(),\n }),\n Properties: type.Record('string', 'string').or(T_NPP),\n Targets: type.string.array(),\n TargetResults: msbuildEvaluationOutput.get('TargetResults').exclude('undefined').array(),\n\n});\n\n/**\n * ArkType type definitions for internal usage, but may be re-used elsewhere\n * @internal\n */\nexport const _InternalMSBuildEvaluationTypes: Scope<{\n msbuildEvaluationOutput: {\n Properties?: Record<string, string> | undefined;\n Items?: Record<string, {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[]> | undefined;\n TargetResults?: Record<string, {\n Result: 'Success';\n Items: {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[];\n } | {\n Result: 'Failure';\n Items: never[];\n }> | undefined;\n };\n}> = type.scope({\n msbuildEvaluationOutput,\n});\n\n/**\n * Resolve a path if it is not already absolute.\n * @param _path A filesystem path.\n * @returns A full path to a filesystem entry. The path is unchecked for whether or not the path (or its parts) exist.\n */\nfunction makeAbsolute(_path: string) {\n return path.isAbsolute(_path) ? _path : path.resolve(_path);\n}\n\n/**\n * Use this in your catch statement or .catch call to return `undefined` when\n * a \"file in use by another process\" (i.e. EBUSY/ERROR_SHARING_VIOLATION) error is reported.\n * @param error Probably an Error object\n * @returns `undefined` if file in use by another process\n */\nexport function catchEBUSY(error: unknown): undefined {\n if (isError(error)) {\n if ('stderr' in error && typeof error.stderr === 'string') {\n // Normalize colon-like chars: '\\uFF1A'.normalize('NFKC') === ':' === true;\n const normalizedStderr = error.stderr.normalize('NFKC');\n const patternEN = /The process cannot access the file '[^']+' because it is being used by another process\\./gm;\n const hasErrMsgPattern = patternEN.test(normalizedStderr);\n const isCS2012 = /^CSC ?:.+CS2012:/gm.test(normalizedStderr);\n // generic error code; error message must be checked.\n const isAVLN9999 = /AVLN9999:/gm.test(normalizedStderr)\n && hasErrMsgPattern;\n if (isCS2012 || isAVLN9999 || hasErrMsgPattern)\n return undefined; /* retry */\n }\n /**\n * some known warnings/errors:\n * - warning MSB3073:\n * The command \"dotnet tool list kuinox.nupkgdeterministicator\"\n * exited with code 145.\n * > $ dotnet tool list kuinox.nupkgdeterministicator\n * > The command could not be loaded, possibly because:\n * > * You intended to execute a .NET application:\n * > The application 'tool' does not exist.\n * > * You intended to execute a .NET SDK command:\n * > No .NET SDKs were found.\n * >\n * > Download a .NET SDK:\n * > https://aka.ms/dotnet/download\n * >\n * > Learn about SDK resolution:\n * > https://aka.ms/dotnet/sdk-not-found\n */\n else throw error;\n }\n else throw new Error('unknown error', { cause: error });\n}\n\n/**\n *\n * Use this in your catch statement or .catch call to return `undefined` when\n * MSBuild error CSC2012 (e.g. \"file in use by another process\") is reported.\n * @param error Probably an Error object\n * @returns `undefined` if CSC2012 (file in use by another process) occurs\n * @deprecated Use {@link catchEBUSY}.\n */\nexport function catchCsc2012(error: unknown): undefined {\n if (isError(error)) {\n // check for error reported when \"file in use by another process\" i.e. EBUSY\n // (UNIX), NTSTATUS.ERROR_SHARING_VIOLATION == 0x20 == 32 (Windows)\n if ('stderr' in error && typeof error.stderr === 'string'\n && /^CSC ?:.+CS2012:/gm.test(\n // '\\uFF1A'.normalize('NFKC') === ':' === true;\n error.stderr.normalize('NFKC'),\n )\n ) {\n return undefined; /* retry */\n }\n /**\n * some known warnings/errors:\n * - warning MSB3073:\n * The command \"dotnet tool list kuinox.nupkgdeterministicator\"\n * exited with code 145.\n * > $ dotnet tool list kuinox.nupkgdeterministicator\n * > The command could not be loaded, possibly because:\n * > * You intended to execute a .NET application:\n * > The application 'tool' does not exist.\n * > * You intended to execute a .NET SDK command:\n * > No .NET SDKs were found.\n * >\n * > Download a .NET SDK:\n * > https://aka.ms/dotnet/download\n * >\n * > Learn about SDK resolution:\n * > https://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;AAOF,SAAS,aAAa,OAAe;AACnC,QAAO,KAAK,WAAW,MAAM,GAAG,QAAQ,KAAK,QAAQ,MAAM;;;;;;;;AAS7D,SAAgB,WAAW,OAA2B;AACpD,KAAI,QAAQ,MAAM,CAChB,KAAI,YAAY,SAAS,OAAO,MAAM,WAAW,UAAU;EAEzD,MAAM,mBAAmB,MAAM,OAAO,UAAU,OAAO;EAEvD,MAAM,mBADY,6FACiB,KAAK,iBAAiB;EACzD,MAAM,WAAW,qBAAqB,KAAK,iBAAiB;EAE5D,MAAM,aAAa,cAAc,KAAK,iBAAiB,IAClD;AACL,MAAI,YAAY,cAAc,iBAC5B,QAAO,KAAA;OAoBN,OAAM;KAER,OAAM,IAAI,MAAM,iBAAiB,EAAE,OAAO,OAAO,CAAC;;;;;;;;;;AAWzD,SAAgB,aAAa,OAA2B;AACtD,KAAI,QAAQ,MAAM,CAGhB,KAAI,YAAY,SAAS,OAAO,MAAM,WAAW,YAC5C,qBAAqB,KAEtB,MAAM,OAAO,UAAU,OAAO,CAC/B,CAED;KAoBG,OAAM;KAER,OAAM,IAAI,MAAM,iBAAiB,EAAE,OAAO,OAAO,CAAC"}
1
+ {"version":3,"file":"MSBuildProject.mjs","names":[],"sources":["../../src/dotnet/MSBuildProject.ts"],"sourcesContent":["import { type, type Scope, type Type } from 'arktype';\nimport { warn } from 'node:console';\nimport { type Dirent } from 'node:fs';\nimport { readdir, realpath, stat } from 'node:fs/promises';\n// eslint-disable-next-line unicorn/import-style\nimport * as path from 'node:path';\nimport { setTimeout } from 'node:timers/promises';\nimport { CaseInsensitiveMap } from '../CaseInsensitiveMap.ts';\nimport { execAsync } from '../utils/execAsync.ts';\nimport { isError } from '../utils/isError.ts';\nimport { MSBuildProjectProperties } from './MSBuildProjectProperties.ts';\nimport {\n NPPGetterNames,\n NugetProjectProperties,\n} from './NugetProjectProperties.ts';\n\n/**\n * See [MSBuild well-known item metadata](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-well-known-item-metadata).\n * Additional string-type properties may be present (e.g. `{ SubType: \"designer\" }`).\n */\nconst interface_ItemMetadataBuiltIn = type({\n '[string]': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\ConsoleApp1.dll\" */\n Identity: 'string',\n /** @example \"Designer\" */\n 'SubType?': 'string',\n /** @example \".NETCoreApp\" */\n 'TargetFrameworkIdentifier?': 'string',\n 'TargetPlatformMoniker?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\obj\\\\Debug\\\\net6.0\\\\ConsoleApp1.csproj.CopyComplete\" */\n 'CopyUpToDateMarker?': 'string',\n 'TargetPlatformIdentifier?': 'string',\n /** @example \"6.0\" */\n 'TargetFrameworkVersion?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\obj\\\\Debug\\\\net6.0\\\\ref\\\\ConsoleApp1.dll\" */\n 'ReferenceAssembly?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\ConsoleApp1.dll\" */\n FullPath: 'string',\n /** @example \"c:\\\\\" */\n RootDir: 'string',\n /** @example \"ConsoleApp1\" */\n Filename: 'string',\n /** @example \".dll\" */\n Extension: 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\\" */\n RelativeDir: 'string',\n /** @example \"source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\\" */\n Directory: 'string',\n RecursiveDir: 'string',\n /** @example \"2023-11-30 13:38:06.5084339\" */\n ModifiedTime: 'string',\n /** @example \"2023-11-30 13:38:06.9308716\" */\n CreatedTime: 'string',\n /** @example \"2023-11-30 13:38:06.9318732\" */\n AccessedTime: 'string',\n /** @example \"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Preview\\\\MSBuild\\\\Current\\\\Bin\\\\amd64\\\\Microsoft.Common.CurrentVersion.targets\" */\n DefiningProjectFullPath: 'string',\n /** @example \"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Preview\\\\MSBuild\\\\Current\\\\Bin\\\\amd64\\\\\" */\n DefiningProjectDirectory: 'string',\n /** @example \"Microsoft.Common.CurrentVersion\" */\n DefiningProjectName: 'string',\n /** @example \".targets\" */\n DefiningProjectExtension: 'string',\n});\n\nconst targetSuccess = type({\n Result: '\\'Success\\'',\n Items: interface_ItemMetadataBuiltIn.array(),\n});\n\nconst targetFailure = type({\n Result: '\\'Failure\\'',\n Items: 'never[]',\n});\n\nconst msbuildEvaluationOutput: Type<{\n Properties?: Record<string, string> | undefined;\n Items?: Record<string, {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[]> | undefined;\n TargetResults?: Record<string, {\n Result: 'Success';\n Items: {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[];\n } | {\n Result: 'Failure';\n Items: never[];\n }> | undefined;\n}> = type({\n 'Properties?': type({ '[string]': 'string' }),\n 'Items?': type({ '[string]': interface_ItemMetadataBuiltIn.array() }),\n 'TargetResults?': type({ '[string]': targetSuccess.or(targetFailure) }),\n});\n\nexport class MSBuildEvaluationOutput {\n /**\n * @param rawMSBuildEvaluation The output of a CLI MSBuild project evaluation.\n * May be the UTF-8 string-encoded JSON or the object decoded from that JSON.\n */\n constructor(rawMSBuildEvaluation: Parameters<typeof JSON.parse>[0] | Parameters<typeof msbuildEvaluationOutput.from>[0]) {\n /** `.assert` instead of `.from` to allow `unknown` JSON.parse return type */\n const knownObject = msbuildEvaluationOutput.assert(typeof rawMSBuildEvaluation === 'string' ? JSON.parse(rawMSBuildEvaluation) : rawMSBuildEvaluation);\n\n this.Properties = knownObject.Properties;\n this.Items = knownObject.Items;\n this.TargetResults = knownObject.TargetResults;\n }\n\n /**\n * The specified properties and their values as evaluated by MSBuild Core.\n * `-getProperty:{propertyName,...}`\n */\n Properties?: typeof msbuildEvaluationOutput.infer.Properties;\n /**\n * The specified items and their values and associated metadata as evaluated\n * by MSBuild Core.\n * `-getItem:{itemName,...}`\n */\n Items?: typeof msbuildEvaluationOutput.infer.Items;\n /**\n * The specified Targets and their output values as evaluated by MSBuild\n * Core.\n * `-getTargetResult:{targetName,...}`\n */\n TargetResults?: typeof msbuildEvaluationOutput.infer.TargetResults;\n}\n\nexport const EvaluationOptions: Type<{\n FullName: string;\n Property: {\n MSBuildProjectFullPath?: string | undefined;\n AssemblyName?: string | undefined;\n BaseIntermediateOutputPath?: string | undefined;\n BaseOutputPath?: string | undefined;\n Description?: string | undefined;\n IntermediateOutput?: string | undefined;\n OutDir?: string | undefined;\n OutputPath?: string | undefined;\n Version?: string | undefined;\n VersionPrefix?: string | undefined;\n VersionSuffix?: string | undefined;\n TargetFramework?: string | undefined;\n TargetFrameworks?: string | undefined;\n RuntimeIdentifier?: string | undefined;\n RuntimeIdentifiers?: string | undefined;\n };\n Targets: readonly string[] | string[];\n GetItem: readonly string[] | string[];\n GetProperty: readonly string[] | string[];\n GetTargetResult: readonly string[] | string[];\n}> = Object.freeze(\n type({\n /**\n * The project file's full path.\n */\n FullName: 'string',\n /**\n * User-defined Properties and their values.\n * { Configuration: \"Release\" } will cause the MSBuild to first set the\n * Configuration property to Release before evaluating the project\n * or the project's Target(s).\n * ```txt\n * -property:<n>=<v> Set or override these project-level properties. <n> is\n * the property name, and <v> is the property value. Use a\n * semicolon or a comma to separate multiple properties, or\n * specify each property separately. (Short form: -p)\n * Example:\n * -property:WarningLevel=2;OutDir=bin\\Debug\\\n * ```\n */\n Property: type({ '[string]': 'string' })\n .as<{ -readonly [P in keyof MSBuildProjectProperties]: MSBuildProjectProperties[P] }>()\n .partial(),\n /**\n * The MSBuild Targets to run for evaluation. [\"Pack\"] is recommended.\n * Property values may be changed by Targets such as those provided by\n * dependencies.\n *\n * ```txt\n * -target:<targets> Build these targets in this project. Use a semicolon or a\n * comma to separate multiple targets, or specify each\n * target separately. (Short form: -t)\n * Example:\n * -target:Resources;Compile\n * ```\n * @default []\n */\n Targets: type.string.array().readonly().or('string[]'),\n /**\n * MSBuild Items to evaluate. `[\"Compile\"]` will result in the MSBuild output\n * including {@link MSBuild}\n */\n GetItem: type.string.array().readonly().or('string[]'),\n GetProperty: type.string.array().readonly().or('string[]'),\n GetTargetResult: type.string.array().readonly().or('string[]'),\n }),\n);\n\nexport class MSBuildProject {\n /**\n * Properties for multi-targeting `dotnet publish` outputs.\n * These are included in {@link NPPGetterNames.InstanceGettersRecursive}.\n */\n public static readonly MatrixProperties: readonly string[] = Object.freeze([\n 'TargetFramework',\n 'TargetFrameworks',\n 'RuntimeIdentifier',\n 'RuntimeIdentifiers',\n ]);\n\n /**\n * Creates an instance of MSBuildProject.\n * @param opts The order-independent arguments for this constructor.\n * Properties may be added or moved around in this definition without\n * breaking compatibility.\n * @param opts.fullPath The full path of the MSBuild project's file. This\n * should have a '.csproj', '.fsproj', or '.vbproj' file extension.\n * @param opts.projTargets A list of MSBuild Targets supported by the project.\n * @param opts.evaluation The output of an MSBuild project evaluation. This\n * comprises MSBuild Properties, Items, and Target results.\n */\n public constructor(opts: {\n fullPath: string;\n projTargets: string[];\n evaluation: MSBuildEvaluationOutput;\n }) {\n this.Items = opts.evaluation.Items ?? {};\n this.Properties = new NugetProjectProperties(\n opts.fullPath,\n new CaseInsensitiveMap<string, string>(\n Object.entries(opts.evaluation.Properties ?? {}),\n ),\n );\n this.Targets = opts.projTargets;\n this.TargetResults\n = opts.evaluation.TargetResults === undefined\n ? []\n : [opts.evaluation.TargetResults];\n }\n\n readonly Items: Readonly<Required<MSBuildEvaluationOutput>['Items']>;\n readonly Properties: Readonly<NugetProjectProperties>;\n readonly Targets: readonly string[];\n /**\n * Allows appending subsequent target results.\n */\n readonly TargetResults: Required<MSBuildEvaluationOutput>['TargetResults'][];\n\n /**\n * @param projectPath The full path of the project file or its directory. A\n * relative path may be passed, but will resolve relative to the current\n * working directory.\n * @param includeNonPublic Include conventionally internal/private MSBuild\n * targets in the result.\n * @returns A string array of the project's MSBuild targets.\n * @todo consider 'file' of -targets[:file]\n * Prints a list of available targets without executing the\n * actual build process. By default the output is written to\n * the console window. If the path to an output file\n * is provided that will be used instead.\n * (Short form: -ts)\n * Example:\n * -ts:out.txt\n */\n static async GetTargets(\n projectPath: string,\n includeNonPublic = false,\n ): Promise<string[]> {\n return execAsync(`dotnet msbuild ${projectPath} -targets`, true)\n .then((v) => {\n const targets = v.stdout\n .split('\\n')\n .filter((v, index) => v !== '' && index !== 0)\n .map(v => v.replaceAll('\\r', ''))\n .sort((a, b) => a.localeCompare(b));\n return includeNonPublic\n ? targets\n : targets.filter(v => !v.startsWith('_'));\n });\n }\n\n /**\n * Evaluate {@link Items}, {@link Properties}, and {@link TargetResults},\n * returning them as an instance of {@link MSBuildProject}.\\\n * Note: MSBuild will probably fail if Restore is skipped and another\n * target is specified. If you choose Pack, you must do ['Restore', 'Pack'].\n * @param options The result of {@link EvaluationOptions.from}.\n * @returns A promised {@link MSBuildProject} instance.\n * @throws {Error} if the exec command fails -OR- the JSON parse fails -OR-\n * MSBuildProject's constructor fails.\n * @see {@link PackableProjectsToMSBuildProjects} for most use-cases.\n */\n public static async Evaluate(\n options: typeof EvaluationOptions.inferOut,\n ): Promise<MSBuildProject> {\n if (\n options.GetProperty.length === 0\n && options.GetItem.length === 0\n && options.GetTargetResult.length === 0\n ) {\n throw new Error(\n 'No MSBuild Property, Item, or TargetResult queries were provided.',\n );\n }\n // reminder: args containing spaces and semi-colons MUST be quote-enclosed!\n options.FullName = MSBuildProjectProperties.GetFullPath(options.FullName);\n const _pairs = Object.entries(options.Property).filter(p => typeof p[1] === 'string');\n const property\n = _pairs.length === 0\n ? ''\n : `-p:\"${_pairs.map(pair => pair[0] + '=' + pair[1]).join(';')}\"`;\n const target\n = options.Targets.length === 0\n ? ''\n : `\"-t:${options.Targets.join(';')}\"`;\n const getItem\n = options.GetItem.length === 0\n ? ''\n : `-getItem:\"${options.GetItem.join(',')}\"`;\n const getProperty\n = options.GetProperty.length === 0\n ? ''\n : `-getProperty:\"${options.GetProperty.join(',')}\"`;\n const getTargetResult\n = options.GetTargetResult.length === 0\n ? ''\n : `-getTargetResult:\"${options.GetTargetResult.join(',')}\"`;\n const cmdLine = [\n 'dotnet',\n 'msbuild',\n `\"${options.FullName}\"`,\n '-restore',\n property,\n target,\n getItem,\n getProperty,\n getTargetResult,\n ]\n .filter(v => v !== '')\n .join(' ');\n let stdio: Awaited<ReturnType<typeof execAsync>> | undefined = undefined;\n // may throw\n while (stdio === undefined) {\n stdio = await setTimeout(\n 1000,\n execAsync(cmdLine, true),\n )\n .then(async p => await p)\n .catch<undefined>(catchEBUSY);\n }\n\n // todo: consider -getResultOutputFile:file\n // Redirect output from get* into a file.\n //\n // Example:\n // -getProperty:Bar -getResultOutputFile:Biz.txt\n // This writes the value of property Bar into Biz.txt.\n\n /**\n * The following issues have triggered this code path:\n * - BaseIntermediateOutputPath must use Unix path separators ('/') on all\n * platforms. Even Windows. Otherwise, MSBuild/dotnet will error-exit with\n * \"The BaseIntermediateOutputPath must end with a trailing slash\".\n */\n if (stdio.stdout.startsWith('MSBuild version')) {\n warn(stdio.stdout);\n throw new Error(\n 'dotnet msbuild was expected to output JSON, but output its version header instead.',\n );\n }\n\n let rawOutput: ConstructorParameters<typeof MSBuildEvaluationOutput>[0];\n if (stdio.stdout.startsWith('{')) {\n /** stdout is JSON string */\n rawOutput = stdio.stdout;\n }\n else if (options.GetProperty.length > 0 && options.GetProperty[0] !== undefined) {\n rawOutput = {\n Properties: {\n [options.GetProperty[0]]: String(JSON.parse(stdio.stdout)),\n },\n };\n }\n else {\n throw new Error('Dotnet/MSBuild evaluation output is not a string nor JSON object or array.');\n }\n\n const evaluation = new MSBuildEvaluationOutput(rawOutput);\n\n return new MSBuildProject({\n fullPath: options.FullName,\n projTargets: await MSBuildProject.GetTargets(options.FullName),\n evaluation,\n });\n }\n\n /**\n * Evaluate multiple project paths with some default Evaluate options.\n * @async\n * @param projectsToPackAndPush An array of MSBuild projects' full file\n * paths. If a path is a directory, files in that directory are filtered for\n * `.csproj`, `.fsproj`, and `.vbproj` project files.\n * See https://github.com/dotnet/sdk/blob/497f334b2862bdf98b30c00ede2fd259ea5f624d/src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluationResult.cs#L19-L32.\\\n * @returns A promised array of {@link MSBuildProject} instances.\n * All known MSBuild and NuGet properties are evaluated.\n * If applicable, a project's \"Pack\" target is evaluated.\n */\n public static async PackableProjectsToMSBuildProjects(\n projectsToPackAndPush: string[],\n ): Promise<Promise<MSBuildProject>[]> {\n const dirEntriesPromise = toDirEntries(typeof projectsToPackAndPush === 'string' ? [projectsToPackAndPush] : projectsToPackAndPush);\n const projectPromises: Promise<MSBuildProject>[] = await dirEntriesPromise\n .then(\n (direntArray: Dirent[]) =>\n direntArray.map(element => convertDirentToMSBuildProject(element)),\n );\n return projectPromises;\n\n /**\n * Map an array of filesystem paths to {@link Dirent} instances representing project files.\n * @param projectsToPackAndPush An array of MSBuild projects' full file\n * paths. If a path is a directory, files in that directory are filtered for\n * `.csproj`, `.fsproj`, and `.vbproj` project files. See\n * https://github.com/dotnet/sdk/blob/497f334b2862bdf98b30c00ede2fd259ea5f624d/src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluationResult.cs#L19-L32.\\\n * @returns An promised array of Dirent instances for discovered project files.\n */\n async function toDirEntries(\n projectsToPackAndPush: string[],\n ): Promise<Dirent[]> {\n const dirEntries: (Dirent | Dirent[])[] = await Promise.all(\n projectsToPackAndPush.map(async (proj) => {\n proj = await realpath(makeAbsolute(proj));\n const stats = await stat(proj);\n let entries: Dirent[];\n\n if (stats.isFile()) {\n entries = await readdir(path.dirname(proj), { withFileTypes: true });\n const dirent: Dirent | undefined = entries.find(v =>\n path.join(\n // condition required for compatibility. `.path` was deprecated, but `.parentPath` is not available in our node minversion\n ('path' in v ? v.path as string | undefined : undefined) ?? (v as unknown as Omit<typeof v, 'path'> & { parentPath: string }).parentPath,\n v.name,\n ) === proj,\n );\n if (dirent)\n return dirent;\n else\n throw new Error(\n `file \"${proj}\" not found. It may have been moved or deleted.`,\n );\n }\n if (!stats.isDirectory())\n throw new Error(`\"${proj}\" is not a file or directory`);\n\n entries = await readdir(proj, { withFileTypes: true });\n return entries.filter(v =>\n v.isFile()\n && (v.name.endsWith('.csproj') || v.name.endsWith('.fsproj') || v.name.endsWith('.vbproj')),\n );\n }),\n );\n\n return dirEntries.flat();\n }\n\n /**\n * Map a {@link Dirent} instance to an {@link MSBuildProject} instance.\n * @param dirent A {@link Dirent} instance. This instance should be an MSBuild project file.\n * @returns An instance of {@link MSBuildProject} evaluated with the `Pack` target result, if applicable. Evaluated properties will be those whose names are returned by {@link NPPGetterNames.InstanceGettersRecursive}.\n */\n async function convertDirentToMSBuildProject(dirent: Dirent): Promise<MSBuildProject> {\n const fullPath = path.join(\n // condition required for compatibility. `.path` was deprecated, but `.parentPath` is not available in our node minversion\n ('path' in dirent ? dirent.path as string | undefined : undefined) ?? (dirent as unknown as Omit<typeof dirent, 'path'> & { parentPath: string }).parentPath,\n dirent.name,\n );\n const projTargets: Promise<string[]> = MSBuildProject.GetTargets(fullPath);\n const evalTargets = await projTargets.then(v =>\n v.includes('Pack') ? ['Pack'] : [],\n );\n // this might be too long for a command line. What was it on Windows?\n // 2^15 (32,768) character limit for command lines?\n const getProperties = NPPGetterNames.InstanceGettersRecursive;\n\n return await MSBuildProject.Evaluate(\n EvaluationOptions.from({\n FullName: fullPath,\n GetItem: [],\n GetProperty: getProperties,\n GetTargetResult: [],\n Property: {},\n Targets: evalTargets,\n }),\n );\n }\n }\n\n public static fromJSON(json: string): MSBuildProject {\n const parsed = T_PseudoMSBPInstance.assert(JSON.parse(json));\n\n type.true.assert(\n Reflect.setPrototypeOf(parsed, MSBuildProject.prototype),\n );\n type.true.assert(\n Reflect.setPrototypeOf(parsed.Properties, NugetProjectProperties.prototype),\n );\n parsed.Properties = T_NPP.assert(parsed.Properties);\n return T_MSBuildProject.assert(parsed);\n }\n}\n\nconst T_MSBuildProject = type.instanceOf(MSBuildProject);\nconst T_NPP = type.instanceOf(NugetProjectProperties);\nconst T_PseudoMSBPInstance = type({\n Items: type({\n '[string]': type({\n '[string]': 'string',\n Identity: 'string',\n FullPath: 'string',\n RootDir: 'string',\n Filename: 'string',\n Extension: 'string',\n RelativeDir: 'string',\n Directory: 'string',\n RecursiveDir: 'string',\n ModifiedTime: 'string',\n CreatedTime: 'string',\n AccessedTime: 'string',\n DefiningProjectFullPath: 'string',\n DefiningProjectDirectory: 'string',\n DefiningProjectName: 'string',\n DefiningProjectExtension: 'string',\n 'SubType?': ' string | undefined',\n 'TargetFrameworkIdentifier?': 'string | undefined',\n 'TargetPlatformMoniker?': 'string | undefined',\n 'CopyUpToDateMarker?': 'string | undefined',\n 'TargetPlatformIdentifier?': 'string | undefined',\n 'TargetFrameworkVersion?': 'string | undefined',\n 'ReferenceAssembly?': 'string | undefined',\n }).array(),\n }),\n Properties: type.Record('string', 'string').or(T_NPP),\n Targets: type.string.array(),\n TargetResults: msbuildEvaluationOutput.get('TargetResults').exclude('undefined').array(),\n\n});\n\n/**\n * ArkType type definitions for internal usage, but may be re-used elsewhere\n * @internal\n */\nexport const _InternalMSBuildEvaluationTypes: Scope<{\n msbuildEvaluationOutput: {\n Properties?: Record<string, string> | undefined;\n Items?: Record<string, {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[]> | undefined;\n TargetResults?: Record<string, {\n Result: 'Success';\n Items: {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[];\n } | {\n Result: 'Failure';\n Items: never[];\n }> | undefined;\n };\n}> = type.scope({\n msbuildEvaluationOutput,\n});\n\n/**\n * Resolve a path if it is not already absolute.\n * @param _path A filesystem path.\n * @returns A full path to a filesystem entry. The path is unchecked for whether or not the path (or its parts) exist.\n */\nfunction makeAbsolute(_path: string) {\n return path.isAbsolute(_path) ? _path : path.resolve(_path);\n}\n\n/**\n * Use this in your catch statement or .catch call to return `undefined` when\n * a \"file in use by another process\" (i.e. EBUSY/ERROR_SHARING_VIOLATION) error is reported.\n * @param error Probably an Error object\n * @returns `undefined` if file in use by another process\n */\nexport function catchEBUSY(error: unknown): undefined {\n if (isError(error)) {\n if ('stderr' in error && typeof error.stderr === 'string') {\n // Normalize colon-like chars: '\\uFF1A'.normalize('NFKC') === ':' === true;\n const normalizedStderr = error.stderr.normalize('NFKC');\n const patternEN = /The process cannot access the file '[^']+' because it is being used by another process\\./gm;\n const hasErrMsgPattern = patternEN.test(normalizedStderr);\n const isCS2012 = /^CSC ?:.+CS2012:/gm.test(normalizedStderr);\n // generic error code; error message must be checked.\n const isAVLN9999 = /AVLN9999:/gm.test(normalizedStderr)\n && hasErrMsgPattern;\n if (isCS2012 || isAVLN9999 || hasErrMsgPattern)\n // eslint-disable-next-line unicorn/no-useless-undefined\n return undefined; /* retry */\n }\n /**\n * some known warnings/errors:\n * - warning MSB3073:\n * The command \"dotnet tool list kuinox.nupkgdeterministicator\"\n * exited with code 145.\n * > $ dotnet tool list kuinox.nupkgdeterministicator\n * > The command could not be loaded, possibly because:\n * > * You intended to execute a .NET application:\n * > The application 'tool' does not exist.\n * > * You intended to execute a .NET SDK command:\n * > No .NET SDKs were found.\n * >\n * > Download a .NET SDK:\n * > https://aka.ms/dotnet/download\n * >\n * > Learn about SDK resolution:\n * > https://aka.ms/dotnet/sdk-not-found\n */\n else throw error;\n }\n else throw new Error('unknown error', { cause: error });\n}\n\n/**\n *\n * Use this in your catch statement or .catch call to return `undefined` when\n * MSBuild error CSC2012 (e.g. \"file in use by another process\") is reported.\n * @param error Probably an Error object\n * @returns `undefined` if CSC2012 (file in use by another process) occurs\n * @deprecated Use {@link catchEBUSY}.\n */\nexport function catchCsc2012(error: unknown): undefined {\n if (isError(error)) {\n // check for error reported when \"file in use by another process\" i.e. EBUSY\n // (UNIX), NTSTATUS.ERROR_SHARING_VIOLATION == 0x20 == 32 (Windows)\n if ('stderr' in error && typeof error.stderr === 'string'\n && /^CSC ?:.+CS2012:/gm.test(\n // '\\uFF1A'.normalize('NFKC') === ':' === true;\n error.stderr.normalize('NFKC'),\n )\n ) {\n // eslint-disable-next-line unicorn/no-useless-undefined\n return undefined; /* retry */\n }\n /**\n * some known warnings/errors:\n * - warning MSB3073:\n * The command \"dotnet tool list kuinox.nupkgdeterministicator\"\n * exited with code 145.\n * > $ dotnet tool list kuinox.nupkgdeterministicator\n * > The command could not be loaded, possibly because:\n * > * You intended to execute a .NET application:\n * > The application 'tool' does not exist.\n * > * You intended to execute a .NET SDK command:\n * > No .NET SDKs were found.\n * >\n * > Download a .NET SDK:\n * > https://aka.ms/dotnet/download\n * >\n * > Learn about SDK resolution:\n * > https://aka.ms/dotnet/sdk-not-found\n */\n else throw error;\n }\n else throw new Error('unknown error', { cause: error });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAM,gCAAgC,KAAK;CACzC,YAAY;CAEZ,UAAU;CAEV,YAAY;CAEZ,8BAA8B;CAC9B,0BAA0B;CAE1B,uBAAuB;CACvB,6BAA6B;CAE7B,2BAA2B;CAE3B,sBAAsB;CAEtB,UAAU;CAEV,SAAS;CAET,UAAU;CAEV,WAAW;CAEX,aAAa;CAEb,WAAW;CACX,cAAc;CAEd,cAAc;CAEd,aAAa;CAEb,cAAc;CAEd,yBAAyB;CAEzB,0BAA0B;CAE1B,qBAAqB;CAErB,0BAA0B;CAC3B,CAAC;AAEF,MAAM,gBAAgB,KAAK;CACzB,QAAQ;CACR,OAAO,8BAA8B,OAAO;CAC7C,CAAC;AAEF,MAAM,gBA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,MAAM,CAGhB,KAAI,YAAY,SAAS,OAAO,MAAM,WAAW,YAC5C,qBAAqB,KAEtB,MAAM,OAAO,UAAU,OAAO,CAC/B,CAGD;KAoBG,OAAM;KAER,OAAM,IAAI,MAAM,iBAAiB,EAAE,OAAO,OAAO,CAAC"}
@@ -1,10 +1,207 @@
1
1
  //#region src/semantic-release__commit-analyzer.d.ts
2
2
  declare module '@semantic-release/commit-analyzer' {
3
- interface RuleObject {
4
- type?: string;
5
- scope?: string;
6
- release: string;
3
+ // #region RuleObject
4
+ namespace RuleObjects {
5
+ interface _Base {
6
+ /** @default true if {@link release} is 'major' */
7
+ breaking?: boolean;
8
+ revert?: boolean;
9
+ /** @default 'patch' if {@link revert} is `true` */
10
+ release: 'major' | 'premajor' | 'minor' | 'preminor' | 'patch' | 'prepatch' | 'prerelease' | false;
11
+ }
12
+ /**
13
+ * @see {@linkplain https://github.com/conventional-changelog/conventional-changelog/blob/61573ecba6aea718b96365c96993d4fa7d53c6fd/packages/conventional-changelog-angular/src/parser.js#L3-L11 ParserOpts_Angular},
14
+ */
15
+ interface Angular extends _Base {
16
+ type?: 'build' | 'ci' | 'docs' | 'feat' | 'fix' | 'perf' | 'refactor' | 'style' | 'test';
17
+ scope?: string;
18
+ subject?: string;
19
+ }
20
+ /**
21
+ * @see {@linkplain https://github.com/conventional-changelog/conventional-changelog/blob/61573ecba6aea718b96365c96993d4fa7d53c6fd/packages/conventional-changelog-atom/src/parser.js#L3-L4 ParserOpts_Atom}
22
+ * @example The defaults config includes...
23
+ * [
24
+ * ...
25
+ * { emoji: ":racehorse:", release: "patch" },
26
+ * { emoji: ":bug:", release: "patch" },
27
+ * { emoji: ":penguin:", release: "patch" },
28
+ * { emoji: ":apple:", release: "patch" },
29
+ * { emoji: ":checkered_flag:", release: "patch" }
30
+ * ...
31
+ * ]
32
+ */
33
+ interface Atom extends _Base {
34
+ /**
35
+ * Consider starting the commit message with an applicable emoji:
36
+ * - 🎨 :art: when improving the format/structure of the code
37
+ * - 🐎 :racehorse: when improving performance
38
+ * - 🚱 :non-potable_water: when plugging memory leaks
39
+ * - 📝 :memo: when writing docs
40
+ * - 🐧 :penguin: when fixing something on Linux
41
+ * - 🍎 :apple: when fixing something on Mac OS
42
+ * - 🏁 :checkered_flag: when fixing something on Windows
43
+ * - 🐛 :bug: when fixing a bug
44
+ * - 🔥 :fire: when removing code or files
45
+ * - 💚 :green_heart: when fixing the CI build
46
+ * - ✅ :white_check_mark: when adding tests
47
+ * - 🔒 :lock: when dealing with security
48
+ * - ⬆️ :arrow_up: when upgrading dependencies
49
+ * - ⬇️ :arrow_down: when downgrading dependencies
50
+ * - 👕 :shirt: when removing linter warnings
51
+ */
52
+ emoji: `:${string}:`;
53
+ shortDesc?: string;
54
+ }
55
+ /**
56
+ * @see {@link https://github.com/conventional-changelog/conventional-changelog/blob/61573ecba6aea718b96365c96993d4fa7d53c6fd/packages/conventional-changelog-codemirror/src/parser.js#L3-L7 ParserOpts_CodeMirror}
57
+ */
58
+ interface CodeMirror extends _Base {
59
+ language?: string;
60
+ type?: string;
61
+ message: string;
62
+ }
63
+ /**
64
+ * @see {@link https://github.com/conventional-changelog/conventional-changelog/blob/61573ecba6aea718b96365c96993d4fa7d53c6fd/packages/conventional-changelog-conventionalcommits/src/parser.js#L3-L13 ParserOpts_ConventionalCommits}
65
+ */
66
+ interface ConventionalCommits extends Angular {
67
+ type?: 'build' | 'chore' | 'ci' | 'docs' | 'feat' | 'feature' | 'fix' | 'perf' | 'refactor' | 'revert' | 'style' | 'test';
68
+ }
69
+ namespace Ember_Subtypes {
70
+ interface Base extends _Base {
71
+ /**
72
+ * In general, almost all commits should fall into one of these categories.
73
+ * In the cases where they don't, commit without a tag.
74
+ */
75
+ tag?: 'BUGFIX' | 'CLEANUP' | 'DOC' | 'FEATURE' | 'SECURITY';
76
+ /**
77
+ * BUGFIX: 'beta' | 'release'
78
+ * CLEANUP: 'beta'
79
+ * DOCS: 'canary' | 'beta' | 'release'
80
+ * Default: 'canary'
81
+ * The most stable release the change applies to.
82
+ * FEATURE: the flag of the feature
83
+ * SECURITY: 'cve'
84
+ * @example [BUGFIX beta], [BUGFIX release], [CLEANUP beta], [DOC canary], [DOC beta], [DOC release], [FEATURE <name>], [SECURITY cve]
85
+ */
86
+ taggedAs?: string;
87
+ /** All text after '[$tag $taggedAs]' in the commit message */
88
+ message?: string;
89
+ }
90
+ type None = Omit<Base, 'tag' | 'taggedAs'>;
91
+ interface BUGFIX extends Base {
92
+ tag: 'BUGFIX';
93
+ taggedAs: 'beta' | 'release';
94
+ }
95
+ interface CLEANUP extends Base {
96
+ tag: 'CLEANUP';
97
+ taggedAs: 'beta';
98
+ }
99
+ interface DOC extends Base {
100
+ tag: 'DOC';
101
+ taggedAs: 'canary' | 'beta' | 'release';
102
+ }
103
+ interface FEATURE extends Base {
104
+ tag: 'FEATURE';
105
+ taggedAs: string;
106
+ }
107
+ interface SECURITY extends Base {
108
+ tag: 'SECURITY';
109
+ taggedAs: 'cve';
110
+ }
111
+ }
112
+ type Ember = Ember_Subtypes.None | Ember_Subtypes.BUGFIX | Ember_Subtypes.CLEANUP | Ember_Subtypes.DOC | Ember_Subtypes.FEATURE | Ember_Subtypes.SECURITY;
113
+ /** Legacy; ESLint uses Conventional Commits. Source: https://eslint.org/docs/latest/contribute/pull-requests#step2 */
114
+ interface ESLint extends _Base {
115
+ /**
116
+ * - Breaking - for a backwards-incompatible enhancement or feature.
117
+ * - Build - changes to build process only.
118
+ * - Chore - for refactoring, adding tests, etc. (anything that isn't user-facing).
119
+ * - Docs - changes to documentation only.
120
+ * - Fix - for a bug fix.
121
+ * - New - implemented a new feature.
122
+ * - Update - either for a backwards-compatible enhancement or for a rule change that adds reported problems.
123
+ * - Upgrade - for a dependency upgrade.
124
+ */
125
+ tag: 'Breaking' | 'Build' | 'Chore' | 'Docs' | 'Fix' | 'New' | 'Update' | 'Upgrade';
126
+ message?: string;
127
+ }
128
+ /** A derivation of Angular / Conventional Commits */
129
+ interface Express extends _Base {
130
+ /** @example 'build' | 'chore' | 'deps' | 'docs' | 'fix' | 'lint' | 'perf' | ... */
131
+ component: Angular['type'] | 'deps' | 'lint';
132
+ shortDesc?: string;
133
+ }
134
+ interface JQuery extends _Base {
135
+ /** @example 'Event' | 'Autocomplete' */
136
+ component?: string;
137
+ }
138
+ interface JSHint extends _Base {
139
+ type: 'FIX' | 'FEAT' | 'DOCS' | 'TEST' | 'CHORE';
140
+ shortDesc?: string;
141
+ }
142
+ }
143
+ type RuleObject = RuleObjects._Base | RuleObjects.Angular | RuleObjects.Atom | RuleObjects.CodeMirror | RuleObjects.ConventionalCommits | RuleObjects.Ember | RuleObjects.ESLint | RuleObjects.Express | RuleObjects.JQuery | RuleObjects.JSHint; // #endregion RuleObject
144
+ // #region PresetConfig
145
+ /**
146
+ * Substitutions:
147
+ * - {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#host host}
148
+ * - {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#owner owner}
149
+ * - {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#repository repository}
150
+ * - {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#hash hash}
151
+ * - {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#previoustype previousTag}
152
+ * - {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#currenttag currentTag}
153
+ */
154
+ namespace PresetConfigs {
155
+ interface _Base {
156
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#commiturlformat-string */
157
+ commitUrlFormat?: string;
158
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#compareurlformat-string */
159
+ compareUrlFormat?: string;
160
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#header-string */
161
+ header?: string;
162
+ /**
163
+ * @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#issueprefixes-array-of-string
164
+ * @example ['TEST-']
165
+ */
166
+ issuePrefixes?: string[];
167
+ /**
168
+ * @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#issueurlformat-string
169
+ * @example 'https://myBugTracker.com/{{prefix}}{{id}}'
170
+ */
171
+ issueUrlFormat?: string;
172
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#premajor-boolean */
173
+ preMajor?: boolean;
174
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#releasecommitmessageformat-string */
175
+ releaseCommitMessageFormat?: string;
176
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#types */
177
+ types?: {
178
+ type: string;
179
+ scope?: string;
180
+ section?: string;
181
+ hidden?: boolean;
182
+ }[];
183
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#userurlformat-string */
184
+ userUrlFormat?: string;
185
+ }
186
+ interface ConventionalCommits extends _Base {
187
+ /**
188
+ * Regular expression to match and exclude commits from the changelog. Commits matching this pattern will be ignored.
189
+ */
190
+ ignoreCommits?: string | RegExp;
191
+ /** Array of commit type objects defining which types to include in the changelog. Hidden types are excluded from the changelog but may still trigger version bumps. Default value accessible via `DEFAULT_COMMIT_TYPES` export. */
192
+ types?: RuleObjects.ConventionalCommits;
193
+ /** When `true`, version bumps occur only for breaking changes or non-hidden commit types. When `false` (default), any commit can trigger a version bump. */
194
+ bumpStrict?: boolean;
195
+ /** String or array of scope names to filter commits. Only commits with matching scopes will be included. When `scopeOnly` is `false` (default), commits without any scope are also included. */
196
+ scope?: string | string[];
197
+ /**
198
+ * When `true` and `scope` is specified, excludes commits that have no scope. When `false` (default), includes both scoped and unscoped commits when filtering by scope.
199
+ * @default false
200
+ */
201
+ scopeOnly?: boolean;
202
+ }
7
203
  }
204
+ type PresetConfig = PresetConfigs._Base | PresetConfigs.ConventionalCommits; // #endregion PresetConfig
8
205
  type AnyRecord = Record<keyof unknown, unknown>;
9
206
  export interface CommitAnalyzerConfig {
10
207
  preset?: string;
@@ -15,6 +212,10 @@ declare module '@semantic-release/commit-analyzer' {
15
212
  * See https://github.com/semantic-release/commit-analyzer?tab=readme-ov-file#external-package--file
16
213
  */
17
214
  releaseRules?: string | RuleObject[];
215
+ /**
216
+ * Additional configuration passed to the {@linkplain https://github.com/conventional-changelog/conventional-changelog conventional-changelog} preset.
217
+ * Used for example with {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md conventional-changelog-conventionalcommits}.
218
+ */
18
219
  presetConfig?: AnyRecord;
19
220
  }
20
221
  export type Options = CommitAnalyzerConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"semantic-release__commit-analyzer.d.mts","names":["Record","AnyRecord","RuleObject","CommitAnalyzerConfig","Promise","type","scope","release","preset","config","parserOpts","releaseRules","presetConfig","Options","analyzeCommits","pluginConfig","commits","cwd","context","sideEffect","_0"],"sources":["../src/semantic-release__commit-analyzer.d.ts"],"mappings":";;YAEYE,UAAAA;IACRG,IAAAA;IACAC,KAAAA;IACAC,OAAAA;EAAAA;EAAAA,KAGGN,SAAAA,GAAYD,MAAAA;EAAAA,iBAEAG,oBAAAA;IACfK,MAAAA;IACAC,MAAAA;IACAC,UAAAA,GAAaT,SAAAA;IAVbI;;;;IAeAM,YAAAA,YAAwBT,UAAAA;IACxBU,YAAAA,GAAeX,SAAAA;EAAAA;EAAAA,YAGLY,OAAAA,GAAUV,oBAAAA;EAJpBQ;;;;;;;;;;;;;EAAAA,gBAmBcG,cAAAA,CACdC,YAAAA;IACEP,MAAAA;IACAC,MAAAA;IACAE,YAAAA,WAAuBV,SAAAA;IACvBS,UAAAA;EAAAA,GAEFQ,OAAAA;IACEF,OAAAA;IACAC,GAAAA;EAAAA,IAEDb,OAAAA;AAAAA"}
1
+ {"version":3,"file":"semantic-release__commit-analyzer.d.mts","names":["_Base","Angular","Base","Omit","Ember_Subtypes","None","BUGFIX","CLEANUP","DOC","FEATURE","SECURITY","RuleObjects","Atom","CodeMirror","ConventionalCommits","Ember","ESLint","Express","JQuery","JSHint","RegExp","PresetConfigs","Record","AnyRecord","RuleObject","CommitAnalyzerConfig","Promise","breaking","revert","release","type","scope","subject","emoji","shortDesc","language","message","tag","taggedAs","component","commitUrlFormat","compareUrlFormat","header","issuePrefixes","issueUrlFormat","preMajor","releaseCommitMessageFormat","types","section","hidden","userUrlFormat","ignoreCommits","bumpStrict","scopeOnly","PresetConfig","preset","config","parserOpts","releaseRules","presetConfig","Options","analyzeCommits","pluginConfig","commits","cwd","context","sideEffect","_0"],"sources":["../src/semantic-release__commit-analyzer.d.ts"],"mappings":";;;YAGYW,WAAAA;IAAAA,UACEX,KAAAA;MA8BaA;MA5BrB2B,QAAAA;MACAC,MAAAA;MAmEuB5B;MAjEvB6B,OAAAA;IAAAA;IAkG0B3B;;;IAAAA,UA5FlBD,OAAAA,SAAgBD,KAAAA;MACxB8B,IAAAA;MACAC,KAAAA;MACAC,OAAAA;IAAAA;IAoHI5B;;;;;;;;;;;;;IAAAA,UApGIQ,IAAAA,SAAaZ,KAAAA;MAiJnBW;;;;;;;;;;;;;;;;;;MA9HFsB,KAAAA;MACAC,SAAAA;IAAAA;IAvCwBlC;;;IAAAA,UA6ChBa,UAAAA,SAAmBb,KAAAA;MAC3BmC,QAAAA;MACAL,IAAAA;MACAM,OAAAA;IAAAA;IAH2BpC;;;IAAAA,UASnBc,mBAAAA,SAA4Bb,OAAAA;MACpC6B,IAAAA;IAAAA;IAAAA,UAGQ1B,cAAAA;MAAAA,UACEF,IAAAA,SAAaF,KAAAA;QAAAA;;;;QAKrBqC,GAAAA;QAyBAC;;;;;;;;;;QATAA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- "version": "3.4.8",
3
+ "version": "3.5.0",
4
4
  "description": "Automate commit message quality, changelogs, and CI/CD releases. Its `main` entry point is a Semantic Release config. Functions and classes are exposed for customization. An ESLint config, a Commitlint config, and addl. resources for .NET projects are also provided.",
5
5
  "keywords": [
6
6
  "semantic-release",
@@ -47,7 +47,6 @@
47
47
  "lint:check": "eslint --cache .",
48
48
  "eslint-inspector": "eslint --inspect-config",
49
49
  "prepack": "npm run clean && npm run build",
50
- "pack": "echo 'You should use `npm pack`' && exit 1",
51
50
  "postinstall": "patch-package && husky",
52
51
  "presemantic-release": "npm pack",
53
52
  "semantic-release": "semantic-release",
@@ -62,7 +61,7 @@
62
61
  "dependencies": {
63
62
  "@commitlint/cli": "^20.5.0",
64
63
  "@commitlint/config-conventional": "^20.5.0",
65
- "@dotenvx/dotenvx": "^1.57.2",
64
+ "@dotenvx/dotenvx": "^1.59.1",
66
65
  "@eslint/js": "^10.0.1",
67
66
  "@eslint/json": "^1.2.0",
68
67
  "@semantic-release/changelog": "^6.0.3",
@@ -76,7 +75,7 @@
76
75
  "@types/node": "~24.12.0",
77
76
  "arktype": "^2.1.20",
78
77
  "chardet": "^2.1.0",
79
- "conventional-changelog-conventionalcommits": "^9.2.0",
78
+ "conventional-changelog-conventionalcommits": "^9.3.1",
80
79
  "debug": "^4.4.1",
81
80
  "error.iserror": "^1.0.2",
82
81
  "es-main": "^1.3.0",
@@ -87,13 +86,12 @@
87
86
  "semantic-release": "^25.0.0",
88
87
  "semantic-release-export-data": "^1.1.0",
89
88
  "ts-essentials": "^10.1.1",
90
- "typescript-eslint": "^8.57.2"
89
+ "typescript-eslint": "^8.58.0"
91
90
  },
92
91
  "peerDependencies": {
93
92
  "@bintoss/semantic-release-npm-multiple": "^3.0.0 || >= 3.0.0",
94
93
  "@commitlint/types": "^20.0.0 || >= 20.0.0",
95
94
  "@semantic-release/gitlab": "^13.0.0 || >= 13.0.0",
96
- "@tsconfig/node24": "^24.0.3",
97
95
  "eslint": "^10.0.0",
98
96
  "typescript": "^5.0.0 || >=5.0.0"
99
97
  },
@@ -110,22 +108,21 @@
110
108
  "@bintoss/semantic-release-npm-multiple": "^3.17.1",
111
109
  "@commitlint/types": "^20.5.0",
112
110
  "@eslint/config-inspector": "^1.4.2",
113
- "@eslint/markdown": "^8.0.0",
111
+ "@eslint/markdown": "^8.0.1",
114
112
  "@sebbo2002/semantic-release-jsr": "^3.2.0",
115
113
  "@semantic-release/gitlab": "^13.3.2",
116
- "@tsconfig/node24": "^24.0.3",
117
114
  "@types/debug": "^4.1.13",
118
115
  "@types/tmp": "^0.2.6",
119
116
  "conventional-changelog-preset-loader": "^5.0.0",
120
117
  "eslint": "^10.1.0",
121
- "eslint-plugin-jsdoc": "^62.8.1",
122
- "eslint-plugin-unicorn": "^63.0.0",
118
+ "eslint-plugin-jsdoc": "^62.9.0",
119
+ "eslint-plugin-unicorn": "^64.0.0",
123
120
  "publint": "^0.3.18",
124
121
  "tmp": "^0.2.3",
125
- "tsdown": "^0.21.5",
122
+ "tsdown": "^0.21.7",
126
123
  "tslib": "^2.8.1",
127
124
  "tsx": "^4.20.3",
128
- "typescript": "^5.8.3",
125
+ "typescript": "^6.0.0",
129
126
  "unplugin-unused": "^0.5.7"
130
127
  },
131
128
  "//engines.node": "See file://./.nvmrc, https://github.com/nvm-sh/nvm#nvmrc. Supporting the lowest version possible is a PITA. Just support LTS. ",
@@ -685,6 +685,7 @@ export function catchEBUSY(error: unknown): undefined {
685
685
  const isAVLN9999 = /AVLN9999:/gm.test(normalizedStderr)
686
686
  && hasErrMsgPattern;
687
687
  if (isCS2012 || isAVLN9999 || hasErrMsgPattern)
688
+ // eslint-disable-next-line unicorn/no-useless-undefined
688
689
  return undefined; /* retry */
689
690
  }
690
691
  /**
@@ -728,6 +729,7 @@ export function catchCsc2012(error: unknown): undefined {
728
729
  error.stderr.normalize('NFKC'),
729
730
  )
730
731
  ) {
732
+ // eslint-disable-next-line unicorn/no-useless-undefined
731
733
  return undefined; /* retry */
732
734
  }
733
735
  /**
@@ -1,11 +1,248 @@
1
1
  declare module '@semantic-release/commit-analyzer' {
2
2
 
3
- interface RuleObject {
4
- type?: string;
5
- scope?: string;
6
- release: string;
3
+ // #region RuleObject
4
+ namespace RuleObjects {
5
+ interface _Base {
6
+ /** @default true if {@link release} is 'major' */
7
+ breaking?: boolean;
8
+ revert?: boolean;
9
+ /** @default 'patch' if {@link revert} is `true` */
10
+ release: 'major' | 'premajor' | 'minor' | 'preminor' | 'patch' | 'prepatch' | 'prerelease' | false;
11
+ }
12
+
13
+ /**
14
+ * @see {@linkplain https://github.com/conventional-changelog/conventional-changelog/blob/61573ecba6aea718b96365c96993d4fa7d53c6fd/packages/conventional-changelog-angular/src/parser.js#L3-L11 ParserOpts_Angular},
15
+ */
16
+ interface Angular extends _Base {
17
+ type?: 'build' | 'ci' | 'docs' | 'feat' | 'fix' | 'perf' | 'refactor' | 'style' | 'test';
18
+ scope?: string;
19
+ subject?: string;
20
+ }
21
+
22
+ /**
23
+ * @see {@linkplain https://github.com/conventional-changelog/conventional-changelog/blob/61573ecba6aea718b96365c96993d4fa7d53c6fd/packages/conventional-changelog-atom/src/parser.js#L3-L4 ParserOpts_Atom}
24
+ * @example The defaults config includes...
25
+ * [
26
+ * ...
27
+ * { emoji: ":racehorse:", release: "patch" },
28
+ * { emoji: ":bug:", release: "patch" },
29
+ * { emoji: ":penguin:", release: "patch" },
30
+ * { emoji: ":apple:", release: "patch" },
31
+ * { emoji: ":checkered_flag:", release: "patch" }
32
+ * ...
33
+ * ]
34
+ */
35
+ interface Atom extends _Base {
36
+ /**
37
+ * Consider starting the commit message with an applicable emoji:
38
+ * - 🎨 :art: when improving the format/structure of the code
39
+ * - 🐎 :racehorse: when improving performance
40
+ * - 🚱 :non-potable_water: when plugging memory leaks
41
+ * - 📝 :memo: when writing docs
42
+ * - 🐧 :penguin: when fixing something on Linux
43
+ * - 🍎 :apple: when fixing something on Mac OS
44
+ * - 🏁 :checkered_flag: when fixing something on Windows
45
+ * - 🐛 :bug: when fixing a bug
46
+ * - 🔥 :fire: when removing code or files
47
+ * - 💚 :green_heart: when fixing the CI build
48
+ * - ✅ :white_check_mark: when adding tests
49
+ * - 🔒 :lock: when dealing with security
50
+ * - ⬆️ :arrow_up: when upgrading dependencies
51
+ * - ⬇️ :arrow_down: when downgrading dependencies
52
+ * - 👕 :shirt: when removing linter warnings
53
+ */
54
+ emoji: `:${string}:`;
55
+ shortDesc?: string;
56
+ }
57
+
58
+ /**
59
+ * @see {@link https://github.com/conventional-changelog/conventional-changelog/blob/61573ecba6aea718b96365c96993d4fa7d53c6fd/packages/conventional-changelog-codemirror/src/parser.js#L3-L7 ParserOpts_CodeMirror}
60
+ */
61
+ interface CodeMirror extends _Base {
62
+ language?: string;
63
+ type?: string;
64
+ message: string;
65
+ }
66
+
67
+ /**
68
+ * @see {@link https://github.com/conventional-changelog/conventional-changelog/blob/61573ecba6aea718b96365c96993d4fa7d53c6fd/packages/conventional-changelog-conventionalcommits/src/parser.js#L3-L13 ParserOpts_ConventionalCommits}
69
+ */
70
+ interface ConventionalCommits extends Angular {
71
+ type?: 'build' | 'chore' | 'ci' | 'docs' | 'feat' | 'feature' | 'fix' | 'perf' | 'refactor' | 'revert' | 'style' | 'test';
72
+ }
73
+
74
+ namespace Ember_Subtypes {
75
+ interface Base extends _Base {
76
+ /**
77
+ * In general, almost all commits should fall into one of these categories.
78
+ * In the cases where they don't, commit without a tag.
79
+ */
80
+ tag?:
81
+ | 'BUGFIX'
82
+ | 'CLEANUP'
83
+ | 'DOC'
84
+ | 'FEATURE'
85
+ | 'SECURITY';
86
+ /**
87
+ * BUGFIX: 'beta' | 'release'
88
+ * CLEANUP: 'beta'
89
+ * DOCS: 'canary' | 'beta' | 'release'
90
+ * Default: 'canary'
91
+ * The most stable release the change applies to.
92
+ * FEATURE: the flag of the feature
93
+ * SECURITY: 'cve'
94
+ * @example [BUGFIX beta], [BUGFIX release], [CLEANUP beta], [DOC canary], [DOC beta], [DOC release], [FEATURE <name>], [SECURITY cve]
95
+ */
96
+ taggedAs?: string;
97
+ /** All text after '[$tag $taggedAs]' in the commit message */
98
+ message?: string;
99
+ }
100
+
101
+ type None = Omit<Base, 'tag' | 'taggedAs'>;
102
+
103
+ interface BUGFIX extends Base {
104
+ tag: 'BUGFIX';
105
+ taggedAs: 'beta' | 'release';
106
+ }
107
+
108
+ interface CLEANUP extends Base {
109
+ tag: 'CLEANUP';
110
+ taggedAs: 'beta';
111
+ }
112
+
113
+ interface DOC extends Base {
114
+ tag: 'DOC';
115
+ taggedAs: 'canary' | 'beta' | 'release';
116
+ }
117
+
118
+ interface FEATURE extends Base {
119
+ tag: 'FEATURE';
120
+ taggedAs: string;
121
+ }
122
+
123
+ interface SECURITY extends Base {
124
+ tag: 'SECURITY';
125
+ taggedAs: 'cve';
126
+ }
127
+ }
128
+
129
+ type Ember
130
+ = | Ember_Subtypes.None
131
+ | Ember_Subtypes.BUGFIX
132
+ | Ember_Subtypes.CLEANUP
133
+ | Ember_Subtypes.DOC
134
+ | Ember_Subtypes.FEATURE
135
+ | Ember_Subtypes.SECURITY;
136
+
137
+ /** Legacy; ESLint uses Conventional Commits. Source: https://eslint.org/docs/latest/contribute/pull-requests#step2 */
138
+ interface ESLint extends _Base {
139
+ /**
140
+ * - Breaking - for a backwards-incompatible enhancement or feature.
141
+ * - Build - changes to build process only.
142
+ * - Chore - for refactoring, adding tests, etc. (anything that isn't user-facing).
143
+ * - Docs - changes to documentation only.
144
+ * - Fix - for a bug fix.
145
+ * - New - implemented a new feature.
146
+ * - Update - either for a backwards-compatible enhancement or for a rule change that adds reported problems.
147
+ * - Upgrade - for a dependency upgrade.
148
+ */
149
+ tag: 'Breaking' | 'Build' | 'Chore' | 'Docs' | 'Fix' | 'New' | 'Update' | 'Upgrade';
150
+ message?: string;
151
+ }
152
+
153
+ /** A derivation of Angular / Conventional Commits */
154
+ interface Express extends _Base {
155
+ /** @example 'build' | 'chore' | 'deps' | 'docs' | 'fix' | 'lint' | 'perf' | ... */
156
+ component: Angular['type'] | 'deps' | 'lint';
157
+ shortDesc?: string;
158
+ }
159
+
160
+ interface JQuery extends _Base {
161
+ /** @example 'Event' | 'Autocomplete' */
162
+ component?: string;
163
+ }
164
+
165
+ interface JSHint extends _Base {
166
+ type: 'FIX' | 'FEAT' | 'DOCS' | 'TEST' | 'CHORE';
167
+ shortDesc?: string;
168
+ }
7
169
  }
8
170
 
171
+ type RuleObject
172
+ = | RuleObjects._Base
173
+ | RuleObjects.Angular
174
+ | RuleObjects.Atom
175
+ | RuleObjects.CodeMirror
176
+ | RuleObjects.ConventionalCommits
177
+ | RuleObjects.Ember
178
+ | RuleObjects.ESLint
179
+ | RuleObjects.Express
180
+ | RuleObjects.JQuery
181
+ | RuleObjects.JSHint;
182
+ // #endregion RuleObject
183
+
184
+ // #region PresetConfig
185
+ /**
186
+ * Substitutions:
187
+ * - {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#host host}
188
+ * - {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#owner owner}
189
+ * - {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#repository repository}
190
+ * - {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#hash hash}
191
+ * - {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#previoustype previousTag}
192
+ * - {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#currenttag currentTag}
193
+ */
194
+ namespace PresetConfigs {
195
+ interface _Base {
196
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#commiturlformat-string */
197
+ commitUrlFormat?: string;
198
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#compareurlformat-string */
199
+ compareUrlFormat?: string;
200
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#header-string */
201
+ header?: string;
202
+ /**
203
+ * @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#issueprefixes-array-of-string
204
+ * @example ['TEST-']
205
+ */
206
+ issuePrefixes?: string[];
207
+ /**
208
+ * @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#issueurlformat-string
209
+ * @example 'https://myBugTracker.com/{{prefix}}{{id}}'
210
+ */
211
+ issueUrlFormat?: string;
212
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#premajor-boolean */
213
+ preMajor?: boolean;
214
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#releasecommitmessageformat-string */
215
+ releaseCommitMessageFormat?: string;
216
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#types */
217
+ types?: { type: string; scope?: string; section?: string; hidden?: boolean }[];
218
+ /** @see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#userurlformat-string */
219
+ userUrlFormat?: string;
220
+ }
221
+
222
+ interface ConventionalCommits extends _Base {
223
+ /**
224
+ * Regular expression to match and exclude commits from the changelog. Commits matching this pattern will be ignored.
225
+ */
226
+ ignoreCommits?: string | RegExp;
227
+ /** Array of commit type objects defining which types to include in the changelog. Hidden types are excluded from the changelog but may still trigger version bumps. Default value accessible via `DEFAULT_COMMIT_TYPES` export. */
228
+ types?: RuleObjects.ConventionalCommits;
229
+ /** When `true`, version bumps occur only for breaking changes or non-hidden commit types. When `false` (default), any commit can trigger a version bump. */
230
+ bumpStrict?: boolean;
231
+ /** String or array of scope names to filter commits. Only commits with matching scopes will be included. When `scopeOnly` is `false` (default), commits without any scope are also included. */
232
+ scope?: string | string[];
233
+ /**
234
+ * When `true` and `scope` is specified, excludes commits that have no scope. When `false` (default), includes both scoped and unscoped commits when filtering by scope.
235
+ * @default false
236
+ */
237
+ scopeOnly?: boolean;
238
+ }
239
+ }
240
+
241
+ type PresetConfig
242
+ = | PresetConfigs._Base
243
+ | PresetConfigs.ConventionalCommits;
244
+ // #endregion PresetConfig
245
+
9
246
  type AnyRecord = Record<keyof unknown, unknown>;
10
247
 
11
248
  export interface CommitAnalyzerConfig {
@@ -17,6 +254,10 @@ declare module '@semantic-release/commit-analyzer' {
17
254
  * See https://github.com/semantic-release/commit-analyzer?tab=readme-ov-file#external-package--file
18
255
  */
19
256
  releaseRules?: string | RuleObject[];
257
+ /**
258
+ * Additional configuration passed to the {@linkplain https://github.com/conventional-changelog/conventional-changelog conventional-changelog} preset.
259
+ * Used for example with {@linkplain https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md conventional-changelog-conventionalcommits}.
260
+ */
20
261
  presetConfig?: AnyRecord;
21
262
  }
22
263
 
@@ -23,13 +23,12 @@
23
23
  }
24
24
  },
25
25
  "compileOnSave": true,
26
- "extends": "@tsconfig/node24/tsconfig.json",
26
+ "extends": "./tsconfig.node.json",
27
27
  "compilerOptions": {
28
28
  "allowImportingTsExtensions": true,
29
29
  "composite": true,
30
30
  "declarationMap": true,
31
31
  "emitDeclarationOnly": true,
32
- "esModuleInterop": false,
33
32
  "forceConsistentCasingInFileNames": true,
34
33
  "isolatedDeclarations": true,
35
34
  "isolatedModules": true,
package/tsconfig.json CHANGED
@@ -1,9 +1,7 @@
1
1
  {
2
2
  "extends": "./tsconfig.base.json",
3
3
  "compilerOptions": {
4
- "allowImportingTsExtensions": true,
5
4
  "outDir": "_tsout",
6
- "target": "es2020",
7
5
  "erasableSyntaxOnly": true
8
6
  },
9
7
  "include": [
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://www.schemastore.org/tsconfig",
3
+ "_version": "24.0.0",
4
+
5
+ "compilerOptions": {
6
+ "lib": [
7
+ "es2024",
8
+ "ESNext.Array",
9
+ "ESNext.Collection",
10
+ "ESNext.Error",
11
+ "ESNext.Iterator",
12
+ "ESNext.Promise"
13
+ ],
14
+ "module": "nodenext",
15
+ "target": "es2024",
16
+ "types": [ "node" ],
17
+
18
+ "skipLibCheck": true
19
+ }
20
+ }