@memberjunction/react-test-harness 4.3.1 → 5.0.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.
@@ -0,0 +1,122 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ const fs = __importStar(require("fs"));
28
+ const path = __importStar(require("path"));
29
+ const component_linter_1 = require("./component-linter.js");
30
+ async function testBroken9() {
31
+ try {
32
+ // Load the broken-9.json spec
33
+ const specPath = path.join(__dirname, 'broken-9.json');
34
+ const specContent = fs.readFileSync(specPath, 'utf-8');
35
+ const spec = JSON.parse(specContent);
36
+ console.log('=== Testing broken-9.json Component ===\n');
37
+ console.log(`Component: ${spec.name} (${spec.title})\n`);
38
+ // Test the root component
39
+ if (spec.code) {
40
+ console.log('Testing root component code...');
41
+ // Remove libraries from spec temporarily to avoid contextUser requirement
42
+ const specWithoutLibraries = { ...spec, libraries: undefined };
43
+ let result;
44
+ try {
45
+ result = await component_linter_1.ComponentLinter.lintComponent(spec.code, spec.name, specWithoutLibraries, true, // isRootComponent
46
+ undefined, // no contextUser for now
47
+ false // no debug mode
48
+ );
49
+ }
50
+ catch (error) {
51
+ console.error('Linter threw error:', error);
52
+ throw error;
53
+ }
54
+ console.log(`Has Errors: ${result.hasErrors}`);
55
+ console.log(`Total Violations: ${result.violations.length}`);
56
+ // Debug: Show all violations
57
+ console.log('All violation rules:', result.violations.map(v => v.rule));
58
+ // Show parse error details
59
+ const parseError = result.violations.find(v => v.rule === 'parse-error');
60
+ if (parseError) {
61
+ console.log('\nParse Error Details:');
62
+ console.log(parseError.message);
63
+ }
64
+ // Filter for callbacks and sorting violations
65
+ const importantViolations = result.violations.filter(v => v.rule === 'callbacks-usage-validation' ||
66
+ v.rule === 'callbacks-passthrough-only' ||
67
+ v.rule === 'table-sorting-implementation');
68
+ if (importantViolations.length > 0) {
69
+ console.log('\n=== IMPORTANT VIOLATIONS FOUND ===');
70
+ importantViolations.forEach((v, i) => {
71
+ console.log(`\n${i + 1}. [${v.severity.toUpperCase()}] ${v.rule}`);
72
+ console.log(` Line ${v.line}, Column ${v.column}`);
73
+ console.log(` Message: ${v.message}`);
74
+ if (v.suggestion) {
75
+ console.log(` Suggestion: ${v.suggestion.text}`);
76
+ if (v.suggestion.example) {
77
+ console.log(` Example:\n${v.suggestion.example.split('\n').map(l => ' ' + l).join('\n')}`);
78
+ }
79
+ }
80
+ });
81
+ }
82
+ }
83
+ // Test child components
84
+ if (spec.dependencies && spec.dependencies.length > 0) {
85
+ console.log('\n\n=== Testing Child Components ===\n');
86
+ for (const dep of spec.dependencies) {
87
+ if (dep.code) {
88
+ console.log(`\nTesting ${dep.name}:`);
89
+ // Remove libraries from spec temporarily to avoid contextUser requirement
90
+ const depSpecWithoutLibraries = { ...dep, libraries: undefined };
91
+ const result = await component_linter_1.ComponentLinter.lintComponent(dep.code, dep.name, depSpecWithoutLibraries, false, // not root component
92
+ undefined, // no contextUser
93
+ false // no debug mode
94
+ );
95
+ console.log(` Has Errors: ${result.hasErrors}`);
96
+ console.log(` Total Violations: ${result.violations.length}`);
97
+ // Find the specific issue with callbacks
98
+ const callbacksIssues = result.violations.filter(v => v.rule === 'callbacks-usage-validation' ||
99
+ v.rule === 'callbacks-passthrough-only' ||
100
+ v.rule === 'component-props-validation');
101
+ if (callbacksIssues.length > 0) {
102
+ console.log('\n Relevant violations:');
103
+ callbacksIssues.forEach((v, i) => {
104
+ console.log(` ${i + 1}. [${v.severity.toUpperCase()}] ${v.rule}`);
105
+ console.log(` Line ${v.line}, Column ${v.column}`);
106
+ console.log(` Message: ${v.message}`);
107
+ if (v.suggestion) {
108
+ console.log(` Suggestion: ${v.suggestion.text}`);
109
+ }
110
+ });
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+ catch (error) {
117
+ console.error('Error testing component:', error);
118
+ process.exit(1);
119
+ }
120
+ }
121
+ testBroken9().catch(console.error);
122
+ //# sourceMappingURL=test-broken-9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-broken-9.js","sourceRoot":"","sources":["../../src/lib/test-broken-9.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,uCAAyB;AACzB,2CAA6B;AAE7B,yDAAqD;AAErD,KAAK,UAAU,WAAW;IACxB,IAAI,CAAC;QACH,8BAA8B;QAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QACvD,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,IAAI,GAAkB,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAEpD,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,KAA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WAAW,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;4BACnE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;4BACvD,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;4BAC1C,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;gCACjB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;4BACvD,CAAC;wBACH,CAAC,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IAEH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,WAAW,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/react-test-harness",
3
- "version": "4.3.1",
3
+ "version": "5.0.0",
4
4
  "description": "React component test harness for MemberJunction using Playwright",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -27,14 +27,14 @@
27
27
  "@babel/parser": "^7.29.0",
28
28
  "@babel/traverse": "^7.29.0",
29
29
  "@babel/types": "^7.29.0",
30
- "@memberjunction/ai-vectors-memory": "4.3.1",
31
- "@memberjunction/ai-core-plus": "4.3.1",
32
- "@memberjunction/aiengine": "4.3.1",
33
- "@memberjunction/core": "4.3.1",
34
- "@memberjunction/core-entities": "4.3.1",
35
- "@memberjunction/global": "4.3.1",
36
- "@memberjunction/interactive-component-types": "4.3.1",
37
- "@memberjunction/react-runtime": "4.3.1",
30
+ "@memberjunction/ai-vectors-memory": "5.0.0",
31
+ "@memberjunction/ai-core-plus": "5.0.0",
32
+ "@memberjunction/aiengine": "5.0.0",
33
+ "@memberjunction/core": "5.0.0",
34
+ "@memberjunction/core-entities": "5.0.0",
35
+ "@memberjunction/global": "5.0.0",
36
+ "@memberjunction/interactive-component-types": "5.0.0",
37
+ "@memberjunction/react-runtime": "5.0.0",
38
38
  "@playwright/test": "^1.58.1",
39
39
  "chalk": "^5.6.2",
40
40
  "commander": "^14.0.3",