Merge pull request #191894 from rhysmdnz/update-micropad

micropad: 3.30.6 -> 4.0.0
This commit is contained in:
Jonas Heinrich 2022-09-21 09:58:58 +02:00 committed by GitHub
commit 9b83d13c7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 763 additions and 726 deletions

View file

@ -14,18 +14,18 @@ let
in in
mkYarnPackage rec { mkYarnPackage rec {
pname = "micropad"; pname = "micropad";
version = "3.30.6"; version = "4.0.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "MicroPad"; owner = "MicroPad";
repo = "Micropad-Electron"; repo = "Micropad-Electron";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-v3hnHG6FMW2xBU/DnenqjFizQv/OZ9cW99n/3SoENe8="; sha256 = "sha256-slutuLH95wQaZK02vRU/WDbYgG0RZbNKvrihLVMZWpQ=";
}; };
micropad-core = fetchzip { micropad-core = fetchzip {
url = "https://github.com/MicroPad/MicroPad-Core/releases/download/v${version}/micropad.tar.xz"; url = "https://github.com/MicroPad/MicroPad-Core/releases/download/v${version}/micropad.tar.xz";
hash = "sha256-aqshYbVrQg6tYtTlO91FGiH7DuueOA0OU5KGCVc7XvI="; sha256 = "1w0ajx15rm2mmyy4518ai8xfkfd6dfm38i3vfr9q9bw9h6igfn6g";
}; };
packageJSON = ./package.json; packageJSON = ./package.json;
@ -84,6 +84,8 @@ in
}) })
]; ];
passthru.updateScript = ./update.sh;
meta = with lib; { meta = with lib; {
description = "A powerful note-taking app that helps you organise + take notes without restrictions"; description = "A powerful note-taking app that helps you organise + take notes without restrictions";
homepage = "https://getmicropad.com/"; homepage = "https://getmicropad.com/";

View file

@ -1,14 +1,15 @@
{ {
"name": "micropad", "name": "micropad",
"version": "3.30.5", "version": "4.0.0",
"description": "A powerful note-taking app that helps you organise + take notes without restrictions.", "description": "A powerful note-taking app that helps you organise + take notes without restrictions.",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
"start": "yarn build && yarn electron . --is-dev --no-sandbox", "start": "yarn build && yarn electron . --is-dev --no-sandbox",
"build": "yarn tsc -p tsconfig.json", "build": "yarn tsc -p tsconfig.json",
"update-core": "rm -rf core && rm -rf tmp && mkdir tmp && wget https://github.com/MicroPad/MicroPad-Core/releases/download/v${npm_package_version}/micropad.tar.xz -P ./tmp && cd tmp && tar -xf micropad.tar.xz && rm build/*.map && rm build/static/*/*.map && cp -r build ../core && cd .. && rm -rf tmp", "update-core": "rm -rf core && rm -rf tmp && mkdir tmp && wget https://github.com/MicroPad/MicroPad-Core/releases/download/v${npm_package_version}/micropad.tar.xz -P ./tmp && cd tmp && tar -xf micropad.tar.xz && rm build/dist/*.map && cp -r build ../core && cd .. && rm -rf tmp",
"pack": "yarn build && yarn electron-builder --dir", "pack": "yarn build && yarn electron-builder --dir",
"dist": "yarn build && yarn electron-builder" "dist": "yarn build && yarn electron-builder",
"windows:version": "echo %npm_package_version%"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -24,14 +25,16 @@
}, },
"homepage": "https://getmicropad.com", "homepage": "https://getmicropad.com",
"devDependencies": { "devDependencies": {
"electron": "^17.1.0", "@types/node": "^18.7.18",
"electron-builder": "^23.0.2", "electron": "^20.1.4",
"typescript": "~4.5.4" "electron-builder": "^23.3.3",
"typescript": "~4.8.3"
}, },
"dependencies": { "dependencies": {
"dictionary-en": "^3.0.0", "dictionary-en": "^3.0.0",
"dictionary-en-au": "^2.1.1", "dictionary-en-au": "^2.1.1",
"electron-context-menu": "^3.1.2", "electron-context-menu": "^3.1.2",
"electron-window-state": "^5.0.3",
"localforage": "^1.10.0", "localforage": "^1.10.0",
"typo-js": "^1.2.1" "typo-js": "^1.2.1"
}, },
@ -47,8 +50,22 @@
], ],
"linux": { "linux": {
"target": [ "target": [
"tar.gz", {
"AppImage", "target": "tar.gz",
"arch": [
"x64",
"armv7l",
"arm64"
]
},
{
"target": "AppImage",
"arch": [
"x64",
"armv7l",
"arm64"
]
},
"snap", "snap",
"deb", "deb",
"rpm", "rpm",
@ -79,9 +96,19 @@
}, },
"win": { "win": {
"target": [ "target": [
"nsis", {
"target": "nsis",
"arch": [
"x64",
"arm64"
]
},
"portable" "portable"
] ]
},
"nsis": {
"allowToChangeInstallationDirectory": true,
"oneClick": false
} }
} }
} }

View file

@ -0,0 +1,27 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl common-updater-scripts jq nix nodePackages.prettier yarn2nix
set -eu -o pipefail
latest_version=$(curl -s https://api.github.com/repos/MicroPad/Micropad-Electron/releases/latest | jq --raw-output '.tag_name[1:]')
old_core_hash=$(nix-instantiate --eval --strict -A "micropad.micropad-core.drvAttrs.outputHash" | tr -d '"' | sed -re 's|[+]|\\&|g')
{
read new_core_hash
read store_path
} < <(
nix-prefetch-url --unpack --print-path "https://github.com/MicroPad/MicroPad-Core/releases/download/v$latest_version/micropad.tar.xz"
)
nixFile=$(nix-instantiate --eval --strict -A "micropad.meta.position" | sed -re 's/^"(.*):[0-9]+"$/\1/')
nixFolder=$(dirname "$nixFile")
sed -i "$nixFile" -re "s|\"$old_core_hash\"|\"$new_core_hash\"|"
curl -o "$nixFolder/package.json" -s "https://raw.githubusercontent.com/MicroPad/MicroPad-Electron/v$latest_version/package.json"
curl -o "$nixFolder/yarn.lock" -s "https://raw.githubusercontent.com/MicroPad/MicroPad-Electron/v$latest_version/yarn.lock"
prettier --write "$nixFolder/package.json"
yarn2nix --lockfile "$nixFolder/yarn.lock" >"$nixFolder/yarn.nix"
update-source-version micropad "$latest_version"

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff