matrix-appservice-slack: 1.11.0 -> 2.0.1

This commit is contained in:
Charlotte Van Petegem 2022-10-06 10:33:32 +02:00 committed by Winter
parent 61e0cd11c3
commit 8f3fd35f10
7 changed files with 152 additions and 5532 deletions

View File

@ -1,30 +1,50 @@
{ pkgs, nodejs, stdenv, fetchFromGitHub, lib, ... }:
{ lib
, fetchFromGitHub
, fetchYarnDeps
, makeWrapper
, matrix-sdk-crypto-nodejs
, mkYarnPackage
, nodejs
}:
let
data = lib.importJSON ./pin.json;
in
mkYarnPackage rec {
pname = "matrix-appservice-slack";
version = data.version;
packageJSON = ./package.json;
src = fetchFromGitHub {
owner = "matrix-org";
repo = "matrix-appservice-slack";
rev = "1.11.0";
sha256 = "U1EHL1ZwcpCXA9sjya6ry/3Q+gwdQWPUDFN+wp1qjrg=";
rev = data.version;
sha256 = data.srcHash;
};
nodePackages = import ./node-composition.nix {
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;
offlineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
sha256 = data.yarnHash;
};
packageResolutions = {
"@matrix-org/matrix-sdk-crypto-nodejs" = "${matrix-sdk-crypto-nodejs}/lib/node_modules/@matrix-org/matrix-sdk-crypto-nodejs";
};
in
nodePackages.package.override {
pname = "matrix-appservice-slack";
inherit src;
nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ pkgs.makeWrapper ];
buildPhase = ''
runHook preBuild
yarn run build
runHook postBuild
'';
postInstall = ''
npm run build
makeWrapper '${nodejs}/bin/node' "$out/bin/matrix-appservice-slack" \
--add-flags "$out/lib/node_modules/matrix-appservice-slack/lib/app.js"
makeWrapper '${nodejs}/bin/node' "$out/bin/matrix-appservice-slack" --add-flags \
"$out/libexec/matrix-appservice-slack/deps/matrix-appservice-slack/lib/app.js"
'';
doDist = false;
meta = with lib; {
description = "A Matrix <--> Slack bridge";
maintainers = with maintainers; [ beardhatcode ];

View File

@ -1,17 +0,0 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nodePackages.node2nix
# Download package.json and package-lock.json from the v1.11.0 release
curl https://raw.githubusercontent.com/matrix-org/matrix-appservice-slack/1.11.0/package.json -o package.json
curl https://raw.githubusercontent.com/matrix-org/matrix-appservice-slack/1.11.0/package-lock.json -o package-lock.json
node2nix \
--nodejs-16 \
--node-env ../../../development/node-packages/node-env.nix \
--development \
--input package.json \
--lock package-lock.json \
--output node-packages.nix \
--composition node-composition.nix \
rm -f package.json package-lock.json

View File

@ -1,17 +0,0 @@
# This file has been generated by node2nix 1.9.0. Do not edit!
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-14_x"}:
let
nodeEnv = import ../../../development/node-packages/node-env.nix {
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,77 @@
{
"name": "matrix-appservice-slack",
"version": "2.0.1",
"description": "A Matrix <--> Slack bridge",
"engines": {
"node": ">=16 <=18"
},
"main": "app.js",
"scripts": {
"prepare": "yarn build",
"start": "node ./lib/app.js",
"build": "tsc --build",
"test": "yarn test:unit && yarn test:integration",
"test:unit": "mocha --require ts-node/register --recursive tests/unit/*.ts",
"test:integration": "mocha --exit --reporter list --ui bdd --require ts-node/register --recursive tests/integration/*.ts",
"test:postgres": "SLACKBRIDGE_TEST_ENABLEPG=yes mocha --reporter list --ui bdd --require ts-node/register --recursive tests/integration/PgDatastoreTest.ts",
"lint": "eslint -c .eslintrc.js ./src"
},
"repository": {
"type": "git",
"url": "git+https://github.com/matrix-org/matrix-appservice-slack.git"
},
"keywords": [
"matrix-org",
"slack"
],
"author": "Matrix.org",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/matrix-org/matrix-appservice-slack/issues"
},
"homepage": "https://github.com/matrix-org/matrix-appservice-slack#readme",
"dependencies": {
"@alloc/quick-lru": "^5.2.0",
"@slack/logger": "^3.0.0",
"@slack/rtm-api": "^6.0.0",
"@slack/web-api": "^6.7.2",
"Slackdown": "git+https://Half-Shot@github.com/half-shot/slackdown.git",
"axios": "^0.27.2",
"escape-string-regexp": "^4.0.0",
"matrix-appservice-bridge": "^5.1.0",
"minimist": "^1.2.6",
"nedb": "^1.8.0",
"node-emoji": "^1.10.0",
"nunjucks": "^3.2.3",
"p-queue": "^6.0.0",
"pg-promise": "^10.11.1",
"randomstring": "^1.2.1",
"uuid": "^8.3.2",
"yargs": "17.5.1"
},
"devDependencies": {
"@tsconfig/node16": "^1.0.3",
"@types/chai": "^4.2.21",
"@types/js-yaml": "^4.0.2",
"@types/mocha": "^9.1.1",
"@types/nedb": "^1.8.12",
"@types/node": "^18.6.1",
"@types/node-emoji": "^1.8.1",
"@types/nunjucks": "^3.1.5",
"@types/randomstring": "^1.1.7",
"@types/uuid": "^8.3.1",
"@types/yargs": "17.0.10",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.31.0",
"chai": "^4.3.4",
"eslint": "^8.20.0",
"eslint-plugin-jsdoc": "^39.3.3",
"eslint-plugin-prefer-arrow": "^1.2.3",
"js-yaml": "^4.1.0",
"mocha": "^10.0.0",
"prom-client": "^14.0.1",
"source-map-support": "^0.5.19",
"ts-node": "^10.1.0",
"typescript": "^4.4.3"
}
}

View File

@ -0,0 +1,5 @@
{
"version": "2.0.1",
"srcHash": "N7EzhqKL3GiuoU2d/Y33eZhKJSCvtLDRVO40mpIBEkw=",
"yarnHash": "1d9kyrzcs1c54xk0yl8n3jp61l3n8dzph1d5a4daifa7ad635hv7"
}

View File

@ -0,0 +1,36 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=../../../../ -i bash -p nix curl jq prefetch-yarn-deps nix-prefetch-github
if [ "$#" -gt 1 ] || [[ "$1" == -* ]]; then
echo "Regenerates packaging data for matrix-appservice-slack."
echo "Usage: $0 [git release tag]"
exit 1
fi
version="$1"
set -euo pipefail
if [ -z "$version" ]; then
version="$(curl "https://api.github.com/repos/matrix-org/matrix-appservice-slack/releases?per_page=1" | jq -r '.[0].tag_name')"
fi
src="https://raw.githubusercontent.com/matrix-org/matrix-appservice-slack/$version"
src_hash=$(nix-prefetch-github matrix-org matrix-appservice-slack --rev ${version} | jq -r .sha256)
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT
pushd $tmpdir
curl -O "$src/yarn.lock"
yarn_hash=$(prefetch-yarn-deps yarn.lock)
popd
curl -O "$src/package.json"
cat > pin.json << EOF
{
"version": "$version",
"srcHash": "$src_hash",
"yarnHash": "$yarn_hash"
}
EOF