about summary refs log tree commit diff
path: root/pkgs/servers/mail/listmonk
diff options
context:
space:
mode:
authorMarcel <me@m4rc3l.de>2024-02-17 19:40:41 +0100
committerMarcel <me@m4rc3l.de>2024-03-01 10:45:12 +0100
commit333ad51f5c7ee6f8d72f7194a95e473becaf90a0 (patch)
tree2291a08d9dc37d2555677acad5ce75ec7eab10d1 /pkgs/servers/mail/listmonk
parent72f01b23cf852b7c7a09e19cfc768e348a427a98 (diff)
listmonk: 2.5.1 -> 3.0.0
listmonk switched their frontend toolchain to vite
the existing past usage of yarn2nix did not work
using the new toolchain setup. Therefore, I
migrated the derivation to the "normal" yarn2nix.
Diffstat (limited to 'pkgs/servers/mail/listmonk')
-rw-r--r--pkgs/servers/mail/listmonk/default.nix18
-rw-r--r--pkgs/servers/mail/listmonk/frontend.nix41
-rw-r--r--pkgs/servers/mail/listmonk/package.json49
3 files changed, 46 insertions, 62 deletions
diff --git a/pkgs/servers/mail/listmonk/default.nix b/pkgs/servers/mail/listmonk/default.nix
index 24f97afa348d8..3ac3522a861e4 100644
--- a/pkgs/servers/mail/listmonk/default.nix
+++ b/pkgs/servers/mail/listmonk/default.nix
@@ -1,25 +1,17 @@
-{ lib, buildGoModule, fetchFromGitHub, callPackage, stuffbin, nixosTests, fetchpatch }:
+{ lib, buildGoModule, fetchFromGitHub, callPackage, stuffbin, nixosTests }:
 
 buildGoModule rec {
   pname = "listmonk";
-  version = "2.5.1";
+  version = "3.0.0";
 
   src = fetchFromGitHub {
     owner = "knadh";
     repo = "listmonk";
     rev = "v${version}";
-    sha256 = "sha256-gCnIblc83CmG1auvYYxqW/xBl6Oy1KHGkqSY/3yIm3I=";
+    sha256 = "sha256-eNX+2ens+mz2V8ZBHtFFHDVbi64AAiiREElMjh67Dd8=";
   };
 
-  patches = [
-    # Ensure that listmonk supports Go 1.20
-    (fetchpatch {
-      url = "https://github.com/knadh/listmonk/commit/25513b81044803b104ada63c0be57a913960484e.patch";
-      hash = "sha256-SYACM8r+NgeSWn9VJV4+wkm+6s/MhNGwn5zyc2tw7FU=";
-    })
-  ];
-
-  vendorHash = "sha256-0sgC1+ueZTUCP+7JwI/OKLktfMHQq959GEk1mC0TQgE=";
+  vendorHash = "sha256-XAm2VfX1nHWTuAV2COEn8qrqPNv0xbaWgTYCpjrEfMw=";
 
   nativeBuildInputs = [
     stuffbin
@@ -50,7 +42,7 @@ buildGoModule rec {
       '';
 
   passthru = {
-    frontend = callPackage ./frontend.nix { inherit meta; };
+    frontend = callPackage ./frontend.nix { inherit meta version src; };
     tests = { inherit (nixosTests) listmonk; };
   };
 
diff --git a/pkgs/servers/mail/listmonk/frontend.nix b/pkgs/servers/mail/listmonk/frontend.nix
index 647f5cfd9f6a7..928092038c127 100644
--- a/pkgs/servers/mail/listmonk/frontend.nix
+++ b/pkgs/servers/mail/listmonk/frontend.nix
@@ -1,40 +1,33 @@
-{ yarn2nix-moretea
-, fetchFromGitHub
+{ mkYarnPackage
 , fetchYarnDeps
 , meta
+, version
+, src
 }:
 
-yarn2nix-moretea.mkYarnPackage rec {
+mkYarnPackage {
   pname = "listmonk-frontend";
-  version = "2.5.1";
-
-  src = fetchFromGitHub {
-    owner = "knadh";
-    repo = "listmonk";
-    rev = "v${version}";
-    sha256 = "sha256-gCnIblc83CmG1auvYYxqW/xBl6Oy1KHGkqSY/3yIm3I=";
-  };
+  inherit version;
 
+  src = "${src}/frontend";
   packageJSON = ./package.json;
-  yarnLock = "${src}/frontend/yarn.lock";
 
   offlineCache = fetchYarnDeps {
-    inherit yarnLock;
-    hash = "sha256-KKNk4lrM7unMFClkY6F3nqhKx5xfx87Ac+rug9sOwvI=";
+    yarnLock = "${src}/frontend/yarn.lock";
+    hash = "sha256-TdrglyRtb2Q8SFtoiCoDj/zBV2+7DwzIm/Fzlt0ZvSo=";
   };
 
-  # For Node.js v17+, this is necessary.
-  NODE_OPTIONS = "--openssl-legacy-provider";
-
-  installPhase = ''
-    runHook preInstall
-
-    cd deps/listmonk-frontend/frontend
-    npm run build
+  configurePhase = ''
+    ln -s $node_modules node_modules
+  '';
 
-    mv dist $out
+  buildPhase = ''
+    yarn --offline build
+  '';
 
-    runHook postInstall
+  installPhase = ''
+    mkdir $out
+    cp -R dist/* $out
   '';
 
   doDist = false;
diff --git a/pkgs/servers/mail/listmonk/package.json b/pkgs/servers/mail/listmonk/package.json
index 6e981fefc8b3f..25018ef265dd7 100644
--- a/pkgs/servers/mail/listmonk/package.json
+++ b/pkgs/servers/mail/listmonk/package.json
@@ -1,46 +1,45 @@
 {
-  "name": "listmonk-frontend",
+  "name": "listmonk",
   "version": "0.1.0",
   "private": true,
   "scripts": {
-    "serve": "vue-cli-service serve",
-    "build": "vue-cli-service build",
-    "build-report": "vue-cli-service build --report",
-    "lint": "vue-cli-service lint"
+    "dev": "vite",
+    "build": "vite build",
+    "serve": "vite preview",
+    "lint": "eslint --ext .js,.vue --ignore-path .gitignore src",
+    "prebuild": "eslint --ext .js,.vue --ignore-path .gitignore src"
   },
   "dependencies": {
     "@tinymce/tinymce-vue": "^3",
-    "axios": "^0.27.2",
-    "buefy": "^0.9.10",
-    "c3": "^0.7.20",
+    "axios": "^1.6.2",
+    "buefy": "^0.9.25",
+    "bulma": "^0.9.4",
+    "chart.js": "^4.4.1",
     "codeflask": "^1.4.1",
-    "core-js": "^3.12.1",
-    "dayjs": "^1.10.4",
+    "dayjs": "^1.11.10",
     "indent.js": "^0.3.5",
     "qs": "^6.10.1",
     "textversionjs": "^1.1.3",
-    "tinymce": "^5.10.7",
-    "turndown": "^7.0.0",
-    "vue": "^2.6.12",
-    "vue-i18n": "^8.22.2",
+    "tinymce": "^5.10.9",
+    "turndown": "^7.1.2",
+    "vue": "^2.7.14",
+    "vue-chartjs": "^5.3.0",
+    "vue-i18n": "^8.28.2",
     "vue-router": "^3.2.0",
     "vuex": "^3.6.2"
   },
   "devDependencies": {
-    "@vue/cli-plugin-babel": "~5.0.8",
-    "@vue/cli-plugin-eslint": "~5.0.8",
-    "@vue/cli-plugin-router": "~5.0.8",
-    "@vue/cli-plugin-vuex": "~5.0.8",
-    "@vue/cli-service": "~5.0.8",
-    "@vue/eslint-config-airbnb": "^5.3.0",
-    "babel-eslint": "^10.1.0",
-    "cypress": "10.10.0",
+    "@vitejs/plugin-vue2": "^2.3.1",
+    "@vue/eslint-config-airbnb": "^7.0.1",
+    "cypress": "13.6.1",
     "cypress-file-upload": "^5.0.2",
-    "eslint": "^7.27.0",
+    "eslint": "^8.56.0",
+    "eslint-define-config": "^2.0.0",
     "eslint-plugin-import": "^2.23.3",
-    "eslint-plugin-vue": "^7.9.0",
+    "eslint-plugin-vue": "^9.19.2",
     "sass": "^1.34.0",
-    "sass-loader": "^10.2.0",
+    "vite": "^5.0.12",
+    "vue-eslint-parser": "^9.3.2",
     "vue-template-compiler": "^2.6.12"
   }
 }