@mercury-fw/cli 0.64.0 → 0.65.0
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 +12 -0
- package/package.json +5 -5
- package/src/render.ts +18 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @mercury-fw/cli
|
|
2
2
|
|
|
3
|
+
## 0.65.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [7a76257]
|
|
12
|
+
- @mercury-fw/core@0.65.0
|
|
13
|
+
- @mercury-fw/utils@0.65.0
|
|
14
|
+
|
|
3
15
|
## 0.64.0
|
|
4
16
|
|
|
5
17
|
### 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.0",
|
|
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.0",
|
|
45
|
+
"@mercury-fw/utils": "0.65.0",
|
|
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.0",
|
|
53
53
|
"@mercury-fw/directory-static": "0.1.2",
|
|
54
|
-
"@mercury-fw/formatter": "0.
|
|
54
|
+
"@mercury-fw/formatter": "0.65.0",
|
|
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,20 @@ 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 bumps it, your own",
|
|
62
|
+
" // tooling does, and a new one shows once the app is rebuilt. Remove this",
|
|
63
|
+
" // line to show none.",
|
|
64
|
+
].join("\n");
|
|
65
|
+
|
|
58
66
|
const CONFIG_HEADER = `/**
|
|
59
67
|
* This app's composition: the tool plugins and channels it runs, the auth
|
|
60
68
|
* provider when a channel needs one, how the lists its plugins hand over read,
|
|
61
69
|
* the assistant's persona and the languages it speaks (\`i18n\`: a file per
|
|
62
|
-
* language in \`locales/\`, \`en.json\` overriding the English texts)
|
|
70
|
+
* language in \`locales/\`, \`en.json\` overriding the English texts) and its version
|
|
71
|
+
* (\`version\`, its \`package.json\`'s, shown on the HTTP channel's \`/version\`). The entrypoints
|
|
63
72
|
* (\`src/index.ts\`, \`src/repl.ts\`) hand this config to \`composeMercury\`.
|
|
64
73
|
*
|
|
65
74
|
* Every tool plugin and channel declared here is active.
|
|
@@ -214,7 +223,11 @@ function renderConfig(
|
|
|
214
223
|
directory: CatalogEntry | undefined,
|
|
215
224
|
): string {
|
|
216
225
|
const withRules = tools.filter((t) => t.formatter);
|
|
217
|
-
const imports = [
|
|
226
|
+
const imports = [
|
|
227
|
+
'import { defineMercuryConfig } from "@mercury-fw/core";',
|
|
228
|
+
'import en from "./locales/en.json";',
|
|
229
|
+
'import pkg from "./package.json";',
|
|
230
|
+
];
|
|
218
231
|
if (withRules.length > 0) {
|
|
219
232
|
imports.push('import { formatterPlugin, formatter } from "@mercury-fw/formatter";');
|
|
220
233
|
}
|
|
@@ -249,6 +262,8 @@ function renderConfig(
|
|
|
249
262
|
...(auth ? [` auth: ${auth.exportName},`] : []),
|
|
250
263
|
...(directory ? [` directory: ${directory.exportName},`] : []),
|
|
251
264
|
" i18n: { locales: { en } },",
|
|
265
|
+
VERSION_COMMENT,
|
|
266
|
+
" version: pkg.version,",
|
|
252
267
|
"});",
|
|
253
268
|
"",
|
|
254
269
|
].join("\n");
|
|
@@ -417,7 +432,7 @@ ${auth ? `- Auth: ${auth.id}\n` : ""}- Tool plugins: ${list(tools)}
|
|
|
417
432
|
${directory ? `- Directory: ${directory.id}\n` : ""}
|
|
418
433
|
## Layout
|
|
419
434
|
|
|
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.
|
|
435
|
+
- \`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 moves it (do it by hand, with Changesets, or with a script before pushing), and a new one shows once the app is rebuilt. Remove the line to show none.
|
|
421
436
|
- \`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
437
|
- \`src/index.ts\`: the service (channels, crons). \`src/repl.ts\`: an interactive terminal for trying things out.
|
|
423
438
|
- \`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.
|