Skip to content

Commit 38a4cc1

Browse files
authored
fix: catch styled remote-control steps and align vitest coverage provider (#302)
## Related Issue Follow-up to #301 (release PR for @pymodel/pythinker-code@1.13.0). No linked issue — maintainer-authored hygiene fixes surfaced during the release loop. ## Problem Two defects left behind by the release commit ce945e1: 1. The remote-control output test asserted the absence of a third setup step with `/^\s*3\.\s/m` against **raw** CLI output. `formatRemoteControlOutput` wraps step numbers in `chalk.bold.hex` (`label()`), so any real third step renders as ` <ESC>[1m<ESC>[38;5;Nm3.<ESC>...` and the line-start anchor never matches — the assertion cannot catch the regression it exists for (and its previous form, a plain `not.toContain('3.')`, false-failed on the `1.13.0` version banner). 2. The vitest 4.1.9 -> 4.1.11 security bump left `@vitest/coverage-v8` pinned at 4.1.9. The installed coverage provider requires the same exact vitest version and vitest warns that mixed provider/test-runner versions are unsupported. Plain test runs do not exercise this path. ## What changed - `apps/pythinker-code/test/cli/web/remote-control.test.ts`: moved the third-step assertion below the existing ANSI/OSC stripping and retargeted it to `plain`, so a styled `3.` step is caught after escapes are removed. Verified by temporarily injecting a styled third step through the same `label()` path — the test fails as required; reverted afterwards. - `package.json` + `pnpm-lock.yaml`: aligned `@vitest/coverage-v8` to 4.1.11; focused `--coverage` run loads the v8 provider with no mixed-version warning. - `flake.nix`: refreshed the `pnpmDeps` fixed-output hash for the lockfile change. - Restaged `dist-web/.web-bundle-manifest.json` (root `package.json` is a web build input). No changeset: nothing here changes published manifests or user-visible behavior. No doc update needed. ## Checklist - [x] I have read the [CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md) document. - [x] I have linked a related issue (external PRs: the issue must have a maintainer's `/approve`). N/A — internal follow-up PR. - [x] I have added tests that prove my feature works. Existing suite covers the assertion; rejection of a styled third step proven by temporary injection. - [x] Ran `gen-changesets` skill, or this PR needs no changeset. Needs none. - [x] Ran `gen-docs` skill, or this PR needs no doc update. Needs none. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Tests** - Improved validation of remote-control output, including complete URLs, formatting cleanup, and expected setup-step visibility. - **Chores** - Updated web build metadata and project maintenance configuration to keep generated assets and development workflows current. - Refreshed development tooling configuration to support consistent coverage reporting and reproducible builds. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 7ec4ad7 commit 38a4cc1

5 files changed

Lines changed: 58 additions & 67 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"sourceHash": "3c20602f9f36046bbb45ad066b2c91e149cc3f8c7f06dc5430c73e7f29537161",
2+
"sourceHash": "86bbfea2180a13d6184f7bb2bb2bf4f62f3ff4098cfd522de348482ef887d842",
33
"sourceFileCount": 493
44
}

‎apps/pythinker-code/test/cli/web/remote-control.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ describe('Remote Control output', () => {
7777
expect(output).toContain('Use Pythinker Code on this machine');
7878
expect(output).toContain('1.');
7979
expect(output).toContain('2.');
80-
expect(output).not.toMatch(/^\s*3\.\s/m);
8180
expect(output).toContain(`\u001B]8;;${url}`);
8281
const plain = output
8382
.replaceAll(/\u001B\]8;;.*?\u0007/g, '')
8483
.replaceAll(/\u001B\[[0-9;]*m/g, '');
8584
expect(plain).toContain(`open ${url}`);
8685
expect(plain).not.toContain('exampl…');
86+
expect(plain).not.toMatch(/^\s*3\.\s/m);
8787
expect(output).toContain('Connected to example.test');
8888
expect(output).toContain('This device:');
8989
expect(output).not.toContain('Manage devices');

‎flake.nix‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
inherit pnpm;
161161
fetcherVersion = 3;
162162
# Monaco's package patch is part of src, not the fetched dependency closure.
163-
hash = "sha256-4HSI70YkScaIbOLsvDU0Qv+VE7YLgtT1tPS2QEcNycY=";
163+
hash = "sha256-PBtUV/DlnvImbRKoUB51a6Di+mMkTFMtSl95Pe0zHgE=";
164164
};
165165

166166
nativeBuildInputs = [

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@microsoft/api-extractor": "7.58.9",
5151
"@types/node": "^26.1.2",
5252
"@typescript/native-preview": "7.0.0-dev.20260707.2",
53-
"@vitest/coverage-v8": "4.1.9",
53+
"@vitest/coverage-v8": "4.1.11",
5454
"lint-staged": "16.4.0",
5555
"oxlint": "1.59.0",
5656
"oxlint-tsgolint": "0.20.0",

‎pnpm-lock.yaml‎

Lines changed: 54 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)