Conversation
There was a problem hiding this comment.
Pull request overview
This pull request tightens the framework file “flattening” behavior so that when one framework’s files are copied into resources/js/, leftover root-level files originating from other frameworks are removed, preventing stale cross-framework artifacts.
Changes:
- Updated
flattenFrameworkFiles()to detect root-level files that correspond to non-selected frameworks and remove them after flattening. - Added a unit test to confirm that a stale root file from another framework is deleted when flattening for the selected framework.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Installer.php |
Tracks non-selected framework file paths and removes any corresponding stale root-level files after flattening. |
tests/ModuleInstallerTest.php |
Adds coverage to ensure stale root files from other frameworks are removed when flattening for the selected framework. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1049
to
+1058
| $installer = new TestableInstaller($this->createStub(IOInterface::class), null); | ||
| $installer->callFlattenFrameworkFiles($jsRoot, 'react'); | ||
|
|
||
| $this->assertFileExists($jsRoot.'/app.tsx'); | ||
| $this->assertFileDoesNotExist($jsRoot.'/app.ts'); | ||
| $this->assertDirectoryDoesNotExist($jsRoot.'/vue'); | ||
| $this->assertDirectoryDoesNotExist($jsRoot.'/react'); | ||
|
|
||
| (new Filesystem)->remove($jsRoot); | ||
| } |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request improves the handling of framework-specific files during the flattening process and adds a new test to ensure stale files from other frameworks are properly removed. The main changes focus on making sure that when copying files for a selected framework, any obsolete files from other frameworks are cleaned up from the root directory.
Framework file flattening and cleanup:
flattenFrameworkFilesinInstaller.phpto track and remove stale files from the root directory that belong to other frameworks, ensuring only the current framework's files remain after flattening.Testing improvements:
test_flatten_framework_files_removes_stale_root_file_from_other_frameworkinModuleInstallerTest.phpto verify that stale root files from other frameworks are deleted and only the selected framework's files persist.