Skip to content

Commit

Permalink
Initial development of Composer support within Manage Updates area
Browse files Browse the repository at this point in the history
  • Loading branch information
bennothommo committed Apr 10, 2024
1 parent 49c8529 commit 871cfeb
Show file tree
Hide file tree
Showing 28 changed files with 410 additions and 136 deletions.
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"winter/wn-backend-module": "dev-develop",
"winter/wn-cms-module": "dev-develop",
"laravel/framework": "^9.1",
"wikimedia/composer-merge-plugin": "~2.1.0"
"winter/packager": "dev-main",
"wikimedia/composer-merge-plugin": "~2.1.0",
"nyholm/psr7": "^1.8"
},
"require-dev": {
"phpunit/phpunit": "^9.5.8",
Expand Down Expand Up @@ -79,7 +81,8 @@
"config": {
"allow-plugins": {
"composer/installers": true,
"wikimedia/composer-merge-plugin": true
"wikimedia/composer-merge-plugin": true,
"php-http/discovery": false
}
}
}
32 changes: 32 additions & 0 deletions config/marketplace.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Cache marketplace packages
|--------------------------------------------------------------------------
|
| By default, marketplace metadata is cached locally to reduce the number
| of calls to the API. This can be disabled by setting this value to false,
| however, this may result in a slower experience when managing themes and
| plugins, or browsing the marketplace.
|
*/

'cache' => true,

/*
|--------------------------------------------------------------------------
| Marketplace package cache store
|--------------------------------------------------------------------------
|
| If caching is enabled, the following value sets the store that should be
| used to store the cache. If this is `null`, the default store will be
| used.
|
*/

'store' => null,

];

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.permissioneditor table{width:100%}
.permissioneditor table th{padding:30px 4px 8px 4px;color:#2a3e51;font-weight:normal;border-bottom:1px solid #dbe1e3}
.permissioneditor table th.tab{font-size:13px}
.permissioneditor table th.permission-type{text-transform:uppercase;font-size:11px;text-align:center;cursor:pointer}
.permissioneditor table th.permission-type{text-transform:uppercase;font-size:11px;text-align:center}
.permissioneditor table td{padding:10px 4px;vertical-align:top;border-bottom:1px solid #ecf0f1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
.permissioneditor table td.permission-value{text-align:center}
.permissioneditor table td.permission-name{font-size:13px;cursor:pointer;color:#777}
Expand Down Expand Up @@ -37,4 +37,4 @@
.permissioneditor table tr:last-child td{border-bottom:none}
.permissioneditor table tr:first-child th{padding-top:0}
.permissioneditor table tr.disabled td.permission-name{color:#AAA}
.permissioneditor table tr.last-section-row td{border-bottom:none}
.permissioneditor table tr.last-section-row td{border-bottom:none}
20 changes: 20 additions & 0 deletions modules/system/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use Markdown;
use Request;
use System\Classes\CombineAssets;
use System\Classes\DetailedPackage;
use System\Classes\DetailedVersionedPackage;
use System\Classes\ErrorHandler;
use System\Classes\MailManager;
use System\Classes\MarkupManager;
Expand Down Expand Up @@ -83,6 +85,7 @@ public function register()
$this->registerBackendNavigation();
$this->registerBackendReportWidgets();
$this->registerBackendSettings();
$this->registerComposer();
}
}

Expand Down Expand Up @@ -580,6 +583,7 @@ protected function registerAssetBundles()
$combiner->registerBundle('~/modules/system/assets/js/framework.combined.js');
$combiner->registerBundle('~/modules/system/assets/less/framework.extras.less');
$combiner->registerBundle('~/modules/system/assets/less/snowboard.extras.less');
$combiner->registerBundle('~/modules/system/assets/less/updates/updates.less');
});
}

Expand Down Expand Up @@ -629,4 +633,20 @@ protected function registerGlobalViewVars()
{
View::share('appName', Config::get('app.name'));
}

protected function registerComposer()
{
$this->app->bind('system.composer', function () {
\Winter\Packager\Composer::setPackageClass('detailedPackage', DetailedPackage::class);
\Winter\Packager\Composer::setPackageClass('detailedVersionedPackage', DetailedVersionedPackage::class);

$composer = new \Winter\Packager\Composer;
$composer
->setHomeDir(storage_path('temp/packager'), true)
->setWorkDir(base_path())
->setStorage(new \System\Classes\PackageStorage);

return $composer;
});
}
}
1 change: 1 addition & 0 deletions modules/system/aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
'BackendMenu' => Backend\Facades\BackendMenu::class,
'Block' => Winter\Storm\Support\Facades\Block::class,
'Cms' => Cms\Facades\Cms::class,
'Composer' => System\Facades\Composer::class,
'Config' => Winter\Storm\Support\Facades\Config::class,
'DbDongle' => Winter\Storm\Support\Facades\DbDongle::class,
'File' => Winter\Storm\Support\Facades\File::class,
Expand Down
117 changes: 1 addition & 116 deletions modules/system/assets/css/updates/updates.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/system/assets/js/build/manifest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/system/assets/js/build/system.debug.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/system/assets/js/build/system.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/system/assets/js/snowboard/build/snowboard.base.js

Large diffs are not rendered by default.

Loading

0 comments on commit 871cfeb

Please sign in to comment.