Public Access
Merge pull request 'feat: interactive repo configuration wizard (#145)' (#294) from feature/145-repo-wizard into main
Platform: mokoplatform CI / Gate 2: Unit Tests (8.1) (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 2: Unit Tests (8.2) (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 2: Unit Tests (8.3) (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 3: Self-Health Check (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 4: Governance (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 5: Template Integrity (push) Blocked by required conditions
Platform: mokoplatform CI / CI Summary (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 1: Code Quality (push) Failing after 50s
Platform: mokoplatform CI / Gate 2: Unit Tests (8.1) (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 2: Unit Tests (8.2) (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 2: Unit Tests (8.3) (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 3: Self-Health Check (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 4: Governance (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 5: Template Integrity (push) Blocked by required conditions
Platform: mokoplatform CI / CI Summary (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 1: Code Quality (push) Failing after 50s
This commit was merged in pull request #294.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: mokocli.Automation
|
||||
# VERSION: 01.00.00
|
||||
# VERSION: 09.36.01
|
||||
# BRIEF: Auto-create feature branch when an issue is opened
|
||||
|
||||
name: "Universal: Issue Branch"
|
||||
|
||||
@@ -6,7 +6,7 @@ DEFGROUP: MokoPlatform.Root
|
||||
INGROUP: MokoPlatform
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
PATH: /README.md
|
||||
VERSION: 09.36.00
|
||||
VERSION: 09.36.01
|
||||
BRIEF: Project overview and documentation
|
||||
-->
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* INGROUP: MokoPlatform.Scripts
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* PATH: /automation/update_dependencies.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Cross-repo dependency update automation — scan, update, PR, auto-merge
|
||||
*/
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@ const COMMAND_MAP = [
|
||||
'repo:archive' => 'cli/archive_repo.php',
|
||||
'repo:scaffold-client' => 'cli/scaffold_client.php',
|
||||
'repo:provision' => 'cli/client_provision.php',
|
||||
'repo:wizard' => 'cli/repo_wizard.php',
|
||||
'repo:rename-branch' => 'cli/branch_rename.php',
|
||||
'repo:reset-dev' => 'cli/dev_branch_reset.php',
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/branch_rename.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Rename a git branch via Gitea API (create new, update PR, delete old)
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/bulk_workflow_push.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Push a workflow file to all governed repos via the Gitea Contents API
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/bulk_workflow_trigger.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Trigger a workflow across multiple repos at once
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/client_dashboard.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Generate unified client dashboard HTML
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/client_inventory.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Discover and list all client-waas repos with their server configuration status
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/client_provision.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Provision a new client environment end-to-end
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/grafana_dashboard.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Manage Grafana dashboards via API
|
||||
*/
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/joomla_build.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Build a Joomla extension ZIP from manifest — all types supported
|
||||
* NOTE: Called by pre-release and auto-release workflows.
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/joomla_metadata_validate.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Validate MokoGitea repo metadata against Joomla extension manifest XML
|
||||
*/
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/manifest_detect.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Auto-detect manifest fields from source files and optionally push to API
|
||||
*/
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/manifest_integrity.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Cross-check manifest API fields against repo contents across the org
|
||||
*/
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/manifest_licensing.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Ensure licensing tags (updateservers, dlid) in Joomla extension manifests
|
||||
*/
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokocli
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* PATH: /cli/manifest_read.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Read repo metadata from Gitea manifest API, auto-detect the rest
|
||||
*/
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/platform_detect.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Auto-detect repository platform type and optionally update manifest
|
||||
*/
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokocli
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* PATH: /cli/release_cascade.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Cascade release zip to all lower stability channels
|
||||
*/
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/release_publish.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Publish a release and create copies for all lesser stability streams.
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,429 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/* Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: mokocli.CLI
|
||||
* INGROUP: mokocli
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||
* PATH: /cli/repo_wizard.php
|
||||
* BRIEF: Interactive configuration wizard for new repositories
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
require_once __DIR__ . '/../lib/Enterprise/CliFramework.php';
|
||||
|
||||
use MokoCli\{CliFramework, Config, PlatformAdapterFactory};
|
||||
|
||||
/**
|
||||
* Interactive repo setup wizard.
|
||||
*
|
||||
* Walks through platform selection, generates config files, workflows,
|
||||
* and optionally creates the repo on Gitea via API.
|
||||
*
|
||||
* @see https://git.mokoconsulting.tech/MokoConsulting/mokocli/issues/145
|
||||
*/
|
||||
class RepoWizard extends CliFramework
|
||||
{
|
||||
private const PLATFORMS = [
|
||||
'joomla' => 'Joomla extension (component, module, plugin, package)',
|
||||
'dolibarr' => 'Dolibarr ERP module',
|
||||
'nodejs' => 'Node.js / TypeScript project',
|
||||
'python' => 'Python project',
|
||||
'mcp-server' => 'MCP server (Model Context Protocol)',
|
||||
'generic' => 'Generic PHP or multi-language project',
|
||||
];
|
||||
|
||||
private const LICENSES = [
|
||||
'GPL-3.0-or-later' => 'GNU General Public License v3',
|
||||
'MIT' => 'MIT License',
|
||||
'Apache-2.0' => 'Apache License 2.0',
|
||||
'proprietary' => 'Proprietary / All rights reserved',
|
||||
];
|
||||
|
||||
/** Collected wizard answers. */
|
||||
private array $answers = [];
|
||||
|
||||
/** When true, skip all interactive prompts and use defaults. */
|
||||
private bool $nonInteractive = false;
|
||||
|
||||
protected function configure(): void
|
||||
{
|
||||
$this->setDescription('Interactive configuration wizard for new repositories');
|
||||
$this->addArgument('--path', 'Directory to generate files in', '.');
|
||||
$this->addArgument('--create-remote', 'Create repo on Gitea via API', false);
|
||||
$this->addArgument('--non-interactive', 'Use defaults (no prompts)', false);
|
||||
}
|
||||
|
||||
protected function run(): int
|
||||
{
|
||||
$rawPath = $this->getArgument('--path', '.');
|
||||
$targetPath = realpath($rawPath) ?: $rawPath;
|
||||
$this->nonInteractive = (bool) $this->getArgument('--non-interactive', false);
|
||||
|
||||
// Validate target path
|
||||
if (!is_dir($targetPath) && !@mkdir($targetPath, 0755, true)) {
|
||||
$this->log('ERROR', "Target path does not exist and cannot be created: {$targetPath}");
|
||||
return self::EXIT_USAGE;
|
||||
}
|
||||
$targetPath = realpath($targetPath) ?: $targetPath;
|
||||
|
||||
$this->section('MokoCli Repository Wizard');
|
||||
|
||||
// ── Gather info ──────────────────────────────────────────────
|
||||
$this->answers['name'] = $this->ask('Repository name', basename($targetPath));
|
||||
$this->answers['platform'] = $this->choose('Platform type', self::PLATFORMS, 'generic');
|
||||
$this->answers['org'] = $this->ask('Organization', 'MokoConsulting');
|
||||
$this->answers['description'] = $this->ask('Description', '');
|
||||
$this->answers['license'] = $this->choose('License', self::LICENSES, 'GPL-3.0-or-later');
|
||||
|
||||
// ── Confirm ──────────────────────────────────────────────────
|
||||
$this->section('Configuration Summary');
|
||||
foreach ($this->answers as $key => $value) {
|
||||
$this->log('INFO', sprintf(' %-12s %s', $key . ':', $value));
|
||||
}
|
||||
|
||||
if (!$this->confirm('Proceed with these settings?', true)) {
|
||||
$this->log('INFO', 'Wizard cancelled');
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ── Generate files ───────────────────────────────────────────
|
||||
$this->section('Generating files');
|
||||
$generated = $this->generateFiles($targetPath);
|
||||
|
||||
foreach ($generated as $file) {
|
||||
$this->status(true, $file);
|
||||
}
|
||||
|
||||
// ── Create remote repo ───────────────────────────────────────
|
||||
if ($this->getArgument('--create-remote', false)) {
|
||||
$this->section('Creating remote repository');
|
||||
$this->createRemoteRepo();
|
||||
}
|
||||
|
||||
$this->log('INFO', '');
|
||||
$this->log('INFO', 'Generated ' . count($generated) . " files in {$targetPath}");
|
||||
$this->log('INFO', 'Next: git init && git add -A && git commit -m "chore: initial scaffold"');
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ── File generation ──────────────────────────────────────────────
|
||||
|
||||
private function generateFiles(string $path): array
|
||||
{
|
||||
$platform = $this->answers['platform'];
|
||||
$name = $this->answers['name'];
|
||||
$generated = [];
|
||||
|
||||
// .editorconfig
|
||||
$generated[] = $this->writeFile($path, '.editorconfig', $this->editorconfig());
|
||||
|
||||
// README.md
|
||||
$generated[] = $this->writeFile($path, 'README.md', $this->readme());
|
||||
|
||||
// CHANGELOG.md
|
||||
$generated[] = $this->writeFile($path, 'CHANGELOG.md', $this->changelog());
|
||||
|
||||
// LICENSE
|
||||
if ($this->answers['license'] !== 'proprietary') {
|
||||
$generated[] = $this->writeFile($path, 'LICENSE', "See SPDX: {$this->answers['license']}");
|
||||
}
|
||||
|
||||
// Platform-specific configs
|
||||
switch ($platform) {
|
||||
case 'joomla':
|
||||
case 'dolibarr':
|
||||
case 'generic':
|
||||
$generated[] = $this->writeFile($path, 'phpcs.xml', $this->phpcsXml());
|
||||
$generated[] = $this->writeFile($path, 'phpstan.neon', $this->phpstanNeon());
|
||||
$generated[] = $this->writeFile($path, 'composer.json', $this->composerJson());
|
||||
break;
|
||||
case 'nodejs':
|
||||
case 'mcp-server':
|
||||
$generated[] = $this->writeFile($path, 'package.json', $this->packageJson());
|
||||
$generated[] = $this->writeFile($path, 'tsconfig.json', $this->tsconfigJson());
|
||||
$generated[] = $this->writeFile($path, '.eslintrc.json', $this->eslintrc());
|
||||
break;
|
||||
case 'python':
|
||||
$generated[] = $this->writeFile($path, 'pyproject.toml', $this->pyprojectToml());
|
||||
$generated[] = $this->writeFile($path, 'requirements.txt', '');
|
||||
break;
|
||||
}
|
||||
|
||||
// .mokogitea/workflows
|
||||
$generated[] = $this->writeFile($path, '.mokogitea/workflows/pr-check.yml',
|
||||
"# PR check workflow — synced from mokocli templates\n# Run: moko sync to update\n");
|
||||
|
||||
// .gitignore
|
||||
$generated[] = $this->writeFile($path, '.gitignore', $this->gitignore($platform));
|
||||
|
||||
// Source directory
|
||||
$srcDir = in_array($platform, ['joomla', 'dolibarr', 'generic']) ? 'source' : 'src';
|
||||
if (!is_dir("{$path}/{$srcDir}")) {
|
||||
@mkdir("{$path}/{$srcDir}", 0755, true);
|
||||
$generated[] = "{$srcDir}/";
|
||||
}
|
||||
|
||||
return array_filter($generated);
|
||||
}
|
||||
|
||||
private function writeFile(string $basePath, string $relativePath, string $content): ?string
|
||||
{
|
||||
$fullPath = $basePath . '/' . $relativePath;
|
||||
$dir = dirname($fullPath);
|
||||
|
||||
if (file_exists($fullPath)) {
|
||||
$this->log('DEBUG', " SKIP {$relativePath} (already exists)");
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($this->dryRun) {
|
||||
$this->log('INFO', "[dry-run] Would create {$relativePath}");
|
||||
return $relativePath;
|
||||
}
|
||||
|
||||
if (!is_dir($dir)) {
|
||||
@mkdir($dir, 0755, true);
|
||||
}
|
||||
|
||||
file_put_contents($fullPath, $content);
|
||||
return $relativePath;
|
||||
}
|
||||
|
||||
// ── Remote repo creation ─────────────────────────────────────────
|
||||
|
||||
private function createRemoteRepo(): void
|
||||
{
|
||||
try {
|
||||
$config = Config::load();
|
||||
$adapter = PlatformAdapterFactory::create($config);
|
||||
$org = $this->answers['org'];
|
||||
|
||||
if ($this->dryRun) {
|
||||
$this->log('INFO', "[dry-run] Would create {$org}/{$this->answers['name']} on Gitea");
|
||||
return;
|
||||
}
|
||||
|
||||
$result = $adapter->createRepository($org, $this->answers['name'], [
|
||||
'description' => $this->answers['description'],
|
||||
'private' => false,
|
||||
]);
|
||||
|
||||
$url = $result['html_url'] ?? "{$org}/{$this->answers['name']}";
|
||||
$this->log('INFO', "Created: {$url}");
|
||||
} catch (\Exception $e) {
|
||||
$this->log('ERROR', "Failed to create remote repo: {$e->getMessage()}");
|
||||
}
|
||||
}
|
||||
|
||||
// ── Interactive helpers (respect --non-interactive) ─────────────
|
||||
|
||||
private function ask(string $prompt, string $default): string
|
||||
{
|
||||
if ($this->nonInteractive) {
|
||||
return $default;
|
||||
}
|
||||
return $this->input($prompt, $default);
|
||||
}
|
||||
|
||||
private function choose(string $prompt, array $options, string $default): string
|
||||
{
|
||||
if ($this->nonInteractive) {
|
||||
return $default;
|
||||
}
|
||||
$keys = array_keys($options);
|
||||
$labels = [];
|
||||
foreach ($options as $key => $desc) {
|
||||
$labels[] = "{$key} — {$desc}";
|
||||
}
|
||||
$chosen = $this->select($prompt, $labels);
|
||||
// Extract the key from "key — description"
|
||||
$chosenKey = explode(' — ', $chosen, 2)[0] ?? $default;
|
||||
return in_array($chosenKey, $keys, true) ? $chosenKey : $default;
|
||||
}
|
||||
|
||||
// ── Template content ─────────────────────────────────────────────
|
||||
|
||||
private function editorconfig(): string
|
||||
{
|
||||
return <<<'CONF'
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
CONF;
|
||||
}
|
||||
|
||||
private function readme(): string
|
||||
{
|
||||
$name = $this->answers['name'];
|
||||
$desc = $this->answers['description'] ?: 'A Moko Consulting project.';
|
||||
$license = $this->answers['license'];
|
||||
|
||||
return <<<MD
|
||||
# {$name}
|
||||
|
||||
{$desc}
|
||||
|
||||
## License
|
||||
|
||||
{$license}
|
||||
MD;
|
||||
}
|
||||
|
||||
private function changelog(): string
|
||||
{
|
||||
return <<<MD
|
||||
# Changelog
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- Initial project scaffold
|
||||
MD;
|
||||
}
|
||||
|
||||
private function composerJson(): string
|
||||
{
|
||||
$data = [
|
||||
'name' => 'mokoconsulting/' . strtolower($this->answers['name']),
|
||||
'description' => $this->answers['description'] ?: $this->answers['name'],
|
||||
'type' => 'library',
|
||||
'license' => $this->answers['license'],
|
||||
'require' => ['php' => '>=8.1'],
|
||||
'autoload' => ['psr-4' => new \stdClass()],
|
||||
];
|
||||
return json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
|
||||
}
|
||||
|
||||
private function phpcsXml(): string
|
||||
{
|
||||
return <<<'XML'
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="MokoCli">
|
||||
<rule ref="PSR12"/>
|
||||
<file>source/</file>
|
||||
<exclude-pattern>vendor/*</exclude-pattern>
|
||||
</ruleset>
|
||||
XML;
|
||||
}
|
||||
|
||||
private function phpstanNeon(): string
|
||||
{
|
||||
return <<<'NEON'
|
||||
parameters:
|
||||
level: 6
|
||||
paths:
|
||||
- source/
|
||||
NEON;
|
||||
}
|
||||
|
||||
private function packageJson(): string
|
||||
{
|
||||
$data = [
|
||||
'name' => '@mokoconsulting/' . strtolower($this->answers['name']),
|
||||
'version' => '0.1.0',
|
||||
'description' => $this->answers['description'] ?: $this->answers['name'],
|
||||
'type' => 'module',
|
||||
'scripts' => ['build' => 'tsc', 'start' => 'node dist/index.js'],
|
||||
'devDependencies' => ['typescript' => '^5.0'],
|
||||
];
|
||||
return json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
|
||||
}
|
||||
|
||||
private function tsconfigJson(): string
|
||||
{
|
||||
return <<<'JSON'
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"strict": true,
|
||||
"declaration": true
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
JSON;
|
||||
}
|
||||
|
||||
private function eslintrc(): string
|
||||
{
|
||||
return <<<'JSON'
|
||||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"]
|
||||
}
|
||||
JSON;
|
||||
}
|
||||
|
||||
private function pyprojectToml(): string
|
||||
{
|
||||
$name = strtolower($this->answers['name']);
|
||||
$desc = str_replace(['\\', '"'], ['\\\\', '\\"'], $this->answers['description'] ?: $this->answers['name']);
|
||||
|
||||
return <<<TOML
|
||||
[project]
|
||||
name = "{$name}"
|
||||
version = "0.1.0"
|
||||
description = "{$desc}"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools>=68.0"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
TOML;
|
||||
}
|
||||
|
||||
private function gitignore(string $platform): string
|
||||
{
|
||||
$common = <<<'GI'
|
||||
# IDE
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
desktop.ini
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
GI;
|
||||
|
||||
$extra = match ($platform) {
|
||||
'joomla', 'dolibarr', 'generic' => "\n# PHP\nvendor/\n.phpunit.result.cache\n",
|
||||
'nodejs', 'mcp-server' => "\n# Node\nnode_modules/\ndist/\n*.tsbuildinfo\n",
|
||||
'python' => "\n# Python\n__pycache__/\n*.pyc\n.venv/\n*.egg-info/\n",
|
||||
default => '',
|
||||
};
|
||||
|
||||
return $common . $extra;
|
||||
}
|
||||
}
|
||||
|
||||
$app = new RepoWizard('repo_wizard');
|
||||
exit($app->execute());
|
||||
@@ -12,7 +12,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/scaffold_client.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Scaffold a new client-waas repo from Template-Client-WaaS with pre-configured settings
|
||||
*/
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/updates_xml_sync.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Sync updates.xml to target branches via Gitea API
|
||||
* NOTE: Called by pre-release and auto-release workflows after updates.xml
|
||||
* is modified on the current branch. Pushes the file to other branches
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/version_auto_bump.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Auto patch-bump, set stability suffix, and commit — single CLI replacing inline workflow bash
|
||||
*/
|
||||
|
||||
|
||||
@@ -370,7 +370,7 @@ class VersionBumpCli extends CliFramework
|
||||
/**
|
||||
* Scan git release tags for the highest version across all channels.
|
||||
*
|
||||
* Checks release names like "MokoSuiteClient (VERSION: 09.36.00)" in
|
||||
* Checks release names like "MokoSuiteClient (VERSION: 09.36.01)" in
|
||||
* git tags (stable, release-candidate, development, etc.) to find the
|
||||
* highest version that has been released on any channel.
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/version_check.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Validate version consistency across README, manifests, and sub-packages
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
* INGROUP: mokoplatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /cli/wiki_sync.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Sync select wiki pages from mokoplatform to all template repos
|
||||
*/
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: moko-platform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
* PATH: /cli/workflow_sync.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Sync workflows from Generic → platform templates → live repos based on manifest.platform
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /deploy/backup-before-deploy.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Snapshot Joomla directories before deployment for rollback capability
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /deploy/deploy-dolibarr.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Deploy Dolibarr module files to a remote server via SFTP/rsync
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /deploy/health-check.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Post-deploy health check — verify a Joomla site is responding correctly
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /deploy/rollback-joomla.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Rollback a Joomla deployment by restoring from a pre-deploy snapshot
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /deploy/sync-joomla.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Sync Joomla site directories between two servers via rsync over SSH
|
||||
*/
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
DEFGROUP: dolibarr-api-mcp.Documentation
|
||||
INGROUP: dolibarr-api-mcp
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/dolibarr-api-mcp
|
||||
VERSION: 09.36.00
|
||||
VERSION: 09.36.01
|
||||
PATH: ./CONTRIBUTING.md
|
||||
BRIEF: Contribution guidelines for the project
|
||||
-->
|
||||
|
||||
@@ -10,7 +10,7 @@ DEFGROUP: dolibarr-api-mcp.Documentation
|
||||
INGROUP: dolibarr-api-mcp
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/dolibarr-api-mcp
|
||||
PATH: /SECURITY.md
|
||||
VERSION: 09.36.00
|
||||
VERSION: 09.36.01
|
||||
BRIEF: Security vulnerability reporting and handling policy
|
||||
-->
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
DEFGROUP:
|
||||
INGROUP: Project.Documentation
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoCli-Template-Generic
|
||||
VERSION: 09.36.00
|
||||
VERSION: 09.36.01
|
||||
PATH: ./CONTRIBUTING.md
|
||||
BRIEF: Contribution guidelines for the project
|
||||
-->
|
||||
|
||||
@@ -23,7 +23,7 @@ DEFGROUP: [PROJECT_NAME]
|
||||
INGROUP: [PROJECT_NAME].Documentation
|
||||
REPO: [REPOSITORY_URL]
|
||||
PATH: /SECURITY.md
|
||||
VERSION: 09.36.00
|
||||
VERSION: 09.36.01
|
||||
BRIEF: Security vulnerability reporting and handling policy
|
||||
-->
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class VersionBumpTest extends TestCase
|
||||
{
|
||||
file_put_contents(
|
||||
"{$this->tmpDir}/README.md",
|
||||
"<!-- VERSION: 09.36.00 -->\nSome content\n"
|
||||
"<!-- VERSION: 09.36.01 -->\nSome content\n"
|
||||
);
|
||||
|
||||
$this->execute();
|
||||
|
||||
@@ -34,7 +34,7 @@ class VersionReadTest extends TestCase
|
||||
{
|
||||
file_put_contents(
|
||||
"{$this->tmpDir}/README.md",
|
||||
"# Test\n<!-- VERSION: 09.36.00 -->\n"
|
||||
"# Test\n<!-- VERSION: 09.36.01 -->\n"
|
||||
);
|
||||
|
||||
$this->assertSame('02.03.04', trim($this->runScript()));
|
||||
@@ -68,7 +68,7 @@ class VersionReadTest extends TestCase
|
||||
{
|
||||
file_put_contents(
|
||||
"{$this->tmpDir}/README.md",
|
||||
"<!-- VERSION: 09.36.00 -->\n"
|
||||
"<!-- VERSION: 09.36.01 -->\n"
|
||||
);
|
||||
mkdir("{$this->tmpDir}/src", 0755, true);
|
||||
file_put_contents(
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* INGROUP: MokoPlatform
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
* PATH: /validate/check_file_integrity.php
|
||||
* VERSION: 09.36.00
|
||||
* VERSION: 09.36.01
|
||||
* BRIEF: Compare deployed files on a remote server against the local repository to detect drift
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user