@reliverse/rse
Version:
@reliverse/rse is your all-in-one companion for bootstrapping and improving any kind of projects (especially web apps built with frameworks like Next.js) — whether you're kicking off something new or upgrading an existing app. It is also a little AI-power
52 lines (51 loc) • 2 kB
TypeScript
import type { RseConfig } from "@reliverse/cfg";
import type { SimpleGit } from "simple-git";
import type { GitModParams } from "../../../../sdk-types.js";
import type { InstanceGithub } from "../../../../utils/instanceGithub.js";
import type { RepoOption } from "../../../../utils/projectRepository.js";
import type { ReliverseMemory } from "../../../../utils/schemaMemory.js";
/**
* Initializes Git repository in effectiveDir if not already present.
* Also renames the default branch to config.repoBranch if provided.
*/
export declare function initializeGitRepo(git: SimpleGit, alreadyGit: boolean, config: RseConfig, isTemplateDownload: boolean): Promise<void>;
/**
* Initializes a git repository for the given project.
* If allowReInit is true and a repository exists, it is removed and reinitialized.
*/
export declare function initGitDir(params: GitModParams & {
allowReInit: boolean;
createCommit: boolean;
config: RseConfig;
isTemplateDownload: boolean;
}): Promise<boolean>;
/**
* Creates a commit in the repository.
* If the repository isn't initialized yet, it initializes it.
*/
export declare function createCommit(params: GitModParams & {
message?: string;
config: RseConfig;
isTemplateDownload: boolean;
}): Promise<boolean>;
/**
* Handles GitHub repository creation or usage.
* If the repo does not exist, it is created; if it exists,
* the user is prompted whether to make a new commit, skip commit, or create a new repository.
*/
export declare function handleGithubRepo(params: GitModParams & {
skipPrompts: boolean;
memory: ReliverseMemory;
config: RseConfig;
maskInput: boolean;
selectedTemplate: RepoOption;
isTemplateDownload: boolean;
githubInstance: InstanceGithub;
githubToken: string;
githubUsername: string;
isDev: boolean;
}): Promise<boolean>;
/**
* Pushes local commits to the remote GitHub repository.
*/
export declare function pushGitCommits(params: GitModParams): Promise<boolean>;