@powerhousedao/vetra 4.1.0-dev.81 → 4.1.0-dev.83
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/dist/document-models/app-module/src/reducers/base-operations.d.ts.map +1 -1
- package/dist/document-models/app-module/src/reducers/base-operations.js +5 -1
- package/dist/document-models/app-module/src/tests/base-operations.test.js +157 -30
- package/dist/document-models/app-module/src/tests/dnd-operations.test.js +38 -7
- package/dist/document-models/app-module/src/tests/document-model.test.js +80 -8
- package/dist/document-models/document-editor/src/reducers/base-operations.d.ts.map +1 -1
- package/dist/document-models/document-editor/src/reducers/base-operations.js +10 -1
- package/dist/document-models/document-editor/src/tests/base-operations.test.js +137 -23
- package/dist/document-models/document-editor/src/tests/document-model.test.js +91 -8
- package/dist/document-models/processor-module/src/reducers/base-operations.d.ts.map +1 -1
- package/dist/document-models/processor-module/src/reducers/base-operations.js +15 -2
- package/dist/document-models/processor-module/src/tests/base-operations.test.js +153 -33
- package/dist/document-models/processor-module/src/tests/document-model.test.js +96 -8
- package/dist/document-models/subgraph-module/src/reducers/base-operations.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/src/reducers/base-operations.js +5 -1
- package/dist/document-models/subgraph-module/src/tests/base-operations.test.js +33 -12
- package/dist/document-models/subgraph-module/src/tests/document-model.test.js +25 -8
- package/dist/document-models/vetra-package/src/reducers/base-operations.d.ts.map +1 -1
- package/dist/document-models/vetra-package/src/reducers/base-operations.js +5 -0
- package/dist/document-models/vetra-package/src/tests/base-operations.test.js +171 -75
- package/dist/document-models/vetra-package/src/tests/document-model.test.js +101 -8
- package/dist/editors/app-editor/components/AppEditorForm.d.ts.map +1 -1
- package/dist/editors/app-editor/components/AppEditorForm.js +2 -2
- package/dist/editors/app-editor/editor.test.d.ts +2 -0
- package/dist/editors/app-editor/editor.test.d.ts.map +1 -0
- package/dist/editors/app-editor/editor.test.js +422 -0
- package/dist/editors/document-editor/components/DocumentEditorForm.d.ts.map +1 -1
- package/dist/editors/document-editor/components/DocumentEditorForm.js +1 -1
- package/dist/editors/document-editor/editor.test.d.ts +2 -0
- package/dist/editors/document-editor/editor.test.d.ts.map +1 -0
- package/dist/editors/document-editor/editor.test.js +374 -0
- package/dist/editors/processor-editor/components/ProcessorEditorForm.d.ts.map +1 -1
- package/dist/editors/processor-editor/components/ProcessorEditorForm.js +1 -1
- package/dist/editors/processor-editor/editor.test.d.ts +2 -0
- package/dist/editors/processor-editor/editor.test.d.ts.map +1 -0
- package/dist/editors/processor-editor/editor.test.js +459 -0
- package/dist/editors/subgraph-editor/components/SubgraphEditorForm.d.ts.map +1 -1
- package/dist/editors/subgraph-editor/components/SubgraphEditorForm.js +3 -3
- package/dist/editors/subgraph-editor/editor.test.d.ts +2 -0
- package/dist/editors/subgraph-editor/editor.test.d.ts.map +1 -0
- package/dist/editors/subgraph-editor/editor.test.js +201 -0
- package/dist/editors/vetra-package/components/MetaForm.d.ts.map +1 -1
- package/dist/editors/vetra-package/components/MetaForm.js +3 -3
- package/dist/editors/vetra-package/editor.test.d.ts +2 -0
- package/dist/editors/vetra-package/editor.test.d.ts.map +1 -0
- package/dist/editors/vetra-package/editor.test.js +330 -0
- package/dist/processors/codegen/__tests__/codegen-processor-e2e.test.d.ts +2 -0
- package/dist/processors/codegen/__tests__/codegen-processor-e2e.test.d.ts.map +1 -0
- package/dist/processors/codegen/__tests__/codegen-processor-e2e.test.js +615 -0
- package/dist/processors/codegen/__tests__/factory.test.d.ts +2 -0
- package/dist/processors/codegen/__tests__/factory.test.d.ts.map +1 -0
- package/dist/processors/codegen/__tests__/factory.test.js +190 -0
- package/dist/setupTests.d.ts +2 -0
- package/dist/setupTests.d.ts.map +1 -0
- package/dist/setupTests.js +1 -0
- package/dist/style.css +9 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/vitest.config.d.ts.map +1 -1
- package/dist/vitest.config.js +9 -0
- package/package.json +19 -14
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { VETRA_PROCESSOR_CONFIG_KEY } from "@powerhousedao/config";
|
|
2
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
+
import { codegenProcessorFactory } from "../factory.js";
|
|
4
|
+
// Mock CodegenProcessor to avoid file operations
|
|
5
|
+
vi.mock("../index.js", () => ({
|
|
6
|
+
CodegenProcessor: vi.fn(() => ({
|
|
7
|
+
onStrands: vi.fn(),
|
|
8
|
+
})),
|
|
9
|
+
}));
|
|
10
|
+
describe("Codegen Processor Factory - Drive Filtering", () => {
|
|
11
|
+
let mockModule;
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
vi.clearAllMocks();
|
|
14
|
+
// Setup default module with no config
|
|
15
|
+
mockModule = {
|
|
16
|
+
config: new Map(),
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
describe("Vetra Drive Pattern Matching (No Explicit Config)", () => {
|
|
20
|
+
it("should create processor for drive with slug 'vetra'", () => {
|
|
21
|
+
const driveHeader = {
|
|
22
|
+
id: "some-id",
|
|
23
|
+
slug: "vetra",
|
|
24
|
+
};
|
|
25
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
26
|
+
expect(result).toHaveLength(1);
|
|
27
|
+
expect(result[0]).toHaveProperty("processor");
|
|
28
|
+
expect(result[0]).toHaveProperty("filter");
|
|
29
|
+
});
|
|
30
|
+
it("should create processor for drive with id 'vetra'", () => {
|
|
31
|
+
const driveHeader = {
|
|
32
|
+
id: "vetra",
|
|
33
|
+
slug: "other-slug",
|
|
34
|
+
};
|
|
35
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
36
|
+
expect(result).toHaveLength(1);
|
|
37
|
+
expect(result[0]).toHaveProperty("processor");
|
|
38
|
+
});
|
|
39
|
+
it("should create processor for drive with slug starting with 'vetra-'", () => {
|
|
40
|
+
const driveHeader = {
|
|
41
|
+
id: "some-id",
|
|
42
|
+
slug: "vetra-dev",
|
|
43
|
+
};
|
|
44
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
45
|
+
expect(result).toHaveLength(1);
|
|
46
|
+
expect(result[0]).toHaveProperty("processor");
|
|
47
|
+
});
|
|
48
|
+
it("should create processor for drive with id starting with 'vetra-'", () => {
|
|
49
|
+
const driveHeader = {
|
|
50
|
+
id: "vetra-production",
|
|
51
|
+
slug: "other-slug",
|
|
52
|
+
};
|
|
53
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
54
|
+
expect(result).toHaveLength(1);
|
|
55
|
+
expect(result[0]).toHaveProperty("processor");
|
|
56
|
+
});
|
|
57
|
+
it("should reject drive with non-vetra slug and id", () => {
|
|
58
|
+
const driveHeader = {
|
|
59
|
+
id: "other-drive-id",
|
|
60
|
+
slug: "other-drive",
|
|
61
|
+
};
|
|
62
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
63
|
+
expect(result).toHaveLength(0);
|
|
64
|
+
});
|
|
65
|
+
it("should reject drive with slug containing 'vetra' but not starting with it", () => {
|
|
66
|
+
const driveHeader = {
|
|
67
|
+
id: "some-id",
|
|
68
|
+
slug: "my-vetra-drive",
|
|
69
|
+
};
|
|
70
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
71
|
+
expect(result).toHaveLength(0);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
describe("Case-Insensitive Matching", () => {
|
|
75
|
+
it("should match slug 'VETRA' (uppercase)", () => {
|
|
76
|
+
const driveHeader = {
|
|
77
|
+
id: "some-id",
|
|
78
|
+
slug: "VETRA",
|
|
79
|
+
};
|
|
80
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
81
|
+
expect(result).toHaveLength(1);
|
|
82
|
+
});
|
|
83
|
+
it("should match slug 'Vetra' (mixed case)", () => {
|
|
84
|
+
const driveHeader = {
|
|
85
|
+
id: "some-id",
|
|
86
|
+
slug: "Vetra",
|
|
87
|
+
};
|
|
88
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
89
|
+
expect(result).toHaveLength(1);
|
|
90
|
+
});
|
|
91
|
+
it("should match slug 'VETRA-DEV' (uppercase with suffix)", () => {
|
|
92
|
+
const driveHeader = {
|
|
93
|
+
id: "some-id",
|
|
94
|
+
slug: "VETRA-DEV",
|
|
95
|
+
};
|
|
96
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
97
|
+
expect(result).toHaveLength(1);
|
|
98
|
+
});
|
|
99
|
+
it("should match id 'Vetra-Production' (mixed case with suffix)", () => {
|
|
100
|
+
const driveHeader = {
|
|
101
|
+
id: "Vetra-Production",
|
|
102
|
+
slug: "other-slug",
|
|
103
|
+
};
|
|
104
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
105
|
+
expect(result).toHaveLength(1);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
describe("Explicit Drive ID Configuration", () => {
|
|
109
|
+
it("should match exact slug when explicit driveId is configured", () => {
|
|
110
|
+
mockModule.config?.set(VETRA_PROCESSOR_CONFIG_KEY, {
|
|
111
|
+
driveId: "my-custom-drive",
|
|
112
|
+
});
|
|
113
|
+
const driveHeader = {
|
|
114
|
+
id: "some-id",
|
|
115
|
+
slug: "my-custom-drive",
|
|
116
|
+
};
|
|
117
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
118
|
+
expect(result).toHaveLength(1);
|
|
119
|
+
});
|
|
120
|
+
it("should match exact id when explicit driveId is configured", () => {
|
|
121
|
+
mockModule.config?.set(VETRA_PROCESSOR_CONFIG_KEY, {
|
|
122
|
+
driveId: "custom-drive-id",
|
|
123
|
+
});
|
|
124
|
+
const driveHeader = {
|
|
125
|
+
id: "custom-drive-id",
|
|
126
|
+
slug: "other-slug",
|
|
127
|
+
};
|
|
128
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
129
|
+
expect(result).toHaveLength(1);
|
|
130
|
+
});
|
|
131
|
+
it("should reject vetra pattern when explicit driveId is configured and does not match", () => {
|
|
132
|
+
mockModule.config?.set(VETRA_PROCESSOR_CONFIG_KEY, {
|
|
133
|
+
driveId: "my-custom-drive",
|
|
134
|
+
});
|
|
135
|
+
const driveHeader = {
|
|
136
|
+
id: "vetra-dev",
|
|
137
|
+
slug: "vetra",
|
|
138
|
+
};
|
|
139
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
140
|
+
// Should be rejected because explicit driveId requires exact match
|
|
141
|
+
expect(result).toHaveLength(0);
|
|
142
|
+
});
|
|
143
|
+
it("should reject non-matching drive when explicit driveId is configured", () => {
|
|
144
|
+
mockModule.config?.set(VETRA_PROCESSOR_CONFIG_KEY, {
|
|
145
|
+
driveId: "my-custom-drive",
|
|
146
|
+
});
|
|
147
|
+
const driveHeader = {
|
|
148
|
+
id: "other-id",
|
|
149
|
+
slug: "other-slug",
|
|
150
|
+
};
|
|
151
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
152
|
+
expect(result).toHaveLength(0);
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
describe("ProcessorRecord Filter Configuration", () => {
|
|
156
|
+
it("should configure filter with correct branch, documentType, and scope", () => {
|
|
157
|
+
const driveHeader = {
|
|
158
|
+
id: "vetra",
|
|
159
|
+
slug: "vetra",
|
|
160
|
+
};
|
|
161
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
162
|
+
expect(result).toHaveLength(1);
|
|
163
|
+
expect(result[0].filter).toEqual({
|
|
164
|
+
branch: ["main"],
|
|
165
|
+
documentId: ["*"],
|
|
166
|
+
documentType: [
|
|
167
|
+
"powerhouse/document-model",
|
|
168
|
+
"powerhouse/package",
|
|
169
|
+
"powerhouse/document-editor",
|
|
170
|
+
"powerhouse/subgraph",
|
|
171
|
+
"powerhouse/processor",
|
|
172
|
+
"powerhouse/app",
|
|
173
|
+
],
|
|
174
|
+
scope: ["global"],
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
it("should pass interactive mode to CodegenProcessor when configured", () => {
|
|
178
|
+
mockModule.config?.set(VETRA_PROCESSOR_CONFIG_KEY, {
|
|
179
|
+
interactive: true,
|
|
180
|
+
});
|
|
181
|
+
const driveHeader = {
|
|
182
|
+
id: "vetra",
|
|
183
|
+
slug: "vetra",
|
|
184
|
+
};
|
|
185
|
+
const result = codegenProcessorFactory(mockModule)(driveHeader);
|
|
186
|
+
expect(result).toHaveLength(1);
|
|
187
|
+
// Processor is created with interactive: true (verified by mock being called)
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupTests.d.ts","sourceRoot":"","sources":["../setupTests.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
package/dist/style.css
CHANGED
|
@@ -525,9 +525,18 @@
|
|
|
525
525
|
.text-yellow-800 {
|
|
526
526
|
color: var(--color-yellow-800);
|
|
527
527
|
}
|
|
528
|
+
.blur {
|
|
529
|
+
--tw-blur: blur(8px);
|
|
530
|
+
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
531
|
+
}
|
|
528
532
|
.filter {
|
|
529
533
|
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
530
534
|
}
|
|
535
|
+
.transition {
|
|
536
|
+
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
|
|
537
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
538
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
539
|
+
}
|
|
531
540
|
.transition-all {
|
|
532
541
|
transition-property: all;
|
|
533
542
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|