@glubean/scanner 0.1.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.
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Scanner types - shared between scanner consumers.
3
+ */
4
+ /** Export metadata for a single test export */
5
+ export interface ExportMeta {
6
+ type: "test";
7
+ /** Unique test ID */
8
+ id: string;
9
+ /** Human-readable name */
10
+ name?: string;
11
+ /** Tags for filtering */
12
+ tags?: string[];
13
+ /** Optional per-test timeout from TestMeta.timeout (milliseconds) */
14
+ timeout?: number;
15
+ /** Whether the test is marked as skip (should not run) */
16
+ skip?: boolean;
17
+ /** Whether the test is marked as only (exclusive run) */
18
+ only?: boolean;
19
+ /**
20
+ * Test variant — indicates the SDK API shape used to define this test.
21
+ *
22
+ * - `"each"` — `test.each(data)("id-$key", fn)` (data-driven)
23
+ * - `"pick"` — `test.pick(examples)("id-$_pick", fn)` (example selection)
24
+ * - `undefined` — simple `test()` or builder `test("id").step(...)`
25
+ *
26
+ * Only populated by static analysis. Runtime extraction cannot distinguish
27
+ * `test.each` from `test.pick` since both produce `EachBuilder` objects.
28
+ */
29
+ variant?: "each" | "pick";
30
+ /**
31
+ * Trace grouping ID — the unresolved template ID for pick tests.
32
+ * When set, the CLI uses this as the trace directory name so all
33
+ * pick variants share one directory for easy diffing.
34
+ *
35
+ * Populated by runtime extraction when the SDK sets `groupId` on
36
+ * registered test metadata (i.e., for `test.pick` tests).
37
+ */
38
+ groupId?: string;
39
+ /** JavaScript export name (e.g., "myTest" or "default") */
40
+ exportName: string;
41
+ /** Source location */
42
+ location?: {
43
+ line: number;
44
+ col: number;
45
+ };
46
+ /** Steps for builder-style flows (visualization only) */
47
+ steps?: {
48
+ name: string;
49
+ group?: string;
50
+ }[];
51
+ }
52
+ /** File metadata in scan result */
53
+ export interface FileMeta {
54
+ /** File content hash (sha256-...) */
55
+ hash: string;
56
+ /** Exported tests from this file */
57
+ exports: ExportMeta[];
58
+ }
59
+ /**
60
+ * Bundle metadata stored in metadata.json.
61
+ */
62
+ export interface BundleMetadata {
63
+ /**
64
+ * Schema version for metadata.json.
65
+ * This is independent from the spec version used by the SDK.
66
+ */
67
+ schemaVersion: "1";
68
+ /** Spec version used when generating metadata */
69
+ specVersion: string;
70
+ /** Generator identifier, e.g. "@glubean/cli@0.2.0" */
71
+ generatedBy: string;
72
+ /** ISO timestamp when metadata was generated */
73
+ generatedAt: string;
74
+ /** Root hash derived from file paths + hashes */
75
+ rootHash: string;
76
+ /** Files with test exports: { "path/to/file.ts": FileMeta } */
77
+ files: Record<string, FileMeta>;
78
+ /** Total number of tests */
79
+ testCount: number;
80
+ /** Total number of files with tests */
81
+ fileCount: number;
82
+ /** All unique tags across all tests */
83
+ tags: string[];
84
+ /** Optional warnings from the scanner */
85
+ warnings?: string[];
86
+ /** Optional bundle version (used by CLI sync) */
87
+ version?: string;
88
+ /** Optional project id (used by CLI sync) */
89
+ projectId?: string;
90
+ }
91
+ /** Result of scanning a directory */
92
+ export interface ScanResult {
93
+ /** Spec version used for scanning */
94
+ specVersion: string;
95
+ /** Files with test exports: { "path/to/file.ts": FileMeta } */
96
+ files: Record<string, FileMeta>;
97
+ /** Total number of tests */
98
+ testCount: number;
99
+ /** Total number of files with tests */
100
+ fileCount: number;
101
+ /** All unique tags across all tests */
102
+ tags: string[];
103
+ /** Diagnostic warnings (non-fatal issues) */
104
+ warnings: string[];
105
+ }
106
+ /** Options for scanning */
107
+ export interface ScanOptions {
108
+ /** Spec version to use (defaults to current SPEC_VERSION) */
109
+ specVersion?: string;
110
+ /** Directories/patterns to skip (defaults: node_modules, .git, dist, build) */
111
+ skipDirs?: string[];
112
+ /** File extensions to scan (defaults: [".ts"]) */
113
+ extensions?: string[];
114
+ /** If true, require package.json in root (defaults: false, just warns) */
115
+ requirePackageJson?: boolean;
116
+ }
117
+ /** Project validation result */
118
+ export interface ValidationResult {
119
+ /** Whether the directory is a valid Glubean project */
120
+ valid: boolean;
121
+ /** Validation errors (if not valid) */
122
+ errors: string[];
123
+ /** Validation warnings (non-fatal issues) */
124
+ warnings: string[];
125
+ /** Detected spec version (from package.json or default) */
126
+ detectedSpecVersion?: string;
127
+ }
128
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,+CAA+C;AAC/C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yDAAyD;IACzD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,yDAAyD;IACzD,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC5C;AAED,mCAAmC;AACnC,MAAM,WAAW,QAAQ;IACvB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,aAAa,EAAE,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BAAgB;IAC/B,uDAAuD;IACvD,KAAK,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,2DAA2D;IAC3D,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
package/dist/types.js ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Scanner types - shared between scanner consumers.
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@glubean/scanner",
3
+ "version": "0.1.2",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.js"
9
+ },
10
+ "./static": {
11
+ "types": "./dist/static.d.ts",
12
+ "import": "./dist/static.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "devDependencies": {
19
+ "@types/node": "^22.0.0"
20
+ },
21
+ "scripts": {
22
+ "build": "tsc -p tsconfig.build.json",
23
+ "test": "vitest run"
24
+ }
25
+ }