Skip to content

Conversation

@emmadesilva
Copy link
Member

@emmadesilva emmadesilva commented Nov 11, 2024

Replace Mix build flags with Vite flag

Description

This PR replaces the --run-dev and --run-prod build command flags with a single --run-vite flag. This change is needed because we switched from Laravel Mix to Vite in #2010, which has different commands and behaviors:

  • npm run dev with Vite starts a development server (incompatible with our build process)
  • npm run prod no longer exists, replaced by npm run build

The new --run-vite flag will:

  1. Run npm run build to compile assets with Vite
  2. Re-run the media asset transfer task since Vite outputs to _site/media (see [2.x] No longer copy files to site output from the asset bundler command #2011)

Breaking Changes

  • Removed --run-dev flag
  • Removed --run-prod flag
  • Added new --run-vite flag

Related Issues/PRs

Upgrade Guide

Replace any usage of --run-dev or --run-prod with --run-vite:

@emmadesilva emmadesilva mentioned this pull request Nov 11, 2024
17 tasks
@codecov
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.98%. Comparing base (3b89ec0) to head (25bbab8).
Report is 6 commits behind head on new-asset-system.

Files with missing lines Patch % Lines
...ramework/src/Console/Commands/BuildSiteCommand.php 75.00% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##             new-asset-system    #2013      +/-   ##
======================================================
- Coverage              100.00%   99.98%   -0.02%     
- Complexity               1891     1892       +1     
======================================================
  Files                     194      194              
  Lines                    5044     5044              
======================================================
- Hits                     5044     5043       -1     
- Misses                      0        1       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@emmadesilva emmadesilva force-pushed the new-vite-build-command-flag branch from 31eb157 to 7e998a2 Compare November 11, 2024 17:56
@emmadesilva emmadesilva force-pushed the new-vite-build-command-flag branch from 74d2278 to 9f3c99f Compare November 11, 2024 18:04
@emmadesilva emmadesilva changed the title [2.x] Replace --run-dev and --run-prod build command flags with --run-vite [2.x] Replace --run-dev and --run-prod build command flags with --run-vite flag Nov 11, 2024
@emmadesilva
Copy link
Member Author

Alternate Name Considerations:

Before choosing the option name --run-vite, I considered some alternative options:

Alternatives:

  • --vite-build: More explicit about the tool and action.
  • --build-assets: Generic and clear about the purpose.
  • --compile-assets: Generic and future-proof, emphasizing the compilation process.

Motivations for --run-vite:

  • Clarity: The name is clear in the context of the build process.
  • Consistency: It aligns with other --run-* flags, providing a consistent naming convention.

Motivations Against Other Options:

  • --vite-build: While explicit, it might be overly specific and could limit flexibility in case of tool changes.
  • --build-assets: While generic and clear, it doesn't explicitly mention Vite and might be less informative for users unfamiliar with the build process.
  • --compile-assets: While future-proof, it might not be as intuitive for users who are primarily familiar with the concept of "building" assets.

@emmadesilva emmadesilva force-pushed the new-vite-build-command-flag branch from 41e57b9 to 25bbab8 Compare November 11, 2024 18:22
@emmadesilva emmadesilva merged commit 1d79bd5 into new-asset-system Nov 11, 2024
10 checks passed
@emmadesilva emmadesilva deleted the new-vite-build-command-flag branch November 11, 2024 18:24
emmadesilva added a commit that referenced this pull request Nov 11, 2024
[2.x] Replace `--run-dev` and `--run-prod` build command flags with `--run-vite` flag
@emmadesilva
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants