From bdd6da64065045fd413f47a257ecd2ebde29cdcb Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Thu, 9 Jul 2020 09:36:31 +0200 Subject: [PATCH 1/5] npm package tgz should contain a single folder the npm package tgz should contain a single folder containing the package.json and other resources. See https://docs.npmjs.com/cli/publish. I suspect this is also the reason the README cannot be found for https://www.npmjs.com/package/mastodon-bot/v/1.0.1 --- .github/workflows/release.yml | 12 ++++++------ RELEASING.md | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 32d82c9..741f69e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -93,11 +93,11 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | - mkdir -p target/npm-build - cp mastodon-bot.js target/npm-build/ - cp target/mastodon-bot.js.sha256 target/npm-build/ - cp target/mastodon-bot.js.sha512 target/npm-build/ - cp package.json target/npm-build/ - cp README.md target/npm-build/ + mkdir -p target/npm-build/mastodon_bot + cp mastodon-bot.js target/npm-build/mastodon_bot/ + cp target/mastodon-bot.js.sha256 target/npm-build/mastodon_bot/ + cp target/mastodon-bot.js.sha512 target/npm-build/mastodon_bot/ + cp package.json target/npm-build/mastodon_bot/ + cp README.md target/npm-build/mastodon_bot/ tar -cz -C target/npm-build -f target/npm-build.tgz . npm publish ./target/npm-build.tgz --access public --dry-run diff --git a/RELEASING.md b/RELEASING.md index a427a09..62687f2 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -7,10 +7,10 @@ shadow-cljs compile test shadow-cljs release app chmod a+x mastodon-bot.js rm -rf target/npm-build -mkdir target/npm-build -cp mastodon-bot.js target/npm-build/ -cp package.json target/npm-build/ -cp README.md target/npm-build/ +mkdir -p target/npm-build/mastodon_bot +cp mastodon-bot.js target/npm-build/mastodon_bot/ +cp package.json target/npm-build/mastodon_bot/ +cp README.md target/npm-build/mastodon_bot/ tar -cz -C target/npm-build -f target/npm-build.tgz . npm publish ./target/npm-build.tgz --access public @@ -32,10 +32,10 @@ shadow-cljs release app shadow-cljs release app chmod a+x mastodon-bot.js rm -rf target/npm-build -mkdir target/npm-build -cp mastodon-bot.js target/npm-build/ -cp package.json target/npm-build/ -cp README.md target/npm-build/ +mkdir -p target/npm-build/mastodon_bot +cp mastodon-bot.js target/npm-build/mastodon_bot/ +cp package.json target/npm-build/mastodon_bot/ +cp README.md target/npm-build/mastodon_bot/ tar -cz -C target/npm-build -f target/npm-build.tgz . npm publish ./target/npm-build.tgz --access public From 4f21e40f739055dee4e483455646ea4ae39c3341 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Thu, 9 Jul 2020 16:42:11 +0200 Subject: [PATCH 2/5] Publish the target directory without creating our own tarball This way 'npm publish' works and the package correctly has the resources in a '/package' directory inside the tarball. Tested by publishing locally, indeed the README is now correctly shown at https://www.npmjs.com/package/mastodon-bot/v/1.0.1-test-raboof-3 Will release 1.0.2 from master after merging --- .github/workflows/release.yml | 3 +-- RELEASING.md | 22 ++++++++++------------ package.json | 2 +- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 741f69e..afa0e22 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,5 +99,4 @@ jobs: cp target/mastodon-bot.js.sha512 target/npm-build/mastodon_bot/ cp package.json target/npm-build/mastodon_bot/ cp README.md target/npm-build/mastodon_bot/ - tar -cz -C target/npm-build -f target/npm-build.tgz . - npm publish ./target/npm-build.tgz --access public --dry-run + npm publish ./target/npm-build --access public --dry-run diff --git a/RELEASING.md b/RELEASING.md index 62687f2..2b77be3 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -7,13 +7,12 @@ shadow-cljs compile test shadow-cljs release app chmod a+x mastodon-bot.js rm -rf target/npm-build -mkdir -p target/npm-build/mastodon_bot -cp mastodon-bot.js target/npm-build/mastodon_bot/ -cp package.json target/npm-build/mastodon_bot/ -cp README.md target/npm-build/mastodon_bot/ -tar -cz -C target/npm-build -f target/npm-build.tgz . +mkdir target/npm-build +cp mastodon-bot.js target/npm-build +cp package.json target/npm-build +cp README.md target/npm-build -npm publish ./target/npm-build.tgz --access public +npm publish ./target/npm-build --access public ``` ## prod release (should be done from master) @@ -32,13 +31,12 @@ shadow-cljs release app shadow-cljs release app chmod a+x mastodon-bot.js rm -rf target/npm-build -mkdir -p target/npm-build/mastodon_bot -cp mastodon-bot.js target/npm-build/mastodon_bot/ -cp package.json target/npm-build/mastodon_bot/ -cp README.md target/npm-build/mastodon_bot/ -tar -cz -C target/npm-build -f target/npm-build.tgz . +mkdir target/npm-build +cp mastodon-bot.js target/npm-build +cp package.json target/npm-build +cp README.md target/npm-build -npm publish ./target/npm-build.tgz --access public +npm publish ./target/npm-build --access public # Bump version vi shadow-cljs.edn diff --git a/package.json b/package.json index d5509dc..0ecbacc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "mastodon-bot", "description": "Bot to publish twitter, tumblr or rss posts to an mastodon account.", "author": "Dmitri Sotnikov", - "version": "1.0.1", + "version": "1.0.2", "homepage": "https://github.com/yogthos/mastodon-bot", "repository": "https://github.com/yogthos/mastodon-bot", "license": "MIT", From e7b0ed233e5efb5acded088276a3409badad2a40 Mon Sep 17 00:00:00 2001 From: "dmitri.sotnikov@gmail.com" Date: Thu, 9 Jul 2020 14:44:35 -0400 Subject: [PATCH 3/5] bumped up package.json version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0ecbacc..bc92920 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "mastodon-bot", "description": "Bot to publish twitter, tumblr or rss posts to an mastodon account.", "author": "Dmitri Sotnikov", - "version": "1.0.2", + "version": "1.0.3", "homepage": "https://github.com/yogthos/mastodon-bot", "repository": "https://github.com/yogthos/mastodon-bot", "license": "MIT", From 8ed30c3057fb4a38c33ab0caf9b945974ae1a458 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Sat, 11 Jul 2020 11:56:27 +0200 Subject: [PATCH 4/5] Fix processing tweets when nitter url rewriting is disabled --- src/main/mastodon_bot/twitter_api.cljs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/mastodon_bot/twitter_api.cljs b/src/main/mastodon_bot/twitter_api.cljs index c3db2b1..c6d8564 100755 --- a/src/main/mastodon_bot/twitter_api.cljs +++ b/src/main/mastodon_bot/twitter_api.cljs @@ -54,8 +54,9 @@ (defn-spec nitter-url map? [source twitter-source? parsed-tweet map?] - (when (:nitter-urls? source) - (update parsed-tweet :text #(string/replace % #"https://twitter.com" "https://nitter.net")))) + (if (:nitter-urls? source) + (update parsed-tweet :text #(string/replace % #"https://twitter.com" "https://nitter.net")) + parsed-tweet)) (defn-spec user-timeline any? [twitter-auth twitter-auth? From 96ececd255fc0b2b3e606ead3dc448bdf7004370 Mon Sep 17 00:00:00 2001 From: "dmitri.sotnikov@gmail.com" Date: Sat, 11 Jul 2020 10:10:40 -0400 Subject: [PATCH 5/5] bumped up version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bc92920..e7bd79c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "mastodon-bot", "description": "Bot to publish twitter, tumblr or rss posts to an mastodon account.", "author": "Dmitri Sotnikov", - "version": "1.0.3", + "version": "1.0.4", "homepage": "https://github.com/yogthos/mastodon-bot", "repository": "https://github.com/yogthos/mastodon-bot", "license": "MIT",