@cplieger/web-terminal-engine 3.10.4 → 4.0.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/README.md CHANGED
@@ -106,7 +106,7 @@ curl -fsSL https://jsr.io/@cplieger/web-terminal-engine/<version>/wire-compatibi
106
106
  ```json
107
107
  {
108
108
  "schemaVersion": 1,
109
- "generatedBy": "web/src/wire-manifest.ts",
109
+ "generatedBy": "web/src/test-helpers/wire-manifest.ts",
110
110
  "wireCompatibility": {
111
111
  "protocolVersion": 4,
112
112
  "minimumServerProtocolVersion": 3,
package/jsr.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cplieger/web-terminal-engine",
3
- "version": "3.10.4",
3
+ "version": "4.0.1",
4
4
  "license": "MPL-2.0",
5
5
  "exports": {
6
6
  ".": "./src/index.ts"
@@ -14,7 +14,8 @@
14
14
  ],
15
15
  "exclude": [
16
16
  "src/**/*.test.ts",
17
- "src/**/__test-helpers__/**"
17
+ "src/**/*-setup.ts",
18
+ "src/**/test-helpers/**"
18
19
  ]
19
20
  }
20
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cplieger/web-terminal-engine",
3
- "version": "3.10.4",
3
+ "version": "4.0.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "typecheck": "tsc -p tsconfig.json",
@@ -67,8 +67,8 @@
67
67
  "files": [
68
68
  "src/",
69
69
  "!src/**/*.test.ts",
70
- "!src/**/test-helpers",
71
- "!src/**/fc-strict-setup.ts",
70
+ "!src/**/*-setup.ts",
71
+ "!src/**/test-helpers/**",
72
72
  "jsr.json",
73
73
  "LICENSE",
74
74
  "wire-compatibility.json"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedBy": "web/src/wire-manifest.ts",
3
+ "generatedBy": "web/src/test-helpers/wire-manifest.ts",
4
4
  "wireCompatibility": {
5
5
  "protocolVersion": 4,
6
6
  "minimumServerProtocolVersion": 3,
@@ -1,77 +0,0 @@
1
- // Generator for the published, language-neutral wire-compatibility manifest
2
- // (`web/wire-compatibility.json`).
3
- //
4
- // Why it exists: the wire revision and directional floor are published as
5
- // TypeScript constants (wire-compatibility.ts) and as Go constants
6
- // (terminal.WireProtocolVersion / MinSupportedClientWireVersion). A consumer
7
- // that is neither — a Dockerfile, a shell release gate, a Python CI script —
8
- // had no machine-readable surface to read them from and resorted to scraping
9
- // the TypeScript source with `sed`, which breaks silently on any reformat.
10
- //
11
- // This module renders that surface FROM the existing WIRE_COMPATIBILITY export,
12
- // so the numbers keep exactly one source of truth in the TypeScript half. The
13
- // rendered text is checked into the repo (see the drift guard in
14
- // wire-manifest.test.ts) because the publish pipeline runs no build step: npm
15
- // and JSR publish the working tree as-is, so a manifest generated at publish
16
- // time would never exist in the tarball.
17
- //
18
- // The manifest deliberately does NOT carry the package version. `npm pkg set
19
- // version` injects that at publish time, after checkout, with no regeneration
20
- // step — an embedded version would be frozen at the repo's placeholder (0.1.0)
21
- // in every published artifact. Consumers read the package version from
22
- // package.json / jsr.json, which the pipeline does rewrite.
23
- //
24
- // Public-artifact contract: see the "Wire compatibility manifest" section of
25
- // web/README.md for what a consumer may rely on and what counts as a breaking
26
- // change.
27
-
28
- import { WIRE_COMPATIBILITY, type WireCompatibility } from "./wire-compatibility.js";
29
-
30
- /**
31
- * Schema revision of the manifest FILE, independent of the wire protocol
32
- * revision it reports. A consumer must reject a `schemaVersion` it does not
33
- * understand rather than guess at the shape. Bumped only for a breaking
34
- * change to the manifest's own layout (a removed or repurposed field).
35
- */
36
- export const WIRE_MANIFEST_SCHEMA_VERSION = 1;
37
-
38
- /** Path of the checked-in artifact this module renders, relative to `web/`. */
39
- export const WIRE_MANIFEST_PATH = "wire-compatibility.json";
40
-
41
- /** Shape of the generated wire-compatibility manifest. */
42
- export interface WireManifest {
43
- /** Schema revision of this file's layout (see WIRE_MANIFEST_SCHEMA_VERSION). */
44
- readonly schemaVersion: number;
45
- /** Informational provenance note; not part of the parsed contract. */
46
- readonly generatedBy: string;
47
- /** The same values the TypeScript `WIRE_COMPATIBILITY` export carries. */
48
- readonly wireCompatibility: WireCompatibility;
49
- }
50
-
51
- /**
52
- * Builds the manifest object from the live TypeScript constants. Nesting the
53
- * protocol values under `wireCompatibility` keeps file-level metadata
54
- * (`schemaVersion`) in a separate namespace from the payload, so a future
55
- * metadata field can never collide with a protocol field name.
56
- */
57
- export function buildWireManifest(): WireManifest {
58
- return {
59
- schemaVersion: WIRE_MANIFEST_SCHEMA_VERSION,
60
- generatedBy: "web/src/wire-manifest.ts",
61
- wireCompatibility: {
62
- protocolVersion: WIRE_COMPATIBILITY.protocolVersion,
63
- minimumServerProtocolVersion: WIRE_COMPATIBILITY.minimumServerProtocolVersion,
64
- incompatibleCloseCode: WIRE_COMPATIBILITY.incompatibleCloseCode,
65
- },
66
- };
67
- }
68
-
69
- /**
70
- * Renders the exact bytes of the checked-in manifest: two-space indentation and
71
- * a trailing newline, which is what `prettier --check` requires of a JSON file
72
- * in this repo. Comparing rendered text (not parsed objects) is what makes the
73
- * drift guard able to fail on a hand edit that happens to parse the same.
74
- */
75
- export function renderWireManifest(): string {
76
- return `${JSON.stringify(buildWireManifest(), null, 2)}\n`;
77
- }