From 543b54a1777b1810aedfc0f43253327ff950f5fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Misty=20De=20M=C3=A9o?= Date: Thu, 27 Jun 2024 11:45:14 -0700 Subject: [PATCH 1/4] fix: hardcode the version flag When built with bun, the version can be displayed correctly if the binary is run inside the source directory and returns `unknown` otherwise. --- axolotlsay-js/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/axolotlsay-js/index.js b/axolotlsay-js/index.js index 559bfe2..1b9a0ce 100755 --- a/axolotlsay-js/index.js +++ b/axolotlsay-js/index.js @@ -2,7 +2,11 @@ const yargs = require("yargs"); const { hideBin } = require("yargs/helpers"); -const argv = yargs(hideBin(process.argv)).argv; +const argv = yargs(hideBin(process.argv)).version( + "--version", + "Show version number", + "0.10.0", +).argv; const msg = argv.msg; console.log(msg); From 25df78fcb43e72c3ff912f5e93ad4c513bc211fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Misty=20De=20M=C3=A9o?= Date: Thu, 27 Jun 2024 11:48:18 -0700 Subject: [PATCH 2/4] release: 0.10.1 --- axolotlsay-js/dist.toml | 2 +- axolotlsay-js/index.js | 2 +- axolotlsay-js/package-lock.json | 4 ++-- axolotlsay-js/package.json | 2 +- crates/Cargo.lock | 2 +- crates/axolotlsay/Cargo.toml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/axolotlsay-js/dist.toml b/axolotlsay-js/dist.toml index 2e6c4df..85e5756 100644 --- a/axolotlsay-js/dist.toml +++ b/axolotlsay-js/dist.toml @@ -1,7 +1,7 @@ [package] name = "axolotlsay-js" description = "JavaScript port of axolotlsay" -version = "0.10.0" +version = "0.10.1" license = "MIT" repository = "https://github.com/axodotdev/axolotlsay-hybrid" binaries = ["axolotlsay-js"] diff --git a/axolotlsay-js/index.js b/axolotlsay-js/index.js index 1b9a0ce..83209b1 100755 --- a/axolotlsay-js/index.js +++ b/axolotlsay-js/index.js @@ -5,7 +5,7 @@ const { hideBin } = require("yargs/helpers"); const argv = yargs(hideBin(process.argv)).version( "--version", "Show version number", - "0.10.0", + "0.10.1", ).argv; const msg = argv.msg; diff --git a/axolotlsay-js/package-lock.json b/axolotlsay-js/package-lock.json index 9893956..2091f0f 100644 --- a/axolotlsay-js/package-lock.json +++ b/axolotlsay-js/package-lock.json @@ -1,12 +1,12 @@ { "name": "axolotlsay", - "version": "0.10.0", + "version": "0.10.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "axolotlsay", - "version": "0.10.0", + "version": "0.10.1", "license": "MIT-or-Apache2.0", "dependencies": { "yargs": "^17.7.2" diff --git a/axolotlsay-js/package.json b/axolotlsay-js/package.json index 53fc2fe..0f77564 100644 --- a/axolotlsay-js/package.json +++ b/axolotlsay-js/package.json @@ -1,6 +1,6 @@ { "name": "axolotlsay", - "version": "0.10.0", + "version": "0.10.1", "description": "> 📄 a template for axodotdev's open source repositories", "main": "index.js", "bin": { diff --git a/crates/Cargo.lock b/crates/Cargo.lock index 5d47aca..c4d6182 100644 --- a/crates/Cargo.lock +++ b/crates/Cargo.lock @@ -68,7 +68,7 @@ dependencies = [ [[package]] name = "axolotlsay" -version = "0.10.0" +version = "0.10.1" dependencies = [ "assert_cmd", "clap", diff --git a/crates/axolotlsay/Cargo.toml b/crates/axolotlsay/Cargo.toml index 81f92c1..0a2a9cb 100644 --- a/crates/axolotlsay/Cargo.toml +++ b/crates/axolotlsay/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "axolotlsay" description = "💬 a CLI for learning to distribute CLIs in rust" -version = "0.10.0" +version = "0.10.1" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/axodotdev/axolotlsay-hybrid" From 5d545dba2998c6c4b733175a2a31f14e5543ff98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Misty=20De=20M=C3=A9o?= Date: Thu, 27 Jun 2024 12:00:24 -0700 Subject: [PATCH 3/4] fix: fetch version via require --- axolotlsay-js/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/axolotlsay-js/index.js b/axolotlsay-js/index.js index 83209b1..05cfd0d 100755 --- a/axolotlsay-js/index.js +++ b/axolotlsay-js/index.js @@ -1,11 +1,19 @@ #!/usr/bin/env bun +// We do this because `require` gets rewritten to handle +// bundling properly, while the filesystem stuff that +// yargs does by default doesn't. +// If we don't do this, the default --version will be +// unable to report its own version when run outside +// the source directory. +const { version } = require("./package.json"); + const yargs = require("yargs"); const { hideBin } = require("yargs/helpers"); const argv = yargs(hideBin(process.argv)).version( "--version", "Show version number", - "0.10.1", + version, ).argv; const msg = argv.msg; From da65cecd0afca23a187e8f6b06e091f37fbae72c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Misty=20De=20M=C3=A9o?= Date: Thu, 27 Jun 2024 12:00:59 -0700 Subject: [PATCH 4/4] release: 0.10.2 --- axolotlsay-js/dist.toml | 2 +- axolotlsay-js/package-lock.json | 4 ++-- axolotlsay-js/package.json | 2 +- crates/Cargo.lock | 2 +- crates/axolotlsay/Cargo.toml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/axolotlsay-js/dist.toml b/axolotlsay-js/dist.toml index 85e5756..a4a13d9 100644 --- a/axolotlsay-js/dist.toml +++ b/axolotlsay-js/dist.toml @@ -1,7 +1,7 @@ [package] name = "axolotlsay-js" description = "JavaScript port of axolotlsay" -version = "0.10.1" +version = "0.10.2" license = "MIT" repository = "https://github.com/axodotdev/axolotlsay-hybrid" binaries = ["axolotlsay-js"] diff --git a/axolotlsay-js/package-lock.json b/axolotlsay-js/package-lock.json index 2091f0f..5684089 100644 --- a/axolotlsay-js/package-lock.json +++ b/axolotlsay-js/package-lock.json @@ -1,12 +1,12 @@ { "name": "axolotlsay", - "version": "0.10.1", + "version": "0.10.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "axolotlsay", - "version": "0.10.1", + "version": "0.10.2", "license": "MIT-or-Apache2.0", "dependencies": { "yargs": "^17.7.2" diff --git a/axolotlsay-js/package.json b/axolotlsay-js/package.json index 0f77564..c05004f 100644 --- a/axolotlsay-js/package.json +++ b/axolotlsay-js/package.json @@ -1,6 +1,6 @@ { "name": "axolotlsay", - "version": "0.10.1", + "version": "0.10.2", "description": "> 📄 a template for axodotdev's open source repositories", "main": "index.js", "bin": { diff --git a/crates/Cargo.lock b/crates/Cargo.lock index c4d6182..044d836 100644 --- a/crates/Cargo.lock +++ b/crates/Cargo.lock @@ -68,7 +68,7 @@ dependencies = [ [[package]] name = "axolotlsay" -version = "0.10.1" +version = "0.10.2" dependencies = [ "assert_cmd", "clap", diff --git a/crates/axolotlsay/Cargo.toml b/crates/axolotlsay/Cargo.toml index 0a2a9cb..00e4744 100644 --- a/crates/axolotlsay/Cargo.toml +++ b/crates/axolotlsay/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "axolotlsay" description = "💬 a CLI for learning to distribute CLIs in rust" -version = "0.10.1" +version = "0.10.2" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/axodotdev/axolotlsay-hybrid"