]> source.dussan.org Git - jquery.git/commitdiff
Build: Fix pre release matching in compare size regex main
authorTimmy Willison <timmywil@users.noreply.github.com>
Thu, 21 Nov 2024 10:21:42 +0000 (05:21 -0500)
committerGitHub <noreply@github.com>
Thu, 21 Nov 2024 10:21:42 +0000 (11:21 +0100)
Closes gh-5584

build/tasks/lib/compareSize.js

index 729bb37f2d56c2a6767e4c1a6f95b9875f2a2f2a..86548a6dab6b1cd3d50fa5490f5c0381f8800ce3 100644 (file)
@@ -5,7 +5,7 @@ import { exec as nodeExec } from "node:child_process";
 import chalk from "chalk";
 import isCleanWorkingDir from "./isCleanWorkingDir.js";
 
 import chalk from "chalk";
 import isCleanWorkingDir from "./isCleanWorkingDir.js";
 
-const VERSION = 1;
+const VERSION = 2;
 const lastRunBranch = " last run";
 
 const gzip = promisify( zlib.gzip );
 const lastRunBranch = " last run";
 
 const gzip = promisify( zlib.gzip );
@@ -111,7 +111,7 @@ export async function compareSize( { cache = ".sizecache.json", files } = {} ) {
                        // Remove the short SHA and .dirty from comparisons.
                        // The short SHA so commits can be compared against each other
                        // and .dirty to compare with the existing branch during development.
                        // Remove the short SHA and .dirty from comparisons.
                        // The short SHA so commits can be compared against each other
                        // and .dirty to compare with the existing branch during development.
-                       const sha = /jQuery v\d+.\d+.\d+(?:-\w+)?(?:\+slim\.|\+)?([^ \.]+(?:\.dirty)?)?/.exec( contents )[ 1 ];
+                       const sha = /jQuery v\d+.\d+.\d+(?:-[\w\.]+)?(?:\+slim\.|\+)?(\w+(?:\.dirty)?)?/.exec( contents )[ 1 ];
                        contents = contents.replace( new RegExp( sha, "g" ), "" );
 
                        const size = Buffer.byteLength( contents, "utf8" );
                        contents = contents.replace( new RegExp( sha, "g" ), "" );
 
                        const size = Buffer.byteLength( contents, "utf8" );