Save team
+
+ @error('teamForm.name')
+ {{ $message }}
+ @enderror
+ @error('teamForm.slug')
+ {{ $message }}
+ @enderror
+ @error('teamForm.color')
+ {{ $message }}
+ @enderror
+ @error('teamForm.user_ids.*')
+ {{ $message }}
+ @enderror
+
+
+
+ Cancel
- Reset
+
+ {{ filled($teamForm['id'] ?? null) ? 'Save changes' : 'Create team' }}
-
-
+
@endif
diff --git a/resources/themes/backend/views/partials/head.blade.php b/resources/themes/backend/views/partials/head.blade.php
index e47f942..cbe8789 100644
--- a/resources/themes/backend/views/partials/head.blade.php
+++ b/resources/themes/backend/views/partials/head.blade.php
@@ -3,9 +3,37 @@
{{ filled($title ?? null) ? $title.' - '.config('app.name', 'Laravel') : config('app.name', 'Laravel') }}
@fonts
-@vite([
- 'resources/themes/backend/assets/css/app.css',
- 'resources/themes/backend/assets/js/passkeys.js',
- 'resources/themes/backend/assets/js/layout.js',
-])
+@php
+ $viteAssets = [
+ 'resources/themes/backend/assets/css/app.css',
+ 'resources/themes/backend/assets/js/passkeys.js',
+ 'resources/themes/backend/assets/js/layout.js',
+ ];
+
+ $moduleStatuses = [];
+ $moduleStatusFile = base_path('modules_statuses.json');
+
+ if (is_file($moduleStatusFile)) {
+ $moduleStatuses = json_decode((string) file_get_contents($moduleStatusFile), true) ?: [];
+ }
+
+ foreach (glob(base_path('Modules/*'), GLOB_ONLYDIR) ?: [] as $moduleDirectory) {
+ $moduleName = basename($moduleDirectory);
+
+ if (array_key_exists($moduleName, $moduleStatuses) && ! $moduleStatuses[$moduleName]) {
+ continue;
+ }
+
+ foreach (['Resources/assets/css/app.css', 'Resources/assets/js/app.js'] as $entry) {
+ $absoluteEntry = $moduleDirectory.DIRECTORY_SEPARATOR.str_replace('/', DIRECTORY_SEPARATOR, $entry);
+
+ if (is_file($absoluteEntry)) {
+ $viteAssets[] = str_replace('\\', '/', substr($absoluteEntry, strlen(base_path()) + 1));
+ }
+ }
+ }
+
+ $viteAssets = array_values(array_unique($viteAssets));
+@endphp
+@vite($viteAssets)
@fluxAppearance
diff --git a/scripts/install-module-dependencies.mjs b/scripts/install-module-dependencies.mjs
index 90ef65e..64d8556 100644
--- a/scripts/install-module-dependencies.mjs
+++ b/scripts/install-module-dependencies.mjs
@@ -1,54 +1,31 @@
-import {
- existsSync,
- readdirSync,
- realpathSync,
- statSync,
-} from 'node:fs';
+import { existsSync, readdirSync, statSync } from 'node:fs';
import { join } from 'node:path';
-import { spawnSync } from 'node:child_process';
+import { execFileSync } from 'node:child_process';
-const modulesPath = join(process.cwd(), 'Modules');
+const modulesDirectory = join(process.cwd(), 'Modules');
-if (!existsSync(modulesPath)) {
+if (!existsSync(modulesDirectory)) {
process.exit(0);
}
-const installed = new Set();
+for (const moduleName of readdirSync(modulesDirectory).sort()) {
+ const moduleDirectory = join(modulesDirectory, moduleName);
-for (const moduleName of readdirSync(modulesPath)) {
- const modulePath = join(modulesPath, moduleName);
-
- if (!statSync(modulePath).isDirectory()) {
+ if (!statSync(moduleDirectory).isDirectory()) {
continue;
}
- const packageJson = join(modulePath, 'package.json');
- const packageLock = join(modulePath, 'package-lock.json');
+ const lockFile = join(moduleDirectory, 'package-lock.json');
+ const packageFile = join(moduleDirectory, 'package.json');
- if (!existsSync(packageJson) || !existsSync(packageLock)) {
+ if (!existsSync(lockFile) || !existsSync(packageFile)) {
continue;
}
- const physicalModulePath = realpathSync(modulePath);
+ console.log(`[modules] Installing ${moduleName} dependencies`);
- if (installed.has(physicalModulePath)) {
- continue;
- }
-
- installed.add(physicalModulePath);
-
- console.log(`[Modules] Installing npm dependencies for ${moduleName}...`);
-
- const result = spawnSync(
- 'npm',
- ['ci', '--no-audit', '--no-fund'],
- {
- cwd: modulePath,
- stdio: 'inherit',
- },
- );
-
- if (result.status !== 0) {
- process.exit(result.status ?? 1);
- }
+ execFileSync('npm', ['ci', '--no-audit', '--no-fund'], {
+ cwd: moduleDirectory,
+ stdio: 'inherit',
+ });
}