@mercury-fw/cli 0.64.0 → 0.65.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 +22 -0
- package/package.json +5 -5
- package/src/render.ts +17 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @mercury-fw/cli
|
|
2
2
|
|
|
3
|
+
## 0.65.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9b2e1bf: - `mfw create`: the comment above the config's `version` and the app's README say what it shows, and no longer how to move the number: that's the app's own business.
|
|
8
|
+
- The `version` field's description says Mercury never changes it, with no advice on who does.
|
|
9
|
+
- Updated dependencies [9b2e1bf]
|
|
10
|
+
- @mercury-fw/core@0.65.1
|
|
11
|
+
- @mercury-fw/utils@0.65.1
|
|
12
|
+
|
|
13
|
+
## 0.65.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- 7a76257: - `mfw create`: the new app's `mercury.config.ts` declares its version, the one in its `package.json` (`version: pkg.version`), with a comment on what it shows and what it doesn't; the app's README says the same.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [7a76257]
|
|
22
|
+
- @mercury-fw/core@0.65.0
|
|
23
|
+
- @mercury-fw/utils@0.65.0
|
|
24
|
+
|
|
3
25
|
## 0.64.0
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercury-fw/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.65.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -41,17 +41,17 @@
|
|
|
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.
|
|
45
|
-
"@mercury-fw/utils": "0.
|
|
44
|
+
"@mercury-fw/core": "0.65.1",
|
|
45
|
+
"@mercury-fw/utils": "0.65.1",
|
|
46
46
|
"commander": "^15.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@mercury-fw/auth-oidc": "0.2.1",
|
|
50
50
|
"@mercury-fw/auth-static": "0.2.2",
|
|
51
51
|
"@mercury-fw/channel-google-chat": "0.11.1",
|
|
52
|
-
"@mercury-fw/channel-http": "0.
|
|
52
|
+
"@mercury-fw/channel-http": "0.14.1",
|
|
53
53
|
"@mercury-fw/directory-static": "0.1.2",
|
|
54
|
-
"@mercury-fw/formatter": "0.
|
|
54
|
+
"@mercury-fw/formatter": "0.65.1",
|
|
55
55
|
"@mercury-fw/plugin-atlassian-admin": "0.5.1",
|
|
56
56
|
"@mercury-fw/plugin-bitbucket": "0.6.1",
|
|
57
57
|
"@mercury-fw/plugin-confluence": "0.1.0",
|
package/src/render.ts
CHANGED
|
@@ -55,11 +55,19 @@ const CORE_ENV: EnvVar[] = [
|
|
|
55
55
|
},
|
|
56
56
|
];
|
|
57
57
|
|
|
58
|
+
/** Above the config's `version`: what it does, and what it doesn't. */
|
|
59
|
+
const VERSION_COMMENT = [
|
|
60
|
+
" // The app's version, from package.json: GET /version shows it next to the",
|
|
61
|
+
" // framework's, to anyone (no token). Mercury never changes it, and a new",
|
|
62
|
+
" // one shows once the app is rebuilt. Remove this line to show none.",
|
|
63
|
+
].join("\n");
|
|
64
|
+
|
|
58
65
|
const CONFIG_HEADER = `/**
|
|
59
66
|
* This app's composition: the tool plugins and channels it runs, the auth
|
|
60
67
|
* provider when a channel needs one, how the lists its plugins hand over read,
|
|
61
68
|
* the assistant's persona and the languages it speaks (\`i18n\`: a file per
|
|
62
|
-
* language in \`locales/\`, \`en.json\` overriding the English texts)
|
|
69
|
+
* language in \`locales/\`, \`en.json\` overriding the English texts) and its version
|
|
70
|
+
* (\`version\`, its \`package.json\`'s, shown on the HTTP channel's \`/version\`). The entrypoints
|
|
63
71
|
* (\`src/index.ts\`, \`src/repl.ts\`) hand this config to \`composeMercury\`.
|
|
64
72
|
*
|
|
65
73
|
* Every tool plugin and channel declared here is active.
|
|
@@ -214,7 +222,11 @@ function renderConfig(
|
|
|
214
222
|
directory: CatalogEntry | undefined,
|
|
215
223
|
): string {
|
|
216
224
|
const withRules = tools.filter((t) => t.formatter);
|
|
217
|
-
const imports = [
|
|
225
|
+
const imports = [
|
|
226
|
+
'import { defineMercuryConfig } from "@mercury-fw/core";',
|
|
227
|
+
'import en from "./locales/en.json";',
|
|
228
|
+
'import pkg from "./package.json";',
|
|
229
|
+
];
|
|
218
230
|
if (withRules.length > 0) {
|
|
219
231
|
imports.push('import { formatterPlugin, formatter } from "@mercury-fw/formatter";');
|
|
220
232
|
}
|
|
@@ -249,6 +261,8 @@ function renderConfig(
|
|
|
249
261
|
...(auth ? [` auth: ${auth.exportName},`] : []),
|
|
250
262
|
...(directory ? [` directory: ${directory.exportName},`] : []),
|
|
251
263
|
" i18n: { locales: { en } },",
|
|
264
|
+
VERSION_COMMENT,
|
|
265
|
+
" version: pkg.version,",
|
|
252
266
|
"});",
|
|
253
267
|
"",
|
|
254
268
|
].join("\n");
|
|
@@ -417,7 +431,7 @@ ${auth ? `- Auth: ${auth.id}\n` : ""}- Tool plugins: ${list(tools)}
|
|
|
417
431
|
${directory ? `- Directory: ${directory.id}\n` : ""}
|
|
418
432
|
## Layout
|
|
419
433
|
|
|
420
|
-
- \`mercury.config.ts\`: what the app is made of (tool plugins, channels, how their lists read) and the assistant's persona: its name, who it is and how it answers. Edit them freely.
|
|
434
|
+
- \`mercury.config.ts\`: what the app is made of (tool plugins, channels, how their lists read) and the assistant's persona: its name, who it is and how it answers. Edit them freely. Its \`version\` is the one in \`package.json\`, which the HTTP channel's \`GET /version\` shows to anyone, no token needed: Mercury never changes it, and a new one shows once the app is rebuilt. Remove the line to show none.
|
|
421
435
|
- \`locales/\`: the texts people see, one file per language the assistant speaks. \`en.json\` overrides the English ones; add \`it.json\` (and \`it\` to \`i18n.locales\` in the config) for Italian, \`i18n.defaultLocale\` for the language people get when they haven't picked one, \`i18n.timeZone\` (an IANA name such as \`Europe/Rome\`) for the time zone of whoever saved none and whose app says none. The app's own texts (a formatter rule's) are \`app.\` keys, written in English in \`en.json\` and translated in every other file. Mercury logs at startup the keys a file is missing.
|
|
422
436
|
- \`src/index.ts\`: the service (channels, crons). \`src/repl.ts\`: an interactive terminal for trying things out.
|
|
423
437
|
- \`plugins/\`: the app's own plugins, when it has any: each one a package in a folder of its own (\`plugins/<name>\`, a workspace), listed in \`dependencies\` as \`workspace:*\` and declared in \`mercury.config.ts\`. \`bun run test\` runs their tests.
|