Ensure ESBuild versions are in sync in PRESUBMIT
We have ESBuild as a dep in two places:
1. `DEPS`, managed by gclient
2. `manage_node_deps.py`, managed by npm
These versions need to match, otherwise any builds that use `esbuild`
will fail in Chrome land. This CL introduces a script and PRESUBMIT
check to ensure that the two versions are in sync.
Bug: none
Change-Id: I7ea9172ae386e4e21e1ac82c208d171b65b29e22
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4067299
Reviewed-by: Liviu Rau <liviurau@google.com>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 3e7849f..7a3ad05 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -175,6 +175,17 @@
return results
+def _CheckESBuildVersion(input_api, output_api):
+ results = [
+ output_api.PresubmitNotifyResult('Running ESBuild version check:')
+ ]
+ script_path = input_api.os_path.join(input_api.PresubmitLocalPath(),
+ 'scripts',
+ 'check_esbuild_versions.js')
+ results.extend(_checkWithNodeScript(input_api, output_api, script_path))
+ return results
+
+
def _CheckFormat(input_api, output_api):
node_modules_affected_files = _getAffectedFiles(input_api, [
input_api.os_path.join(input_api.PresubmitLocalPath(), 'node_modules'),
@@ -567,6 +578,7 @@
input_api, output_api))
results.extend(_CheckFormat(input_api, output_api))
+ results.extend(_CheckESBuildVersion(input_api, output_api))
results.extend(_CheckChangesAreExclusiveToDirectory(input_api, output_api))
# Run the canned checks from `depot_tools` after the custom DevTools checks.
# The canned checks for example check that lines have line endings. The