@flowscripter/flowscripter-io-cli 3.0.18 → 3.0.19

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.
@@ -10,4 +10,3 @@ permissions:
10
10
  jobs:
11
11
  call-lint-pr-message:
12
12
  uses: flowscripter/.github/.github/workflows/lint-pr-message.yml@v1
13
- secrets: inherit
package/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # flowscripter-io-cli
2
2
 
3
- [![version](https://img.shields.io/github/v/release/flowscripter/flowscripter-io-cli?sort=semver)](https://github.com/flowscripter/flowscripter-io-cli/releases)
4
- [![build](https://img.shields.io/github/actions/workflow/status/flowscripter/flowscripter-io-cli/release-bun-executable.yml)](https://github.com/flowscripter/flowscripter-io-cli/actions/workflows/release-bun-executable.yml)
5
- [![license: MIT](https://img.shields.io/github/license/flowscripter/flowscripter-io-cli)](https://github.com/flowscripter/flowscripter-io-cli/blob/main/LICENSE)
3
+ [![version](https://raw.githubusercontent.com/flowscripter/flowscripter-io-cli/badges/version.svg)](https://github.com/flowscripter/flowscripter-io-cli/releases)
4
+ [![build](https://github.com/flowscripter/flowscripter-io-cli/actions/workflows/release-bun-executable.yml/badge.svg?branch=main)](https://github.com/flowscripter/flowscripter-io-cli/actions/workflows/release-bun-executable.yml)
5
+ [![coverage](https://raw.githubusercontent.com/flowscripter/flowscripter-io-cli/badges/coverage.svg)](https://github.com/flowscripter/flowscripter-io-cli/actions/workflows/release-bun-executable.yml?query=branch%3Amain)
6
+ [![license](https://raw.githubusercontent.com/flowscripter/flowscripter-io-cli/badges/license.svg)](https://github.com/flowscripter/flowscripter-io-cli/blob/main/LICENSE)
6
7
 
7
8
  > CLI for the
8
9
  > [pluggable-io-framework](https://github.com/flowscripter/pluggable-io-framework),
@@ -0,0 +1,52 @@
1
+ # Plan: Upgrade Service in flowscripter-io-cli
2
+
3
+ Refs flowscripter/flowscripter-io-cli#66. Spec: [spec.md](spec.md).
4
+
5
+ Decided on the spec PR (#67): enable config file support and the key-value service so auto-upgrade can store its answer, and leave macOS x64 out of the supported platforms.
6
+
7
+ ## Work packages
8
+
9
+ ### WP1: flowscripter-io-cli - enable the upgrade service
10
+
11
+ - Repo: `flowscripter/flowscripter-io-cli`
12
+ - Commit type: `feat` (minor release)
13
+ - Blocked by: none. `dynamic-cli-framework` 12.2.8 and `dynamic-cli-framework-api` 5.1.11, already locked in `bun.lock`, ship the upgrade service, `UpgradeLocationsConfig`, `SupportedOs` and `SupportedArch`.
14
+ - Changes:
15
+ - `src/cli.ts`, `getCLIFeatureOptions()`: add `configFileSupportEnabled`, `keyValueServiceEnabled`, `fetchServiceEnabled` and `upgradeServiceEnabled` (all `true`), and an `upgradeLocationsConfig` modelled on `example-cli`'s `src/cli.ts`:
16
+ - `supportedPlatforms`: Linux x64, Linux arm64, macOS arm64, Windows x64, Windows arm64
17
+ - `githubRelease`: owner `flowscripter`, repo `flowscripter-io-cli`, `assetPattern` `flowscripter-io-cli_{os}_{arch}.zip` (the released assets are `flowscripter-io-cli_Linux_x64.zip`, `_Linux_arm64`, `_MacOS_aarch64`, `_Windows_x64`, `_Windows_arm64`, and the framework maps macOS arm64 to `aarch64`)
18
+ - `linuxScript.scriptUrl`: `https://raw.githubusercontent.com/flowscripter/flowscripter-io-cli/main/script/install.sh`
19
+ - `homebrew`: tap `flowscripter/tap`, formula `flowscripter-io-cli`
20
+ - `winget.packageId`: `Flowscripter.flowscripter-io-cli`
21
+ - `restartAfterAutoUpgrade` stays at its default (`false`), as the spec's non-goals say.
22
+ - Import `SupportedArch` and `SupportedOs` from `@flowscripter/dynamic-cli-framework-api`, a direct dependency already. The existing services, `argumentPrompterServiceEnabled`, `spawnServiceEnabled` and `pluginServiceEnabled`, stay as they are. The framework registers the `upgrade` command, the background version check and the auto-upgrade startup task.
23
+ - `README.md`: a `## Upgrading` section after `## Installation` covering `--upgrade`, `--install-method`, the one-time auto-upgrade prompt and where the answer is stored, and the `--config` option that config file support adds.
24
+ - `.claude/CLAUDE.md`: note which framework services are enabled, and that the config and key-value services are on for the upgrade service.
25
+ - Acceptance criteria covered: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
26
+ - Tests to add:
27
+ - `tests/cli.test.ts`: assert that the four new flags are `true`, and that `upgradeLocationsConfig` has exactly the five platforms, with no macOS x64 (AC 5, 6), and the GitHub release, script, Homebrew and winget values.
28
+ - `functional_tests/features/upgrade.feature`, using the existing `the executable stdout is captured for` step:
29
+ - `--help` exits 0 and its output contains `upgrade` (AC 1).
30
+ - `upgrade` exits 0 with output containing either `flowscripter-io-cli upgraded` or `flowscripter-io-cli is already up to date`, the same check `example-cli` makes, because CI builds the PR version, which can be ahead of or behind the latest release (AC 2, 3).
31
+ - AC 8: the existing `commands.feature`, `plugin.feature` and `s3.feature` scenarios run without a TTY and must pass unchanged, with no prompt text in their output.
32
+ - AC 9: the framework's own tests cover a failed check (`#checkAndUpgrade` logs at debug level and returns). The Verify stage checks it on the released build with the network off.
33
+ - AC 3 (by method), 4 and 7 need a real install and a TTY. The Verify stage checks them on the released build: AC 4 with `--install-method=github-release` on Linux, and AC 7 with a first interactive run, then a second run that doesn't prompt.
34
+
35
+ ## Cross-repo testing
36
+
37
+ None needed. The change is in `flowscripter-io-cli` only and uses framework versions that are already released. Run the checks from `.claude/CLAUDE.md` (tsc, oxlint, oxfmt, `bun test --coverage`, typedoc, `bun build index.ts --compile`), and the behave suite against the compiled executable with a temp `HOME` so the auto-upgrade answer and config file don't touch the real `~/.flowscripter-io-cli`.
38
+
39
+ ## Cascade
40
+
41
+ None. No repo depends on `flowscripter-io-cli`. The `feat` merge releases it (3.1.0 expected), and the release workflow updates the Homebrew formula and winget package as it does for every release. Verify checks AC 2 on 3.1.0 itself. The first build that can install a newer version is 3.1.0, so the actual upgrade (AC 3) can only be seen once a later release exists. Until then Verify checks it with `--install-method=github-release`, which reinstalls nothing when the CLI is up to date, and reports the full upgrade check as pending.
42
+
43
+ ## Distillation
44
+
45
+ - `README.md`: the `## Upgrading` section (AC 10).
46
+ - `.claude/CLAUDE.md`: the enabled framework services.
47
+ - No ADR. This enables an existing framework feature the same way `example-cli` does.
48
+
49
+ ## Risks
50
+
51
+ - `configFileSupportEnabled` adds the framework's global `--config` option and `config` command. No `flowscripter-io-cli` command or option uses that name, but the `--help` output changes, so check any functional test that matches the full help text.
52
+ - The functional `upgrade` scenario talks to GitHub and, when the PR version is behind the latest release, really installs it in the CI runner, as `example-cli`'s does. A GitHub outage fails that scenario even though the CLI handles it.
@@ -0,0 +1,44 @@
1
+ # Upgrade Service in flowscripter-io-cli
2
+
3
+ Refs flowscripter/flowscripter-io-cli#66
4
+
5
+ ## Problem
6
+
7
+ `example-cli` can upgrade itself: `example-cli --upgrade` installs the latest release, and on startup it offers to turn on automatic upgrades. `flowscripter-io-cli` is released and installed the same way (GitHub release zips, `script/install.sh`, the `flowscripter/tap` Homebrew formula and the `Flowscripter.flowscripter-io-cli` winget package), but it doesn't enable the upgrade service from `dynamic-cli-framework`, so users have to reinstall by hand to get a new version.
8
+
9
+ `example-cli` gets this through `launchMultiCommandCLI` options alone: `upgradeServiceEnabled: true` plus an `upgradeLocationsConfig` (supported platforms, GitHub release asset pattern, Linux script URL, Homebrew tap and formula, winget package id). The framework then registers the `upgrade` command and two startup tasks: a background version check, and a blocking auto-upgrade task that prompts once and stores the answer. That task needs the fetch, spawn, prompter and key-value services; the key-value service needs config support. `flowscripter-io-cli` today enables only the argument prompter, spawn and plugin services.
10
+
11
+ ## Acceptance criteria
12
+
13
+ 1. `flowscripter-io-cli --upgrade` is a known command, and `flowscripter-io-cli --help` lists it.
14
+ 2. When the installed version is the latest release, `flowscripter-io-cli --upgrade` prints that it is already up to date with the current version and exits 0.
15
+ 3. When a newer release exists, `flowscripter-io-cli --upgrade` installs it with the detected install method (Homebrew on macOS, the install script on Linux, winget on Windows, or the GitHub release zip otherwise), and prints the old and new versions.
16
+ 4. `--upgrade --install-method=<method>` overrides the detected method, with the methods allowed for the platform.
17
+ 5. The upgrade locations point at flowscripter-io-cli's own channels: release assets `flowscripter-io-cli_{os}_{arch}.zip` on `flowscripter/flowscripter-io-cli`, `script/install.sh` on `main`, Homebrew `flowscripter/tap/flowscripter-io-cli`, winget `Flowscripter.flowscripter-io-cli`.
18
+ 6. The supported platforms match the release assets that exist: Linux x64 and arm64, macOS arm64, Windows x64 and arm64. (proposed)
19
+ 7. On an interactive first run from a supported install, the CLI asks once whether to enable automatic upgrades. The answer persists: "Yes" checks for and installs a newer version before each later run, "No" never asks again.
20
+ 8. With prompting unavailable (non-TTY, as in the functional tests), no upgrade prompt is shown and commands behave as before. (proposed)
21
+ 9. A failed version check (offline, GitHub unavailable) doesn't stop the requested command from running. (proposed)
22
+ 10. The README documents `--upgrade` and the auto-upgrade prompt. (proposed)
23
+
24
+ ## Non-goals
25
+
26
+ - Changes to `dynamic-cli-framework` or its upgrade service: it already supports this.
27
+ - Restarting into the new version after an auto-upgrade (`restartAfterAutoUpgrade`): off by default for `launchMultiCommandCLI`, as in `example-cli`.
28
+ - Adding a macOS x64 release build.
29
+ - Upgrading installed provider plugins (`plugin:upgrade` already exists).
30
+ - Other optional framework services `example-cli` enables (banner, completion, image printer, secrets).
31
+
32
+ ## Affected repos
33
+
34
+ From the current repo graph:
35
+
36
+ - `flowscripter-io-cli`: the only code change, in its CLI feature options, plus README and tests.
37
+ - `dynamic-cli-framework` and `dynamic-cli-framework-api` (dependencies): no change. The upgrade service, `UpgradeLocationsConfig`, `SupportedOs` and `SupportedArch` already ship in the versions `flowscripter-io-cli` depends on.
38
+ - `homebrew-tap` and `winget-pkgs`: no change. The `flowscripter-io-cli` formula and winget package already exist, and the upgrade uses them as they are.
39
+ - No repo depends on `flowscripter-io-cli`, so nothing cascades.
40
+
41
+ ## Open questions
42
+
43
+ 1. Auto-upgrade stores its answer in the key-value service, which requires config support. Turning that on also adds the framework's config file option. Enable both, as `example-cli` does? Recommended: yes. Auto-upgrade can't persist "declined" without it, and the config file is opt-in.
44
+ 2. `example-cli` lists macOS x64 as supported, but no `MacOS_x64` asset is released for either CLI. Leave it out for `flowscripter-io-cli` (criterion 6)? Recommended: yes, so a macOS x64 machine reports "unsupported" instead of failing the download.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/flowscripter-io-cli",
3
- "version": "3.0.18",
3
+ "version": "3.0.19",
4
4
  "description": "CLI for https://github.com/flowscripter/pluggable-io-framework",
5
5
  "keywords": [
6
6
  "bun",