MD-Anderson-Bioinformatics / NG-CHM

A dynamic, graphical environment for exploration of clustered or non-clustered heat map data in a web browser.
https://bioinformatics.mdanderson.org/main/NG-CHM-V2:Overview
GNU General Public License v2.0
10 stars 9 forks source link

Run prettier on .js files and update actions #527

Closed marohrdanz closed 5 months ago

marohrdanz commented 5 months ago

This pull request

  1. Runs prettier to standardize formatting of the .js files
  2. Updates our GitHub actions to:
    • Account for whitespace change in CompatibilityManger.js line that contains the version number
    • Remove deprecation warnings about Node 16.
  3. Updates third-party GitHub actions to remove deprecation warnings about Node 16.

My fork of the NG-CHM Artifacts repo contains artifacts built from the changes in this PR: https://github.com/marohrdanz/NG-CHM-Artifacts

1. Prettier

Ran prettier with default options:

prettier --write *.js

on WebContent/javascript/*.js and custom.js files.

I just got tired of trying to understand the code with variable formatting and indentation.

2. GitHub Action updates

This run of prettier changed the line in CompatibilityManager.js containing the version string from

CM.version = "<version number>"

to include leading whitespace:

  CM.version = "<version number>"

I naively thought I could simply add leading whitspace in the action workflow that extracts the version number. E.g.:

start_string: '  CM.version = '

However GitHub Actions remove leading whitespace from arguments, lolz.

So I updated the github action that extracts the version number from CompatibilityManager.js.

I also updated these actions to avoid GitHub's warning that Node 16 is deprecated. These actions have been updated to Node 20.

These updates are reflected in their corresponding repo releases:

3. Third-party actions update

These version updates were inspired by the Node 16 deprecation warnings.

ChrisWakefield commented 5 months ago

@marohrdanz Does your comment about "My fork of the NG-CHM Artifacts" mean that you have built and tested those artifacts after the Prettier step?

marohrdanz commented 5 months ago

FYI: the two force pushes to mary-dev were rebases to

  1. fix a typo in a commit message, and
  2. squash a commit because I initially missed updating the version for github action softprops/action-gh-release in NG-CHM-Artifiacts_release.yml
marohrdanz commented 5 months ago

@ChrisWakefield , I have tested:

Are there other tests I should perform? (maybe a topic for today's meeting).