Skip to content

Add frontend files-tree finder

Mark Florian requested to merge migrate-classes-to-tailwind-script into master

What does this MR do and why?

This adds a script that find a given frontend file's dependencies by walking its import dependency tree. This can be used in conjunction with the Tailwind migration script to migrate batches of related files.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Run the script against some frontend file, eg with app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue:

    scripts/frontend/find_frontend_files.mjs app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue
  2. Or pipe the output to the Tailwind migration script to update the CSS utils in those files:

    yarn # Make sure your dependencies are up-to-date as the migration script is part of `@gitlab/ui@86`.
    scripts/frontend/find_frontend_files.mjs app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue | ./node_modules/@gitlab/ui/bin/migrate_custom_utils_to_tw.bundled.mjs --from-stdin
Edited by Paul Gascou-Vaillancourt

Merge request reports