Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,4 @@ composer.phar

# ignores the cache files
.php-cs-fixer.cache
/.phpunit.cache

# env files
../app/.env
../app/.env.example
/.phpunit.cache
4 changes: 2 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @see https://webifycms.com/extension/base
*
* @copyright Copyright (c) 2023 - Present WebifyCMS
* @license https://webifycms.com/extension/base/license
* @license https://webifycms.com/license
* @author Mohammed Shifreen <mshifreen@gmail.com>
*/
declare(strict_types=1);
Expand All @@ -33,7 +33,7 @@
@see https://webifycms.com/extension/base

@copyright Copyright (c) 2023 - Present WebifyCMS
@license https://webifycms.com/extension/base/license
@license https://webifycms.com/license
@author Mohammed Shifreen <mshifreen@gmail.com>
HEADER;
$rules = [
Expand Down
57 changes: 57 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# WebifyCMS Base Extension (shared-kernel)

Package `webifycms/ext-base` (composer type `webifycms-extension`). The foundation
layer of WebifyCMS. Every other extension depends on it. It is NOT a standalone
application — it provides the bootstrap lifecycle, domain building blocks, the
infrastructure stack, and the contracts that make extensions composable.

## Layout

```
src/Application/ # application-layer service contracts (ConfigInterface)
src/Contract/ # shared contracts: Collection, Translation, Exception, helpers
src/Domain/
Contract/ # Authorization, Authentication, Identity
Entity/AggregateRoot.php
Event/ # DomainEventInterface, DomainEventPublisherInterface
Exception/
Service/ # SlugifyInterface, UlidGeneratorInterface
ValueObject/ # AggregateId, Email, Slug, DateTime, SecureToken
src/Infrastructure/
Container/ # PhpDiContainerBuilder
Container/Definitions/# Console, Event, Http, Logging definition groups
Contract/ # ExtensionInterface, ServiceProviderInterface, bootstrap,
# definition groups, error handler, escaper
Environment/
Event/ # LeagueDomainEventPublisher (PSR-14 bridge)
Helper/ # Escaper
Kernel/ # Http + Console kernels
Provider/ # BaseServiceProvider
Service/ # Application, Config, SymfonyAsciiSlugify, SymfonyUlidGenerator
```

## Conventions

- Namespace `Webify\Base\*` (autoload `Webify\Base\` → `src/`); tests `Webify\Base\Test\` → `test/`.
- Two provider styles: `ServiceProviderInterface::getDefinitions()` (pre-build) and
`BootstrapServiceProviderInterface::bootstrap()` (post-build).
- Extension entry points implement `ExtensionInterface`.
- ARCHITECTURE IS ENFORCED by PHPat (`test/Architecture/ArchitectureSpec.php`):
dependency direction must be Domain → Application → Infrastructure.
- VOs immutable + `fromNative()`/`toNative()` (string-backed enums allowed); aggregates extend `AggregateRoot`.

## Notes

- The theming system (template resolution, theme inheritance, rendering,
assets) is designed but **not implemented** in this package yet — see
`docs/theming/architecture.md` for the design pending contract implementation.

## Verification

```bash
composer test # PHPUnit (incl. architecture spec)
composer analyse # PHPStan level 8
composer sniff # PHP-CS-Fixer dry-run
composer code-check # analyse + sniff
composer code-format # PHP-CS-Fixer fix
```
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "webifycms/ext-base",
"description": "The WebifyCMS base extension serves as the foundation for the entire application, holding abstractions and reusable components. It is adjusted as needed when new features are introduced.",
"license": "MIT",
"version": "0.1.0-alpha",
"type": "webifycms-extension",
"authors": [
{
Expand All @@ -13,6 +14,7 @@
"prefer-stable": true,
"require": {
"php": ">=8.4",
"psr/cache": "^3.0",
"psr/http-message": "^2.0",
"psr/http-factory": "^1.1",
"psr/http-server-handler": "^1.0",
Expand All @@ -29,6 +31,7 @@
"league/event": "^3.0",
"illuminate/database": "^13.12",
"symfony/cache": "^8.1",
"symfony/filesystem": "^8.1",
"symfony/translation": "^8.1",
"symfony/console": "^8.1",
"symfony/uid": "^8.1",
Expand All @@ -52,8 +55,7 @@
},
"autoload-dev": {
"psr-4": {
"Webify\\Base\\Test\\": "test/",
"Webify\\Base\\Dev\\": "dev/"
"Webify\\Base\\Test\\": "test/"
}
},
"optimize-autoloader": true,
Expand Down
Loading
Loading