Simplify fileURLToPath usage in scripts
What does this MR do and why?
Allow import extensions in scripts
Rather than repeatedly disabling it, just allow it in scripts and configuration files.
Fix find_frontend_files script
This was broken !170174 (merged).
Node requires file extensions when used with the import
statement.
Simplify fileURLToPath usage in scripts
The dirname
and filename
properties of import.meta
were added
in Node 20.11.0, and we've been on 20.12.2 for a while.
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.
Screenshots or screen recordings
n/a
How to set up and validate locally
These scripts should all operate normally without any errors. You don't need to know what these scripts do or how they work, only that they don't error out.
-
config/helpers/vite_plugin_style.mjs
- Run the GDK locally with Vite enabled. There should be no obvious errors.
-
scripts/frontend/lib/compile_css.mjs
- As above.
-
scripts/frontend/tailwindcss.mjs
- As above, and also:
node scripts/frontend/tailwindcss.mjs
-
eslint.config.mjs
- Run
yarn lint:eslint jest_resolver.js
, or similar.
- Run
-
scripts/frontend/find_frontend_files.mjs
-
scripts/frontend/find_frontend_files.mjs app/assets/javascripts/awards_handler.js
. - This was broken by !170174 (merged), but now should work.
-
-
scripts/frontend/preinstall.mjs
yarn install
Edited by Mark Florian