@memberjunction/react-runtime 2.70.0 → 2.72.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +24 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -1
- package/dist/utilities/component-error-analyzer.d.ts +20 -0
- package/dist/utilities/component-error-analyzer.d.ts.map +1 -0
- package/dist/utilities/component-error-analyzer.js +204 -0
- package/dist/utilities/component-styles.d.ts +4 -0
- package/dist/utilities/component-styles.d.ts.map +1 -0
- package/dist/utilities/component-styles.js +97 -0
- package/dist/utilities/index.d.ts +6 -0
- package/dist/utilities/index.d.ts.map +1 -0
- package/dist/utilities/index.js +21 -0
- package/dist/utilities/library-loader.d.ts +33 -0
- package/dist/utilities/library-loader.d.ts.map +1 -0
- package/dist/utilities/library-loader.js +193 -0
- package/dist/utilities/runtime-utilities.d.ts +10 -0
- package/dist/utilities/runtime-utilities.d.ts.map +1 -0
- package/dist/utilities/runtime-utilities.js +92 -0
- package/dist/utilities/standard-libraries.d.ts +27 -0
- package/dist/utilities/standard-libraries.d.ts.map +1 -0
- package/dist/utilities/standard-libraries.js +55 -0
- package/package.json +4 -1
- package/src/index.ts +31 -0
- package/src/utilities/component-error-analyzer.ts +315 -0
- package/src/utilities/component-styles.ts +121 -0
- package/src/utilities/index.ts +10 -0
- package/src/utilities/library-loader.ts +307 -0
- package/src/utilities/runtime-utilities.ts +122 -0
- package/src/utilities/standard-libraries.ts +97 -0
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
1
|
# @memberjunction/react-runtime
|
|
2
2
|
|
|
3
|
+
## 2.72.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @memberjunction/interactive-component-types@2.72.0
|
|
8
|
+
- @memberjunction/core@2.72.0
|
|
9
|
+
- @memberjunction/global@2.72.0
|
|
10
|
+
|
|
11
|
+
## 2.71.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 91188ab: migration file + various improvements and reorganization
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 062918f: fix package.json
|
|
20
|
+
- Updated dependencies [c5a409c]
|
|
21
|
+
- Updated dependencies [5a127bb]
|
|
22
|
+
- Updated dependencies [91188ab]
|
|
23
|
+
- @memberjunction/global@2.71.0
|
|
24
|
+
- @memberjunction/core@2.71.0
|
|
25
|
+
- @memberjunction/interactive-component-types@2.71.0
|
|
26
|
+
|
|
3
27
|
## 2.70.0
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ export { createErrorBoundary, withErrorBoundary, formatComponentError, createErr
|
|
|
10
10
|
export { wrapComponent, memoizeComponent, lazyComponent, injectProps, conditionalComponent, withErrorHandler, portalComponent, WrapperOptions } from './runtime';
|
|
11
11
|
export { buildComponentProps, normalizeCallbacks, normalizeStyles, validateComponentProps, mergeProps, createPropsTransformer, wrapCallbacksWithLogging, extractPropPaths, PropBuilderOptions } from './runtime';
|
|
12
12
|
export { ComponentHierarchyRegistrar, registerComponentHierarchy, validateComponentSpec, flattenComponentHierarchy, countComponentsInHierarchy, HierarchyRegistrationResult, ComponentRegistrationError, HierarchyRegistrationOptions } from './runtime';
|
|
13
|
+
export { RuntimeUtilities, createRuntimeUtilities } from './utilities/runtime-utilities';
|
|
14
|
+
export { SetupStyles, createDefaultComponentStyles } from './utilities/component-styles';
|
|
15
|
+
export { STANDARD_LIBRARY_URLS, StandardLibraries, getCoreLibraryUrls, getUILibraryUrls, getCSSUrls, createStandardLibraries } from './utilities/standard-libraries';
|
|
16
|
+
export { LibraryLoader, LibraryLoadOptions, LibraryLoadResult } from './utilities/library-loader';
|
|
17
|
+
export { ComponentErrorAnalyzer, FailedComponentInfo } from './utilities/component-error-analyzer';
|
|
13
18
|
export declare const VERSION = "2.69.1";
|
|
14
19
|
export declare const DEFAULT_CONFIGS: {
|
|
15
20
|
compiler: {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACb,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACf,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,WAAW,CAAC;AAGnB,eAAO,MAAM,OAAO,WAAW,CAAC;AAGhC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;CAiB3B,CAAC;AAQF,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,GAAG,EAClB,MAAM,CAAC,EAAE;IACP,QAAQ,CAAC,EAAE,OAAO,CAAC,OAAO,SAAS,EAAE,cAAc,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC,OAAO,SAAS,EAAE,cAAc,CAAC,CAAC;CACtD;;;;;EAcF"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACb,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACf,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,WAAW,EACX,4BAA4B,EAC7B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,uBAAuB,EACxB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAG9C,eAAO,MAAM,OAAO,WAAW,CAAC;AAGhC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;CAiB3B,CAAC;AAQF,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,GAAG,EAClB,MAAM,CAAC,EAAE;IACP,QAAQ,CAAC,EAAE,OAAO,CAAC,OAAO,SAAS,EAAE,cAAc,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC,OAAO,SAAS,EAAE,cAAc,CAAC,CAAC;CACtD;;;;;EAcF"}
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.createReactRuntime = exports.DEFAULT_CONFIGS = exports.VERSION = exports.countComponentsInHierarchy = exports.flattenComponentHierarchy = exports.validateComponentSpec = exports.registerComponentHierarchy = exports.ComponentHierarchyRegistrar = exports.extractPropPaths = exports.wrapCallbacksWithLogging = exports.createPropsTransformer = exports.mergeProps = exports.validateComponentProps = exports.normalizeStyles = exports.normalizeCallbacks = exports.buildComponentProps = exports.portalComponent = exports.withErrorHandler = exports.conditionalComponent = exports.injectProps = exports.lazyComponent = exports.memoizeComponent = exports.wrapComponent = exports.createErrorLogger = exports.formatComponentError = exports.withErrorBoundary = exports.createErrorBoundary = exports.ComponentResolver = exports.ComponentRegistry = exports.getJSXConfig = exports.validateBabelPresets = exports.getBabelConfig = exports.DEVELOPMENT_CONFIG = exports.PRODUCTION_CONFIG = exports.DEFAULT_PLUGINS = exports.DEFAULT_PRESETS = exports.ComponentCompiler = void 0;
|
|
17
|
+
exports.createReactRuntime = exports.DEFAULT_CONFIGS = exports.VERSION = exports.ComponentErrorAnalyzer = exports.LibraryLoader = exports.createStandardLibraries = exports.getCSSUrls = exports.getUILibraryUrls = exports.getCoreLibraryUrls = exports.STANDARD_LIBRARY_URLS = exports.createDefaultComponentStyles = exports.SetupStyles = exports.createRuntimeUtilities = exports.RuntimeUtilities = exports.countComponentsInHierarchy = exports.flattenComponentHierarchy = exports.validateComponentSpec = exports.registerComponentHierarchy = exports.ComponentHierarchyRegistrar = exports.extractPropPaths = exports.wrapCallbacksWithLogging = exports.createPropsTransformer = exports.mergeProps = exports.validateComponentProps = exports.normalizeStyles = exports.normalizeCallbacks = exports.buildComponentProps = exports.portalComponent = exports.withErrorHandler = exports.conditionalComponent = exports.injectProps = exports.lazyComponent = exports.memoizeComponent = exports.wrapComponent = exports.createErrorLogger = exports.formatComponentError = exports.withErrorBoundary = exports.createErrorBoundary = exports.ComponentResolver = exports.ComponentRegistry = exports.getJSXConfig = exports.validateBabelPresets = exports.getBabelConfig = exports.DEVELOPMENT_CONFIG = exports.PRODUCTION_CONFIG = exports.DEFAULT_PLUGINS = exports.DEFAULT_PRESETS = exports.ComponentCompiler = void 0;
|
|
18
18
|
const compiler_1 = require("./compiler");
|
|
19
19
|
const registry_1 = require("./registry");
|
|
20
20
|
const registry_2 = require("./registry");
|
|
@@ -61,6 +61,22 @@ Object.defineProperty(exports, "registerComponentHierarchy", { enumerable: true,
|
|
|
61
61
|
Object.defineProperty(exports, "validateComponentSpec", { enumerable: true, get: function () { return runtime_4.validateComponentSpec; } });
|
|
62
62
|
Object.defineProperty(exports, "flattenComponentHierarchy", { enumerable: true, get: function () { return runtime_4.flattenComponentHierarchy; } });
|
|
63
63
|
Object.defineProperty(exports, "countComponentsInHierarchy", { enumerable: true, get: function () { return runtime_4.countComponentsInHierarchy; } });
|
|
64
|
+
var runtime_utilities_1 = require("./utilities/runtime-utilities");
|
|
65
|
+
Object.defineProperty(exports, "RuntimeUtilities", { enumerable: true, get: function () { return runtime_utilities_1.RuntimeUtilities; } });
|
|
66
|
+
Object.defineProperty(exports, "createRuntimeUtilities", { enumerable: true, get: function () { return runtime_utilities_1.createRuntimeUtilities; } });
|
|
67
|
+
var component_styles_1 = require("./utilities/component-styles");
|
|
68
|
+
Object.defineProperty(exports, "SetupStyles", { enumerable: true, get: function () { return component_styles_1.SetupStyles; } });
|
|
69
|
+
Object.defineProperty(exports, "createDefaultComponentStyles", { enumerable: true, get: function () { return component_styles_1.createDefaultComponentStyles; } });
|
|
70
|
+
var standard_libraries_1 = require("./utilities/standard-libraries");
|
|
71
|
+
Object.defineProperty(exports, "STANDARD_LIBRARY_URLS", { enumerable: true, get: function () { return standard_libraries_1.STANDARD_LIBRARY_URLS; } });
|
|
72
|
+
Object.defineProperty(exports, "getCoreLibraryUrls", { enumerable: true, get: function () { return standard_libraries_1.getCoreLibraryUrls; } });
|
|
73
|
+
Object.defineProperty(exports, "getUILibraryUrls", { enumerable: true, get: function () { return standard_libraries_1.getUILibraryUrls; } });
|
|
74
|
+
Object.defineProperty(exports, "getCSSUrls", { enumerable: true, get: function () { return standard_libraries_1.getCSSUrls; } });
|
|
75
|
+
Object.defineProperty(exports, "createStandardLibraries", { enumerable: true, get: function () { return standard_libraries_1.createStandardLibraries; } });
|
|
76
|
+
var library_loader_1 = require("./utilities/library-loader");
|
|
77
|
+
Object.defineProperty(exports, "LibraryLoader", { enumerable: true, get: function () { return library_loader_1.LibraryLoader; } });
|
|
78
|
+
var component_error_analyzer_1 = require("./utilities/component-error-analyzer");
|
|
79
|
+
Object.defineProperty(exports, "ComponentErrorAnalyzer", { enumerable: true, get: function () { return component_error_analyzer_1.ComponentErrorAnalyzer; } });
|
|
64
80
|
exports.VERSION = '2.69.1';
|
|
65
81
|
exports.DEFAULT_CONFIGS = {
|
|
66
82
|
compiler: {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface FailedComponentInfo {
|
|
2
|
+
componentName: string;
|
|
3
|
+
errorType: string;
|
|
4
|
+
errorMessage: string;
|
|
5
|
+
lineNumber?: number;
|
|
6
|
+
context?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class ComponentErrorAnalyzer {
|
|
9
|
+
private static readonly ERROR_PATTERNS;
|
|
10
|
+
static identifyFailedComponents(errors: string[]): string[];
|
|
11
|
+
static analyzeComponentErrors(errors: string[]): FailedComponentInfo[];
|
|
12
|
+
private static extractComponentsFromError;
|
|
13
|
+
private static analyzeError;
|
|
14
|
+
private static extractComponentsFromStackTrace;
|
|
15
|
+
private static isLikelyComponentName;
|
|
16
|
+
private static extractLineNumber;
|
|
17
|
+
private static extractContext;
|
|
18
|
+
static formatAnalysisResults(failures: FailedComponentInfo[]): string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=component-error-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-error-analyzer.d.ts","sourceRoot":"","sources":["../../src/utilities/component-error-analyzer.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,mBAAmB;IAElC,aAAa,EAAE,MAAM,CAAC;IAEtB,SAAS,EAAE,MAAM,CAAC;IAElB,YAAY,EAAE,MAAM,CAAC;IAErB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAKD,qBAAa,sBAAsB;IAIjC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CA6DpC;IAOF,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAgB3D,MAAM,CAAC,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,mBAAmB,EAAE;IAuBtE,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAuBzC,OAAO,CAAC,MAAM,CAAC,YAAY;IAsC3B,OAAO,CAAC,MAAM,CAAC,+BAA+B;IA2B9C,OAAO,CAAC,MAAM,CAAC,qBAAqB;IA6BpC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAqBhC,OAAO,CAAC,MAAM,CAAC,cAAc;IAmB7B,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,GAAG,MAAM;CAqBtE"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentErrorAnalyzer = void 0;
|
|
4
|
+
class ComponentErrorAnalyzer {
|
|
5
|
+
static identifyFailedComponents(errors) {
|
|
6
|
+
const failedComponents = new Set();
|
|
7
|
+
for (const error of errors) {
|
|
8
|
+
const components = this.extractComponentsFromError(error);
|
|
9
|
+
components.forEach(comp => failedComponents.add(comp));
|
|
10
|
+
}
|
|
11
|
+
return Array.from(failedComponents);
|
|
12
|
+
}
|
|
13
|
+
static analyzeComponentErrors(errors) {
|
|
14
|
+
const failures = [];
|
|
15
|
+
for (const error of errors) {
|
|
16
|
+
const failureInfo = this.analyzeError(error);
|
|
17
|
+
failures.push(...failureInfo);
|
|
18
|
+
}
|
|
19
|
+
const uniqueFailures = new Map();
|
|
20
|
+
failures.forEach(failure => {
|
|
21
|
+
const key = `${failure.componentName}-${failure.errorType}`;
|
|
22
|
+
if (!uniqueFailures.has(key)) {
|
|
23
|
+
uniqueFailures.set(key, failure);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return Array.from(uniqueFailures.values());
|
|
27
|
+
}
|
|
28
|
+
static extractComponentsFromError(error) {
|
|
29
|
+
const components = [];
|
|
30
|
+
for (const errorPattern of this.ERROR_PATTERNS) {
|
|
31
|
+
const match = error.match(errorPattern.pattern);
|
|
32
|
+
if (match) {
|
|
33
|
+
const componentName = errorPattern.extractComponent(match);
|
|
34
|
+
if (componentName && this.isLikelyComponentName(componentName)) {
|
|
35
|
+
components.push(componentName);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const stackComponents = this.extractComponentsFromStackTrace(error);
|
|
40
|
+
components.push(...stackComponents);
|
|
41
|
+
return components;
|
|
42
|
+
}
|
|
43
|
+
static analyzeError(error) {
|
|
44
|
+
const failures = [];
|
|
45
|
+
for (const errorPattern of this.ERROR_PATTERNS) {
|
|
46
|
+
const match = error.match(errorPattern.pattern);
|
|
47
|
+
if (match) {
|
|
48
|
+
const componentName = errorPattern.extractComponent(match);
|
|
49
|
+
if (componentName && this.isLikelyComponentName(componentName)) {
|
|
50
|
+
failures.push({
|
|
51
|
+
componentName,
|
|
52
|
+
errorType: errorPattern.errorType,
|
|
53
|
+
errorMessage: error,
|
|
54
|
+
lineNumber: this.extractLineNumber(error),
|
|
55
|
+
context: this.extractContext(error)
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (failures.length === 0) {
|
|
61
|
+
const stackComponents = this.extractComponentsFromStackTrace(error);
|
|
62
|
+
stackComponents.forEach(componentName => {
|
|
63
|
+
failures.push({
|
|
64
|
+
componentName,
|
|
65
|
+
errorType: 'unknown',
|
|
66
|
+
errorMessage: error,
|
|
67
|
+
lineNumber: this.extractLineNumber(error)
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return failures;
|
|
72
|
+
}
|
|
73
|
+
static extractComponentsFromStackTrace(error) {
|
|
74
|
+
const components = [];
|
|
75
|
+
const stackPatterns = [
|
|
76
|
+
/at (\w+Component\w*)/g,
|
|
77
|
+
/at (\w+)\s*\(/g,
|
|
78
|
+
/in (\w+)\s*\(at/g,
|
|
79
|
+
/in (\w+)\s*\(created by/g
|
|
80
|
+
];
|
|
81
|
+
for (const pattern of stackPatterns) {
|
|
82
|
+
let match;
|
|
83
|
+
while ((match = pattern.exec(error)) !== null) {
|
|
84
|
+
const name = match[1];
|
|
85
|
+
if (this.isLikelyComponentName(name)) {
|
|
86
|
+
components.push(name);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return [...new Set(components)];
|
|
91
|
+
}
|
|
92
|
+
static isLikelyComponentName(name) {
|
|
93
|
+
const jsBuiltins = new Set([
|
|
94
|
+
'Object', 'Array', 'String', 'Number', 'Boolean', 'Function',
|
|
95
|
+
'Promise', 'Error', 'TypeError', 'ReferenceError', 'SyntaxError',
|
|
96
|
+
'undefined', 'null', 'console', 'window', 'document'
|
|
97
|
+
]);
|
|
98
|
+
const nonComponents = new Set([
|
|
99
|
+
'render', 'setState', 'forceUpdate', 'props', 'state', 'context',
|
|
100
|
+
'componentDidMount', 'componentWillUnmount', 'useEffect', 'useState'
|
|
101
|
+
]);
|
|
102
|
+
return (name.length > 0 &&
|
|
103
|
+
/^[A-Z]/.test(name) &&
|
|
104
|
+
!jsBuiltins.has(name) &&
|
|
105
|
+
!nonComponents.has(name) &&
|
|
106
|
+
!/^use[A-Z]/.test(name));
|
|
107
|
+
}
|
|
108
|
+
static extractLineNumber(error) {
|
|
109
|
+
const patterns = [
|
|
110
|
+
/:(\d+):\d+/,
|
|
111
|
+
/line (\d+)/i,
|
|
112
|
+
/Line (\d+)/
|
|
113
|
+
];
|
|
114
|
+
for (const pattern of patterns) {
|
|
115
|
+
const match = error.match(pattern);
|
|
116
|
+
if (match) {
|
|
117
|
+
return parseInt(match[1], 10);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
static extractContext(error) {
|
|
123
|
+
const fileMatch = error.match(/\(at ([^)]+)\)/);
|
|
124
|
+
if (fileMatch) {
|
|
125
|
+
return fileMatch[1];
|
|
126
|
+
}
|
|
127
|
+
const createdByMatch = error.match(/created by (\w+)/);
|
|
128
|
+
if (createdByMatch) {
|
|
129
|
+
return `Created by ${createdByMatch[1]}`;
|
|
130
|
+
}
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
static formatAnalysisResults(failures) {
|
|
134
|
+
if (failures.length === 0) {
|
|
135
|
+
return 'No component failures detected';
|
|
136
|
+
}
|
|
137
|
+
let result = `Detected ${failures.length} component failure(s):\n`;
|
|
138
|
+
failures.forEach((failure, index) => {
|
|
139
|
+
result += `\n${index + 1}. Component: ${failure.componentName}\n`;
|
|
140
|
+
result += ` Error Type: ${failure.errorType}\n`;
|
|
141
|
+
if (failure.lineNumber) {
|
|
142
|
+
result += ` Line: ${failure.lineNumber}\n`;
|
|
143
|
+
}
|
|
144
|
+
if (failure.context) {
|
|
145
|
+
result += ` Context: ${failure.context}\n`;
|
|
146
|
+
}
|
|
147
|
+
result += ` Message: ${failure.errorMessage.substring(0, 200)}${failure.errorMessage.length > 200 ? '...' : ''}\n`;
|
|
148
|
+
});
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
exports.ComponentErrorAnalyzer = ComponentErrorAnalyzer;
|
|
153
|
+
ComponentErrorAnalyzer.ERROR_PATTERNS = [
|
|
154
|
+
{
|
|
155
|
+
pattern: /ReferenceError: (\w+) is not defined/,
|
|
156
|
+
errorType: 'not_defined',
|
|
157
|
+
extractComponent: (match) => match[1]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
pattern: /Cannot read propert(?:y|ies) '(\w+)' of undefined/,
|
|
161
|
+
errorType: 'property_error',
|
|
162
|
+
extractComponent: (match) => match[1]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
pattern: /(\w+)\(\.\.\.\): Nothing was returned from render/,
|
|
166
|
+
errorType: 'render_error',
|
|
167
|
+
extractComponent: (match) => match[1]
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
pattern: /at (\w+Component\w*)/,
|
|
171
|
+
errorType: 'stack_trace',
|
|
172
|
+
extractComponent: (match) => match[1]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
pattern: /Error: Unable to find node on an unmounted component/,
|
|
176
|
+
errorType: 'unmounted_component',
|
|
177
|
+
extractComponent: () => null
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
pattern: /Invalid hook call.*component (\w+)/,
|
|
181
|
+
errorType: 'invalid_hook',
|
|
182
|
+
extractComponent: (match) => match[1]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
pattern: /TypeError:.*in (\w+) \(at/,
|
|
186
|
+
errorType: 'type_error',
|
|
187
|
+
extractComponent: (match) => match[1]
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
pattern: /Module not found: Error: Can't resolve '\.\/(\w+)'/,
|
|
191
|
+
errorType: 'missing_import',
|
|
192
|
+
extractComponent: (match) => match[1]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
pattern: /(\w+) is not a function/,
|
|
196
|
+
errorType: 'not_a_function',
|
|
197
|
+
extractComponent: (match) => match[1]
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
pattern: /Minified React error.*Visit.*for the full message.*component[: ](\w+)/s,
|
|
201
|
+
errorType: 'react_error',
|
|
202
|
+
extractComponent: (match) => match[1]
|
|
203
|
+
}
|
|
204
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-styles.d.ts","sourceRoot":"","sources":["../../src/utilities/component-styles.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAO9E,wBAAgB,WAAW,IAAI,eAAe,CAyG7C;AAGD,eAAO,MAAM,4BAA4B,oBAAc,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createDefaultComponentStyles = exports.SetupStyles = void 0;
|
|
4
|
+
function SetupStyles() {
|
|
5
|
+
return {
|
|
6
|
+
colors: {
|
|
7
|
+
primary: '#5B4FE9',
|
|
8
|
+
primaryHover: '#4940D4',
|
|
9
|
+
primaryLight: '#E8E6FF',
|
|
10
|
+
secondary: '#64748B',
|
|
11
|
+
secondaryHover: '#475569',
|
|
12
|
+
success: '#10B981',
|
|
13
|
+
successLight: '#D1FAE5',
|
|
14
|
+
warning: '#F59E0B',
|
|
15
|
+
warningLight: '#FEF3C7',
|
|
16
|
+
error: '#EF4444',
|
|
17
|
+
errorLight: '#FEE2E2',
|
|
18
|
+
info: '#3B82F6',
|
|
19
|
+
infoLight: '#DBEAFE',
|
|
20
|
+
background: '#FFFFFF',
|
|
21
|
+
surface: '#F8FAFC',
|
|
22
|
+
surfaceHover: '#F1F5F9',
|
|
23
|
+
text: '#1E293B',
|
|
24
|
+
textSecondary: '#64748B',
|
|
25
|
+
textTertiary: '#94A3B8',
|
|
26
|
+
textInverse: '#FFFFFF',
|
|
27
|
+
border: '#E2E8F0',
|
|
28
|
+
borderLight: '#F1F5F9',
|
|
29
|
+
borderFocus: '#5B4FE9',
|
|
30
|
+
shadow: 'rgba(0, 0, 0, 0.05)',
|
|
31
|
+
shadowMedium: 'rgba(0, 0, 0, 0.1)',
|
|
32
|
+
shadowLarge: 'rgba(0, 0, 0, 0.15)',
|
|
33
|
+
},
|
|
34
|
+
spacing: {
|
|
35
|
+
xs: '4px',
|
|
36
|
+
sm: '8px',
|
|
37
|
+
md: '16px',
|
|
38
|
+
lg: '24px',
|
|
39
|
+
xl: '32px',
|
|
40
|
+
xxl: '48px',
|
|
41
|
+
xxxl: '64px',
|
|
42
|
+
},
|
|
43
|
+
typography: {
|
|
44
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif',
|
|
45
|
+
fontSize: {
|
|
46
|
+
xs: '11px',
|
|
47
|
+
sm: '12px',
|
|
48
|
+
md: '14px',
|
|
49
|
+
lg: '16px',
|
|
50
|
+
xl: '20px',
|
|
51
|
+
xxl: '24px',
|
|
52
|
+
xxxl: '32px',
|
|
53
|
+
},
|
|
54
|
+
fontWeight: {
|
|
55
|
+
light: '300',
|
|
56
|
+
regular: '400',
|
|
57
|
+
medium: '500',
|
|
58
|
+
semibold: '600',
|
|
59
|
+
bold: '700',
|
|
60
|
+
},
|
|
61
|
+
lineHeight: {
|
|
62
|
+
tight: '1.25',
|
|
63
|
+
normal: '1.5',
|
|
64
|
+
relaxed: '1.75',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
borders: {
|
|
68
|
+
radius: {
|
|
69
|
+
sm: '6px',
|
|
70
|
+
md: '8px',
|
|
71
|
+
lg: '12px',
|
|
72
|
+
xl: '16px',
|
|
73
|
+
full: '9999px',
|
|
74
|
+
},
|
|
75
|
+
width: {
|
|
76
|
+
thin: '1px',
|
|
77
|
+
medium: '2px',
|
|
78
|
+
thick: '3px',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
shadows: {
|
|
82
|
+
sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
83
|
+
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
|
|
84
|
+
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
|
|
85
|
+
xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)',
|
|
86
|
+
inner: 'inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)',
|
|
87
|
+
},
|
|
88
|
+
transitions: {
|
|
89
|
+
fast: '150ms ease-in-out',
|
|
90
|
+
normal: '250ms ease-in-out',
|
|
91
|
+
slow: '350ms ease-in-out',
|
|
92
|
+
},
|
|
93
|
+
overflow: 'auto'
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
exports.SetupStyles = SetupStyles;
|
|
97
|
+
exports.createDefaultComponentStyles = SetupStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AAKA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./runtime-utilities"), exports);
|
|
18
|
+
__exportStar(require("./component-styles"), exports);
|
|
19
|
+
__exportStar(require("./standard-libraries"), exports);
|
|
20
|
+
__exportStar(require("./library-loader"), exports);
|
|
21
|
+
__exportStar(require("./component-error-analyzer"), exports);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { StandardLibraries } from './standard-libraries';
|
|
2
|
+
interface LoadedResource {
|
|
3
|
+
element: HTMLScriptElement | HTMLLinkElement;
|
|
4
|
+
promise: Promise<any>;
|
|
5
|
+
}
|
|
6
|
+
export interface LibraryLoadOptions {
|
|
7
|
+
loadCore?: boolean;
|
|
8
|
+
loadUI?: boolean;
|
|
9
|
+
loadCSS?: boolean;
|
|
10
|
+
customLibraries?: {
|
|
11
|
+
url: string;
|
|
12
|
+
globalName: string;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
15
|
+
export interface LibraryLoadResult {
|
|
16
|
+
React: any;
|
|
17
|
+
ReactDOM: any;
|
|
18
|
+
Babel: any;
|
|
19
|
+
libraries: StandardLibraries;
|
|
20
|
+
}
|
|
21
|
+
export declare class LibraryLoader {
|
|
22
|
+
private static loadedResources;
|
|
23
|
+
static loadAllLibraries(): Promise<LibraryLoadResult>;
|
|
24
|
+
static loadLibraries(options: LibraryLoadOptions): Promise<LibraryLoadResult>;
|
|
25
|
+
private static loadScript;
|
|
26
|
+
private static loadCSS;
|
|
27
|
+
private static waitForScriptLoad;
|
|
28
|
+
private static getLibraryNameFromUrl;
|
|
29
|
+
static getLoadedResources(): Map<string, LoadedResource>;
|
|
30
|
+
static clearCache(): void;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=library-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-loader.d.ts","sourceRoot":"","sources":["../../src/utilities/library-loader.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,iBAAiB,EAIlB,MAAM,sBAAsB,CAAC;AAK9B,UAAU,cAAc;IACtB,OAAO,EAAE,iBAAiB,GAAG,eAAe,CAAC;IAC7C,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;CACvB;AAKD,MAAM,WAAW,kBAAkB;IAEjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,eAAe,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACzD;AAKD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,GAAG,CAAC;IACd,KAAK,EAAE,GAAG,CAAC;IACX,SAAS,EAAE,iBAAiB,CAAC;CAC9B;AAKD,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAqC;WAMtD,gBAAgB,IAAI,OAAO,CAAC,iBAAiB,CAAC;WAW9C,aAAa,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;mBAqF9D,UAAU;IA+D/B,OAAO,CAAC,MAAM,CAAC,OAAO;IAwBtB,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAwChC,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAiBpC,MAAM,CAAC,kBAAkB,IAAI,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC;IAOxD,MAAM,CAAC,UAAU,IAAI,IAAI;CAG1B"}
|