Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update Manager Refactor #1259

Draft
wants to merge 66 commits into
base: wip/support-uploading-packages
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
f698d3a
Init wip
jaxwilko Nov 29, 2024
9546fbd
Work in progress... do not try and run it :(
jaxwilko Dec 3, 2024
abdb18f
Added winter/packager + ovberrides and bumped php version
jaxwilko Dec 6, 2024
b80e34f
Added wip
jaxwilko Dec 6, 2024
ac5733c
Added fix to allow install to create files
jaxwilko Dec 6, 2024
b22d11b
Added objects for source types
jaxwilko Dec 6, 2024
6c4bbe8
WIP
jaxwilko Dec 9, 2024
5d705b9
Added wip
jaxwilko Dec 19, 2024
db52bcd
Added fix for installing specific package
jaxwilko Dec 19, 2024
f250393
Added abstract stubs
jaxwilko Dec 19, 2024
be09f6c
Added support for updating composer plugins
jaxwilko Dec 19, 2024
d9830f3
Added wip
jaxwilko Dec 19, 2024
2c1d4ca
Migrated core code to storm
jaxwilko Dec 20, 2024
68721cf
Added wip
jaxwilko Dec 20, 2024
dd3fc6c
Added wip
jaxwilko Dec 30, 2024
644052f
Moved commands into directories
jaxwilko Dec 30, 2024
69b11d8
Refactored stuff
jaxwilko Dec 30, 2024
fc7e32a
Added theme extension logic
jaxwilko Dec 30, 2024
1391495
Added market place support
jaxwilko Jan 2, 2025
a1b7c3a
Added plugin code detection from path using child process
jaxwilko Jan 2, 2025
312e6bd
Added support for installing from arbitary paths
jaxwilko Jan 3, 2025
56ead48
Added theme successfully installed message
jaxwilko Jan 3, 2025
f4b67bb
Added plugin successfully installed message and fixed no updates requ…
jaxwilko Jan 3, 2025
19a09cd
Added more messages to improve ux
jaxwilko Jan 3, 2025
8593b0b
Added wip
jaxwilko Jan 3, 2025
e6dc1ad
Hooked up old update checker ui with new update system
jaxwilko Jan 3, 2025
4e1f7e8
Update composer.json
LukeTowers Jan 4, 2025
43bbaf2
Moved stubs for create commands
jaxwilko Jan 4, 2025
fced1de
Added better reporting for module upgrades
jaxwilko Jan 4, 2025
f144fda
Removed stubbed function as implemented in parent class
jaxwilko Jan 4, 2025
bc61e32
Added default return
jaxwilko Jan 4, 2025
1d268b0
Added fix to ensure upgrades succeed for uninstalled plugins
jaxwilko Jan 4, 2025
62ec335
Added fix for reporting
jaxwilko Jan 4, 2025
bfc3cd1
Added support for preserving modules
jaxwilko Jan 4, 2025
9fa2063
Removed call to setOutputNotes
jaxwilko Jan 4, 2025
ebd5d2d
Added fixes for tests
jaxwilko Jan 4, 2025
c2b62c2
Merge branch 'wip/support-uploading-packages-update-manager-changes' …
jaxwilko Jan 4, 2025
9395f2b
Removed packager from winter deps
jaxwilko Jan 4, 2025
9a5055f
Added style fixes
jaxwilko Jan 4, 2025
bb953e9
Reverted php requirement change
jaxwilko Jan 4, 2025
43acf5c
Added findThemesInPath method
jaxwilko Jan 4, 2025
5de0809
Added method for unpacking a zip and returning all sources inside
jaxwilko Jan 4, 2025
e3aeefa
Fix typo
LukeTowers Jan 5, 2025
729e46e
Moved logic into parent
jaxwilko Jan 5, 2025
6900cae
Merge branch 'wip/support-uploading-packages-update-manager-changes' …
jaxwilko Jan 5, 2025
d8d9850
Apply suggestions from code review
jaxwilko Jan 5, 2025
4e33930
Added notice when cms.disableCoreUpdates is enabled
jaxwilko Jan 5, 2025
db75757
Removed misleading comment
jaxwilko Jan 5, 2025
c8bbe35
Added fix to refer to property instead of method
jaxwilko Jan 5, 2025
8da2212
Added use of plugin manager to check for plugin code
jaxwilko Jan 5, 2025
f950ce3
Removed old update manager
jaxwilko Jan 5, 2025
16a4841
Removed incorrect imports
jaxwilko Jan 5, 2025
f9773db
Removed unused class
jaxwilko Jan 5, 2025
1120f01
Made plugin guessing even simplier
jaxwilko Jan 5, 2025
09a7a88
Apply suggestions from code review
jaxwilko Jan 5, 2025
d328417
Wip
jaxwilko Jan 6, 2025
9d27012
Update modules/system/controllers/updates/assets/src/components/Produ…
LukeTowers Jan 7, 2025
bd3ce1e
Update modules/system/controllers/updates/_install_plugins.php
LukeTowers Jan 7, 2025
a8540d0
Moved eslint to prevent compiled js being linted
jaxwilko Jan 7, 2025
8959acd
Merge branch 'wip/support-uploading-packages-update-manager-changes' …
jaxwilko Jan 7, 2025
d75512c
Added fix for eslint ignore
jaxwilko Jan 7, 2025
dbbda7c
Report missing version.yaml as no update rather than failed update
jaxwilko Jan 8, 2025
f062d51
Added fix for eslint
jaxwilko Jan 8, 2025
a1c5214
Added compiled js
jaxwilko Jan 8, 2025
22aaef0
Re-added old updates.js file
jaxwilko Jan 8, 2025
60a7089
Added install support for plugins
jaxwilko Jan 8, 2025
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"require": {
"php": "^8.0.2",
"winter/storm": "dev-develop as 1.2",
"winter/storm": "dev-wip/support-uploading-packages-update-manager-changes as 1.2",
"winter/wn-system-module": "dev-develop",
"winter/wn-backend-module": "dev-develop",
"winter/wn-cms-module": "dev-develop",
Expand Down
3 changes: 2 additions & 1 deletion modules/backend/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
use System\Classes\MailManager;
use System\Classes\SettingsManager;
use System\Classes\UpdateManager;
use Winter\Storm\Foundation\Extension\WinterExtension;
use Winter\Storm\Support\Facades\Config;
use Winter\Storm\Support\Facades\Flash;
use Winter\Storm\Support\ModuleServiceProvider;

class ServiceProvider extends ModuleServiceProvider
class ServiceProvider extends ModuleServiceProvider implements WinterExtension
{
/**
* Register the service provider.
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/classes/AuthManager.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace Backend\Classes;

use Config;
use System\Classes\PluginManager;
use System\Classes\Extensions\PluginManager;
use Winter\Storm\Auth\Manager as StormAuthManager;
use Winter\Storm\Exception\SystemException;

Expand Down
2 changes: 1 addition & 1 deletion modules/backend/classes/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Request;
use Response;
use Str;
use System\Classes\PluginManager;
use System\Classes\Extensions\PluginManager;
use View;
use Winter\Storm\Router\Helper as RouterHelper;

Expand Down
10 changes: 5 additions & 5 deletions modules/backend/classes/NavigationManager.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php namespace Backend\Classes;

use Event;
use BackendAuth;
use System\Classes\PluginManager;
use Validator;
use SystemException;
use Log;
use Config;
use Event;
use Log;
use System\Classes\Extensions\PluginManager;
use SystemException;
use Validator;

/**
* Manages the backend navigation.
Expand Down
6 changes: 3 additions & 3 deletions modules/backend/classes/WidgetManager.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php namespace Backend\Classes;

use Str;
use BackendAuth;
use SystemException;
use System\Classes\PluginManager;
use Event;
use Str;
use System\Classes\Extensions\PluginManager;
use SystemException;

/**
* Widget manager
Expand Down
26 changes: 13 additions & 13 deletions modules/backend/widgets/Lists.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?php namespace Backend\Widgets;

use ApplicationException;
use Backend;
use Backend\Classes\ListColumn;
use Backend\Classes\WidgetBase;
use BackendAuth;
use Carbon\Carbon;
use Db;
use Str;
use DbDongle;
use Html;
use Lang;
use Backend;
use DbDongle;
use Carbon\Carbon;
use Winter\Storm\Html\Helper as HtmlHelper;
use Winter\Storm\Router\Helper as RouterHelper;
use System\Helpers\DateTime as DateTimeHelper;
use System\Classes\PluginManager;
use System\Classes\MediaLibrary;
use Str;
use System\Classes\Extensions\PluginManager;
use System\Classes\ImageResizer;
use Backend\Classes\ListColumn;
use Backend\Classes\WidgetBase;
use System\Classes\MediaLibrary;
use System\Helpers\DateTime as DateTimeHelper;
use Winter\Storm\Database\Model;
use ApplicationException;
use BackendAuth;
use Winter\Storm\Html\Helper as HtmlHelper;
use Winter\Storm\Router\Helper as RouterHelper;

/**
* List Widget
Expand Down
16 changes: 15 additions & 1 deletion modules/cms/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Cms\Classes\Page as CmsPage;
use Cms\Classes\Router;
use Cms\Classes\Theme;
use Cms\Classes\ThemeManager;
use Cms\Models\ThemeData;
use Cms\Models\ThemeLog;
use Cms\Twig\DebugExtension;
Expand All @@ -21,14 +22,16 @@
use Illuminate\Support\Facades\View;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use System\Classes\CombineAssets;
use Winter\Storm\Console\Command;
use Winter\Storm\Foundation\Extension\WinterExtension;
use System\Classes\MarkupManager;
use System\Classes\SettingsManager;
use Twig\Cache\FilesystemCache as TwigCacheFilesystem;
use Winter\Storm\Support\Facades\Event;
use Winter\Storm\Support\Facades\Url;
use Winter\Storm\Support\ModuleServiceProvider;

class ServiceProvider extends ModuleServiceProvider
class ServiceProvider extends ModuleServiceProvider implements WinterExtension
{
/**
* Register the service provider.
Expand Down Expand Up @@ -58,6 +61,17 @@ public function register()
$this->registerBackendWidgets();
$this->registerBackendSettings();
}

/*
* Console specific
*/
if ($this->app->runningInConsole()) {
Command::extend(function (Command $command) {
$command->bindEvent('beforeRun', function () use ($command) {
ThemeManager::instance()->setOutput($command->getOutput());
});
});
}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions modules/cms/classes/ComponentManager.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php namespace Cms\Classes;

use Illuminate\Support\Facades\App;
use Str;
use System\Classes\PluginManager;
use System\Classes\Extensions\PluginManager;
use SystemException;
use Illuminate\Support\Facades\App;

/**
* Component manager
Expand Down
20 changes: 19 additions & 1 deletion modules/cms/classes/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Lang;
use Winter\Storm\Foundation\Extension\WinterExtension;
use System\Models\Parameter;
use Winter\Storm\Exception\ApplicationException;
use Winter\Storm\Exception\SystemException;
use Winter\Storm\Halcyon\Datasource\DatasourceInterface;
use Winter\Storm\Halcyon\Datasource\DbDatasource;
use Winter\Storm\Halcyon\Datasource\FileDatasource;
use Winter\Storm\Packager\Composer;
use Winter\Storm\Support\Facades\Config;
use Winter\Storm\Support\Facades\Event;
use Winter\Storm\Support\Facades\File;
use Winter\Storm\Support\Facades\Url;
use Winter\Storm\Support\Facades\Yaml;
use Winter\Storm\Support\Str;
use Winter\Storm\Support\Traits\HasComposerPackage;

/**
* This class represents the CMS theme.
Expand All @@ -29,8 +32,10 @@
* @package winter\wn-cms-module
* @author Alexey Bobkov, Samuel Georges
*/
class Theme extends CmsObject
class Theme extends CmsObject implements WinterExtension
{
use HasComposerPackage;

/**
* @var string Specifies the theme directory name.
*/
Expand Down Expand Up @@ -73,10 +78,13 @@ public static function load($dirName, $file = null): self
$theme = new static;
$theme->setDirName($dirName);
$theme->registerHalcyonDatasource();

if (App::runningInBackend()) {
$theme->registerBackendLocalization();
}

$theme->setComposerPackage(Composer::getPackageInfoByPath($theme->getPath()));

return $theme;
}

Expand Down Expand Up @@ -713,4 +721,14 @@ public function __isset($key)

return false;
}

public function getVersion(): string
{
// TODO: Implement extensionVersion() method.
}

public function getIdentifier(): string
{
return $this->getId();
}
}
Loading
Loading