vize 0.100.0 → 0.103.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/README.md +9 -2
- package/dist/cli.d.mts +1 -18
- package/dist/cli.mjs +2 -1015
- package/dist/cli.mjs.map +1 -1
- package/package.json +3 -10
- package/src/cli.ts +2 -1814
- package/dist/cli.d.mts.map +0 -1
- package/src/cli.test.ts +0 -89
package/dist/cli.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.mts","names":[],"sources":["../src/cli.ts"],"mappings":";iBA8IgB,4BAAA,CAA6B,YAAA;AAAA,iBAixB7B,uBAAA,CAAwB,OAAA;EACtC,WAAA;EACA,MAAA;EACA,KAAA;AAAA;AAAA,iBAac,oBAAA,CAAqB,KAAA;AAAA,iBA+DrB,WAAA,CAAY,QAAA;AAAA,UA4IlB,uBAAA;EACR,QAAA;EACA,QAAA;EACA,MAAA,IAAU,IAAA;AAAA;AAAA,iBAWI,wBAAA,CACd,KAAA,qBACA,OAAA,EAAS,uBAAA"}
|
package/src/cli.test.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
createBoundedFileBatches,
|
|
5
|
-
displayPath,
|
|
6
|
-
sanitizeTerminalText,
|
|
7
|
-
shouldPreferWorkspaceBinding,
|
|
8
|
-
shouldRetainCheckSource,
|
|
9
|
-
} from "./cli";
|
|
10
|
-
|
|
11
|
-
describe("shouldPreferWorkspaceBinding", () => {
|
|
12
|
-
it("detects the local workspace native package", () => {
|
|
13
|
-
expect(
|
|
14
|
-
shouldPreferWorkspaceBinding(
|
|
15
|
-
`${path.sep}Users${path.sep}example${path.sep}repo${path.sep}npm${path.sep}vize-native${path.sep}index.js`,
|
|
16
|
-
),
|
|
17
|
-
).toBe(true);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it("ignores published platform packages", () => {
|
|
21
|
-
expect(
|
|
22
|
-
shouldPreferWorkspaceBinding(
|
|
23
|
-
`${path.sep}repo${path.sep}node_modules${path.sep}.pnpm${path.sep}@vizejs+native-darwin-arm64${path.sep}node_modules${path.sep}@vizejs${path.sep}native-darwin-arm64${path.sep}index.js`,
|
|
24
|
-
),
|
|
25
|
-
).toBe(false);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it("returns false when the fallback package cannot be resolved", () => {
|
|
29
|
-
expect(shouldPreferWorkspaceBinding(null)).toBe(false);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
describe("sanitizeTerminalText", () => {
|
|
34
|
-
it("strips terminal escape and control sequences", () => {
|
|
35
|
-
const sanitized = sanitizeTerminalText("bad\x1b]52;c;AAAA\x07\x1b[31mname");
|
|
36
|
-
|
|
37
|
-
expect(sanitized).not.toContain("\x1b");
|
|
38
|
-
expect(sanitized).not.toContain("\x07");
|
|
39
|
-
expect(sanitized).toBe("badname");
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it("keeps ordinary multiline terminal text readable", () => {
|
|
43
|
-
expect(sanitizeTerminalText("line 1\n\tline 2\r\n")).toBe("line 1\n\tline 2\r\n");
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it("sanitizes displayed path segments", () => {
|
|
47
|
-
const unsafePath = path.join(process.cwd(), "bad\x1b[31m.vue");
|
|
48
|
-
|
|
49
|
-
expect(displayPath(unsafePath)).toBe("bad.vue");
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
describe("createBoundedFileBatches", () => {
|
|
54
|
-
it("splits batches by file count and total source bytes", () => {
|
|
55
|
-
const batches = createBoundedFileBatches(["a.vue", "b.vue", "c.vue", "d.vue"], {
|
|
56
|
-
maxFiles: 3,
|
|
57
|
-
maxBytes: 10,
|
|
58
|
-
sizeOf(file) {
|
|
59
|
-
return file === "c.vue" ? 9 : 4;
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
expect(batches).toEqual([["a.vue", "b.vue"], ["c.vue"], ["d.vue"]]);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it("keeps a single oversized file processable", () => {
|
|
67
|
-
const batches = createBoundedFileBatches(["huge.vue", "small.vue"], {
|
|
68
|
-
maxFiles: 4,
|
|
69
|
-
maxBytes: 10,
|
|
70
|
-
sizeOf(file) {
|
|
71
|
-
return file === "huge.vue" ? 100 : 1;
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
expect(batches).toEqual([["huge.vue"], ["small.vue"]]);
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
describe("shouldRetainCheckSource", () => {
|
|
80
|
-
it("drops source retention for JSON and quiet check output", () => {
|
|
81
|
-
expect(shouldRetainCheckSource({ format: "json" })).toBe(false);
|
|
82
|
-
expect(shouldRetainCheckSource({ quiet: true })).toBe(false);
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it("keeps source retention when diagnostics or declarations need it", () => {
|
|
86
|
-
expect(shouldRetainCheckSource({})).toBe(true);
|
|
87
|
-
expect(shouldRetainCheckSource({ format: "json", declaration: true })).toBe(true);
|
|
88
|
-
});
|
|
89
|
-
});
|