mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 10:10:08 +02:00
[web] change esm codemod to use vitest and general refactor GitOrigin-RevId: 7f8c699b160ee0b7ff991d6284cb126165694c4f
23 lines
457 B
Bash
Executable File
23 lines
457 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: transform-dir.sh <module_path>"
|
|
exit 1
|
|
fi
|
|
|
|
MODULE_PATH=$1
|
|
|
|
while true; do
|
|
FILES=$(node scripts/esm-check-migration.mjs -f "$MODULE_PATH" -j | jq -r '.filesNotImportedViaCjs | join(" ")')
|
|
if [ -z "$FILES" ]; then
|
|
break
|
|
fi
|
|
# We want word splitting here
|
|
# shellcheck disable=SC2086
|
|
node transform/cjs-to-esm/cjs-to-esm.mjs $FILES
|
|
done
|
|
|
|
make format_fix > /dev/null
|
|
|
|
echo "All files processed."
|