Skip to content

Commit

Permalink
mattermostLatest: 10.3.1 -> 10.4.1
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
numinit committed Jan 19, 2025
1 parent 88ef3d9 commit cbd54cc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
12 changes: 12 additions & 0 deletions pkgs/by-name/ma/mattermost/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions pkgs/by-name/ma/mattermostLatest/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}

0 comments on commit cbd54cc

Please sign in to comment.