Add helpful warnings to migration tool#8037
Merged
Conversation
Contributor
|
Netlify Draft Deployment |
Contributor
Hydration Benchmark Report (vs Baseline)✅ Top 5 Improvements (Best Speedups)
🔻 Flop 5 Regressions (Worst Slowdowns)
📋 Show all results
|
2c1d3b4 to
74386e0
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Martin <6279703+deleonio@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Martin <6279703+deleonio@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Martin <6279703+deleonio@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Martin <6279703+deleonio@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request enhances the KoliBri CLI migration tool by adding validation checks and improved user feedback to guide users when migrating projects. The changes help identify potential issues early and provide clearer guidance when migrations don't find KoliBri components or produce no file modifications.
- Added regex-based detection of KoliBri tags in project files to validate migration targets
- Implemented directory existence validation and warning messages for empty migration results
- Enhanced console output to provide better user guidance during the migration process
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/tools/visual-tests/src/index.js | Improved fallback logic for temporary directory resolution by adding os.tmpdir() |
| packages/tools/kolibri-cli/src/types.ts | Added regex patterns for detecting KoliBri web and React component tags |
| packages/tools/kolibri-cli/src/migrate/shares/reuse.ts | Implemented hasKolibriTags function to scan files for KoliBri component usage |
| packages/tools/kolibri-cli/src/migrate/index.ts | Integrated validation checks and enhanced user feedback in migration workflow |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 introduces several updates to the
kolibri-clitool, including improvements to error handling, support for asynchronous command parsing, and enhancements to the migration process. It also includes updates to the test suite and minor changes to the visual tests utility. Below are the most important changes grouped by theme:Command Parsing and Execution:
program.parse()) with asynchronous parsing (program.parseAsync()) across multiple files to improve non-blocking execution. ([[1]](https://github.com/public-ui/kolibri/pull/8037/files#diff-a6e505ca1bce6beb1c26ea6eaa817b6a7917584fbff1528c591329eadc51023aL34-R34),[[2]](https://github.com/public-ui/kolibri/pull/8037/files#diff-43c2c697e00052437a19b2faa0283bbf06768b62c65dd6ef6f525bfab54ead45L13-R58),[[3]](https://github.com/public-ui/kolibri/pull/8037/files#diff-43c2c697e00052437a19b2faa0283bbf06768b62c65dd6ef6f525bfab54ead45L71-R76))Migration Enhancements:
[[1]](https://github.com/public-ui/kolibri/pull/8037/files#diff-0f4c1099a75fc41acdcfd8e777ddec500af1b5e7f335cfad1b33bdc78638b909R95-R101),[[2]](https://github.com/public-ui/kolibri/pull/8037/files#diff-0f4c1099a75fc41acdcfd8e777ddec500af1b5e7f335cfad1b33bdc78638b909R214-R217))hasKoliBriTagsutility function to efficiently scan directories for KoliBri component tags (web or React) using regex patterns. ([packages/tools/kolibri-cli/src/migrate/shares/reuse.tsR64-R102](https://github.com/public-ui/kolibri/pull/8037/files#diff-b2916f4608b5373374152773dfcf75d1b67e52e9f482abc70be174ca6ff99a55R64-R102))WEB_TAG_REGEXandREACT_TAG_REGEXfor identifying KoliBri tags in markup files. ([packages/tools/kolibri-cli/src/types.tsR8-R10](https://github.com/public-ui/kolibri/pull/8037/files#diff-f6fa260b90aef11eeffd413f2460122fa7ab99105e603faac41aa82bc13cf596R8-R10))Test Suite Updates:
program.parseAsync) and ensured proper restoration of the working directory after tests. ([[1]](https://github.com/public-ui/kolibri/pull/8037/files#diff-43c2c697e00052437a19b2faa0283bbf06768b62c65dd6ef6f525bfab54ead45L13-R58),[[2]](https://github.com/public-ui/kolibri/pull/8037/files#diff-43c2c697e00052437a19b2faa0283bbf06768b62c65dd6ef6f525bfab54ead45L90-R102))Utility Improvements:
getBinaryVersionto prevent unintended modifications topackage.jsonwhen using Yarn with Corepack. ([packages/tools/kolibri-cli/src/info/index.tsR11-R23](https://github.com/public-ui/kolibri/pull/8037/files#diff-4dd1057d925acf329dc208b76c7ed41617399e25be3b3f6aa6ecdc6f363e0136R11-R23))tempDirhandling in visual tests utility to fall back toos.tmpdir()when environment variables are not set. ([packages/tools/visual-tests/src/index.jsR9-R11](https://github.com/public-ui/kolibri/pull/8037/files#diff-f61a4e5c7dd4a054ee031451088f13b7355212e7b53766f6ae8d5eed1e0d9f15R9-R11))