承接 adachsoft/repo-gen 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

adachsoft/repo-gen

最新稳定版本:0.1.1

Composer 安装命令:

composer require adachsoft/repo-gen

包简介

Tools for repository generation

README 文档

README

Repo Gen is a small PHP library for bootstrapping new Git repositories for PHP libraries. It focuses on automating the initial repository setup using templates, GitLab integration and optional Packagist registration.

The core entry point is the RepoGenFacade which orchestrates repository initialization and Packagist package creation.

Features

  • Initialize a new Git repository from filesystem templates
  • Create a remote repository via GitLab API (through git-platform integration)
  • Initialize a local Git repository, commit generated files and push to the remote
  • Register the repository as a package on Packagist
  • Simple factory for wiring all dependencies (RepoGenFacadeFactory)
  • CLI helper script bin_dev/initialize_repository for quick manual usage

Installation

Install via Composer:

composer require adachsoft/repo-gen

Note: The package name above assumes the library is published as adachsoft/repo-gen. Adjust it if your fork uses a different vendor or package name.

Requirements

  • PHP 8.1 or higher (as configured in composer.json)
  • Git installed and available on the command line
  • Access to a GitLab instance (or git-platform compatible API) with a personal access token
  • Optional: Packagist account and API token for automatic package registration

Basic usage (Facade)

The main entry point is AdachSoft\\RepoGen\\RepoGenFacadeInterface. You can obtain an instance using the RepoGenFacadeFactory and a configuration DTO:

use AdachSoft\RepoGen\Config\RepoGenConfigDto;
use AdachSoft\RepoGen\Dto\CreatePackagistPackageDto;
use AdachSoft\RepoGen\Dto\InitRepositoryDto;
use AdachSoft\RepoGen\Factory\RepoGenFacadeFactory;

$config = new RepoGenConfigDto(
    basePath: '/var/www',
    gitLabBaseUrl: 'https://gitlab.com',
    gitLabAccessToken: getenv('GIT_LAB_KEY') ?: '',
    gitLabNamespace: 'your-namespace',
    packagistUsername: getenv('PACKAGIST_USERNAME') ?: '',
    packagistApiToken: getenv('PACKAGIST_API_TOKEN') ?: '',
    templateDirectory: __DIR__ . '/var/templates/php-library-default',
    defaultVisibility: 'public',
);

$facade = RepoGenFacadeFactory::createWithDependencies($config)->create();

// Initialize repository (local + remote)
$repositoryDto = $facade->initializeRepository(
    new InitRepositoryDto(
        name: 'my-library',
        description: 'My first library generated with Repo Gen',
        visibility: 'public',
    ),
);

// Optionally register on Packagist
$facade->createPackagistPackage(
    new CreatePackagistPackageDto(
        repositoryUrl: $repositoryDto->url ?? 'https://gitlab.com/your-namespace/my-library.git',
    ),
);

CLI helper

For quick manual usage there is a CLI helper script:

php bin_dev/initialize_repository \
    --base_path=/var/www \
    --name=my-library \
    --description="My awesome library" \
    --visibility=public

The script reads configuration from environment variables (optionally via .env):

  • GIT_LAB_KEY – GitLab personal access token
  • PACKAGIST_USERNAME – Packagist username (also used as GitLab namespace if non-empty)
  • PACKAGIST_API_TOKEN – Packagist API token

It then creates a RepoGenConfigDto, builds all dependencies through RepoGenFacadeFactory::createWithDependencies() and calls RepoGenFacadeInterface::initializeRepository().

Versioning

This project follows Semantic Versioning. The first tagged release is 0.1.0, which introduces the initial public API around RepoGenFacade and its supporting services.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固