@mercury-fw/cli 0.59.0 → 0.59.2

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,23 @@
1
1
  # @mercury-fw/cli
2
2
 
3
+ ## 0.59.2
4
+
5
+ ### Patch Changes
6
+
7
+ - f631dd5: README: a link to the package's page on Mercury's documentation site (https://lucabro81.github.io/mercury-fw/), published from this release on. The HTTP channel's README points to the HTTP API reference there, and the core's memory section to the page that explains it.
8
+ - Updated dependencies [f631dd5]
9
+ - Updated dependencies [3b67dd6]
10
+ - @mercury-fw/core@0.59.2
11
+ - @mercury-fw/utils@0.59.2
12
+
13
+ ## 0.59.1
14
+
15
+ ### Patch Changes
16
+
17
+ - 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`.
18
+ - @mercury-fw/core@0.59.1
19
+ - @mercury-fw/utils@0.59.1
20
+
3
21
  ## 0.59.0
4
22
 
5
23
  ### Patch Changes
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  `mfw`, the command-line tool of [Mercury](https://github.com/lucabro81/mercury-fw): it creates an app, then runs it. Every command except `create` works from inside an app, meaning its folder or any folder under it (the one holding `mercury.config.ts`), and wraps the `docker compose` calls that app needs, so you don't have to remember them; each section below says which calls those are. New commands get documented here as they're added.
4
4
 
5
+ On Mercury's documentation site: [the `mfw` reference](https://lucabro81.github.io/mercury-fw/reference/cli/).
6
+
5
7
  ## Table of contents
6
8
 
7
9
  - [Getting it](#getting-it)
@@ -36,7 +38,7 @@ bun add -g @mercury-fw/cli
36
38
  mfw create my-agent
37
39
  ```
38
40
 
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.
41
+ `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
42
 
41
43
  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
44
 
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.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,24 +41,24 @@
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.2",
45
+ "@mercury-fw/utils": "0.59.2",
46
46
  "commander": "^15.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@mercury-fw/auth-oidc": "0.2.0",
50
- "@mercury-fw/auth-static": "0.2.1",
51
- "@mercury-fw/channel-google-chat": "0.11.0",
52
- "@mercury-fw/channel-http": "0.13.0",
53
- "@mercury-fw/directory-static": "0.1.1",
54
- "@mercury-fw/formatter": "0.59.0",
55
- "@mercury-fw/plugin-atlassian-admin": "0.5.0",
56
- "@mercury-fw/plugin-bitbucket": "0.6.0",
57
- "@mercury-fw/plugin-jira": "0.8.0",
58
- "@mercury-fw/plugin-web-search": "0.4.0",
59
- "@mercury-fw/plugin-zitadel": "0.5.0",
49
+ "@mercury-fw/auth-oidc": "0.2.1",
50
+ "@mercury-fw/auth-static": "0.2.2",
51
+ "@mercury-fw/channel-google-chat": "0.11.1",
52
+ "@mercury-fw/channel-http": "0.13.1",
53
+ "@mercury-fw/directory-static": "0.1.2",
54
+ "@mercury-fw/formatter": "0.59.2",
55
+ "@mercury-fw/plugin-atlassian-admin": "0.5.1",
56
+ "@mercury-fw/plugin-bitbucket": "0.6.1",
57
+ "@mercury-fw/plugin-jira": "0.8.1",
58
+ "@mercury-fw/plugin-web-search": "0.4.1",
59
+ "@mercury-fw/plugin-zitadel": "0.5.1",
60
60
  "@mercury-fw/typescript-config": "*",
61
- "@mercury-fw/web-search-searxng": "0.1.0",
61
+ "@mercury-fw/web-search-searxng": "0.1.1",
62
62
  "@types/bun": "^1.4.2",
63
63
  "typescript": "^6.0.3"
64
64
  }
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 {