@-xun/project
Version:
A library to help me wrangle the complex landscape between monorepos and polyrepos
124 lines • 4.07 kB
TypeScript
/**
* Options available when constructing a new `ProjectError` object.
*/
export type ProjectErrorOptions = {
/**
* By default, if an {@link Error} object is passed to `ProjectError`, that
* `Error` instance will be passed through as `ProjectError.cause` and that
* instance's `Error.message` will be passed through as
* `ProjectError.message`.
*
* Use this option to override this default behavior and instead set
* `ProjectError.cause` manually.
*/
cause?: ErrorOptions['cause'];
};
export declare const ProjectError: import("@-xun/error").SpecificErrorClassConstructor<{
name: string;
message: string;
stack?: string;
cause?: unknown;
}> & import("@-xun/error").NamedErrorConstructorStaticProperties<{
name: string;
message: string;
stack?: string;
cause?: unknown;
}>;
export declare const NotAGitRepositoryError: import("@-xun/error").SpecificErrorClassConstructor<{
name: string;
message: string;
stack?: string;
cause?: unknown;
}> & import("@-xun/error").NamedErrorConstructorStaticProperties<{
name: string;
message: string;
stack?: string;
cause?: unknown;
}>;
export declare const XPackageJsonNotParsableError: import("@-xun/error").SpecificErrorClassConstructor<{
readonly packageJsonPath: string;
readonly reason: unknown;
name: string;
message: string;
stack?: string;
cause?: unknown;
}> & import("@-xun/error").NamedErrorConstructorStaticProperties<{
readonly packageJsonPath: string;
readonly reason: unknown;
name: string;
message: string;
stack?: string;
cause?: unknown;
}>;
export declare const DuplicatePackageNameError: import("@-xun/error").SpecificErrorClassConstructor<{
readonly packageName: string;
readonly firstPath: string;
readonly secondPath: string;
name: string;
message: string;
stack?: string;
cause?: unknown;
}> & import("@-xun/error").NamedErrorConstructorStaticProperties<{
readonly packageName: string;
readonly firstPath: string;
readonly secondPath: string;
name: string;
message: string;
stack?: string;
cause?: unknown;
}>;
export declare const DuplicatePackageIdError: import("@-xun/error").SpecificErrorClassConstructor<{
readonly id: string;
readonly firstPath: string;
readonly secondPath: string;
name: string;
message: string;
stack?: string;
cause?: unknown;
}> & import("@-xun/error").NamedErrorConstructorStaticProperties<{
readonly id: string;
readonly firstPath: string;
readonly secondPath: string;
name: string;
message: string;
stack?: string;
cause?: unknown;
}>;
/**
* Represents encountering an unnamed workspace with the same package-id as
* another workspace.
*/
export type DuplicatePackageIdError = InstanceType<typeof DuplicatePackageIdError>;
/**
* Represents encountering a workspace package.json file with the same
* `"name"` field as another workspace.
*/
export type DuplicatePackageNameError = InstanceType<typeof DuplicatePackageNameError>;
/**
* Represents encountering a project that is not a git repository.
*/
export type NotAGitRepositoryError = InstanceType<typeof NotAGitRepositoryError>;
/**
* Represents an exception originating from project meta-analysis tooling
* (e.g. from `@-xun/project`).
*
* `ProjectError` is the "foundational" base {@link Error} subclass for
* several project-related tools among various libraries.
*/
export type ProjectError = InstanceType<typeof ProjectError>;
/**
* Represents encountering an unparsable package.json file in an
* symbiote-powered project.
*/
export type XPackageJsonNotParsableError = InstanceType<typeof XPackageJsonNotParsableError>;
/**
* A collection of possible error and warning messages.
*/
export declare const CommonErrorMessage: {
Generic(): string;
GuruMeditation(): string;
NotAGitRepositoryError(): string;
PackageJsonNotParsable(packageJsonPath: string, reason: unknown): string;
DuplicatePackageName(packageName: string, firstPath: string, secondPath: string): string;
DuplicatePackageId(id: string, firstPath: string, secondPath: string): string;
};