From 5b28f6b25f32ffd7e9a964c09a1bdd5a98ed2c5f Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 24 Jan 2020 22:43:55 +0000 Subject: [PATCH 1/4] Tools: Improved git changelog --- Tools/git-changelog.js | 2 +- Tools/tool-utils.js | 42 +++++++++++++++++++++++++----------------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Tools/git-changelog.js b/Tools/git-changelog.js index bfbcc3e04d..13f371dc35 100644 --- a/Tools/git-changelog.js +++ b/Tools/git-changelog.js @@ -26,7 +26,7 @@ async function gitLog(sinceTag) { author: { email: authorEmail, name: authorName, - login: await githubUsername(authorEmail), + login: await githubUsername(authorEmail, authorName), }, }); } diff --git a/Tools/tool-utils.js b/Tools/tool-utils.js index ced08bbde1..4f146150a7 100644 --- a/Tools/tool-utils.js +++ b/Tools/tool-utils.js @@ -122,35 +122,43 @@ async function saveGitHubUsernameCache(cache) { await fs.writeFile(path, JSON.stringify(cache)); } -toolUtils.githubUsername = async function(email) { +toolUtils.githubUsername = async function(email, name) { const cache = await loadGitHubUsernameCache(); - if (email in cache) return cache[email]; + const cacheKey = `${email}:${name}`; + if (cacheKey in cache) return cache[cacheKey]; let output = null; const oauthToken = await toolUtils.githubOauthToken(); - const response = await fetch(`https://api.github.com/search/users?q=${encodeURI(email)}+in:email`, { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - 'Authorization': `token ${oauthToken}`, - }, - }); + const urlsToTry = [ + `https://api.github.com/search/users?q=${encodeURI(email)}+in:email`, + `https://api.github.com/search/users?q=user:${encodeURI(name)}`, + ]; - const responseText = await response.text(); + for (const url of urlsToTry) { + const response = await fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + 'Authorization': `token ${oauthToken}`, + }, + }); + + const responseText = await response.text(); + + if (!response.ok) continue; - if (response.ok) { const responseJson = JSON.parse(responseText); - if (!responseJson || !responseJson.items || responseJson.items.length !== 1) { - output = null; - } else { - output = responseJson.items[0].login; - } + if (!responseJson || !responseJson.items || responseJson.items.length !== 1) continue; + + output = responseJson.items[0].login; + break; } - cache[email] = output; + cache[cacheKey] = output; await saveGitHubUsernameCache(cache); + return output; }; From 333aebf32caca331e74f7d006443d3ff16cc7116 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 24 Jan 2020 23:15:05 +0000 Subject: [PATCH 2/4] Tools: Removed debugging code --- Tools/git-changelog.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Tools/git-changelog.js b/Tools/git-changelog.js index 13f371dc35..a93d497d75 100644 --- a/Tools/git-changelog.js +++ b/Tools/git-changelog.js @@ -223,7 +223,6 @@ async function findFirstRelevantTag(baseTag) { while (true) { try { const logs = await gitLog(tag); - console.info(logs);process.exit(); if (logs.length) return tag; } catch (error) { if (error.message.indexOf('unknown revision') >= 0) { From c61e4cae4dc52665734346e76ad53b29afd6b9cb Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 24 Jan 2020 23:17:46 +0000 Subject: [PATCH 3/4] CLI v1.0.153 --- CliClient/package-lock.json | 2 +- CliClient/package.json | 2 +- CliClient/publish.sh | 3 +++ readme/changelog_cli.md | 18 ++++++++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CliClient/package-lock.json b/CliClient/package-lock.json index a85b64b538..61b99a4d98 100644 --- a/CliClient/package-lock.json +++ b/CliClient/package-lock.json @@ -1,6 +1,6 @@ { "name": "joplin", - "version": "1.0.150", + "version": "1.0.153", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/CliClient/package.json b/CliClient/package.json index c14cae11fa..281141a740 100644 --- a/CliClient/package.json +++ b/CliClient/package.json @@ -20,7 +20,7 @@ ], "owner": "Laurent Cozic" }, - "version": "1.0.150", + "version": "1.0.153", "bin": { "joplin": "./main.js" }, diff --git a/CliClient/publish.sh b/CliClient/publish.sh index cca107eeee..0a5c6d080b 100755 --- a/CliClient/publish.sh +++ b/CliClient/publish.sh @@ -1,4 +1,7 @@ #!/bin/bash +echo "Deprecated! Use `node Tools/release-cli.js`" +exit 1 + set -e SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/readme/changelog_cli.md b/readme/changelog_cli.md index f59b98b1de..32d726d8c5 100644 --- a/readme/changelog_cli.md +++ b/readme/changelog_cli.md @@ -1,5 +1,23 @@ # Joplin terminal app changelog +## [cli-v1.0.153](https://github.com/laurent22/joplin/releases/tag/cli-v1.0.153) - 2020-01-24T23:16:32Z + +- New: Added new, more secure encryption methods, so that they can be switched to at a later time +- New: Add --export, --import, and --import-file flags to joplin config (#2179 by Marcus Hill) +- New: Added more logging for resource fetching to try to debug issue +- New: Add warning message when user tries to upload a file 10MB or larger (#2102) (#2097 by Marcus Hill) +- Improved: Replace note links with relative paths in MD Exporter (#2161 by Vaidotas Simkus) +- Improved: Upgrade sqlite (#2248 by Devon Zuegel) +- Improved: Extract note renderer to separate package (WIP) (#2206 by Laurent Cozic) +- Improved: Better handling of resource download errors, and added resource info to sync status screen +- Improved: Update CliClient node dependency to 10+ (#2177 by [@joeltaylor](https://github.com/joeltaylor)) +- Improved: Allow exporting a note as HTML +- Improved: Improved logging during sync to allow finding bugs more easily +- Fixed: Handle WebDAV servers that do not return a last modified date (fixes mail.ru) (#2091) +- Fixed: Restaured translations that had been accidentally deleted (#2126) +- Fixed: Prevent synch from happening if target dir could not be created, in local sync (#2117) +- Fixed: Handle rare case when notebook has a parent that no longer exists, which causes a crash when sorting (#2088) + ## [cli-v1.0.150](https://github.com/laurent22/joplin/releases/tag/cli-v1.0.150) - 2019-11-11T19:19:03Z - New: Add command to list all tags for a note (#2003) (#1974) From c3d5463589edff5f183d9625f86d01ee5b807d4b Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 24 Jan 2020 23:18:46 +0000 Subject: [PATCH 4/4] Tools: Improved CLI release script --- Tools/release-cli.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Tools/release-cli.js b/Tools/release-cli.js index c58f33c2ff..307a0d8aae 100644 --- a/Tools/release-cli.js +++ b/Tools/release-cli.js @@ -74,6 +74,7 @@ async function main() { const defaultEditor = await execCommand('echo $EDITOR'); const finalCmds = [ + 'git pull', 'git add -A', `git commit -m "CLI ${newVersion}"`, `git tag "cli-${newVersion}"`,