import "@-xun/symbiote/assets/conventional.config.js"; import { ThisPackageGlobalScope as ReleaseScope } from "../configure.js"; import type { AsStrictExecutionContext, ChildConfiguration } from '@-xun/cli'; import type { ProjectMetadata, XPackageJson } from '@-xun/project'; import type { RunOptions } from '@-xun/run'; import type { ExtendedDebugger, ExtendedLogger } from 'rejoinder'; import type { KeyAsString, Merge, OmitIndexSignature } from 'type-fest'; import type { GlobalCliArguments, GlobalExecutionContext } from "../configure.js"; /** * The environment variables this command expects to be defined in * `process.env`. */ export declare const expectedEnvVariables: string[]; /** * @see {@link ReleaseScope} */ export declare const releaseScopes: ReleaseScope.ThisPackage[]; /** * Well-known names representing groups of tasks to be skipped when running the * release process. */ export declare enum SkippableTasksGroup { /** * A string that can be passed to --skip-tasks representing all prerelease and * postrelease tasks. */ AllTasks = "all", /** * A string that can be passed to --skip-tasks representing all prerelease * tasks. */ AllPrereleaseTasks = "prerelease", /** * A string that can be passed to --skip-tasks representing all postrelease * tasks. */ AllPostReleaseTasks = "postrelease", /** * A string that can be passed to --skip-tasks representing all prerelease * tasks that should be skipped when following "Manual Release Method 2" in * `MAINTAINING.md`. */ AllManualPrereleaseTasks = "manual", } /** * @see {@link SkippableTasksGroup} */ export declare const skippableTasksGroups: SkippableTasksGroup[]; /** * The context passed to each individual task. */ export type ReleaseTaskContext = { self: ReleaseTask; log: ExtendedLogger; debug: ExtendedDebugger; findTaskByDescription: ( /** * **WARNING: MUST NEVER BE A RegExp WITH A GLOBAL (g) FLAG!** */ searchRegExp: RegExp) => ReleaseTask; }; /** * A reified {@link ProtoReleaseTaskRunner}. Generated automatically by tooling. */ export type ReleaseTaskRunner = (argv: Parameters['handler']>>[0], taskContextPartial: Omit) => Promise; export type ExecutionContextWithProjectMetadata = Merge[0], { projectMetadata: ProjectMetadata; }>; /** * A partial release task with loose typings for quickly authoring new tasks. */ export type ProtoReleaseTaskRunner = (executionContext: ExecutionContextWithProjectMetadata, argv: Parameters['handler']>>[0], taskContext: ReleaseTaskContext) => ReturnType; /** * A prerelease, release, or postrelease task to be executed by this command. */ export type ReleaseTask = { type: 'pre' | 'post'; id: number; skippable: boolean; allowMissingNpmScripts: boolean; npmScripts: KeyAsString>>[]; actionDescription?: string; helpDescription: string; emoji?: string; io: RunOptions['stdout']; run?: ReleaseTaskRunner; } | { type: 'release'; id: number; skippable: false; allowMissingNpmScripts: boolean; npmScripts: never[]; actionDescription?: string; helpDescription: string; emoji?: string; io: RunOptions['stdout']; run?: ReleaseTaskRunner; }; export interface BaseProtoTask { /** * Whether the task can be skipped by the user or not. */ skippable: boolean; /** * Whether the task will automatically fail if none of the scripts given in * `npmScripts` exist in the package's `package.json`. * * @default false */ allowMissingNpmScripts?: boolean; /** * Run only the first NPM script in `npmScripts` that is found in the * package's `package.json`. */ npmScripts?: Exclude; /** * The description reported to the user when the task is run. * * @default `Running task #${id}` */ actionDescription?: string; /** * The description reported to the user when `--help` is called. */ helpDescription: string; /** * A symbol that will be placed before symbiote output text concerning this * task. */ emoji?: string; /** * Determines how the process's `stdout` and `stdin` streams will be * configured when executing {@link npmScripts}. Does not apply to `run` or * {@link ProtoReleaseTaskRunner}. * * This should always be left as `'pipe'` (the default) unless the task is the * only member of its task group (in which case `'inherit'` may be * appropriate). * * Note that this value may be overridden (with `'ignore'`) if the user * supplies `--hush`/`--quiet`/`--silent`. * * @default 'pipe' */ io?: RunOptions['stdout']; /** * A function called when the task is triggered. */ run?: ProtoReleaseTaskRunner; } /** * A partially defined prerelease-`type` {@link ReleaseTask}. */ export interface ProtoPrereleaseTask extends BaseProtoTask { type?: 'pre'; } /** * A partially defined postrelease-`type` {@link ReleaseTask}. */ export interface ProtoPostreleaseTask extends BaseProtoTask { type?: 'post'; } /** * A partially defined release-`type` {@link ReleaseTask}. */ export interface ProtoCoreReleaseTask extends Omit { skippable?: false; npmScripts?: never[]; emoji?: ''; } export type CustomCliArguments = GlobalCliArguments & { ci: boolean; dryRun: boolean; force: boolean; parallel: boolean; skipTasks: string[]; skipTaskMissingScripts: boolean; }; export default function command(executionContext: AsStrictExecutionContext): ChildConfiguration;