Review main Abandoned

72629[WIP][TASK] Avoid relative imports in TypeScript

Benjamin Franzke CR 0 V 0 Hard +454 −454 updated 01/05/22, 12:05

Commit message

Refactor for ES6 to allow importmaps
to handle mapping module specifiers
to filenames.

All changes have been automated with the following script,
no manual adaptions:

  # Note: For rebase use following prefix commands
  #rm -rf Build/Sources/TypeScript/
  #git checkout HEAD^ -- Build/Sources/TypeScript/

  sed -i 's:../../DateTimePicker:TYPO3/CMS/Backend/DateTimePicker:g' \
      Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/Element/InputDateTimeElement.ts

  find Build/Sources/TypeScript/ -name '*.ts' | while read filepath
  do
      filename=$(echo "${filepath}" | sed 's/Build\/Sources\/TypeScript\///')
      extname=$(echo "${filename}" | sed 's/\([^\/]*\)\/.*/\1/')
      packagename=$(echo "${extname}" | sed -r 's/(^|_)([a-z])/\U\2/g')
      dirname=$(echo ${filename} | sed -e 's/Resources\/Public\/TypeScript//' -e 's/^[^\/]*\/\(.*\)\/[^\/][^\/]*/\1/')

      basename="TYPO3/CMS/${packagename}${dirname}"

      sed -i "s:^\(import.*'\)\\.:\1${basename}\\/.:" "${filepath}"

      sed -i '/^import/s/\/.\//\//' "${filepath}"
      sed -i '/^import/s/\/\([^\/]*\)\/..\//\//' "${filepath}"
      sed -i '/^import/s/\/\([^\/]*\)\/..\//\//' "${filepath}"
      sed -i '/^import/s/\/\([^\/]*\)\/..\//\//' "${filepath}"
  done

Review

  • Code review CR 0

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V 0

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 240

Show 220 more files