diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index d0adbd6..56c4941 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -6,17 +6,10 @@ import { getPackagesSidebar, getPackagesNav } from './sidebar.js' const __dirname = path.dirname(fileURLToPath(import.meta.url)) const docsDir = path.resolve(__dirname, '..') -// Auto-discover packages +// Auto-discover packages and build items const packagesSidebar = getPackagesSidebar(docsDir) const packagesNav = getPackagesNav(docsDir) -// Separate PHP/Go from ecosystem packages for nav -const phpNav = packagesNav.find(p => p.link === '/packages/php/') -const goNav = packagesNav.find(p => p.link === '/packages/go/') -const ecosystemNav = packagesNav.filter(p => - p.link !== '/packages/php/' && p.link !== '/packages/go/' -) - export default defineConfig({ title: 'Host UK', description: 'Native application frameworks for PHP and Go', @@ -27,71 +20,74 @@ export default defineConfig({ /^https?:\/\/localhost/, // Old paths during migration /\/packages\/core/, + /\/packages\/(php|go)/, /\/core\//, /\/architecture\//, /\/patterns-guide\//, - // Security pages not yet created - /\/security\/(api-authentication|rate-limiting|workspace-isolation|sql-validation|gdpr)/, + // Security pages moved to /build/php/ + /\/security\//, // Package pages not yet created /\/packages\/admin\/(tables|security|hlcrf|activity)/, /\/packages\/api\/(openapi|analytics|alerts|logging)/, /\/packages\/mcp\/commerce/, - /\/packages\/php\/(services|seeders|security|email-shield|action-gate|i18n)/, + /\/build\/php\/(services|seeders|security|email-shield|action-gate|i18n)/, // Package root links (without trailing slash) - VitePress resolves these - /^\/packages\/(admin|api|mcp|php|go)$/, - /^\/packages\/(admin|api|mcp|php|go)#/, + /^\/packages\/(admin|api|mcp|tenant|commerce|content|developer)$/, + /^\/packages\/(admin|api|mcp|tenant|commerce|content|developer)#/, + /^\/build\/(php|go)$/, + /^\/build\/(php|go)#/, + // Guide moved to /build/php/ + /\/guide\//, // Other pages not yet created /\/testing\//, + /\/changelog/, /\/contributing/, - /\/guide\/testing/, - // Go docs - relative paths + // Go docs - relative paths (cmd moved to /build/cli/) /\.\.\/configuration/, /\.\.\/examples/, + /\.\/cmd\//, ], themeConfig: { logo: '/logo.svg', nav: [ - { text: 'Guide', link: '/guide/getting-started' }, { - text: 'PHP', - link: '/packages/php/', - activeMatch: '/packages/php/' + text: 'Build', + activeMatch: '/build/', + items: [ + { text: 'PHP', link: '/build/php/' }, + { text: 'Go', link: '/build/go/' }, + { text: 'CLI', link: '/build/cli/' } + ] }, { - text: 'Go', - link: '/packages/go/', - activeMatch: '/packages/go/' + text: 'Publish', + activeMatch: '/publish/', + items: [ + { text: 'Overview', link: '/publish/' }, + { text: 'GitHub', link: '/publish/github' }, + { text: 'Docker', link: '/publish/docker' }, + { text: 'npm', link: '/publish/npm' }, + { text: 'Homebrew', link: '/publish/homebrew' }, + { text: 'Scoop', link: '/publish/scoop' }, + { text: 'AUR', link: '/publish/aur' }, + { text: 'Chocolatey', link: '/publish/chocolatey' }, + { text: 'LinuxKit', link: '/publish/linuxkit' } + ] + }, + { + text: 'Deploy', + activeMatch: '/deploy/', + items: [] }, { text: 'Packages', - items: ecosystemNav - }, - { text: 'Security', link: '/security/overview' }, - { - text: 'v1.0', - items: [ - { text: 'Changelog', link: '/changelog' }, - { text: 'Contributing', link: '/contributing' } - ] + items: packagesNav } ], sidebar: { - '/guide/': [ - { - text: 'Introduction', - items: [ - { text: 'Getting Started', link: '/guide/getting-started' }, - { text: 'Installation', link: '/guide/installation' }, - { text: 'Configuration', link: '/guide/configuration' }, - { text: 'Quick Start', link: '/guide/quick-start' }, - { text: 'Testing', link: '/guide/testing' } - ] - } - ], - // Packages index '/packages/': [ { @@ -100,21 +96,27 @@ export default defineConfig({ } ], - // Auto-discovered package sidebars (php, go, admin, api, mcp, etc.) - ...packagesSidebar, - - '/security/': [ + // Publish section + '/publish/': [ { - text: 'Security', + text: 'Publish', items: [ - { text: 'Overview', link: '/security/overview' }, - { text: 'Namespaces & Entitlements', link: '/security/namespaces' }, - { text: 'Changelog', link: '/security/changelog' }, - { text: 'Responsible Disclosure', link: '/security/responsible-disclosure' } + { text: 'Overview', link: '/publish/' }, + { text: 'GitHub', link: '/publish/github' }, + { text: 'Docker', link: '/publish/docker' }, + { text: 'npm', link: '/publish/npm' }, + { text: 'Homebrew', link: '/publish/homebrew' }, + { text: 'Scoop', link: '/publish/scoop' }, + { text: 'AUR', link: '/publish/aur' }, + { text: 'Chocolatey', link: '/publish/chocolatey' }, + { text: 'LinuxKit', link: '/publish/linuxkit' } ] } ], + // Auto-discovered package sidebars (php, go, admin, api, mcp, etc.) + ...packagesSidebar, + '/api/': [ { text: 'API Reference', diff --git a/docs/.vitepress/sidebar.js b/docs/.vitepress/sidebar.js index 5affc9b..843c0f5 100644 --- a/docs/.vitepress/sidebar.js +++ b/docs/.vitepress/sidebar.js @@ -2,7 +2,7 @@ import fs from 'fs' import path from 'path' import matter from 'gray-matter' -// Auto-discover packages from docs/packages/ +// Auto-discover packages from docs/packages/ and docs/build/ // Each package folder should have an index.md // // Frontmatter options: @@ -12,23 +12,32 @@ import matter from 'gray-matter' // collapsed: true - Start group collapsed (for directories) export function getPackagesSidebar(docsDir) { - const packagesDir = path.join(docsDir, 'packages') + return { + ...getSidebarForDir(docsDir, 'packages'), + ...getSidebarForDir(docsDir, 'build'), + ...getSidebarForDir(docsDir, 'publish'), + ...getSidebarForDir(docsDir, 'deploy') + } +} - if (!fs.existsSync(packagesDir)) { +function getSidebarForDir(docsDir, dirName) { + const targetDir = path.join(docsDir, dirName) + + if (!fs.existsSync(targetDir)) { return {} } const sidebar = {} - const packages = fs.readdirSync(packagesDir, { withFileTypes: true }) + const packages = fs.readdirSync(targetDir, { withFileTypes: true }) .filter(d => d.isDirectory()) .map(d => d.name) .sort() for (const pkg of packages) { - const pkgDir = path.join(packagesDir, pkg) + const pkgDir = path.join(targetDir, pkg) // Build sidebar tree recursively - const items = buildSidebarItems(pkgDir, `/packages/${pkg}`) + const items = buildSidebarItems(pkgDir, `/${dirName}/${pkg}`) if (items.length === 0) continue @@ -46,7 +55,7 @@ export function getPackagesSidebar(docsDir) { } } - sidebar[`/packages/${pkg}/`] = [ + sidebar[`/${dirName}/${pkg}/`] = [ { text: packageTitle, items: items diff --git a/docs/packages/go/cmd/ai/example.md b/docs/build/cli/ai/example.md similarity index 100% rename from docs/packages/go/cmd/ai/example.md rename to docs/build/cli/ai/example.md diff --git a/docs/packages/go/cmd/ai/index.md b/docs/build/cli/ai/index.md similarity index 100% rename from docs/packages/go/cmd/ai/index.md rename to docs/build/cli/ai/index.md diff --git a/docs/packages/go/cmd/build/example.md b/docs/build/cli/build/example.md similarity index 100% rename from docs/packages/go/cmd/build/example.md rename to docs/build/cli/build/example.md diff --git a/docs/packages/go/cmd/build/index.md b/docs/build/cli/build/index.md similarity index 100% rename from docs/packages/go/cmd/build/index.md rename to docs/build/cli/build/index.md diff --git a/docs/packages/go/cmd/build/sdk/example.md b/docs/build/cli/build/sdk/example.md similarity index 100% rename from docs/packages/go/cmd/build/sdk/example.md rename to docs/build/cli/build/sdk/example.md diff --git a/docs/packages/go/cmd/build/sdk/index.md b/docs/build/cli/build/sdk/index.md similarity index 100% rename from docs/packages/go/cmd/build/sdk/index.md rename to docs/build/cli/build/sdk/index.md diff --git a/docs/packages/go/cmd/ci/changelog/example.md b/docs/build/cli/ci/changelog/example.md similarity index 100% rename from docs/packages/go/cmd/ci/changelog/example.md rename to docs/build/cli/ci/changelog/example.md diff --git a/docs/packages/go/cmd/ci/changelog/index.md b/docs/build/cli/ci/changelog/index.md similarity index 100% rename from docs/packages/go/cmd/ci/changelog/index.md rename to docs/build/cli/ci/changelog/index.md diff --git a/docs/packages/go/cmd/ci/example.md b/docs/build/cli/ci/example.md similarity index 100% rename from docs/packages/go/cmd/ci/example.md rename to docs/build/cli/ci/example.md diff --git a/docs/packages/go/cmd/ci/index.md b/docs/build/cli/ci/index.md similarity index 100% rename from docs/packages/go/cmd/ci/index.md rename to docs/build/cli/ci/index.md diff --git a/docs/packages/go/cmd/ci/init/example.md b/docs/build/cli/ci/init/example.md similarity index 100% rename from docs/packages/go/cmd/ci/init/example.md rename to docs/build/cli/ci/init/example.md diff --git a/docs/packages/go/cmd/ci/init/index.md b/docs/build/cli/ci/init/index.md similarity index 100% rename from docs/packages/go/cmd/ci/init/index.md rename to docs/build/cli/ci/init/index.md diff --git a/docs/packages/go/cmd/ci/version/example.md b/docs/build/cli/ci/version/example.md similarity index 100% rename from docs/packages/go/cmd/ci/version/example.md rename to docs/build/cli/ci/version/example.md diff --git a/docs/packages/go/cmd/ci/version/index.md b/docs/build/cli/ci/version/index.md similarity index 100% rename from docs/packages/go/cmd/ci/version/index.md rename to docs/build/cli/ci/version/index.md diff --git a/docs/packages/go/cmd/dev/ci/index.md b/docs/build/cli/dev/ci/index.md similarity index 100% rename from docs/packages/go/cmd/dev/ci/index.md rename to docs/build/cli/dev/ci/index.md diff --git a/docs/packages/go/cmd/dev/commit/index.md b/docs/build/cli/dev/commit/index.md similarity index 100% rename from docs/packages/go/cmd/dev/commit/index.md rename to docs/build/cli/dev/commit/index.md diff --git a/docs/packages/go/cmd/dev/example.md b/docs/build/cli/dev/example.md similarity index 100% rename from docs/packages/go/cmd/dev/example.md rename to docs/build/cli/dev/example.md diff --git a/docs/packages/go/cmd/dev/health/index.md b/docs/build/cli/dev/health/index.md similarity index 100% rename from docs/packages/go/cmd/dev/health/index.md rename to docs/build/cli/dev/health/index.md diff --git a/docs/packages/go/cmd/dev/impact/index.md b/docs/build/cli/dev/impact/index.md similarity index 100% rename from docs/packages/go/cmd/dev/impact/index.md rename to docs/build/cli/dev/impact/index.md diff --git a/docs/packages/go/cmd/dev/index.md b/docs/build/cli/dev/index.md similarity index 100% rename from docs/packages/go/cmd/dev/index.md rename to docs/build/cli/dev/index.md diff --git a/docs/packages/go/cmd/dev/issues/index.md b/docs/build/cli/dev/issues/index.md similarity index 100% rename from docs/packages/go/cmd/dev/issues/index.md rename to docs/build/cli/dev/issues/index.md diff --git a/docs/packages/go/cmd/dev/pull/index.md b/docs/build/cli/dev/pull/index.md similarity index 100% rename from docs/packages/go/cmd/dev/pull/index.md rename to docs/build/cli/dev/pull/index.md diff --git a/docs/packages/go/cmd/dev/push/index.md b/docs/build/cli/dev/push/index.md similarity index 100% rename from docs/packages/go/cmd/dev/push/index.md rename to docs/build/cli/dev/push/index.md diff --git a/docs/packages/go/cmd/dev/reviews/index.md b/docs/build/cli/dev/reviews/index.md similarity index 100% rename from docs/packages/go/cmd/dev/reviews/index.md rename to docs/build/cli/dev/reviews/index.md diff --git a/docs/packages/go/cmd/dev/work/example.md b/docs/build/cli/dev/work/example.md similarity index 100% rename from docs/packages/go/cmd/dev/work/example.md rename to docs/build/cli/dev/work/example.md diff --git a/docs/packages/go/cmd/dev/work/index.md b/docs/build/cli/dev/work/index.md similarity index 100% rename from docs/packages/go/cmd/dev/work/index.md rename to docs/build/cli/dev/work/index.md diff --git a/docs/packages/go/cmd/docs/example.md b/docs/build/cli/docs/example.md similarity index 100% rename from docs/packages/go/cmd/docs/example.md rename to docs/build/cli/docs/example.md diff --git a/docs/packages/go/cmd/docs/index.md b/docs/build/cli/docs/index.md similarity index 100% rename from docs/packages/go/cmd/docs/index.md rename to docs/build/cli/docs/index.md diff --git a/docs/packages/go/cmd/doctor/example.md b/docs/build/cli/doctor/example.md similarity index 100% rename from docs/packages/go/cmd/doctor/example.md rename to docs/build/cli/doctor/example.md diff --git a/docs/packages/go/cmd/doctor/index.md b/docs/build/cli/doctor/index.md similarity index 100% rename from docs/packages/go/cmd/doctor/index.md rename to docs/build/cli/doctor/index.md diff --git a/docs/packages/go/cmd/go/cov/example.md b/docs/build/cli/go/cov/example.md similarity index 100% rename from docs/packages/go/cmd/go/cov/example.md rename to docs/build/cli/go/cov/example.md diff --git a/docs/packages/go/cmd/go/cov/index.md b/docs/build/cli/go/cov/index.md similarity index 100% rename from docs/packages/go/cmd/go/cov/index.md rename to docs/build/cli/go/cov/index.md diff --git a/docs/packages/go/cmd/go/example.md b/docs/build/cli/go/example.md similarity index 100% rename from docs/packages/go/cmd/go/example.md rename to docs/build/cli/go/example.md diff --git a/docs/packages/go/cmd/go/fmt/example.md b/docs/build/cli/go/fmt/example.md similarity index 100% rename from docs/packages/go/cmd/go/fmt/example.md rename to docs/build/cli/go/fmt/example.md diff --git a/docs/packages/go/cmd/go/fmt/index.md b/docs/build/cli/go/fmt/index.md similarity index 100% rename from docs/packages/go/cmd/go/fmt/index.md rename to docs/build/cli/go/fmt/index.md diff --git a/docs/packages/go/cmd/go/index.md b/docs/build/cli/go/index.md similarity index 100% rename from docs/packages/go/cmd/go/index.md rename to docs/build/cli/go/index.md diff --git a/docs/packages/go/cmd/go/install/example.md b/docs/build/cli/go/install/example.md similarity index 100% rename from docs/packages/go/cmd/go/install/example.md rename to docs/build/cli/go/install/example.md diff --git a/docs/packages/go/cmd/go/install/index.md b/docs/build/cli/go/install/index.md similarity index 100% rename from docs/packages/go/cmd/go/install/index.md rename to docs/build/cli/go/install/index.md diff --git a/docs/packages/go/cmd/go/lint/example.md b/docs/build/cli/go/lint/example.md similarity index 100% rename from docs/packages/go/cmd/go/lint/example.md rename to docs/build/cli/go/lint/example.md diff --git a/docs/packages/go/cmd/go/lint/index.md b/docs/build/cli/go/lint/index.md similarity index 100% rename from docs/packages/go/cmd/go/lint/index.md rename to docs/build/cli/go/lint/index.md diff --git a/docs/packages/go/cmd/go/mod/download/index.md b/docs/build/cli/go/mod/download/index.md similarity index 100% rename from docs/packages/go/cmd/go/mod/download/index.md rename to docs/build/cli/go/mod/download/index.md diff --git a/docs/packages/go/cmd/go/mod/example.md b/docs/build/cli/go/mod/example.md similarity index 100% rename from docs/packages/go/cmd/go/mod/example.md rename to docs/build/cli/go/mod/example.md diff --git a/docs/packages/go/cmd/go/mod/graph/index.md b/docs/build/cli/go/mod/graph/index.md similarity index 100% rename from docs/packages/go/cmd/go/mod/graph/index.md rename to docs/build/cli/go/mod/graph/index.md diff --git a/docs/packages/go/cmd/go/mod/index.md b/docs/build/cli/go/mod/index.md similarity index 100% rename from docs/packages/go/cmd/go/mod/index.md rename to docs/build/cli/go/mod/index.md diff --git a/docs/packages/go/cmd/go/mod/tidy/index.md b/docs/build/cli/go/mod/tidy/index.md similarity index 100% rename from docs/packages/go/cmd/go/mod/tidy/index.md rename to docs/build/cli/go/mod/tidy/index.md diff --git a/docs/packages/go/cmd/go/mod/verify/index.md b/docs/build/cli/go/mod/verify/index.md similarity index 100% rename from docs/packages/go/cmd/go/mod/verify/index.md rename to docs/build/cli/go/mod/verify/index.md diff --git a/docs/packages/go/cmd/go/test/example.md b/docs/build/cli/go/test/example.md similarity index 100% rename from docs/packages/go/cmd/go/test/example.md rename to docs/build/cli/go/test/example.md diff --git a/docs/packages/go/cmd/go/test/index.md b/docs/build/cli/go/test/index.md similarity index 100% rename from docs/packages/go/cmd/go/test/index.md rename to docs/build/cli/go/test/index.md diff --git a/docs/packages/go/cmd/go/work/index.md b/docs/build/cli/go/work/index.md similarity index 100% rename from docs/packages/go/cmd/go/work/index.md rename to docs/build/cli/go/work/index.md diff --git a/docs/packages/go/cmd/go/work/init/index.md b/docs/build/cli/go/work/init/index.md similarity index 100% rename from docs/packages/go/cmd/go/work/init/index.md rename to docs/build/cli/go/work/init/index.md diff --git a/docs/packages/go/cmd/go/work/sync/index.md b/docs/build/cli/go/work/sync/index.md similarity index 100% rename from docs/packages/go/cmd/go/work/sync/index.md rename to docs/build/cli/go/work/sync/index.md diff --git a/docs/packages/go/cmd/go/work/use/index.md b/docs/build/cli/go/work/use/index.md similarity index 100% rename from docs/packages/go/cmd/go/work/use/index.md rename to docs/build/cli/go/work/use/index.md diff --git a/docs/packages/go/cmd/index.md b/docs/build/cli/index.md similarity index 91% rename from docs/packages/go/cmd/index.md rename to docs/build/cli/index.md index fce3183..9aeee02 100644 --- a/docs/packages/go/cmd/index.md +++ b/docs/build/cli/index.md @@ -28,4 +28,4 @@ go install github.com/host-uk/core/cmd/core@latest Verify: `core doctor` -See [Getting Started](../getting-started.md) for all installation options. +See [Getting Started](/build/go/getting-started) for all installation options. diff --git a/docs/packages/go/cmd/php/example.md b/docs/build/cli/php/example.md similarity index 100% rename from docs/packages/go/cmd/php/example.md rename to docs/build/cli/php/example.md diff --git a/docs/packages/go/cmd/php/index.md b/docs/build/cli/php/index.md similarity index 100% rename from docs/packages/go/cmd/php/index.md rename to docs/build/cli/php/index.md diff --git a/docs/packages/go/cmd/pkg/example.md b/docs/build/cli/pkg/example.md similarity index 100% rename from docs/packages/go/cmd/pkg/example.md rename to docs/build/cli/pkg/example.md diff --git a/docs/packages/go/cmd/pkg/index.md b/docs/build/cli/pkg/index.md similarity index 100% rename from docs/packages/go/cmd/pkg/index.md rename to docs/build/cli/pkg/index.md diff --git a/docs/packages/go/cmd/pkg/search/example.md b/docs/build/cli/pkg/search/example.md similarity index 100% rename from docs/packages/go/cmd/pkg/search/example.md rename to docs/build/cli/pkg/search/example.md diff --git a/docs/packages/go/cmd/pkg/search/index.md b/docs/build/cli/pkg/search/index.md similarity index 100% rename from docs/packages/go/cmd/pkg/search/index.md rename to docs/build/cli/pkg/search/index.md diff --git a/docs/packages/go/cmd/sdk/example.md b/docs/build/cli/sdk/example.md similarity index 100% rename from docs/packages/go/cmd/sdk/example.md rename to docs/build/cli/sdk/example.md diff --git a/docs/packages/go/cmd/sdk/index.md b/docs/build/cli/sdk/index.md similarity index 100% rename from docs/packages/go/cmd/sdk/index.md rename to docs/build/cli/sdk/index.md diff --git a/docs/packages/go/cmd/setup/example.md b/docs/build/cli/setup/example.md similarity index 100% rename from docs/packages/go/cmd/setup/example.md rename to docs/build/cli/setup/example.md diff --git a/docs/packages/go/cmd/setup/index.md b/docs/build/cli/setup/index.md similarity index 100% rename from docs/packages/go/cmd/setup/index.md rename to docs/build/cli/setup/index.md diff --git a/docs/packages/go/cmd/test/example.md b/docs/build/cli/test/example.md similarity index 100% rename from docs/packages/go/cmd/test/example.md rename to docs/build/cli/test/example.md diff --git a/docs/packages/go/cmd/test/index.md b/docs/build/cli/test/index.md similarity index 100% rename from docs/packages/go/cmd/test/index.md rename to docs/build/cli/test/index.md diff --git a/docs/packages/go/cmd/vm/example.md b/docs/build/cli/vm/example.md similarity index 100% rename from docs/packages/go/cmd/vm/example.md rename to docs/build/cli/vm/example.md diff --git a/docs/packages/go/cmd/vm/index.md b/docs/build/cli/vm/index.md similarity index 100% rename from docs/packages/go/cmd/vm/index.md rename to docs/build/cli/vm/index.md diff --git a/docs/packages/go/cmd/vm/templates/example.md b/docs/build/cli/vm/templates/example.md similarity index 100% rename from docs/packages/go/cmd/vm/templates/example.md rename to docs/build/cli/vm/templates/example.md diff --git a/docs/packages/go/cmd/vm/templates/index.md b/docs/build/cli/vm/templates/index.md similarity index 100% rename from docs/packages/go/cmd/vm/templates/index.md rename to docs/build/cli/vm/templates/index.md diff --git a/docs/packages/go/configuration.md b/docs/build/go/configuration.md similarity index 100% rename from docs/packages/go/configuration.md rename to docs/build/go/configuration.md diff --git a/docs/packages/go/getting-started.md b/docs/build/go/getting-started.md similarity index 100% rename from docs/packages/go/getting-started.md rename to docs/build/go/getting-started.md diff --git a/docs/packages/go/glossary.md b/docs/build/go/glossary.md similarity index 100% rename from docs/packages/go/glossary.md rename to docs/build/go/glossary.md diff --git a/docs/packages/go/index.md b/docs/build/go/index.md similarity index 70% rename from docs/packages/go/index.md rename to docs/build/go/index.md index 83f647e..155a047 100644 --- a/docs/packages/go/index.md +++ b/docs/build/go/index.md @@ -1,6 +1,6 @@ -# Core CLI +# Core Go -Core is a unified CLI for the host-uk ecosystem - build, release, and deploy Go, Wails, PHP, and container workloads. +Core is a Go framework for the host-uk ecosystem - build, release, and deploy Go, Wails, PHP, and container workloads. ## Installation @@ -20,21 +20,21 @@ See [Getting Started](getting-started.md) for all installation options including ## Command Reference -See [cmd/](cmd/) for full command documentation. +See [CLI](/build/cli/) for full command documentation. | Command | Description | |---------|-------------| -| [go](cmd/go/) | Go development (test, fmt, lint, cov) | -| [php](cmd/php/) | Laravel/PHP development | -| [build](cmd/build/) | Build Go, Wails, Docker, LinuxKit projects | -| [ci](cmd/ci/) | Publish releases (dry-run by default) | -| [sdk](cmd/sdk/) | SDK generation and validation | -| [dev](cmd/dev/) | Multi-repo workflow + dev environment | -| [pkg](cmd/pkg/) | Package search and install | -| [vm](cmd/vm/) | LinuxKit VM management | -| [docs](cmd/docs/) | Documentation management | -| [setup](cmd/setup/) | Clone repos from registry | -| [doctor](cmd/doctor/) | Check development environment | +| [go](/build/cli/go/) | Go development (test, fmt, lint, cov) | +| [php](/build/cli/php/) | Laravel/PHP development | +| [build](/build/cli/build/) | Build Go, Wails, Docker, LinuxKit projects | +| [ci](/build/cli/ci/) | Publish releases (dry-run by default) | +| [sdk](/build/cli/sdk/) | SDK generation and validation | +| [dev](/build/cli/dev/) | Multi-repo workflow + dev environment | +| [pkg](/build/cli/pkg/) | Package search and install | +| [vm](/build/cli/vm/) | LinuxKit VM management | +| [docs](/build/cli/docs/) | Documentation management | +| [setup](/build/cli/setup/) | Clone repos from registry | +| [doctor](/build/cli/doctor/) | Check development environment | ## Quick Start diff --git a/docs/packages/go/migration.md b/docs/build/go/migration.md similarity index 100% rename from docs/packages/go/migration.md rename to docs/build/go/migration.md diff --git a/docs/packages/go/skill/index.md b/docs/build/go/skill/index.md similarity index 100% rename from docs/packages/go/skill/index.md rename to docs/build/go/skill/index.md diff --git a/docs/packages/go/troubleshooting.md b/docs/build/go/troubleshooting.md similarity index 100% rename from docs/packages/go/troubleshooting.md rename to docs/build/go/troubleshooting.md diff --git a/docs/packages/go/workflows.md b/docs/build/go/workflows.md similarity index 100% rename from docs/packages/go/workflows.md rename to docs/build/go/workflows.md diff --git a/docs/packages/php/actions.md b/docs/build/php/actions.md similarity index 100% rename from docs/packages/php/actions.md rename to docs/build/php/actions.md diff --git a/docs/packages/php/activity.md b/docs/build/php/activity.md similarity index 100% rename from docs/packages/php/activity.md rename to docs/build/php/activity.md diff --git a/docs/packages/php/architecture/custom-events.md b/docs/build/php/architecture/custom-events.md similarity index 100% rename from docs/packages/php/architecture/custom-events.md rename to docs/build/php/architecture/custom-events.md diff --git a/docs/packages/php/architecture/lazy-loading.md b/docs/build/php/architecture/lazy-loading.md similarity index 100% rename from docs/packages/php/architecture/lazy-loading.md rename to docs/build/php/architecture/lazy-loading.md diff --git a/docs/packages/php/architecture/lifecycle-events.md b/docs/build/php/architecture/lifecycle-events.md similarity index 100% rename from docs/packages/php/architecture/lifecycle-events.md rename to docs/build/php/architecture/lifecycle-events.md diff --git a/docs/packages/php/architecture/module-system.md b/docs/build/php/architecture/module-system.md similarity index 100% rename from docs/packages/php/architecture/module-system.md rename to docs/build/php/architecture/module-system.md diff --git a/docs/packages/php/architecture/multi-tenancy.md b/docs/build/php/architecture/multi-tenancy.md similarity index 100% rename from docs/packages/php/architecture/multi-tenancy.md rename to docs/build/php/architecture/multi-tenancy.md diff --git a/docs/packages/php/architecture/performance.md b/docs/build/php/architecture/performance.md similarity index 100% rename from docs/packages/php/architecture/performance.md rename to docs/build/php/architecture/performance.md diff --git a/docs/packages/php/cdn.md b/docs/build/php/cdn.md similarity index 100% rename from docs/packages/php/cdn.md rename to docs/build/php/cdn.md diff --git a/docs/packages/php/configuration.md b/docs/build/php/configuration.md similarity index 100% rename from docs/packages/php/configuration.md rename to docs/build/php/configuration.md diff --git a/docs/packages/php/events.md b/docs/build/php/events.md similarity index 100% rename from docs/packages/php/events.md rename to docs/build/php/events.md diff --git a/docs/guide/getting-started.md b/docs/build/php/getting-started.md similarity index 100% rename from docs/guide/getting-started.md rename to docs/build/php/getting-started.md diff --git a/docs/packages/php/index.md b/docs/build/php/index.md similarity index 100% rename from docs/packages/php/index.md rename to docs/build/php/index.md diff --git a/docs/guide/installation.md b/docs/build/php/installation.md similarity index 100% rename from docs/guide/installation.md rename to docs/build/php/installation.md diff --git a/docs/packages/php/media.md b/docs/build/php/media.md similarity index 100% rename from docs/packages/php/media.md rename to docs/build/php/media.md diff --git a/docs/packages/php/modules.md b/docs/build/php/modules.md similarity index 100% rename from docs/packages/php/modules.md rename to docs/build/php/modules.md diff --git a/docs/security/namespaces.md b/docs/build/php/namespaces.md similarity index 100% rename from docs/security/namespaces.md rename to docs/build/php/namespaces.md diff --git a/docs/packages/php/patterns/actions.md b/docs/build/php/patterns/actions.md similarity index 100% rename from docs/packages/php/patterns/actions.md rename to docs/build/php/patterns/actions.md diff --git a/docs/packages/php/patterns/activity-logging.md b/docs/build/php/patterns/activity-logging.md similarity index 100% rename from docs/packages/php/patterns/activity-logging.md rename to docs/build/php/patterns/activity-logging.md diff --git a/docs/packages/php/patterns/hlcrf.md b/docs/build/php/patterns/hlcrf.md similarity index 100% rename from docs/packages/php/patterns/hlcrf.md rename to docs/build/php/patterns/hlcrf.md diff --git a/docs/packages/php/patterns/repositories.md b/docs/build/php/patterns/repositories.md similarity index 100% rename from docs/packages/php/patterns/repositories.md rename to docs/build/php/patterns/repositories.md diff --git a/docs/packages/php/patterns/seeders.md b/docs/build/php/patterns/seeders.md similarity index 100% rename from docs/packages/php/patterns/seeders.md rename to docs/build/php/patterns/seeders.md diff --git a/docs/packages/php/patterns/services.md b/docs/build/php/patterns/services.md similarity index 100% rename from docs/packages/php/patterns/services.md rename to docs/build/php/patterns/services.md diff --git a/docs/guide/quick-start.md b/docs/build/php/quick-start.md similarity index 100% rename from docs/guide/quick-start.md rename to docs/build/php/quick-start.md diff --git a/docs/packages/php/search.md b/docs/build/php/search.md similarity index 100% rename from docs/packages/php/search.md rename to docs/build/php/search.md diff --git a/docs/security/overview.md b/docs/build/php/security.md similarity index 100% rename from docs/security/overview.md rename to docs/build/php/security.md diff --git a/docs/packages/php/seeder-system.md b/docs/build/php/seeder-system.md similarity index 100% rename from docs/packages/php/seeder-system.md rename to docs/build/php/seeder-system.md diff --git a/docs/packages/php/seo.md b/docs/build/php/seo.md similarity index 100% rename from docs/packages/php/seo.md rename to docs/build/php/seo.md diff --git a/docs/packages/php/service-contracts.md b/docs/build/php/service-contracts.md similarity index 100% rename from docs/packages/php/service-contracts.md rename to docs/build/php/service-contracts.md diff --git a/docs/packages/php/tenancy.md b/docs/build/php/tenancy.md similarity index 100% rename from docs/packages/php/tenancy.md rename to docs/build/php/tenancy.md diff --git a/docs/guide/testing.md b/docs/build/php/testing.md similarity index 100% rename from docs/guide/testing.md rename to docs/build/php/testing.md diff --git a/docs/changelog.md b/docs/changelog.md deleted file mode 100644 index b8c714d..0000000 --- a/docs/changelog.md +++ /dev/null @@ -1,211 +0,0 @@ -# Changelog - -All notable changes to Core PHP Framework will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -### Added -- Comprehensive documentation for all core packages -- Usage alert system for workspace quota monitoring -- Tool analytics and performance tracking for MCP - -### Changed -- Improved workspace context validation -- Enhanced security headers configuration - -## [1.0.0] - 2026-01-26 - -Initial public release of Core PHP Framework. - -### Added - -#### Core Package -- Event-driven module system with lazy loading -- Multi-tenancy with Workspaces and Namespaces -- CDN integration (BunnyCDN, FluxCDN support) -- Actions pattern for business logic -- Configuration management with profiles and versioning -- Activity logging with GDPR compliance -- Media processing with image optimization -- Unified search with analytics -- SEO tools (metadata, sitemaps, structured data) -- Security headers middleware -- Email validation with disposable domain detection -- Privacy helpers (IP hashing, data anonymization) - -#### Admin Package -- HLCRF layout system (Hierarchical Layout Component Rendering Framework) -- Form components with authorization props -- Full-page Livewire modals with file uploads -- Global search with providers and analytics -- Admin menu registry with badges and authorization -- UI components (cards, stats, tables, badges, alerts) -- Authorization integration with Gates and Policies - -#### API Package -- RESTful API with OpenAPI documentation -- API key management with bcrypt hashing -- Scope-based permissions system -- Webhook delivery with HMAC signatures -- Rate limiting with tier-based quotas -- Automatic retry logic with exponential backoff -- OpenAPI 3.0 spec generation -- Multiple documentation viewers (Swagger, Scalar, ReDoc) - -#### MCP Package -- Query Database tool with SQL validation -- Workspace context isolation -- Tool analytics and usage tracking -- Tier-based usage quotas -- SQL injection prevention -- Workspace boundary enforcement -- Performance metrics (P95, P99 latency) -- Error tracking and alerting - -#### Multi-Tenancy -- Workspace isolation with automatic scoping -- Namespace support for agencies/white-label -- Workspace invitations system -- Entitlements and feature gating -- Usage tracking per workspace -- Member management - -### Security - -#### Initial Security Measures -- SQL injection prevention in MCP tools -- Workspace context validation -- API key hashing with bcrypt -- Webhook signature verification (HMAC-SHA256) -- IP address hashing for GDPR -- Security headers (CSP, HSTS, X-Frame-Options) -- Rate limiting per workspace tier -- Scope-based API permissions -- Action Gate for route-level authorization - -## Version History - -### Versioning Scheme - -Core PHP Framework follows [Semantic Versioning](https://semver.org/): - -- **MAJOR** version for incompatible API changes -- **MINOR** version for backwards-compatible functionality -- **PATCH** version for backwards-compatible bug fixes - -### Upgrade Guides - -When upgrading between major versions, refer to the upgrade guide: - -- [Upgrading to 2.0](#) (coming soon) - -### Package Changelogs - -Detailed changelogs for individual packages: - -- [Core Package](/packages/core-php/changelog/) -- [Admin Package](/packages/core-admin/changelog/) -- [API Package](/packages/core-api/changelog/) -- [MCP Package](/packages/core-mcp/changelog/) - -## Release Schedule - -- **Major releases:** Annually -- **Minor releases:** Quarterly -- **Patch releases:** As needed for bug fixes and security - -## Support Policy - -| Version | PHP Version | Laravel Version | Support Until | -|---------|-------------|-----------------|---------------| -| 1.x | 8.2+ | 11.x | 2027-01-26 | - -### Security Updates - -Security updates are provided for: -- Current major version: Full support -- Previous major version: Security fixes only (12 months) - -## Notable Changes by Category - -### Breaking Changes - -None yet! This is the initial release. - -### Deprecations - -None yet! This is the initial release. - -### New Features - -See [1.0.0](#100---2026-01-26) release notes above. - -### Bug Fixes - -This is the initial release, so no bug fixes yet. - -## Migration Guides - -### From Host Hub Internal - -If you're migrating from the internal Host Hub codebase: - -1. **Namespace changes:** - - `App\` → `Core\`, `Mod\`, `Website\` - - Update imports throughout - -2. **Module registration:** - - Remove manual service provider registration - - Modules auto-discovered via `Boot.php` - -3. **Event names:** - - `RouteRegistering` → `WebRoutesRegistering` - - `AdminBooting` → `AdminPanelBooting` - -4. **Configuration:** - - Move config to database with ConfigService - - Use profiles for environment-specific values - -5. **Multi-tenancy:** - - Add `BelongsToWorkspace` trait to models - - Update queries to respect workspace scope - -## Contributing - -See [Contributing Guide](/contributing) for how to contribute to Core PHP Framework. - -## License - -Core PHP Framework is open-source software licensed under the [EUPL-1.2](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12). - -## Credits - -### Core Team - -- [Host UK](https://host.uk) - Original development - -### Contributors - -Thank you to all contributors who have helped shape Core PHP Framework! - -See [Contributors](https://github.com/host-uk/core-php/graphs/contributors) on GitHub. - -### Acknowledgments - -Built with: -- [Laravel](https://laravel.com) - The PHP framework -- [Livewire](https://livewire.laravel.com) - Full-stack framework for Laravel -- [Alpine.js](https://alpinejs.dev) - Lightweight JavaScript framework -- [Tailwind CSS](https://tailwindcss.com) - Utility-first CSS framework - -Special thanks to the open-source community! - ---- - -For more information, visit: -- [Documentation](https://core.help/) -- [GitHub Repository](https://github.com/host-uk/core-php) -- [Issue Tracker](https://github.com/host-uk/core-php/issues) diff --git a/docs/contributing.md b/docs/contributing.md deleted file mode 100644 index 3e0a63c..0000000 --- a/docs/contributing.md +++ /dev/null @@ -1,466 +0,0 @@ -# Contributing to Core PHP Framework - -Thank you for considering contributing to Core PHP Framework! This guide will help you get started. - -## Code of Conduct - -Be respectful, professional, and constructive. We're building open-source software together. - -## How to Contribute - -### Reporting Bugs - -Before creating a bug report: -- Check existing issues to avoid duplicates -- Verify the bug exists in the latest version -- Collect relevant information (PHP version, Laravel version, error messages) - -**Good Bug Report:** - -```markdown -**Description:** API key validation fails with bcrypt-hashed keys - -**Steps to Reproduce:** -1. Create API key: `$key = ApiKey::create(['name' => 'Test'])` -2. Attempt authentication: `GET /api/v1/posts` with key -3. Receive 401 Unauthorized - -**Expected:** Authentication succeeds -**Actual:** Authentication fails -**Version:** v1.0.0 -**PHP:** 8.2.0 -**Laravel:** 11.x -``` - -### Suggesting Features - -Feature requests should include: -- Clear use case -- Example implementation (if possible) -- Impact on existing functionality -- Alternative approaches considered - -### Pull Requests - -1. **Fork the repository** -2. **Create a feature branch:** `git checkout -b feature/my-feature` -3. **Make your changes** (see coding standards below) -4. **Write tests** for your changes -5. **Run test suite:** `composer test` -6. **Commit with clear message:** `feat: add API key rotation` -7. **Push to your fork** -8. **Open pull request** against `main` branch - -## Development Setup - -### Prerequisites - -- PHP 8.2+ -- Composer -- MySQL/PostgreSQL -- Redis (optional, for cache testing) - -### Installation - -```bash -# Clone your fork -git clone https://github.com/YOUR_USERNAME/core-php.git -cd core-php - -# Install dependencies -composer install - -# Copy environment file -cp .env.example .env - -# Run tests -composer test -``` - -### Running Tests - -```bash -# All tests -composer test - -# Specific test file -./vendor/bin/phpunit packages/core-php/tests/Feature/ActivityLogServiceTest.php - -# With coverage -./vendor/bin/phpunit --coverage-html coverage -``` - -## Coding Standards - -### PSR-12 Compliance - -Follow [PSR-12](https://www.php-fig.org/psr/psr-12/) coding standards: - -```php -validated()); - return response()->json($post, 201); -} - -// ❌ Bad -public function store($request) -{ - $post = CreatePost::run($request->validated()); - return response()->json($post, 201); -} -``` - -### Docblocks - -Use docblocks for complex methods: - -```php -/** - * Generate OG image for blog post. - * - * @param Post $post The blog post - * @param array $options Image generation options - * @return string Path to generated image - * @throws ImageGenerationException - */ -public function generateOgImage(Post $post, array $options = []): string -{ - // Implementation -} -``` - -### Naming Conventions - -**Classes:** -- PascalCase -- Descriptive names -- Singular nouns for models - -```php -class Post extends Model {} -class CreatePost extends Action {} -class PostController extends Controller {} -``` - -**Methods:** -- camelCase -- Verb-based names -- Descriptive intent - -```php -public function createPost() {} -public function publishPost() {} -public function getPublishedPosts() {} -``` - -**Variables:** -- camelCase -- Descriptive names -- No abbreviations - -```php -// ✅ Good -$publishedPosts = Post::published()->get(); -$userWorkspace = $user->workspace; - -// ❌ Bad -$p = Post::published()->get(); -$ws = $user->workspace; -``` - -## Module Structure - -Follow the established module pattern: - -``` -src/Mod/MyModule/ -├── Boot.php # Module entry point -├── Controllers/ -│ ├── Web/ -│ └── Api/ -├── Models/ -├── Actions/ -├── Migrations/ -├── Routes/ -│ ├── web.php -│ └── api.php -├── Views/ -│ └── Blade/ -├── Lang/ -│ └── en_GB/ -└── Tests/ - ├── Feature/ - └── Unit/ -``` - -**Boot.php Example:** - -```php - 'onWebRoutes', - AdminPanelBooting::class => 'onAdminPanel', - ]; - - public function onWebRoutes(WebRoutesRegistering $event): void - { - $event->views('mymodule', __DIR__.'/Views'); - $event->routes(fn () => require __DIR__.'/Routes/web.php'); - } - - public function onAdminPanel(AdminPanelBooting $event): void - { - $event->menu(new MyModuleMenuProvider()); - } -} -``` - -## Testing Guidelines - -### Write Tests First - -Follow TDD when possible: - -```php -// 1. Write test -public function test_creates_post(): void -{ - $post = CreatePost::run([ - 'title' => 'Test Post', - 'content' => 'Content', - ]); - - $this->assertDatabaseHas('posts', [ - 'title' => 'Test Post', - ]); -} - -// 2. Implement feature -class CreatePost -{ - use Action; - - public function handle(array $data): Post - { - return Post::create($data); - } -} -``` - -### Test Coverage - -Aim for 80%+ coverage on new code: - -```bash -./vendor/bin/phpunit --coverage-text -``` - -### Test Organization - -```php -class PostTest extends TestCase -{ - // Feature tests - test complete workflows - public function test_user_can_create_post(): void {} - public function test_user_cannot_create_post_without_permission(): void {} - - // Unit tests - test isolated components - public function test_post_is_published(): void {} - public function test_post_has_slug(): void {} -} -``` - -## Commit Messages - -Follow [Conventional Commits](https://www.conventionalcommits.org/): - -``` -(): - - - -