-
Notifications
You must be signed in to change notification settings - Fork 274
🏗️ build: replace webpack with vite 8 build system #4529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
riccio82
wants to merge
40
commits into
develop
Choose a base branch
from
spike/vite-migration
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
180d87d
Replace Webpack with Vite 8 build system
riccio82 818c824
Adapt source code for Vite compatibility
riccio82 f7d3160
Clean up post-migration config files
riccio82 d0c5972
Update submodule
riccio82 1e69d11
Fix PHPStan errors in Vite integration
riccio82 f1db594
Use AppConfig::$HTTPHOST instead of hardcoded dev URL in ViteAssets
riccio82 e4f5e8d
Apply suggestion from @Copilot
riccio82 09ce5e0
Added missing subfiltering_handlers in GetContributionWorker (#4519)
mauretto78 f3363a9
🐛 fix(project-creation): eliminate replication-lag race and make pre-…
Ostico 8e33cba
fix: subfiltering handlers persist (#4521)
mauretto78 eec4aef
fix: correct handling of self closing PC tags (#4525)
mauretto78 659f115
🔧 chore(deps): update @translated/lara to 1.9.0 (#4516)
riccio82 88a6445
feat: add ed error_code to AI Worker messages (#4533)
mauretto78 921571a
🔧 chore(phpstan): regenerate baseline for new @throws rules
Ostico fa75811
📝 docs: add PR readiness checklist template and GitHub Actions validator
Ostico 798a5b3
📝 docs(pr-template): simplify AI usage disclosure instructions
Ostico d601fcb
🔧 chore(jest): exclude .github/ from Jest test discovery
Ostico dfad79f
🔧 chore(phpstan): exclude APIDoc build artifacts from analysis
Ostico 9367b15
🔧 chore(phpstan): mark APIDoc.php exclude path as optional
Ostico b8b3cbb
Update .github/workflows/pr-readiness-check.yml
Ostico 09affd9
👷 ci: add conventional-commit message enforcement workflow
Ostico 8a1c3e8
🐛 fix(ci): relax commit message check for Copilot and GitHub web edits
Ostico dec166e
🔧 chore(phpstan): add @throws \Throwable to FastAnalysis transaction …
Ostico 12c9045
👷 ci(test-guard): add test adequacy gate workflow
Ostico 8012fb8
👷 ci(test-guard): integrate test-guard into CI/CD pipeline
Ostico ef9e750
👷 ci(test-guard): bump ostico/test-guard to v1.0.3
Ostico 331aef5
👷 ci(test-guard): bump ostico/test-guard to v1.0.5
Ostico 4aa0604
👷 ci: add models:read permission to _ci-cd.yml
Ostico 3aa2362
🐛 fix(ci): add models:read permission for test-guard AI analysis
Ostico 9837941
👷 ci(test-guard): switch to floating tag ostico/test-guard@v1
Ostico 068e928
👷 ci(permissions): replace statuses:write with checks:write in workflows
Ostico dbe6bb5
👷 ci(coverage): add JS coverage report to test-guard pipeline
Ostico 1ba25de
Update submodule
riccio82 cb1793c
Remove unused test-entry.js placeholder
riccio82 728bd0a
Merge remote-tracking branch 'origin/develop' into spike/vite-migration
riccio82 b656357
Merge branch 'develop' into spike/vite-migration
riccio82 a543170
♻️ refactor(imports): convert lazy require() to async import() and up…
riccio82 d58e9c3
🐛 fix(hmr): prevent portal crash on hot reload and remove hardcoded d…
riccio82 9c863b6
fix: remove redundant dynamic imports and add error handling to updat…
Copilot 530b7f6
🛡️ fix(imports): add defensive guards to async import getters
riccio82 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,4 +84,5 @@ certs | |
| /.phpunit.cache | ||
| /CallGraph | ||
| /PHP-SQL-Parser | ||
| /storage | ||
| /storage | ||
| /public/build/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,30 @@ | ||
| #!/usr/bin/env node | ||
| const {execSync} = require('child_process') | ||
| const madge = require('madge') | ||
|
|
||
| let cycles | ||
| try { | ||
| const output = execSync( | ||
| 'npx madge --circular --extensions js --json public/js/', | ||
| {encoding: 'utf8', maxBuffer: 10 * 1024 * 1024}, | ||
| ) | ||
| cycles = JSON.parse(output) | ||
| } catch (e) { | ||
| if (e.stdout) { | ||
| cycles = JSON.parse(e.stdout) | ||
| } else { | ||
| console.error('Failed to run madge:', e.message) | ||
| process.exit(1) | ||
| } | ||
| } | ||
| madge('public/js/', { | ||
| fileExtensions: ['js'], | ||
| detectiveOptions: { | ||
| es6: { | ||
| skipAsyncImports: true, | ||
| }, | ||
| }, | ||
| }) | ||
| .then((res) => { | ||
| const cycles = res.circular() | ||
|
|
||
| if (cycles.length > 0) { | ||
| console.error( | ||
| `\x1b[31m✖ Found ${cycles.length} circular dependencies:\x1b[0m\n`, | ||
| ) | ||
| cycles.forEach((cycle, i) => { | ||
| console.error(` ${i + 1}) ${cycle.join(' → ')}`) | ||
| if (cycles.length > 0) { | ||
| console.error( | ||
| `\x1b[31m✖ Found ${cycles.length} circular dependencies:\x1b[0m\n`, | ||
| ) | ||
| cycles.forEach((cycle, i) => { | ||
| console.error(` ${i + 1}) ${cycle.join(' → ')}`) | ||
| }) | ||
| process.exit(1) | ||
| } else { | ||
| console.log('\x1b[32m✔ No circular dependencies\x1b[0m') | ||
| } | ||
| }) | ||
| .catch((err) => { | ||
| console.error('Failed to run madge:', err.message) | ||
| process.exit(1) | ||
| }) | ||
| process.exit(1) | ||
| } else { | ||
| console.log('\x1b[32m✔ No circular dependencies\x1b[0m') | ||
| } |
Submodule docker
updated
from b0553a to 1be999
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| <?php | ||
|
|
||
| namespace Utils\Vite; | ||
|
|
||
| use Utils\Registry\AppConfig; | ||
|
|
||
| class ViteAssets { | ||
|
|
||
| private const GROUPS_PATH = 'public/vite-entries/groups.json'; | ||
|
|
||
| private static ?bool $devMode = null; | ||
|
|
||
| /** @var array<string, list<string>>|null */ | ||
| private static ?array $groups = null; | ||
|
|
||
| public static function isDevMode(): bool { | ||
| if ( self::$devMode !== null ) { | ||
| return self::$devMode; | ||
| } | ||
| self::$devMode = !empty( $_ENV[ 'VITE_DEV' ] ) || !empty( $_SERVER[ 'VITE_DEV' ] ); | ||
|
|
||
| return self::$devMode; | ||
| } | ||
|
|
||
| /** | ||
| * @return array<string, list<string>> | ||
| */ | ||
| private static function loadGroups(): array { | ||
| if ( self::$groups !== null ) { | ||
| return self::$groups; | ||
| } | ||
|
|
||
| $path = AppConfig::$ROOT . '/' . self::GROUPS_PATH; | ||
| if ( !file_exists( $path ) ) { | ||
| self::$groups = []; | ||
|
|
||
| return self::$groups; | ||
| } | ||
|
|
||
| $raw = file_get_contents( $path ); | ||
| if ( $raw === false ) { | ||
| self::$groups = []; | ||
|
|
||
| return self::$groups; | ||
| } | ||
|
|
||
| self::$groups = json_decode( $raw, true ) ?: []; | ||
|
|
||
| return self::$groups; | ||
| } | ||
|
|
||
| public static function getHtml( string $templateName, string $nonce = '' ): string { | ||
| if ( !self::isDevMode() ) { | ||
| return ''; | ||
| } | ||
|
|
||
| return self::buildDevHtml( $templateName, $nonce ); | ||
| } | ||
|
|
||
| private static function buildDevHtml( string $templateName, string $nonce ): string { | ||
| $groups = self::loadGroups(); | ||
| $entries = $groups[ $templateName ] ?? []; | ||
|
|
||
| if ( empty( $entries ) ) { | ||
| return ''; | ||
| } | ||
|
|
||
| $host = AppConfig::$HTTPHOST; | ||
| $n = $nonce ? " nonce=\"{$nonce}\"" : ''; | ||
| $lines = []; | ||
|
|
||
| $lines[] = '<script type="module"' . $n . '>' | ||
| . "import RefreshRuntime from '/@react-refresh'\n" | ||
| . "RefreshRuntime.injectIntoGlobalHook(window)\n" | ||
| . 'window.$RefreshReg$ = () => {}' . "\n" | ||
| . 'window.$RefreshSig$ = () => (type) => type' . "\n" | ||
| . 'window.__vite_plugin_react_preamble_installed__ = true' | ||
| . '</script>'; | ||
|
|
||
| $lines[] = '<script type="module" src="' . $host . '/@vite/client"' . $n . '></script>'; | ||
|
|
||
| foreach ( $entries as $entry ) { | ||
| $lines[] = '<script type="module" src="' . $host . '/public/vite-entries/' . $entry . '.js"' . $n . '></script>'; | ||
| } | ||
|
|
||
| return implode( "\n", $lines ); | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule translated
updated
from c957a2 to ff0e0f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.