Skip to content

Convert scripts/Gulpfile to checked mjs/cjs so they can run without compilation - #50988

Merged
Jake Bailey (jakebailey) merged 13 commits into
microsoft:mainfrom
jakebailey:pure-js-scripts-1
Oct 7, 2022
Merged

Convert scripts/Gulpfile to checked mjs/cjs so they can run without compilation#50988
Jake Bailey (jakebailey) merged 13 commits into
microsoft:mainfrom
jakebailey:pure-js-scripts-1

Conversation

@jakebailey

@jakebailey Jake Bailey (jakebailey) commented Sep 29, 2022

Copy link
Copy Markdown
Member

This overall makes the build and branch switches faster. It's also a prerequisite for sharing some code between scripts and the scripts/built modules (which are only used from the gulpfile).

To prevent any annoying gitignore troubles, all files are either mjs or cjs, any .js files are ignored so going forward/back in the commit history shouldn't leave any annoying files around.

I had to update node-fetch; the previous version hits the new-ish issues with 4.8's default behavior. I don't think this has any major impact on daily use of the repo, so differences in the versions shouldn't cause annoyances when bisecting.

Leaving this as a draft until I go around to figure out what all are using these scripts directly, e.g. open-cherry-pick-pr and such are not referenced in this repo so probably are defined in some build somewhere.

Things that have to change external to this PR:

  • There are various pipelines on AzDo that directly compile scripts and then run them. They can be fixed pretty easily by checking if [ -f "./scripts/open-cherry-pick-pr.mjs" ]; then ... else ... fi.
  • We have a PR task which screws around with chalk; this should be a no-op at this point given we now pin a specific verison, but when we're mjs, it's never a problem since the whole reason for the fix is to get around ESM stuff anyway.

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants