Skip to content

Commit

Permalink
Merge pull request #29 from GreenMeteor/develop
Browse files Browse the repository at this point in the history
v1.17.0 Test
  • Loading branch information
ArchBlood authored Oct 25, 2024
2 parents 59b8589 + 55c15ad commit e5a689d
Show file tree
Hide file tree
Showing 533 changed files with 6,620 additions and 17,002 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Cache Composer packages
if: github.event_name == 'pull_request'
id: composer-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
Expand Down
26 changes: 0 additions & 26 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,6 @@ class Module extends BaseModule
*/
public $resourcesPath = 'resources';

// Define the namespace for web controllers
public $controllerNamespace = 'humhub\modules\composer\controllers';

// Define the namespace for console commands
public $commandNamespace = 'humhub\modules\composer\commands';

public function init()
{
parent::init();
if (Yii::$app instanceof \yii\console\Application) {
// Set controller namespace to default web controllers namespace for console application
$this->controllerNamespace = 'humhub\modules\composer\controllers';
// Define console command mappings
$this->controllerMap = [
'theme' => 'humhub\modules\composer\commands\ThemeController',
];
}
}

public function actions()
{
return [
'theme/compile' => 'humhub\modules\composer\commands\ThemeController',
];
}

/**
* @inheritdoc
*/
Expand Down
98 changes: 0 additions & 98 deletions commands/ThemeController.php

This file was deleted.

7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"require": {
"php": "^8.2",
"symfony/process": "^7.1",
"composer/installers": "^2.2",
"oyejorge/less.php": "^1.7"
"composer/installers": "^2.2"
},
"require-dev": {
"composer/composer": "^2.7"
Expand All @@ -29,9 +28,9 @@
"type": "package",
"package": {
"name": "gruntjs/grunt",
"version": "1.4.1",
"version": "1.6.1",
"dist": {
"url": "https://registry.npmjs.org/grunt/-/grunt-1.4.1.tgz",
"url": "https://registry.npmjs.org/grunt/-/grunt-1.6.1.tgz",
"type": "tar"
},
"autoload": {
Expand Down
75 changes: 4 additions & 71 deletions composer.lock

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

20 changes: 0 additions & 20 deletions controllers/GruntController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,6 @@ public function actionBuildAssets()
}
}

/**
* Builds a theme using Grunt.
*
* @param string|null $themeName The name of the theme to build.
* @return string The rendering result.
*/
public function actionBuildTheme()
{
$themeName = Yii::$app->request->post('themeName');

if ($themeName === null) {
throw new \yii\web\BadRequestHttpException('Theme name cannot be null.');
}

$gruntService = new GruntService();
$output = $gruntService->buildTheme($themeName);

return $this->asJson(['success' => true, 'output' => $output]);
}

/**
* Builds the search index using Grunt.
*
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "greenmeteor/composer",
"version": "1.0.0",
"version": "1.0.1",
"description": "Update your Composer installed HumHub instance",
"scripts": {
"grunt-build-assets": "grunt build-assets",
"grunt-build-theme": "grunt build-theme",
"grunt-build-search": "grunt build-search",
"grunt-migrate-up": "grunt migrate-up"
},
Expand All @@ -14,8 +13,8 @@
},
"license": "AGPL-3.0-or-later",
"devDependencies": {
"grunt": "^1.4.1",
"grunt-cli": "^1.4.3",
"symfony/process": "^5.0"
"grunt": "^1.6.1",
"grunt-cli": "^1.5.0",
"symfony/process": "^7.1"
}
}
}
12 changes: 0 additions & 12 deletions services/GruntService.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class GruntService
* Executes a Grunt command and returns the output.
*
* @param string $command The Grunt command to execute.
* @param string|null $themeName The name of the theme to build (optional).
* @return array The output of the Grunt command.
* @throws \yii\web\ForbiddenHttpException If the user is not allowed to perform this action.
* @throws \yii\web\ServerErrorHttpException If the working directory is invalid.
Expand Down Expand Up @@ -63,17 +62,6 @@ public function buildAssets(): array
return $this->executeCommand('build-assets');
}

/**
* Builds a theme using Grunt.
*
* @param string $themeName The name of the theme to build.
* @return array The output of the Grunt build-theme command.
*/
public function buildTheme(string $themeName): array
{
return $this->executeCommand('build-theme', $themeName);
}

/**
* Builds the search index using Grunt.
*
Expand Down
5 changes: 2 additions & 3 deletions vendor/bin/composer
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ if (PHP_VERSION_ID < 80000) {
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
) {
include("phpvfscomposer://" . __DIR__ . '/..'.'/composer/composer/bin/composer');
exit(0);
return include("phpvfscomposer://" . __DIR__ . '/..'.'/composer/composer/bin/composer');
}
}

include __DIR__ . '/..'.'/composer/composer/bin/composer';
return include __DIR__ . '/..'.'/composer/composer/bin/composer';
5 changes: 2 additions & 3 deletions vendor/bin/jsonlint
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ if (PHP_VERSION_ID < 80000) {
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
) {
include("phpvfscomposer://" . __DIR__ . '/..'.'/seld/jsonlint/bin/jsonlint');
exit(0);
return include("phpvfscomposer://" . __DIR__ . '/..'.'/seld/jsonlint/bin/jsonlint');
}
}

include __DIR__ . '/..'.'/seld/jsonlint/bin/jsonlint';
return include __DIR__ . '/..'.'/seld/jsonlint/bin/jsonlint';
Loading

0 comments on commit e5a689d

Please sign in to comment.