gentle-shell-bridge 0.3.0 → 0.3.2
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/LICENSE +202 -0
- package/README.md +91 -722
- package/docs/contract.md +92 -35
- package/package.json +13 -1
- package/src/api.ts +1 -1
- package/.codegraph/.gitignore +0 -5
- package/PRD.md +0 -144
- package/examples/bash-card.ts +0 -1694
- package/gentle-shell-bridge-0.3.0.tgz +0 -0
- package/odd/tasks/palette-sections.md +0 -30
- package/odd/tasks/plugin-keymap.md +0 -32
- package/odd/tasks/plugin-surface-contract.md +0 -55
- package/test/api.test.ts +0 -395
- package/test/apply-on-move.test.ts +0 -477
- package/test/arm.test.ts +0 -220
- package/test/bridge-ready.test.ts +0 -309
- package/test/bus.test.ts +0 -165
- package/test/button-rows.test.ts +0 -409
- package/test/capture.test.ts +0 -356
- package/test/card-style-rows.test.ts +0 -510
- package/test/card-style-transform.test.ts +0 -379
- package/test/card-style-wiring.test.ts +0 -258
- package/test/card-styles-e2e.test.ts +0 -491
- package/test/card-styles.test.ts +0 -324
- package/test/card-transcript-path.test.ts +0 -178
- package/test/config.test.ts +0 -93
- package/test/e2e.test.ts +0 -443
- package/test/example-bash-identity.test.ts +0 -372
- package/test/example-bash-matrix.test.ts +0 -856
- package/test/example-designs.test.ts +0 -734
- package/test/example-neon-transform.test.ts +0 -283
- package/test/example-plain-style.test.ts +0 -1268
- package/test/extension.test.ts +0 -160
- package/test/fake-events.ts +0 -58
- package/test/fake-host.ts +0 -211
- package/test/fake-sidebar.ts +0 -516
- package/test/fake-transcript.ts +0 -486
- package/test/frame-telemetry.test.ts +0 -417
- package/test/hook.test.ts +0 -196
- package/test/manifest.test.ts +0 -105
- package/test/new-category.test.ts +0 -979
- package/test/notices.test.ts +0 -328
- package/test/plugin-integration-lines.test.ts +0 -979
- package/test/plugin-surface.test.ts +0 -152
- package/test/presence.test.ts +0 -459
- package/test/rail-surfaces.test.ts +0 -457
- package/test/rail-width.test.ts +0 -423
- package/test/regression.test.ts +0 -483
- package/test/repaint-api.test.ts +0 -200
- package/test/reserved-categories.test.ts +0 -361
- package/test/row-labels.test.ts +0 -284
- package/test/row-names.test.ts +0 -473
- package/test/row-origin.test.ts +0 -395
- package/test/section-interaction.test.ts +0 -364
- package/test/section-panel.test.ts +0 -403
- package/test/sections-rows.test.ts +0 -291
- package/test/sidebar-backend.test.ts +0 -471
- package/test/sidebar-e2e.test.ts +0 -331
- package/test/sidebar-hover.test.ts +0 -276
- package/test/sidebar-independent.test.ts +0 -349
- package/test/sidebar-render.test.ts +0 -281
- package/test/sidebar-sections.test.ts +0 -245
- package/test/status-card-styles.test.ts +0 -201
- package/test/status-section-frame.test.ts +0 -181
- package/test/status-sections.test.ts +0 -243
- package/test/status.test.ts +0 -209
- package/test/store.test.ts +0 -192
- package/test/surface-repaint-cost.test.ts +0 -520
- package/test/tool-design-chain.test.ts +0 -483
- package/test/tool-design-cost.test.ts +0 -473
- package/test/tool-design-rows.test.ts +0 -359
- package/test/tool-designs.test.ts +0 -745
- package/test/transform-pipeline.test.ts +0 -465
- package/test/transforms-bus.test.ts +0 -233
- package/test/verifier-width-regressions.test.ts +0 -164
- package/tsconfig.json +0 -18
package/test/manifest.test.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
3
|
-
import { dirname, isAbsolute, relative, resolve } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
import test from "node:test";
|
|
6
|
-
|
|
7
|
-
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
8
|
-
const manifest = JSON.parse(readFileSync(resolve(packageRoot, "package.json"), "utf8"));
|
|
9
|
-
|
|
10
|
-
test("keywords contains pi-package", () => {
|
|
11
|
-
assert.ok(Array.isArray(manifest.keywords), "keywords must be an array");
|
|
12
|
-
assert.ok(
|
|
13
|
-
manifest.keywords.includes("pi-package"),
|
|
14
|
-
`keywords must contain "pi-package", got ${JSON.stringify(manifest.keywords)}`,
|
|
15
|
-
);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
test("pi.extensions is a non-empty array of package-root-relative paths", () => {
|
|
19
|
-
const extensions = manifest.pi?.extensions;
|
|
20
|
-
assert.ok(Array.isArray(extensions), "pi.extensions must be an array");
|
|
21
|
-
assert.ok(extensions.length > 0, "pi.extensions must not be empty");
|
|
22
|
-
for (const entry of extensions) {
|
|
23
|
-
assert.equal(typeof entry, "string", `pi.extensions entry must be a string: ${entry}`);
|
|
24
|
-
assert.ok(entry.length > 0, "pi.extensions entry must not be empty");
|
|
25
|
-
assert.ok(!isAbsolute(entry), `pi.extensions entry must be package-root relative: ${entry}`);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test("every declared extension path resolves to an existing file inside the package", () => {
|
|
30
|
-
for (const entry of manifest.pi.extensions) {
|
|
31
|
-
const resolved = resolve(packageRoot, entry);
|
|
32
|
-
const relativeToRoot = relative(packageRoot, resolved);
|
|
33
|
-
assert.ok(
|
|
34
|
-
relativeToRoot.length > 0 &&
|
|
35
|
-
!relativeToRoot.startsWith("..") &&
|
|
36
|
-
!isAbsolute(relativeToRoot),
|
|
37
|
-
`extension path escapes the package root: ${entry}`,
|
|
38
|
-
);
|
|
39
|
-
assert.ok(existsSync(resolved), `extension path does not exist: ${entry} -> ${resolved}`);
|
|
40
|
-
assert.ok(
|
|
41
|
-
statSync(resolved).isFile(),
|
|
42
|
-
`extension path is not a file: ${entry} -> ${resolved}`,
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* The same containment rule the extension paths are held to: a package-root-relative path that
|
|
49
|
-
* exists, is a file, and cannot escape the package root.
|
|
50
|
-
*/
|
|
51
|
-
const assertResolvesInsidePackage = (entry: unknown, label: string): void => {
|
|
52
|
-
assert.equal(typeof entry, "string", `${label} must be a string: ${String(entry)}`);
|
|
53
|
-
assert.ok((entry as string).length > 0, `${label} must not be empty`);
|
|
54
|
-
assert.ok(!isAbsolute(entry as string), `${label} must be package-root relative: ${String(entry)}`);
|
|
55
|
-
const resolved = resolve(packageRoot, entry as string);
|
|
56
|
-
const relativeToRoot = relative(packageRoot, resolved);
|
|
57
|
-
assert.ok(
|
|
58
|
-
relativeToRoot.length > 0 && !relativeToRoot.startsWith("..") && !isAbsolute(relativeToRoot),
|
|
59
|
-
`${label} escapes the package root: ${String(entry)}`,
|
|
60
|
-
);
|
|
61
|
-
assert.ok(existsSync(resolved), `${label} does not exist: ${String(entry)} -> ${resolved}`);
|
|
62
|
-
assert.ok(statSync(resolved).isFile(), `${label} is not a file: ${String(entry)} -> ${resolved}`);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
test("types points at an existing file inside the package", () => {
|
|
66
|
-
assertResolvesInsidePackage(manifest.types, "types");
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
test("exports maps the package root to existing files inside the package", () => {
|
|
70
|
-
const rootExports = manifest.exports?.["."];
|
|
71
|
-
assert.ok(rootExports !== undefined, 'exports must expose the package root as "."');
|
|
72
|
-
|
|
73
|
-
if (typeof rootExports === "string") {
|
|
74
|
-
assertResolvesInsidePackage(rootExports, 'exports["."]');
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
assertResolvesInsidePackage(rootExports.types, 'exports["."].types');
|
|
79
|
-
assertResolvesInsidePackage(rootExports.default, 'exports["."].default');
|
|
80
|
-
assert.equal(
|
|
81
|
-
rootExports.types,
|
|
82
|
-
manifest.types,
|
|
83
|
-
"the root export's types target must be the same file as the types field",
|
|
84
|
-
);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
test("test and typecheck scripts are declared", () => {
|
|
88
|
-
assert.equal(manifest.scripts?.test, "node --test");
|
|
89
|
-
assert.equal(manifest.scripts?.typecheck, "tsc --noEmit");
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
test("the released version and the public VERSION agree", async () => {
|
|
93
|
-
const entry = await import("../src/index.ts");
|
|
94
|
-
assert.equal(typeof manifest.version, "string");
|
|
95
|
-
assert.match(
|
|
96
|
-
manifest.version,
|
|
97
|
-
/^\d+\.\d+\.\d+$/u,
|
|
98
|
-
`the manifest version must be a plain release version, got ${String(manifest.version)}`,
|
|
99
|
-
);
|
|
100
|
-
assert.equal(
|
|
101
|
-
entry.VERSION,
|
|
102
|
-
manifest.version,
|
|
103
|
-
"package.json and src/index.ts must never drift: one of them is what a consumer reads",
|
|
104
|
-
);
|
|
105
|
-
});
|