@mercury-fw/cli 0.59.0 → 0.59.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @mercury-fw/cli
2
2
 
3
+ ## 0.59.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 44f2540: Inside an app, `mfw --version` and `mfw --help` (and a bare `mfw`) come from the app's own CLI too when the global one is another version, like every app command: before, they stayed the global one's, so `mfw --version` there showed the global version and a mismatch with the app's went unnoticed. The line saying it hands over names both versions (`mfw 0.53.2: running the app's 0.58.0`). `create` and `upgrade` stay the global CLI's. It's the global `mfw` that hands over, so this takes effect once it's updated: `mfw upgrade`.
8
+ - @mercury-fw/core@0.59.1
9
+ - @mercury-fw/utils@0.59.1
10
+
3
11
  ## 0.59.0
4
12
 
5
13
  ### Patch Changes
package/README.md CHANGED
@@ -36,7 +36,7 @@ bun add -g @mercury-fw/cli
36
36
  mfw create my-agent
37
37
  ```
38
38
 
39
- `mfw upgrade` keeps it current. Every app also lists `@mercury-fw/cli` among its devDependencies, at the framework's version, and inside an app the global `mfw` hands its commands over to that one when the two differ (it says so in one line; `mfw --version` and `mfw --help` stay the global one's), so an app's commands always match the framework it runs, whatever version is installed globally. An app not installed yet (no `bun install`) runs on the global one.
39
+ `mfw upgrade` keeps it current. Every app also lists `@mercury-fw/cli` among its devDependencies, at the framework's version, and inside an app the global `mfw` hands its commands over to that one when the two differ, `mfw --version` and `mfw --help` included, so an app's commands always match the framework it runs, whatever version is installed globally. It says so in one line naming both versions (`mfw 0.53.2: running the app's 0.58.0`), so `mfw --version` inside an app tells you when the global one is behind and `mfw upgrade` is due. An app not installed yet (no `bun install`) runs on the global one.
40
40
 
41
41
  Without a global install: `bun create mercury-agent my-agent` creates an app, and `bunx mfw <command>` runs the app's own CLI from inside it.
42
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercury-fw/cli",
3
- "version": "0.59.0",
3
+ "version": "0.59.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,8 +41,8 @@
41
41
  "comment:shape": "The Mercury CLI (`mfw`). `mfw create <dir>` writes a new Mercury app from the template. The framework packages move in lockstep with it, so a new app gets them at the CLI's own version; plugins and channels at the registry's latest. The plugin and channel packages are devDependencies only for the catalog test. `main(argv)` is exported for create-mercury-agent.",
42
42
  "dependencies": {
43
43
  "@clack/prompts": "^1.8.1",
44
- "@mercury-fw/core": "0.59.0",
45
- "@mercury-fw/utils": "0.59.0",
44
+ "@mercury-fw/core": "0.59.1",
45
+ "@mercury-fw/utils": "0.59.1",
46
46
  "commander": "^15.0.0"
47
47
  },
48
48
  "devDependencies": {
@@ -51,7 +51,7 @@
51
51
  "@mercury-fw/channel-google-chat": "0.11.0",
52
52
  "@mercury-fw/channel-http": "0.13.0",
53
53
  "@mercury-fw/directory-static": "0.1.1",
54
- "@mercury-fw/formatter": "0.59.0",
54
+ "@mercury-fw/formatter": "0.59.1",
55
55
  "@mercury-fw/plugin-atlassian-admin": "0.5.0",
56
56
  "@mercury-fw/plugin-bitbucket": "0.6.0",
57
57
  "@mercury-fw/plugin-jira": "0.8.0",
package/src/main.ts CHANGED
@@ -208,12 +208,14 @@ const OWN_COMMANDS = new Set(["create", "upgrade"]);
208
208
  /** Inside an app whose own CLI (its devDependency) is installed at another
209
209
  * version than this one, as a global `mfw` can be, runs `argv` through that
210
210
  * CLI and returns its exit code: the app's commands then always match the
211
- * framework the app runs. `undefined` means run here: not an app command, not
212
- * inside an app, the app not installed yet, the same version, or already
213
- * handed over (`MFW_DEFERRED`). */
211
+ * framework the app runs. `--version` and `--help` (and a bare `mfw`) go over
212
+ * too, so inside an app they describe the app's CLI, and the line saying it
213
+ * hands over shows both versions. `undefined` means run here: one of this
214
+ * CLI's own commands (`create`, `upgrade`), not inside an app, the app not
215
+ * installed yet, the same version, or already handed over (`MFW_DEFERRED`). */
214
216
  async function handOverToAppCli(argv: string[], cwd: string, relaunch: Relaunch): Promise<number | undefined> {
215
217
  const command = argv[0];
216
- if (command === undefined || command.startsWith("-") || OWN_COMMANDS.has(command)) return undefined;
218
+ if (command !== undefined && OWN_COMMANDS.has(command)) return undefined;
217
219
  if (process.env.MFW_DEFERRED) return undefined;
218
220
  let app: App;
219
221
  try {