Skip to content

Commit 2749e7e

Browse files
palickoclaude
andcommitted
chore: release webentor-core 0.12.0 and starter 2.0.6
Move init.php bootstrap into WebentorCoreServiceProvider. Consumer themes no longer need to manually require_once webentor-core/init.php — Acorn auto-discovers the provider and its boot() now loads all core app files, defines path constants, and includes the optional vendor autoload. BREAKING (core 0.12.0): init.php is removed. Consumer themes must delete the require_once WEBENTOR_CORE_PHP_PATH . '/init.php' line from functions.php. Keep the WEBENTOR_CORE_PHP_PATH define — config/view.php still uses it to register core view paths. Starter 2.0.6 + theme 2.0.6 updated alongside: functions.php no longer requires init.php, composer/package constraints bumped to ^0.12. Compatibility matrix updated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 56f74a4 commit 2749e7e

14 files changed

Lines changed: 67 additions & 41 deletions

File tree

docs/src/architecture/theme-architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ High-level overview of how Webentor Core integrates with a Sage theme.
44

55
## Boot flow
66

7-
- init.php: defines paths and loads Core modules (blocks, images, utils, build glue).
7+
- `WebentorCoreServiceProvider` (auto-discovered by Acorn via `extra.acorn.providers` in `webentor-core/composer.json`): defines Core path constants, loads Core modules (blocks, images, utils, build glue), registers Blade directives and View Components.
88
- Block registration: scans `resources/blocks/**/block.json` in theme and Core, registers each block.
99
- Frontend assets: for each block, matches Vite manifest to add `script.ts` and `style.css` handles, injected into block metadata.
1010
- Server-side rendering: blocks render via Blade views (`resources/blocks/<slug>/view.blade.php`) with computed classes and optional `additional_data`.

docs/src/compatibility-matrix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
| starterVersion | themeVersion | coreVersion | configsVersion | setupCliVersion | php | node |
66
| --- | --- | --- | --- | --- | --- | --- |
7+
| 2.0.6 | 2.0.6 | 0.12.0 | 1.0.2 | 1.0.3 | >=8.3 | >=20 |
78
| 2.0.5 | 2.0.5 | 0.11.0 | 1.0.2 | 1.0.3 | >=8.3 | >=20 |
89
| 2.0.4 | 2.0.4 | 0.10.1 | 1.0.2 | 1.0.3 | >=8.3 | >=20 |
910
| 2.0.3 | 2.0.4 | 0.10.0 | 1.0.2 | 1.0.2 | >=8.3 | >=20 |

packages/webentor-core/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Webentor Core Changelog
22

3+
## 0.12.0
4+
5+
- **BREAKING**: Remove `init.php` entry point. Bootstrap logic (constant defines, optional vendor autoload, core app file requires) moved into `WebentorCoreServiceProvider`. Acorn auto-discovery handles loading — consumer themes must no longer manually `require_once WEBENTOR_CORE_PHP_PATH . '/init.php'` from `functions.php`.
6+
- Migration: delete the `require_once WEBENTOR_CORE_PHP_PATH . '/init.php'` line from your theme's `functions.php`. Keep the `WEBENTOR_CORE_PHP_PATH` define — it's still consumed by `config/view.php` to register core view paths. Then run `composer update webikon/webentor-core && wp acorn optimize:clear`.
7+
38
## 0.11.0
49

510
- Add responsive spacing settings for WP Core blocks (`core/paragraph`, `core/heading`) — spacing panel appears automatically, classes rendered on frontend via `WP_HTML_Tag_Processor`

packages/webentor-core/app/Providers/WebentorCoreServiceProvider.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,50 @@
1212

1313
class WebentorCoreServiceProvider extends ServiceProvider
1414
{
15+
public function register(): void
16+
{
17+
// WEBENTOR_CORE_PHP_PATH is normally defined by the consumer theme's
18+
// functions.php (it's also consumed by config/view.php, which runs
19+
// before providers register). Fallback to the package directory so
20+
// the provider still works in contexts where the consumer omitted it.
21+
if (!defined('WEBENTOR_CORE_PHP_PATH')) {
22+
define('WEBENTOR_CORE_PHP_PATH', dirname(__DIR__, 2));
23+
}
24+
25+
if (!defined('WEBENTOR_CORE_PUBLIC_PATH')) {
26+
define('WEBENTOR_CORE_PUBLIC_PATH', WEBENTOR_CORE_PHP_PATH . '/public/build');
27+
}
28+
if (!defined('WEBENTOR_CORE_MANIFEST_PATH')) {
29+
define('WEBENTOR_CORE_MANIFEST_PATH', WEBENTOR_CORE_PUBLIC_PATH . '/manifest.json');
30+
}
31+
if (!defined('WEBENTOR_CORE_RESOURCES_PATH')) {
32+
define('WEBENTOR_CORE_RESOURCES_PATH', WEBENTOR_CORE_PHP_PATH . '/resources');
33+
}
34+
if (!defined('WEBENTOR_CORE_VITE_MANIFEST_DIR')) {
35+
define('WEBENTOR_CORE_VITE_MANIFEST_DIR', WEBENTOR_CORE_PHP_PATH . '/public/build');
36+
}
37+
if (!defined('WEBENTOR_CORE_RESOURCES_DIR')) {
38+
define('WEBENTOR_CORE_RESOURCES_DIR', WEBENTOR_CORE_PHP_PATH . '/resources');
39+
}
40+
41+
if (file_exists($composer = WEBENTOR_CORE_PHP_PATH . '/vendor/autoload.php')) {
42+
require_once $composer;
43+
}
44+
}
45+
1546
public function boot(): void
1647
{
48+
// Load core app bootstrap files (hook registrations, helpers, CLI).
49+
require_once WEBENTOR_CORE_PHP_PATH . '/app/acf.php';
50+
require_once WEBENTOR_CORE_PHP_PATH . '/app/blocks-init.php';
51+
require_once WEBENTOR_CORE_PHP_PATH . '/app/blocks-settings.php';
52+
require_once WEBENTOR_CORE_PHP_PATH . '/app/blocks-migration.php';
53+
require_once WEBENTOR_CORE_PHP_PATH . '/app/CloudinaryClient.php';
54+
require_once WEBENTOR_CORE_PHP_PATH . '/app/i18n.php';
55+
require_once WEBENTOR_CORE_PHP_PATH . '/app/images.php';
56+
require_once WEBENTOR_CORE_PHP_PATH . '/app/setup-core.php';
57+
require_once WEBENTOR_CORE_PHP_PATH . '/app/utils.php';
58+
1759
// Register Blade directives
1860
Blade::directive('sliderContent', new SliderContentBladeDirective());
1961
Blade::directive('enqueueScripts', new EnqueueScriptsBladeDirective());

packages/webentor-core/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webikon/webentor-core",
3-
"version": "0.11.0",
3+
"version": "0.12.0",
44
"license": "MIT",
55
"description": "Webentor Core package",
66
"homepage": "https://webikon.sk",

packages/webentor-core/init.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

packages/webentor-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@webikon/webentor-core",
33
"homepage": "https://webikon.sk",
4-
"version": "0.11.0",
4+
"version": "0.12.0",
55
"description": "Core functionality and useful utilities for Webentor Stack",
66
"license": "MIT",
77
"author": "Webikon s.r.o.",

packages/webentor-starter/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Webentor Starter Changelog
22

3+
### 2.0.6
4+
5+
- Bump `webentor-core` to `^0.12`
6+
- Remove manual `require_once WEBENTOR_CORE_PHP_PATH . '/init.php'` from `functions.php` — webentor-core now loads via `WebentorCoreServiceProvider` (Acorn auto-discovery)
7+
38
### 2.0.5
49

510
- Remove Blade directives and View Components from theme (now provided by `webentor-core` ServiceProvider)

packages/webentor-starter/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "webikon/webentor-starter",
33
"type": "project",
4-
"version": "2.0.5",
4+
"version": "2.0.6",
55
"license": "MIT",
66
"description": "WordPress boilerplate with Composer, easier configuration, and an improved folder structure",
77
"homepage": "https://roots.io/bedrock/",

packages/webentor-starter/web/app/themes/webentor-theme-v2/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Webentor Theme Changelog
22

3+
### Version 2.0.6
4+
5+
- Bump `webentor-core` to `^0.12`
6+
- Remove `require_once WEBENTOR_CORE_PHP_PATH . '/init.php'` from `functions.php` — webentor-core now auto-loads via `WebentorCoreServiceProvider` (Acorn auto-discovery). The `WEBENTOR_CORE_PHP_PATH` constant define is kept because `config/view.php` still uses it for core view paths.
7+
38
### Version 2.0.5
49

510
- Remove Blade directives (`@sliderContent`, `@enqueueScripts`, `@xdebugBreak`) — now registered by `WebentorCoreServiceProvider`

0 commit comments

Comments
 (0)