mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-25 01:41:05 -05:00
Made Dependency interface
This commit is contained in:
parent
f6c5dfd62b
commit
428bc335e9
1 changed files with 25 additions and 0 deletions
25
src/metadata/dependency.ts
Normal file
25
src/metadata/dependency.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import PublisherTarget from "../publishing/publisher-target";
|
||||
import DependencyKind from "./dependency-kind";
|
||||
|
||||
interface Dependency {
|
||||
get id(): string;
|
||||
get version(): string;
|
||||
get kind(): DependencyKind;
|
||||
get ignore(): boolean;
|
||||
|
||||
getProjectSlug(project: PublisherTarget): string;
|
||||
}
|
||||
|
||||
namespace Dependency {
|
||||
export function create({ id, version = "*", kind = DependencyKind.Depends, ignore = false }: { id: string, version?: string, kind?: DependencyKind, ignore?: boolean }): Dependency {
|
||||
return {
|
||||
id,
|
||||
version: version ?? "*",
|
||||
kind: kind ?? DependencyKind.Depends,
|
||||
ignore: ignore ?? false,
|
||||
getProjectSlug: _ => id
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export default Dependency;
|
Loading…
Reference in a new issue