mattermostLatest: 10.3.1 -> 10.4.1
Add a lockfileOverlay option that lets us make changes to the package lockfile if it's broken, such as unlocking packages and letting npm-lockfile-fix handle them if they are mis-locked.
This commit is contained in:
@@ -41,6 +41,18 @@ buildGoModule rec {
|
||||
def desuffix(version): version | gsub("^(?<prefix>[^\\+]+)\\+.*$"; "\(.prefix)");
|
||||
.packages |= map_values(if has("version") then .version = desuffix(.version) else . end)
|
||||
' < package-lock.json > package-lock.fixed.json
|
||||
|
||||
# Run the lockfile overlay, if present.
|
||||
${lib.optionalString (versionInfo.lockfileOverlay or null != null) ''
|
||||
${lib.getExe jq} ${lib.escapeShellArg ''
|
||||
# Unlock a dependency and let npm-lockfile-fix relock it.
|
||||
def unlock(root; dependency; path):
|
||||
root | .packages[path] |= del(.resolved, .integrity)
|
||||
| .packages[path].version = root.packages.channels.dependencies[dependency];
|
||||
${versionInfo.lockfileOverlay}
|
||||
''} < package-lock.fixed.json > package-lock.overlaid.json
|
||||
mv package-lock.overlaid.json package-lock.fixed.json
|
||||
''}
|
||||
${lib.getExe npm-lockfile-fix} package-lock.fixed.json
|
||||
|
||||
rm -f package-lock.json
|
||||
|
||||
@@ -11,10 +11,13 @@ mattermost.override {
|
||||
# and make sure the version regex is up to date here.
|
||||
# Ensure you also check ../mattermost/package.nix for ESR releases.
|
||||
regex = "^v(10\.4\.[0-9]+)$";
|
||||
version = "10.3.1";
|
||||
srcHash = "sha256-nghwf9FgdqEDLkm8dKqhvY1SvALSZ8dasTDwMwbL5AI=";
|
||||
vendorHash = "sha256-G2IhU8/XSITjJKNu1Iwwoabm+hG9r3kLPtZnlzuKBD8=";
|
||||
npmDepsHash = "sha256-Dc+ZFQzRQoUnsZDnPs55gr6O82WwyuBEmCZYFAwW50M=";
|
||||
version = "10.4.1";
|
||||
srcHash = "sha256-e7uT30tWhJpEQzlcDUY2huFcupDbe4l8B19Dgub2pg0=";
|
||||
vendorHash = "sha256-AcemUxcBoytE/ZoXqaIlxkzAnmGV/C1laDqziMuE+XE=";
|
||||
npmDepsHash = "sha256-HABPwdhtev9DZLhWJQsyU4g2ZueYgsX+tUduMsc74YY=";
|
||||
lockfileOverlay = ''
|
||||
unlock(.; "@floating-ui/react"; "channels/node_modules/@floating-ui/react")
|
||||
'';
|
||||
autoUpdate = ./package.nix;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user