From 6f6021805ea0b2408d7f453fd4e0af319c23165c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 16:08:53 +0000 Subject: [PATCH 1/4] Initial plan From 44821235a0db97f9bafc55438db4faa784babb0b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 16:15:29 +0000 Subject: [PATCH 2/4] Fix Vite build error by removing vendor CSS imports - Remove imports from vendor/filament/support, actions, forms, etc. - Replace with @import 'tailwindcss' for Tailwind CSS v4 compatibility - Update all theme files to use proper @source directives - Delete unused merge.css file This fixes the build error where Vite couldn't resolve vendor CSS paths because composer install runs after vite build in the CI workflow. Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com> --- resources/css/app.css | 24 ----------------- .../filament/company/invoiceplane-blue.css | 4 ++- .../css/filament/company/invoiceplane.css | 3 ++- resources/css/filament/company/nord.css | 3 ++- resources/css/filament/company/orange.css | 3 ++- resources/css/filament/company/reddit.css | 3 ++- resources/css/merge.css | 27 ------------------- 7 files changed, 11 insertions(+), 56 deletions(-) delete mode 100644 resources/css/merge.css diff --git a/resources/css/app.css b/resources/css/app.css index 70262b93b..9134f8538 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,29 +1,5 @@ @import 'tailwindcss'; -/* Required by all components */ -@import '../../vendor/filament/support/resources/css/index.css'; - -/* Required by actions and tables */ -@import '../../vendor/filament/actions/resources/css/index.css'; - -/* Required by actions, forms and tables */ -@import '../../vendor/filament/forms/resources/css/index.css'; - -/* Required by actions and infolists */ -@import '../../vendor/filament/infolists/resources/css/index.css'; - -/* Required by notifications */ -@import '../../vendor/filament/notifications/resources/css/index.css'; - -/* Required by actions, infolists, forms, schemas and tables */ -@import '../../vendor/filament/schemas/resources/css/index.css'; - -/* Required by tables */ -@import '../../vendor/filament/tables/resources/css/index.css'; - -/* Required by widgets */ -@import '../../vendor/filament/widgets/resources/css/index.css'; - @source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php'; @source '../../storage/framework/views/*.php'; @source "../**/*.blade.php"; diff --git a/resources/css/filament/company/invoiceplane-blue.css b/resources/css/filament/company/invoiceplane-blue.css index 56cb71b55..69803c151 100644 --- a/resources/css/filament/company/invoiceplane-blue.css +++ b/resources/css/filament/company/invoiceplane-blue.css @@ -1,4 +1,6 @@ -@import '../../../../vendor/filament/filament/resources/css/theme.css'; +@import 'tailwindcss'; + +@source '../../../../vendor/filament/**/*.blade.php'; /* .dark .fi-body { diff --git a/resources/css/filament/company/invoiceplane.css b/resources/css/filament/company/invoiceplane.css index 8aa30130d..ad6cdcd58 100644 --- a/resources/css/filament/company/invoiceplane.css +++ b/resources/css/filament/company/invoiceplane.css @@ -1,7 +1,8 @@ -@import '../../../../vendor/filament/filament/resources/css/theme.css'; +@import 'tailwindcss'; @source '../../../../app/Filament/Tenant/**/*'; @source '../../../../resources/views/filament/tenant/**/*'; +@source '../../../../vendor/filament/**/*.blade.php'; .fi-bg-color-600 { @apply bg-primary-700; diff --git a/resources/css/filament/company/nord.css b/resources/css/filament/company/nord.css index ce3162eb9..9f0e13ae8 100644 --- a/resources/css/filament/company/nord.css +++ b/resources/css/filament/company/nord.css @@ -1,7 +1,8 @@ -@import '../../../../vendor/filament/filament/resources/css/theme.css'; +@import 'tailwindcss'; @source '../../../../app/Filament/Tenant/**/*'; @source '../../../../resources/views/filament/tenant/**/*'; +@source '../../../../vendor/filament/**/*.blade.php'; @theme { --color-secondary-50: #E3E9F0; diff --git a/resources/css/filament/company/orange.css b/resources/css/filament/company/orange.css index 04c1420a7..b15930992 100644 --- a/resources/css/filament/company/orange.css +++ b/resources/css/filament/company/orange.css @@ -1,7 +1,8 @@ -@import '../../../../vendor/filament/filament/resources/css/theme.css'; +@import 'tailwindcss'; @source '../../../../app/Filament/Tenant/**/*'; @source '../../../../resources/views/filament/tenant/**/*'; +@source '../../../../vendor/filament/**/*.blade.php'; .fi-bg-color-600 { @apply bg-orange-700; diff --git a/resources/css/filament/company/reddit.css b/resources/css/filament/company/reddit.css index 648a8d53d..0f03df181 100644 --- a/resources/css/filament/company/reddit.css +++ b/resources/css/filament/company/reddit.css @@ -1,7 +1,8 @@ -@import '../../../../vendor/filament/filament/resources/css/theme.css'; +@import 'tailwindcss'; @source '../../../../app/Filament/Tenant/**/*'; @source '../../../../resources/views/filament/tenant/**/*'; +@source '../../../../vendor/filament/**/*.blade.php'; .fi-bg-color-600 { @apply bg-[#FF4500]; diff --git a/resources/css/merge.css b/resources/css/merge.css deleted file mode 100644 index 8a072990b..000000000 --- a/resources/css/merge.css +++ /dev/null @@ -1,27 +0,0 @@ -@import 'tailwindcss'; - -/* Required by all components */ -@import '../../vendor/filament/support/resources/css/index.css'; - -/* Required by actions and tables */ -@import '../../vendor/filament/actions/resources/css/index.css'; - -/* Required by actions, forms and tables */ -@import '../../vendor/filament/forms/resources/css/index.css'; - -/* Required by actions and infolists */ -@import '../../vendor/filament/infolists/resources/css/index.css'; - -/* Required by notifications */ -@import '../../vendor/filament/notifications/resources/css/index.css'; - -/* Required by actions, infolists, forms, schemas and tables */ -@import '../../vendor/filament/schemas/resources/css/index.css'; - -/* Required by tables */ -@import '../../vendor/filament/tables/resources/css/index.css'; - -/* Required by widgets */ -@import '../../vendor/filament/widgets/resources/css/index.css'; - -@variant dark (&:where(.dark, .dark *)); From e89b1af44428bfc9c82df8674cc36fde477409c6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 16:21:56 +0000 Subject: [PATCH 3/4] Revert CSS changes and fix workflow build order instead - Restore original CSS vendor imports in app.css and theme files - Restore merge.css file - Reorder release workflow: run composer install BEFORE yarn build - PHP/Composer setup now runs before Node.js/Yarn setup - Frontend build can now resolve vendor CSS paths correctly Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com> --- .github/workflows/release.yml | 66 +++++++++---------- resources/css/app.css | 24 +++++++ .../filament/company/invoiceplane-blue.css | 4 +- .../css/filament/company/invoiceplane.css | 3 +- resources/css/filament/company/nord.css | 3 +- resources/css/filament/company/orange.css | 3 +- resources/css/filament/company/reddit.css | 3 +- resources/css/merge.css | 27 ++++++++ 8 files changed, 89 insertions(+), 44 deletions(-) create mode 100644 resources/css/merge.css diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4985c1882..c96a2f4b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,42 +79,32 @@ jobs: fi echo "✓ Translations structure validated" | tee -a "$LOG_FILE" - # Step 3: Set up Node.js for frontend build - - name: Set up Node.js - uses: actions/setup-node@v4 + # Step 3: Set up PHP and Composer (before frontend build) + - name: Set up PHP + uses: shivammathur/setup-php@v2 with: - node-version: '20' - cache: 'yarn' - - - name: Install frontend dependencies (production mode) - run: | - set -e - set -o pipefail - - LOG_FILE="${{ env.LOG_DIR }}/yarn-install.log" - - echo "Installing frontend dependencies..." | tee -a "$LOG_FILE" - yarn install --frozen-lockfile --production=false 2>&1 | tee -a "$LOG_FILE" - echo "✓ Frontend dependencies installed" | tee -a "$LOG_FILE" + php-version: '8.4' + extensions: gd, bcmath, dom, intl, xml, zip, mbstring, pdo_mysql + coverage: none - - name: Build frontend assets for production + - name: Install Composer dependencies (production) run: | set -e set -o pipefail - LOG_FILE="${{ env.LOG_DIR }}/yarn-build.log" + LOG_FILE="${{ env.LOG_DIR }}/composer-install.log" - echo "Building frontend assets..." | tee -a "$LOG_FILE" - yarn build 2>&1 | tee -a "$LOG_FILE" - echo "✓ Frontend assets built successfully" | tee -a "$LOG_FILE" + echo "Installing Composer dependencies (production mode)..." | tee -a "$LOG_FILE" + composer install --no-dev --optimize-autoloader \ + --no-interaction --prefer-dist 2>&1 | tee -a "$LOG_FILE" + echo "✓ Composer dependencies installed" | tee -a "$LOG_FILE" - # Step 4: Set up PHP and Composer - - name: Set up PHP - uses: shivammathur/setup-php@v2 + # Step 4: Set up Node.js for frontend build + - name: Set up Node.js + uses: actions/setup-node@v4 with: - php-version: '8.4' - extensions: gd, bcmath, dom, intl, xml, zip, mbstring, pdo_mysql - coverage: none + node-version: '20' + cache: 'yarn' - name: Display tool versions run: | @@ -130,17 +120,27 @@ jobs: echo "Yarn version: $(yarn -v)" | tee -a "$LOG_FILE" echo "=========================================" | tee -a "$LOG_FILE" - - name: Install Composer dependencies (production) + - name: Install frontend dependencies (production mode) run: | set -e set -o pipefail - LOG_FILE="${{ env.LOG_DIR }}/composer-install.log" + LOG_FILE="${{ env.LOG_DIR }}/yarn-install.log" - echo "Installing Composer dependencies (production mode)..." | tee -a "$LOG_FILE" - composer install --no-dev --optimize-autoloader \ - --no-interaction --prefer-dist 2>&1 | tee -a "$LOG_FILE" - echo "✓ Composer dependencies installed" | tee -a "$LOG_FILE" + echo "Installing frontend dependencies..." | tee -a "$LOG_FILE" + yarn install --frozen-lockfile --production=false 2>&1 | tee -a "$LOG_FILE" + echo "✓ Frontend dependencies installed" | tee -a "$LOG_FILE" + + - name: Build frontend assets for production + run: | + set -e + set -o pipefail + + LOG_FILE="${{ env.LOG_DIR }}/yarn-build.log" + + echo "Building frontend assets..." | tee -a "$LOG_FILE" + yarn build 2>&1 | tee -a "$LOG_FILE" + echo "✓ Frontend assets built successfully" | tee -a "$LOG_FILE" - name: Install vendor cleaner and optimize run: | diff --git a/resources/css/app.css b/resources/css/app.css index 9134f8538..70262b93b 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,5 +1,29 @@ @import 'tailwindcss'; +/* Required by all components */ +@import '../../vendor/filament/support/resources/css/index.css'; + +/* Required by actions and tables */ +@import '../../vendor/filament/actions/resources/css/index.css'; + +/* Required by actions, forms and tables */ +@import '../../vendor/filament/forms/resources/css/index.css'; + +/* Required by actions and infolists */ +@import '../../vendor/filament/infolists/resources/css/index.css'; + +/* Required by notifications */ +@import '../../vendor/filament/notifications/resources/css/index.css'; + +/* Required by actions, infolists, forms, schemas and tables */ +@import '../../vendor/filament/schemas/resources/css/index.css'; + +/* Required by tables */ +@import '../../vendor/filament/tables/resources/css/index.css'; + +/* Required by widgets */ +@import '../../vendor/filament/widgets/resources/css/index.css'; + @source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php'; @source '../../storage/framework/views/*.php'; @source "../**/*.blade.php"; diff --git a/resources/css/filament/company/invoiceplane-blue.css b/resources/css/filament/company/invoiceplane-blue.css index 69803c151..56cb71b55 100644 --- a/resources/css/filament/company/invoiceplane-blue.css +++ b/resources/css/filament/company/invoiceplane-blue.css @@ -1,6 +1,4 @@ -@import 'tailwindcss'; - -@source '../../../../vendor/filament/**/*.blade.php'; +@import '../../../../vendor/filament/filament/resources/css/theme.css'; /* .dark .fi-body { diff --git a/resources/css/filament/company/invoiceplane.css b/resources/css/filament/company/invoiceplane.css index ad6cdcd58..8aa30130d 100644 --- a/resources/css/filament/company/invoiceplane.css +++ b/resources/css/filament/company/invoiceplane.css @@ -1,8 +1,7 @@ -@import 'tailwindcss'; +@import '../../../../vendor/filament/filament/resources/css/theme.css'; @source '../../../../app/Filament/Tenant/**/*'; @source '../../../../resources/views/filament/tenant/**/*'; -@source '../../../../vendor/filament/**/*.blade.php'; .fi-bg-color-600 { @apply bg-primary-700; diff --git a/resources/css/filament/company/nord.css b/resources/css/filament/company/nord.css index 9f0e13ae8..ce3162eb9 100644 --- a/resources/css/filament/company/nord.css +++ b/resources/css/filament/company/nord.css @@ -1,8 +1,7 @@ -@import 'tailwindcss'; +@import '../../../../vendor/filament/filament/resources/css/theme.css'; @source '../../../../app/Filament/Tenant/**/*'; @source '../../../../resources/views/filament/tenant/**/*'; -@source '../../../../vendor/filament/**/*.blade.php'; @theme { --color-secondary-50: #E3E9F0; diff --git a/resources/css/filament/company/orange.css b/resources/css/filament/company/orange.css index b15930992..04c1420a7 100644 --- a/resources/css/filament/company/orange.css +++ b/resources/css/filament/company/orange.css @@ -1,8 +1,7 @@ -@import 'tailwindcss'; +@import '../../../../vendor/filament/filament/resources/css/theme.css'; @source '../../../../app/Filament/Tenant/**/*'; @source '../../../../resources/views/filament/tenant/**/*'; -@source '../../../../vendor/filament/**/*.blade.php'; .fi-bg-color-600 { @apply bg-orange-700; diff --git a/resources/css/filament/company/reddit.css b/resources/css/filament/company/reddit.css index 0f03df181..648a8d53d 100644 --- a/resources/css/filament/company/reddit.css +++ b/resources/css/filament/company/reddit.css @@ -1,8 +1,7 @@ -@import 'tailwindcss'; +@import '../../../../vendor/filament/filament/resources/css/theme.css'; @source '../../../../app/Filament/Tenant/**/*'; @source '../../../../resources/views/filament/tenant/**/*'; -@source '../../../../vendor/filament/**/*.blade.php'; .fi-bg-color-600 { @apply bg-[#FF4500]; diff --git a/resources/css/merge.css b/resources/css/merge.css new file mode 100644 index 000000000..8a072990b --- /dev/null +++ b/resources/css/merge.css @@ -0,0 +1,27 @@ +@import 'tailwindcss'; + +/* Required by all components */ +@import '../../vendor/filament/support/resources/css/index.css'; + +/* Required by actions and tables */ +@import '../../vendor/filament/actions/resources/css/index.css'; + +/* Required by actions, forms and tables */ +@import '../../vendor/filament/forms/resources/css/index.css'; + +/* Required by actions and infolists */ +@import '../../vendor/filament/infolists/resources/css/index.css'; + +/* Required by notifications */ +@import '../../vendor/filament/notifications/resources/css/index.css'; + +/* Required by actions, infolists, forms, schemas and tables */ +@import '../../vendor/filament/schemas/resources/css/index.css'; + +/* Required by tables */ +@import '../../vendor/filament/tables/resources/css/index.css'; + +/* Required by widgets */ +@import '../../vendor/filament/widgets/resources/css/index.css'; + +@variant dark (&:where(.dark, .dark *)); From 233a63552e601b47bb42641637cfe1aba3699445 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 16:31:29 +0000 Subject: [PATCH 4/4] Enhance yarn-update workflow with lockfile checks and better update options - Add package-lock.json conflict detection with warnings - Add 'security-updates' option (new default for scheduled runs) - Rename 'all-dependencies' to 'all-latest-with-build' for clarity - Add comprehensive logging for all update steps - Display lockfile conflict warnings in PR body - Security updates now identify and upgrade vulnerable packages - Improved screen output with clear section separators Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com> --- .github/workflows/yarn-update.yml | 104 +++++++++++++++++++++++++++--- 1 file changed, 95 insertions(+), 9 deletions(-) diff --git a/.github/workflows/yarn-update.yml b/.github/workflows/yarn-update.yml index e11adfdf8..83f41993d 100644 --- a/.github/workflows/yarn-update.yml +++ b/.github/workflows/yarn-update.yml @@ -8,10 +8,11 @@ on: required: true type: choice options: + - security-updates - common-packages - patch-minor - - all-dependencies - default: 'common-packages' + - all-latest-with-build + default: 'security-updates' schedule: # Run weekly on Monday at 10:00 AM UTC - cron: '0 10 * * 1' @@ -36,6 +37,36 @@ jobs: node-version: '20' cache: 'yarn' + - name: Check for package-lock.json conflicts + id: lockfile-check + run: | + echo "=========================================" + echo "Checking for lock file conflicts..." + echo "=========================================" + + if [ -f "package-lock.json" ]; then + echo "⚠️ WARNING: package-lock.json detected!" + echo "⚠️ This project uses Yarn (yarn.lock), not npm (package-lock.json)" + echo "⚠️ Having both lock files can cause dependency conflicts" + echo "" + echo "lockfile_conflict=true" >> $GITHUB_OUTPUT + + # Show when it was last modified + echo "📅 package-lock.json last modified: $(stat -c %y package-lock.json 2>/dev/null || stat -f '%Sm' package-lock.json 2>/dev/null || echo 'unknown')" + echo "" + else + echo "✓ No package-lock.json conflict detected" + echo "lockfile_conflict=false" >> $GITHUB_OUTPUT + fi + + if [ -f "yarn.lock" ]; then + echo "✓ yarn.lock present (correct for this project)" + else + echo "❌ ERROR: yarn.lock is missing!" + exit 1 + fi + echo "=========================================" + - name: Install Yarn dependencies run: yarn install --frozen-lockfile @@ -56,26 +87,75 @@ jobs: echo "vulnerabilities_found=false" >> $GITHUB_OUTPUT fi + - name: Update Yarn dependencies (Security Updates Only) + if: github.event.inputs.update_type == 'security-updates' || github.event_name == 'schedule' + run: | + echo "=========================================" + echo "Applying security updates only..." + echo "=========================================" + + # Run yarn audit and apply fixes + yarn audit --json > audit-before.json || true + + # Note: Yarn v1 doesn't have 'audit fix', so we identify and upgrade vulnerable packages + if [ -f audit-report.json ]; then + echo "📋 Audit report generated. Checking for fixable vulnerabilities..." + + # Extract vulnerable package names and upgrade them + VULNERABLE_PACKAGES=$(grep -o '"module_name":"[^"]*"' audit-report.json | cut -d'"' -f4 | sort -u || echo "") + + if [ -n "$VULNERABLE_PACKAGES" ]; then + echo "🔒 Upgrading packages with security vulnerabilities:" + echo "$VULNERABLE_PACKAGES" + for pkg in $VULNERABLE_PACKAGES; do + echo " Upgrading $pkg..." + yarn upgrade "$pkg" --latest || true + done + else + echo "✓ No vulnerable packages found to upgrade" + fi + else + echo "⚠️ No audit report available" + fi + + echo "=========================================" + - name: Update Yarn dependencies (Common Packages) - if: github.event.inputs.update_type == 'common-packages' || github.event_name == 'schedule' + if: github.event.inputs.update_type == 'common-packages' run: | + echo "=========================================" + echo "Upgrading common packages..." + echo "=========================================" # Note: This upgrades a predefined set of commonly updated packages - # For true security-only updates, use yarn audit to identify vulnerable packages yarn upgrade --pattern 'vite|laravel-vite-plugin|tailwindcss|autoprefixer|axios' + echo "=========================================" - name: Update Yarn dependencies (Patch & Minor) if: github.event.inputs.update_type == 'patch-minor' run: | + echo "=========================================" + echo "Upgrading to latest patch and minor versions..." + echo "=========================================" yarn upgrade + echo "=========================================" - - name: Update Yarn dependencies (All) - if: github.event.inputs.update_type == 'all-dependencies' + - name: Update Yarn dependencies (All Latest with Build) + if: github.event.inputs.update_type == 'all-latest-with-build' run: | + echo "=========================================" + echo "Upgrading all packages to latest versions..." + echo "=========================================" yarn upgrade --latest + echo "=========================================" - name: Build assets run: | + echo "=========================================" + echo "Building production assets..." + echo "=========================================" yarn build + echo "✓ Build completed successfully" + echo "=========================================" - name: Check for changes id: check-changes @@ -101,18 +181,22 @@ jobs: uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GITHUB_TOKEN }} - commit-message: "chore(deps): update Yarn dependencies (${{ github.event.inputs.update_type || 'common-packages' }})" + commit-message: "chore(deps): update Yarn dependencies (${{ github.event.inputs.update_type || 'security-updates' }})" branch: automated/yarn-update-${{ github.run_number }} delete-branch: true - title: "chore(deps): Update Yarn dependencies (${{ github.event.inputs.update_type || 'common-packages' }})" + title: "chore(deps): Update Yarn dependencies (${{ github.event.inputs.update_type || 'security-updates' }})" body: | ## Yarn Dependency Update This PR updates Yarn (npm) dependencies. - **Update Type:** ${{ github.event.inputs.update_type }} + **Update Type:** ${{ github.event.inputs.update_type || 'security-updates' }} **Triggered by:** ${{ github.event_name }} + ### Lock File Status + + ${{ steps.lockfile-check.outputs.lockfile_conflict == 'true' && '⚠️ **WARNING:** package-lock.json detected alongside yarn.lock. This can cause dependency conflicts. Consider removing package-lock.json.' || '✓ No lock file conflicts detected.' }} + ### Updated Packages ``` @@ -123,6 +207,7 @@ jobs: - [x] Assets built successfully - [x] Dependencies installed and verified + - [x] Lock file conflicts checked ### Security Audit @@ -135,6 +220,7 @@ jobs: - [ ] Check for breaking changes in frontend - [ ] Test UI changes in development environment - [ ] Verify no console errors in browser + ${{ steps.lockfile-check.outputs.lockfile_conflict == 'true' && '- [ ] Remove package-lock.json if not needed' || '' }} ---