@memberjunction/react-test-harness 5.29.0 → 5.30.1
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 +140 -153
- package/dist/__tests__/setup/vitest-setup.d.ts +11 -0
- package/dist/__tests__/setup/vitest-setup.d.ts.map +1 -0
- package/dist/__tests__/setup/vitest-setup.js +73 -0
- package/dist/__tests__/setup/vitest-setup.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/component-linter.d.ts +10 -13
- package/dist/lib/component-linter.d.ts.map +1 -1
- package/dist/lib/component-linter.js +96 -8552
- package/dist/lib/component-linter.js.map +1 -1
- package/dist/lib/component-runner.d.ts.map +1 -1
- package/dist/lib/component-runner.js +34 -10
- package/dist/lib/component-runner.js.map +1 -1
- package/dist/lib/lint-rule.d.ts +70 -0
- package/dist/lib/lint-rule.d.ts.map +1 -0
- package/dist/lib/lint-rule.js +41 -0
- package/dist/lib/lint-rule.js.map +1 -0
- package/dist/lib/lint-utils.d.ts +131 -0
- package/dist/lib/lint-utils.d.ts.map +1 -0
- package/dist/lib/lint-utils.js +358 -0
- package/dist/lib/lint-utils.js.map +1 -0
- package/dist/lib/prop-value-extractor.d.ts +2 -2
- package/dist/lib/prop-value-extractor.js +2 -2
- package/dist/lib/runtime-rules/ai-tools-availability-check.d.ts +9 -0
- package/dist/lib/runtime-rules/ai-tools-availability-check.d.ts.map +1 -0
- package/dist/lib/runtime-rules/ai-tools-availability-check.js +223 -0
- package/dist/lib/runtime-rules/ai-tools-availability-check.js.map +1 -0
- package/dist/lib/runtime-rules/callback-event-validation.d.ts +22 -0
- package/dist/lib/runtime-rules/callback-event-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/callback-event-validation.js +561 -0
- package/dist/lib/runtime-rules/callback-event-validation.js.map +1 -0
- package/dist/lib/runtime-rules/chart-field-validation.d.ts +10 -0
- package/dist/lib/runtime-rules/chart-field-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/chart-field-validation.js +270 -0
- package/dist/lib/runtime-rules/chart-field-validation.js.map +1 -0
- package/dist/lib/runtime-rules/child-component-prop-validation.d.ts +10 -0
- package/dist/lib/runtime-rules/child-component-prop-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/child-component-prop-validation.js +447 -0
- package/dist/lib/runtime-rules/child-component-prop-validation.js.map +1 -0
- package/dist/lib/runtime-rules/component-name-mismatch.d.ts +19 -0
- package/dist/lib/runtime-rules/component-name-mismatch.d.ts.map +1 -0
- package/dist/lib/runtime-rules/component-name-mismatch.js +82 -0
- package/dist/lib/runtime-rules/component-name-mismatch.js.map +1 -0
- package/dist/lib/runtime-rules/component-not-in-dependencies.d.ts +20 -0
- package/dist/lib/runtime-rules/component-not-in-dependencies.d.ts.map +1 -0
- package/dist/lib/runtime-rules/component-not-in-dependencies.js +92 -0
- package/dist/lib/runtime-rules/component-not-in-dependencies.js.map +1 -0
- package/dist/lib/runtime-rules/component-props-validation.d.ts +25 -0
- package/dist/lib/runtime-rules/component-props-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/component-props-validation.js +228 -0
- package/dist/lib/runtime-rules/component-props-validation.js.map +1 -0
- package/dist/lib/runtime-rules/component-usage-without-destructuring.d.ts +20 -0
- package/dist/lib/runtime-rules/component-usage-without-destructuring.d.ts.map +1 -0
- package/dist/lib/runtime-rules/component-usage-without-destructuring.js +124 -0
- package/dist/lib/runtime-rules/component-usage-without-destructuring.js.map +1 -0
- package/dist/lib/runtime-rules/data-result-validation.d.ts +9 -0
- package/dist/lib/runtime-rules/data-result-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/data-result-validation.js +763 -0
- package/dist/lib/runtime-rules/data-result-validation.js.map +1 -0
- package/dist/lib/runtime-rules/datagrid-field-validation.d.ts +10 -0
- package/dist/lib/runtime-rules/datagrid-field-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/datagrid-field-validation.js +245 -0
- package/dist/lib/runtime-rules/datagrid-field-validation.js.map +1 -0
- package/dist/lib/runtime-rules/dependency-shadowing.d.ts +20 -0
- package/dist/lib/runtime-rules/dependency-shadowing.d.ts.map +1 -0
- package/dist/lib/runtime-rules/dependency-shadowing.js +147 -0
- package/dist/lib/runtime-rules/dependency-shadowing.js.map +1 -0
- package/dist/lib/runtime-rules/entity-field-access-validation.d.ts +12 -0
- package/dist/lib/runtime-rules/entity-field-access-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/entity-field-access-validation.js +304 -0
- package/dist/lib/runtime-rules/entity-field-access-validation.js.map +1 -0
- package/dist/lib/runtime-rules/event-parameter-validation.d.ts +22 -0
- package/dist/lib/runtime-rules/event-parameter-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/event-parameter-validation.js +406 -0
- package/dist/lib/runtime-rules/event-parameter-validation.js.map +1 -0
- package/dist/lib/runtime-rules/index.d.ts +59 -0
- package/dist/lib/runtime-rules/index.d.ts.map +1 -0
- package/dist/lib/runtime-rules/index.js +60 -0
- package/dist/lib/runtime-rules/index.js.map +1 -0
- package/dist/lib/runtime-rules/library-variable-names.d.ts +24 -0
- package/dist/lib/runtime-rules/library-variable-names.d.ts.map +1 -0
- package/dist/lib/runtime-rules/library-variable-names.js +88 -0
- package/dist/lib/runtime-rules/library-variable-names.js.map +1 -0
- package/dist/lib/runtime-rules/no-child-implementation.d.ts +18 -0
- package/dist/lib/runtime-rules/no-child-implementation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/no-child-implementation.js +57 -0
- package/dist/lib/runtime-rules/no-child-implementation.js.map +1 -0
- package/dist/lib/runtime-rules/no-data-prop.d.ts +22 -0
- package/dist/lib/runtime-rules/no-data-prop.d.ts.map +1 -0
- package/dist/lib/runtime-rules/no-data-prop.js +111 -0
- package/dist/lib/runtime-rules/no-data-prop.js.map +1 -0
- package/dist/lib/runtime-rules/no-export-statements.d.ts +18 -0
- package/dist/lib/runtime-rules/no-export-statements.d.ts.map +1 -0
- package/dist/lib/runtime-rules/no-export-statements.js +143 -0
- package/dist/lib/runtime-rules/no-export-statements.js.map +1 -0
- package/dist/lib/runtime-rules/no-iife-wrapper.d.ts +18 -0
- package/dist/lib/runtime-rules/no-iife-wrapper.d.ts.map +1 -0
- package/dist/lib/runtime-rules/no-iife-wrapper.js +217 -0
- package/dist/lib/runtime-rules/no-iife-wrapper.js.map +1 -0
- package/dist/lib/runtime-rules/no-import-statements.d.ts +18 -0
- package/dist/lib/runtime-rules/no-import-statements.d.ts.map +1 -0
- package/dist/lib/runtime-rules/no-import-statements.js +65 -0
- package/dist/lib/runtime-rules/no-import-statements.js.map +1 -0
- package/dist/lib/runtime-rules/no-react-destructuring.d.ts +18 -0
- package/dist/lib/runtime-rules/no-react-destructuring.d.ts.map +1 -0
- package/dist/lib/runtime-rules/no-react-destructuring.js +60 -0
- package/dist/lib/runtime-rules/no-react-destructuring.js.map +1 -0
- package/dist/lib/runtime-rules/no-require-statements.d.ts +18 -0
- package/dist/lib/runtime-rules/no-require-statements.d.ts.map +1 -0
- package/dist/lib/runtime-rules/no-require-statements.js +109 -0
- package/dist/lib/runtime-rules/no-require-statements.js.map +1 -0
- package/dist/lib/runtime-rules/no-return-component.d.ts +18 -0
- package/dist/lib/runtime-rules/no-return-component.d.ts.map +1 -0
- package/dist/lib/runtime-rules/no-return-component.js +106 -0
- package/dist/lib/runtime-rules/no-return-component.js.map +1 -0
- package/dist/lib/runtime-rules/no-use-reducer.d.ts +19 -0
- package/dist/lib/runtime-rules/no-use-reducer.d.ts.map +1 -0
- package/dist/lib/runtime-rules/no-use-reducer.js +78 -0
- package/dist/lib/runtime-rules/no-use-reducer.js.map +1 -0
- package/dist/lib/runtime-rules/no-window-access.d.ts +23 -0
- package/dist/lib/runtime-rules/no-window-access.d.ts.map +1 -0
- package/dist/lib/runtime-rules/no-window-access.js +136 -0
- package/dist/lib/runtime-rules/no-window-access.js.map +1 -0
- package/dist/lib/runtime-rules/noisy-settings-updates.d.ts +18 -0
- package/dist/lib/runtime-rules/noisy-settings-updates.d.ts.map +1 -0
- package/dist/lib/runtime-rules/noisy-settings-updates.js +110 -0
- package/dist/lib/runtime-rules/noisy-settings-updates.js.map +1 -0
- package/dist/lib/runtime-rules/pass-standard-props.d.ts +19 -0
- package/dist/lib/runtime-rules/pass-standard-props.d.ts.map +1 -0
- package/dist/lib/runtime-rules/pass-standard-props.js +82 -0
- package/dist/lib/runtime-rules/pass-standard-props.js.map +1 -0
- package/dist/lib/runtime-rules/prefer-async-await.d.ts +17 -0
- package/dist/lib/runtime-rules/prefer-async-await.d.ts.map +1 -0
- package/dist/lib/runtime-rules/prefer-async-await.js +52 -0
- package/dist/lib/runtime-rules/prefer-async-await.js.map +1 -0
- package/dist/lib/runtime-rules/prefer-jsx-syntax.d.ts +17 -0
- package/dist/lib/runtime-rules/prefer-jsx-syntax.d.ts.map +1 -0
- package/dist/lib/runtime-rules/prefer-jsx-syntax.js +51 -0
- package/dist/lib/runtime-rules/prefer-jsx-syntax.js.map +1 -0
- package/dist/lib/runtime-rules/prop-state-sync.d.ts +19 -0
- package/dist/lib/runtime-rules/prop-state-sync.d.ts.map +1 -0
- package/dist/lib/runtime-rules/prop-state-sync.js +76 -0
- package/dist/lib/runtime-rules/prop-state-sync.js.map +1 -0
- package/dist/lib/runtime-rules/property-name-consistency.d.ts +20 -0
- package/dist/lib/runtime-rules/property-name-consistency.d.ts.map +1 -0
- package/dist/lib/runtime-rules/property-name-consistency.js +172 -0
- package/dist/lib/runtime-rules/property-name-consistency.js.map +1 -0
- package/dist/lib/runtime-rules/query-result-field-access-validation.d.ts +10 -0
- package/dist/lib/runtime-rules/query-result-field-access-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/query-result-field-access-validation.js +304 -0
- package/dist/lib/runtime-rules/query-result-field-access-validation.js.map +1 -0
- package/dist/lib/runtime-rules/react-component-naming.d.ts +19 -0
- package/dist/lib/runtime-rules/react-component-naming.d.ts.map +1 -0
- package/dist/lib/runtime-rules/react-component-naming.js +72 -0
- package/dist/lib/runtime-rules/react-component-naming.js.map +1 -0
- package/dist/lib/runtime-rules/react-hooks-rules.d.ts +27 -0
- package/dist/lib/runtime-rules/react-hooks-rules.d.ts.map +1 -0
- package/dist/lib/runtime-rules/react-hooks-rules.js +223 -0
- package/dist/lib/runtime-rules/react-hooks-rules.js.map +1 -0
- package/dist/lib/runtime-rules/required-queries-not-called.d.ts +19 -0
- package/dist/lib/runtime-rules/required-queries-not-called.d.ts.map +1 -0
- package/dist/lib/runtime-rules/required-queries-not-called.js +146 -0
- package/dist/lib/runtime-rules/required-queries-not-called.js.map +1 -0
- package/dist/lib/runtime-rules/runquery-call-validation.d.ts +11 -0
- package/dist/lib/runtime-rules/runquery-call-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/runquery-call-validation.js +886 -0
- package/dist/lib/runtime-rules/runquery-call-validation.js.map +1 -0
- package/dist/lib/runtime-rules/runview-call-validation.d.ts +10 -0
- package/dist/lib/runtime-rules/runview-call-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/runview-call-validation.js +336 -0
- package/dist/lib/runtime-rules/runview-call-validation.js.map +1 -0
- package/dist/lib/runtime-rules/saved-user-settings-pattern.d.ts +19 -0
- package/dist/lib/runtime-rules/saved-user-settings-pattern.d.ts.map +1 -0
- package/dist/lib/runtime-rules/saved-user-settings-pattern.js +90 -0
- package/dist/lib/runtime-rules/saved-user-settings-pattern.js.map +1 -0
- package/dist/lib/runtime-rules/search-availability-check.d.ts +9 -0
- package/dist/lib/runtime-rules/search-availability-check.d.ts.map +1 -0
- package/dist/lib/runtime-rules/search-availability-check.js +220 -0
- package/dist/lib/runtime-rules/search-availability-check.js.map +1 -0
- package/dist/lib/runtime-rules/search-call-validation.d.ts +9 -0
- package/dist/lib/runtime-rules/search-call-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/search-call-validation.js +336 -0
- package/dist/lib/runtime-rules/search-call-validation.js.map +1 -0
- package/dist/lib/runtime-rules/server-reload-on-client-operation.d.ts +18 -0
- package/dist/lib/runtime-rules/server-reload-on-client-operation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/server-reload-on-client-operation.js +107 -0
- package/dist/lib/runtime-rules/server-reload-on-client-operation.js.map +1 -0
- package/dist/lib/runtime-rules/single-function-only.d.ts +18 -0
- package/dist/lib/runtime-rules/single-function-only.d.ts.map +1 -0
- package/dist/lib/runtime-rules/single-function-only.js +103 -0
- package/dist/lib/runtime-rules/single-function-only.js.map +1 -0
- package/dist/lib/runtime-rules/string-replace-all-occurrences.d.ts +19 -0
- package/dist/lib/runtime-rules/string-replace-all-occurrences.d.ts.map +1 -0
- package/dist/lib/runtime-rules/string-replace-all-occurrences.js +109 -0
- package/dist/lib/runtime-rules/string-replace-all-occurrences.js.map +1 -0
- package/dist/lib/runtime-rules/string-template-validation.d.ts +22 -0
- package/dist/lib/runtime-rules/string-template-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/string-template-validation.js +163 -0
- package/dist/lib/runtime-rules/string-template-validation.js.map +1 -0
- package/dist/lib/runtime-rules/styles-validation.d.ts +10 -0
- package/dist/lib/runtime-rules/styles-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/styles-validation.js +153 -0
- package/dist/lib/runtime-rules/styles-validation.js.map +1 -0
- package/dist/lib/runtime-rules/type-inference-errors.d.ts +23 -0
- package/dist/lib/runtime-rules/type-inference-errors.d.ts.map +1 -0
- package/dist/lib/runtime-rules/type-inference-errors.js +53 -0
- package/dist/lib/runtime-rules/type-inference-errors.js.map +1 -0
- package/dist/lib/runtime-rules/type-mismatch-operation.d.ts +23 -0
- package/dist/lib/runtime-rules/type-mismatch-operation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/type-mismatch-operation.js +141 -0
- package/dist/lib/runtime-rules/type-mismatch-operation.js.map +1 -0
- package/dist/lib/runtime-rules/undefined-component-usage.d.ts +20 -0
- package/dist/lib/runtime-rules/undefined-component-usage.d.ts.map +1 -0
- package/dist/lib/runtime-rules/undefined-component-usage.js +138 -0
- package/dist/lib/runtime-rules/undefined-component-usage.js.map +1 -0
- package/dist/lib/runtime-rules/undefined-jsx-component.d.ts +25 -0
- package/dist/lib/runtime-rules/undefined-jsx-component.d.ts.map +1 -0
- package/dist/lib/runtime-rules/undefined-jsx-component.js +269 -0
- package/dist/lib/runtime-rules/undefined-jsx-component.js.map +1 -0
- package/dist/lib/runtime-rules/unsafe-array-operations.d.ts +25 -0
- package/dist/lib/runtime-rules/unsafe-array-operations.d.ts.map +1 -0
- package/dist/lib/runtime-rules/unsafe-array-operations.js +347 -0
- package/dist/lib/runtime-rules/unsafe-array-operations.js.map +1 -0
- package/dist/lib/runtime-rules/unsafe-formatting-methods.d.ts +24 -0
- package/dist/lib/runtime-rules/unsafe-formatting-methods.d.ts.map +1 -0
- package/dist/lib/runtime-rules/unsafe-formatting-methods.js +277 -0
- package/dist/lib/runtime-rules/unsafe-formatting-methods.js.map +1 -0
- package/dist/lib/runtime-rules/unused-component-dependencies.d.ts +19 -0
- package/dist/lib/runtime-rules/unused-component-dependencies.d.ts.map +1 -0
- package/dist/lib/runtime-rules/unused-component-dependencies.js +90 -0
- package/dist/lib/runtime-rules/unused-component-dependencies.js.map +1 -0
- package/dist/lib/runtime-rules/unused-libraries.d.ts +19 -0
- package/dist/lib/runtime-rules/unused-libraries.d.ts.map +1 -0
- package/dist/lib/runtime-rules/unused-libraries.js +127 -0
- package/dist/lib/runtime-rules/unused-libraries.js.map +1 -0
- package/dist/lib/runtime-rules/use-function-declaration.d.ts +18 -0
- package/dist/lib/runtime-rules/use-function-declaration.d.ts.map +1 -0
- package/dist/lib/runtime-rules/use-function-declaration.js +127 -0
- package/dist/lib/runtime-rules/use-function-declaration.js.map +1 -0
- package/dist/lib/runtime-rules/use-unwrap-components.d.ts +19 -0
- package/dist/lib/runtime-rules/use-unwrap-components.d.ts.map +1 -0
- package/dist/lib/runtime-rules/use-unwrap-components.js +84 -0
- package/dist/lib/runtime-rules/use-unwrap-components.js.map +1 -0
- package/dist/lib/runtime-rules/useeffect-unstable-dependencies.d.ts +23 -0
- package/dist/lib/runtime-rules/useeffect-unstable-dependencies.d.ts.map +1 -0
- package/dist/lib/runtime-rules/useeffect-unstable-dependencies.js +215 -0
- package/dist/lib/runtime-rules/useeffect-unstable-dependencies.js.map +1 -0
- package/dist/lib/runtime-rules/utilities-api-validation.d.ts +24 -0
- package/dist/lib/runtime-rules/utilities-api-validation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/utilities-api-validation.js +121 -0
- package/dist/lib/runtime-rules/utilities-api-validation.js.map +1 -0
- package/dist/lib/runtime-rules/utilities-no-direct-instantiation.d.ts +20 -0
- package/dist/lib/runtime-rules/utilities-no-direct-instantiation.d.ts.map +1 -0
- package/dist/lib/runtime-rules/utilities-no-direct-instantiation.js +58 -0
- package/dist/lib/runtime-rules/utilities-no-direct-instantiation.js.map +1 -0
- package/dist/lib/runtime-rules/validate-component-references.d.ts +19 -0
- package/dist/lib/runtime-rules/validate-component-references.d.ts.map +1 -0
- package/dist/lib/runtime-rules/validate-component-references.js +255 -0
- package/dist/lib/runtime-rules/validate-component-references.js.map +1 -0
- package/dist/lib/schema-validation/component-prop-rule.d.ts +125 -0
- package/dist/lib/schema-validation/component-prop-rule.d.ts.map +1 -0
- package/dist/lib/schema-validation/component-prop-rule.js +630 -0
- package/dist/lib/schema-validation/component-prop-rule.js.map +1 -0
- package/dist/lib/schema-validation/index.d.ts +26 -0
- package/dist/lib/schema-validation/index.d.ts.map +1 -0
- package/dist/lib/schema-validation/index.js +26 -0
- package/dist/lib/schema-validation/index.js.map +1 -0
- package/dist/lib/schema-validation/semantic-validators/index.d.ts +23 -0
- package/dist/lib/schema-validation/semantic-validators/index.d.ts.map +1 -0
- package/dist/lib/schema-validation/semantic-validators/index.js +23 -0
- package/dist/lib/schema-validation/semantic-validators/index.js.map +1 -0
- package/dist/lib/{constraint-validators → schema-validation/semantic-validators}/required-when-validator.d.ts +2 -2
- package/dist/lib/schema-validation/semantic-validators/required-when-validator.d.ts.map +1 -0
- package/dist/lib/{constraint-validators → schema-validation/semantic-validators}/required-when-validator.js +3 -3
- package/dist/lib/schema-validation/semantic-validators/required-when-validator.js.map +1 -0
- package/dist/lib/schema-validation/semantic-validators/semantic-validator-registry.d.ts +122 -0
- package/dist/lib/schema-validation/semantic-validators/semantic-validator-registry.d.ts.map +1 -0
- package/dist/lib/schema-validation/semantic-validators/semantic-validator-registry.js +166 -0
- package/dist/lib/schema-validation/semantic-validators/semantic-validator-registry.js.map +1 -0
- package/dist/lib/{constraint-validators/base-constraint-validator.d.ts → schema-validation/semantic-validators/semantic-validator.d.ts} +12 -11
- package/dist/lib/schema-validation/semantic-validators/semantic-validator.d.ts.map +1 -0
- package/dist/lib/{constraint-validators/base-constraint-validator.js → schema-validation/semantic-validators/semantic-validator.js} +11 -10
- package/dist/lib/schema-validation/semantic-validators/semantic-validator.js.map +1 -0
- package/dist/lib/{constraint-validators → schema-validation/semantic-validators}/sql-where-clause-validator.d.ts +2 -8
- package/dist/lib/schema-validation/semantic-validators/sql-where-clause-validator.d.ts.map +1 -0
- package/dist/lib/{constraint-validators → schema-validation/semantic-validators}/sql-where-clause-validator.js +7 -18
- package/dist/lib/schema-validation/semantic-validators/sql-where-clause-validator.js.map +1 -0
- package/dist/lib/{constraint-validators → schema-validation/semantic-validators}/subset-of-entity-fields-validator.d.ts +2 -2
- package/dist/lib/schema-validation/semantic-validators/subset-of-entity-fields-validator.d.ts.map +1 -0
- package/dist/lib/{constraint-validators → schema-validation/semantic-validators}/subset-of-entity-fields-validator.js +3 -3
- package/dist/lib/schema-validation/semantic-validators/subset-of-entity-fields-validator.js.map +1 -0
- package/dist/lib/{constraint-validators → schema-validation/semantic-validators}/validation-context.d.ts +14 -5
- package/dist/lib/schema-validation/semantic-validators/validation-context.d.ts.map +1 -0
- package/dist/lib/{constraint-validators → schema-validation/semantic-validators}/validation-context.js +1 -1
- package/dist/lib/schema-validation/semantic-validators/validation-context.js.map +1 -0
- package/dist/lib/type-context.d.ts.map +1 -1
- package/dist/lib/type-context.js +16 -1
- package/dist/lib/type-context.js.map +1 -1
- package/dist/lib/type-inference-engine.d.ts +13 -0
- package/dist/lib/type-inference-engine.d.ts.map +1 -1
- package/dist/lib/type-inference-engine.js +144 -22
- package/dist/lib/type-inference-engine.js.map +1 -1
- package/dist/lib/type-rules/type-compatibility-rule.d.ts +79 -0
- package/dist/lib/type-rules/type-compatibility-rule.d.ts.map +1 -0
- package/dist/lib/type-rules/type-compatibility-rule.js +211 -0
- package/dist/lib/type-rules/type-compatibility-rule.js.map +1 -0
- package/package.json +15 -12
- package/dist/lib/constraint-validators/base-constraint-validator.d.ts.map +0 -1
- package/dist/lib/constraint-validators/base-constraint-validator.js.map +0 -1
- package/dist/lib/constraint-validators/index.d.ts +0 -21
- package/dist/lib/constraint-validators/index.d.ts.map +0 -1
- package/dist/lib/constraint-validators/index.js +0 -21
- package/dist/lib/constraint-validators/index.js.map +0 -1
- package/dist/lib/constraint-validators/required-when-validator.d.ts.map +0 -1
- package/dist/lib/constraint-validators/required-when-validator.js.map +0 -1
- package/dist/lib/constraint-validators/sql-where-clause-validator.d.ts.map +0 -1
- package/dist/lib/constraint-validators/sql-where-clause-validator.js.map +0 -1
- package/dist/lib/constraint-validators/subset-of-entity-fields-validator.d.ts.map +0 -1
- package/dist/lib/constraint-validators/subset-of-entity-fields-validator.js.map +0 -1
- package/dist/lib/constraint-validators/validation-context.d.ts.map +0 -1
- package/dist/lib/constraint-validators/validation-context.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,194 +1,181 @@
|
|
|
1
1
|
# @memberjunction/react-test-harness
|
|
2
2
|
|
|
3
|
-
Automated test harness for MemberJunction React components
|
|
3
|
+
Automated test harness for MemberJunction interactive React components. Provides static analysis (linting) with 57 extensible rules, type inference, constraint validation, browser-based rendering via Playwright, and a CLI for running test suites.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### Linting a Component
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { ComponentLinter } from '@memberjunction/react-test-harness';
|
|
6
11
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
subgraph "Constraint Validators"
|
|
20
|
-
I[BaseConstraintValidator]
|
|
21
|
-
I --> J[RequiredWhenValidator]
|
|
22
|
-
I --> K[SQLWhereClauseValidator]
|
|
23
|
-
I --> L[SubsetOfEntityFieldsValidator]
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
C --> D
|
|
27
|
-
D --> M["Playwright Browser"]
|
|
28
|
-
|
|
29
|
-
N[CLI] --> A
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
subgraph "Dependencies"
|
|
33
|
-
O["@memberjunction/react-runtime<br/>(Component Compilation)"]
|
|
34
|
-
P["Babel Parser<br/>(AST Analysis)"]
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
B --> P
|
|
38
|
-
C --> O
|
|
39
|
-
|
|
40
|
-
style A fill:#2d6a9f,stroke:#1a4971,color:#fff
|
|
41
|
-
style B fill:#2d8659,stroke:#1a5c3a,color:#fff
|
|
42
|
-
style C fill:#2d8659,stroke:#1a5c3a,color:#fff
|
|
43
|
-
style D fill:#7c5295,stroke:#563a6b,color:#fff
|
|
44
|
-
style E fill:#b8762f,stroke:#8a5722,color:#fff
|
|
45
|
-
style I fill:#7c5295,stroke:#563a6b,color:#fff
|
|
46
|
-
style N fill:#2d6a9f,stroke:#1a4971,color:#fff
|
|
12
|
+
const result = await ComponentLinter.lintComponent(
|
|
13
|
+
code, // JavaScript/JSX source
|
|
14
|
+
'MyComponent', // Component name
|
|
15
|
+
componentSpec, // ComponentSpec with metadata
|
|
16
|
+
true, // isRootComponent
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
if (!result.success) {
|
|
20
|
+
for (const v of result.violations) {
|
|
21
|
+
console.log(`[${v.severity}] ${v.rule}: ${v.message} (line ${v.line})`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
47
24
|
```
|
|
48
25
|
|
|
49
|
-
|
|
26
|
+
### Browser-Based Testing
|
|
50
27
|
|
|
51
|
-
|
|
28
|
+
```typescript
|
|
29
|
+
import { ComponentRunner } from '@memberjunction/react-test-harness';
|
|
52
30
|
|
|
53
|
-
|
|
31
|
+
const runner = new ComponentRunner();
|
|
32
|
+
const result = await runner.executeComponent(componentSpec, {
|
|
33
|
+
contextUser,
|
|
34
|
+
props: { data: testData },
|
|
35
|
+
});
|
|
54
36
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- **Control Flow Analysis**: Detects unreachable code, missing returns, and complex control flow patterns
|
|
59
|
-
- **Browser Rendering**: Launches components in a real browser via Playwright for visual/functional testing
|
|
60
|
-
- **Prop Value Extraction**: Extracts and validates prop values from JSX source
|
|
61
|
-
- **Library Lint Caching**: Caches lint results for external libraries to improve performance
|
|
62
|
-
- **CLI Tool**: `mj-react-test` command for running test suites
|
|
37
|
+
console.log('Rendered:', result.success);
|
|
38
|
+
console.log('Errors:', result.errors);
|
|
39
|
+
```
|
|
63
40
|
|
|
64
|
-
|
|
41
|
+
### Writing Custom Rules
|
|
65
42
|
|
|
66
|
-
|
|
67
|
-
|
|
43
|
+
Rules extend `BaseLintRule` and auto-register via `@RegisterClass`:
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
47
|
+
import { BaseLintRule } from '@memberjunction/react-test-harness';
|
|
48
|
+
|
|
49
|
+
@RegisterClass(BaseLintRule, 'my-custom-rule')
|
|
50
|
+
export class MyCustomRule extends BaseLintRule {
|
|
51
|
+
get Name() { return 'my-custom-rule'; }
|
|
52
|
+
get AppliesTo(): 'all' | 'child' | 'root' { return 'all'; }
|
|
53
|
+
|
|
54
|
+
Test(ast, componentName, componentSpec, options, typeContext) {
|
|
55
|
+
const violations = [];
|
|
56
|
+
// Babel AST traversal and validation logic
|
|
57
|
+
return violations;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
68
60
|
```
|
|
69
61
|
|
|
70
|
-
|
|
62
|
+
External packages (e.g., Skip-Brain) can define custom rules — the linter discovers them automatically via MJGlobal's ClassFactory.
|
|
71
63
|
|
|
72
|
-
|
|
64
|
+
## Testing
|
|
73
65
|
|
|
74
66
|
```bash
|
|
75
|
-
|
|
76
|
-
npx mj-react-test
|
|
67
|
+
cd packages/React/test-harness
|
|
77
68
|
|
|
78
|
-
#
|
|
79
|
-
|
|
80
|
-
```
|
|
69
|
+
# Build (required before testing)
|
|
70
|
+
npm run build
|
|
81
71
|
|
|
82
|
-
|
|
72
|
+
# Run all 425 tests
|
|
73
|
+
npx vitest run
|
|
83
74
|
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
# Run with verbose output (see individual fixture results)
|
|
76
|
+
npx vitest run --reporter=verbose
|
|
86
77
|
|
|
87
|
-
|
|
78
|
+
# Watch mode
|
|
79
|
+
npx vitest
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Database Connection (Optional)
|
|
83
|
+
|
|
84
|
+
Some rules validate against entity metadata from the database. Create `.env`:
|
|
88
85
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
```
|
|
87
|
+
DB_HOST=your-host
|
|
88
|
+
DB_DATABASE=your-db
|
|
89
|
+
DB_USERNAME=your-user
|
|
90
|
+
DB_PASSWORD=your-password
|
|
91
|
+
DB_PORT=1433
|
|
92
|
+
DB_TRUST_SERVER_CERTIFICATE=1
|
|
94
93
|
```
|
|
95
94
|
|
|
96
|
-
|
|
95
|
+
Without a database, DB-dependent fixtures still run but rules that need entity metadata emit low-severity warnings instead of violations.
|
|
97
96
|
|
|
98
|
-
|
|
99
|
-
import { ComponentLinter } from '@memberjunction/react-test-harness';
|
|
97
|
+
## Architecture
|
|
100
98
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
See [LINTER-ARCHITECTURE.md](LINTER-ARCHITECTURE.md) for comprehensive documentation including:
|
|
100
|
+
- How rules work and how to add new ones
|
|
101
|
+
- Rule categories and what each validates
|
|
102
|
+
- Type inference engine capabilities
|
|
103
|
+
- Metadata fallback strategy
|
|
104
|
+
- SQL dialect configuration
|
|
105
|
+
- Test fixture organization
|
|
107
106
|
|
|
108
|
-
|
|
109
|
-
console.log(`${issue.severity}: ${issue.message} (line ${issue.line})`);
|
|
110
|
-
}
|
|
111
|
-
```
|
|
107
|
+
## Lint Rules (57)
|
|
112
108
|
|
|
113
|
-
###
|
|
109
|
+
### Data Access (5 rules)
|
|
110
|
+
- `runview-call-validation` — RunView/RunViews call-site validation
|
|
111
|
+
- `runquery-call-validation` — RunQuery call-site validation with parameter type checking
|
|
112
|
+
- `data-result-validation` — RunView/RunQuery/Search result usage patterns
|
|
113
|
+
- `search-availability-check` — `utilities.search` null guard
|
|
114
|
+
- `search-call-validation` — Search/PreviewSearch parameter validation
|
|
114
115
|
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
### Entity & Query Fields (4 rules)
|
|
117
|
+
- `entity-field-access-validation` — Field access on RunView results (typos, case, type coercion)
|
|
118
|
+
- `query-result-field-access-validation` — Field access on RunQuery results
|
|
119
|
+
- `chart-field-validation` — Chart prop field references
|
|
120
|
+
- `datagrid-field-validation` — Grid column field references
|
|
117
121
|
|
|
118
|
-
|
|
119
|
-
|
|
122
|
+
### Runtime Constraints (8 rules)
|
|
123
|
+
- `no-import-statements`, `no-export-statements`, `no-require-statements`
|
|
124
|
+
- `no-iife-wrapper`, `no-return-component`, `no-window-access`
|
|
125
|
+
- `use-function-declaration`, `single-function-only`
|
|
120
126
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
127
|
+
### Component Structure (9 rules)
|
|
128
|
+
- `react-component-naming`, `component-name-mismatch`, `pass-standard-props`
|
|
129
|
+
- `no-react-destructuring`, `no-data-prop`, `no-child-implementation`
|
|
130
|
+
- `component-props-validation`, `child-component-prop-validation`
|
|
131
|
+
- `component-usage-without-destructuring`
|
|
125
132
|
|
|
126
|
-
|
|
127
|
-
|
|
133
|
+
### Dependencies (7 rules)
|
|
134
|
+
- `component-not-in-dependencies`, `undefined-component-usage`
|
|
135
|
+
- `unused-libraries`, `unused-component-dependencies`
|
|
136
|
+
- `library-variable-names`, `dependency-shadowing`, `validate-component-references`
|
|
128
137
|
|
|
129
|
-
|
|
130
|
-
|
|
138
|
+
### Callbacks & Events (1 consolidated rule)
|
|
139
|
+
- `callback-event-validation` — Method usage, parameter signatures, passthrough, event null-checks
|
|
131
140
|
|
|
132
|
-
###
|
|
141
|
+
### Best Practices (8 rules)
|
|
142
|
+
- `prefer-async-await`, `prefer-jsx-syntax`, `react-hooks-rules`
|
|
143
|
+
- `useeffect-unstable-dependencies`, `unsafe-array-operations`, `unsafe-formatting-methods`
|
|
144
|
+
- `string-replace-all-occurrences`, `string-template-validation`
|
|
133
145
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
SQLWhereClauseValidator,
|
|
137
|
-
RequiredWhenValidator,
|
|
138
|
-
SubsetOfEntityFieldsValidator
|
|
139
|
-
} from '@memberjunction/react-test-harness';
|
|
140
|
-
|
|
141
|
-
// Validate a SQL WHERE clause
|
|
142
|
-
const sqlValidator = new SQLWhereClauseValidator();
|
|
143
|
-
const sqlResult = sqlValidator.Validate("Status = 'Active' AND Age > 18", context);
|
|
144
|
-
|
|
145
|
-
// Validate required-when conditions
|
|
146
|
-
const reqValidator = new RequiredWhenValidator();
|
|
147
|
-
const reqResult = reqValidator.Validate("IsAdmin = true", context);
|
|
148
|
-
|
|
149
|
-
// Validate field subset
|
|
150
|
-
const subsetValidator = new SubsetOfEntityFieldsValidator();
|
|
151
|
-
const subsetResult = subsetValidator.Validate(["Name", "Email", "Status"], context);
|
|
152
|
-
```
|
|
146
|
+
### Type Safety (2 rules)
|
|
147
|
+
- `type-inference-errors`, `type-mismatch-operation`
|
|
153
148
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
| Component | Description |
|
|
157
|
-
|-----------|-------------|
|
|
158
|
-
| `TestHarness` | Main orchestrator for running all test types |
|
|
159
|
-
| `ComponentLinter` | Static analysis of component source code |
|
|
160
|
-
| `ComponentRunner` | Browser-based component rendering tests |
|
|
161
|
-
| `BrowserContext` | Manages Playwright browser lifecycle |
|
|
162
|
-
| `TypeInferenceEngine` | Infers prop types from source code |
|
|
163
|
-
| `ControlFlowAnalyzer` | Detects control flow issues |
|
|
164
|
-
| `PropValueExtractor` | Extracts and validates prop values |
|
|
165
|
-
| `StylesTypeAnalyzer` | Analyzes component style patterns |
|
|
166
|
-
| `LibraryLintCache` | Caches lint results for external libraries |
|
|
167
|
-
| `LinterTestTool` | Testing utilities for linter development |
|
|
149
|
+
### Styles (1 consolidated rule)
|
|
150
|
+
- `styles-validation` — Invalid path access, unsafe patterns
|
|
168
151
|
|
|
169
|
-
|
|
152
|
+
### Utilities (3 rules)
|
|
153
|
+
- `utilities-api-validation`, `utilities-no-direct-instantiation`, `ai-tools-availability-check`
|
|
170
154
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
155
|
+
### State & Settings (5 rules)
|
|
156
|
+
- `saved-user-settings-pattern`, `noisy-settings-updates`, `prop-state-sync`
|
|
157
|
+
- `property-name-consistency`, `server-reload-on-client-operation`
|
|
158
|
+
|
|
159
|
+
### Other (4 rules)
|
|
160
|
+
- `no-use-reducer`, `required-queries-not-called`
|
|
161
|
+
- `undefined-jsx-component`, `no-child-implementation`
|
|
162
|
+
|
|
163
|
+
## Exports
|
|
175
164
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
| `chalk` | Terminal styling |
|
|
191
|
-
| `node-sql-parser` | SQL WHERE clause validation |
|
|
165
|
+
```typescript
|
|
166
|
+
// Core linting
|
|
167
|
+
export { ComponentLinter, LintResult, Violation } from './lib/component-linter';
|
|
168
|
+
export { BaseLintRule } from './lib/lint-rule';
|
|
169
|
+
|
|
170
|
+
// Test harness
|
|
171
|
+
export { ReactTestHarness, TestHarnessOptions } from './lib/test-harness';
|
|
172
|
+
export { ComponentRunner, ComponentExecutionOptions, ComponentExecutionResult } from './lib/component-runner';
|
|
173
|
+
export { BrowserManager, BrowserContextOptions } from './lib/browser-context';
|
|
174
|
+
|
|
175
|
+
// Utilities
|
|
176
|
+
export { LibraryLintCache, CompiledLibraryRules, CompiledValidator } from './lib/library-lint-cache';
|
|
177
|
+
export { ComponentSpec } from '@memberjunction/interactive-component-types';
|
|
178
|
+
```
|
|
192
179
|
|
|
193
180
|
## License
|
|
194
181
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vitest Setup File — Database Connection (runs in each test worker)
|
|
3
|
+
*
|
|
4
|
+
* Establishes a SQL Server connection and initializes the MJ metadata provider
|
|
5
|
+
* so that component linter tests can access entity metadata, library lint rules,
|
|
6
|
+
* and other database-dependent validation logic.
|
|
7
|
+
*
|
|
8
|
+
* Credentials are loaded from packages/React/test-harness/.env
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=vitest-setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest-setup.d.ts","sourceRoot":"","sources":["../../../src/__tests__/setup/vitest-setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vitest Setup File — Database Connection (runs in each test worker)
|
|
3
|
+
*
|
|
4
|
+
* Establishes a SQL Server connection and initializes the MJ metadata provider
|
|
5
|
+
* so that component linter tests can access entity metadata, library lint rules,
|
|
6
|
+
* and other database-dependent validation logic.
|
|
7
|
+
*
|
|
8
|
+
* Credentials are loaded from packages/React/test-harness/.env
|
|
9
|
+
*/
|
|
10
|
+
import sql from 'mssql';
|
|
11
|
+
import dotenv from 'dotenv';
|
|
12
|
+
import path from 'path';
|
|
13
|
+
import { fileURLToPath } from 'url';
|
|
14
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
15
|
+
const ENV_PATH = path.resolve(__dirname, '../../../.env');
|
|
16
|
+
let connectionPool = null;
|
|
17
|
+
// Load .env
|
|
18
|
+
dotenv.config({ path: ENV_PATH, override: true });
|
|
19
|
+
const dbHost = process.env.DB_HOST || 'localhost';
|
|
20
|
+
const dbPort = parseInt(process.env.DB_PORT || '1433', 10);
|
|
21
|
+
const dbDatabase = process.env.DB_DATABASE;
|
|
22
|
+
const dbUsername = process.env.DB_USERNAME;
|
|
23
|
+
const dbPassword = process.env.DB_PASSWORD;
|
|
24
|
+
const trustCert = process.env.DB_TRUST_SERVER_CERTIFICATE === '1';
|
|
25
|
+
if (dbDatabase && dbUsername && dbPassword) {
|
|
26
|
+
const sqlConfig = {
|
|
27
|
+
server: dbHost,
|
|
28
|
+
port: dbPort,
|
|
29
|
+
database: dbDatabase,
|
|
30
|
+
user: dbUsername,
|
|
31
|
+
password: dbPassword,
|
|
32
|
+
options: {
|
|
33
|
+
encrypt: true,
|
|
34
|
+
trustServerCertificate: trustCert,
|
|
35
|
+
enableArithAbort: true,
|
|
36
|
+
},
|
|
37
|
+
pool: {
|
|
38
|
+
max: 10,
|
|
39
|
+
min: 2,
|
|
40
|
+
idleTimeoutMillis: 30000,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
try {
|
|
44
|
+
connectionPool = new sql.ConnectionPool(sqlConfig);
|
|
45
|
+
await connectionPool.connect();
|
|
46
|
+
const { setupSQLServerClient, SQLServerProviderConfigData } = await import('@memberjunction/sqlserver-dataprovider');
|
|
47
|
+
const providerConfig = new SQLServerProviderConfigData(connectionPool, '__mj', 180000);
|
|
48
|
+
await setupSQLServerClient(providerConfig);
|
|
49
|
+
const { Metadata } = await import('@memberjunction/core');
|
|
50
|
+
const md = new Metadata();
|
|
51
|
+
console.log(`✅ MJ Provider initialized — ${md.Entities.length} entities loaded`);
|
|
52
|
+
process.env.__MJ_DB_AVAILABLE = 'true';
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
56
|
+
console.warn(`⚠️ Database connection failed — DB-dependent tests will be skipped.\n Error: ${msg}`);
|
|
57
|
+
process.env.__MJ_DB_AVAILABLE = 'false';
|
|
58
|
+
if (connectionPool) {
|
|
59
|
+
try {
|
|
60
|
+
await connectionPool.close();
|
|
61
|
+
}
|
|
62
|
+
catch { /* ignore */ }
|
|
63
|
+
connectionPool = null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
console.warn('⚠️ Database credentials not configured — DB-dependent tests will be skipped.\n' +
|
|
69
|
+
' Set DB_HOST, DB_DATABASE, DB_USERNAME, DB_PASSWORD in .env to enable them.');
|
|
70
|
+
}
|
|
71
|
+
// Connection pool closes automatically when the process exits.
|
|
72
|
+
// Don't use afterAll — vitest may run this setup per-file with tight hook timeouts.
|
|
73
|
+
//# sourceMappingURL=vitest-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest-setup.js","sourceRoot":"","sources":["../../../src/__tests__/setup/vitest-setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO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/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { BrowserManager, BrowserContextOptions } from './lib/browser-context.js'
|
|
|
3
3
|
export { ComponentRunner, ComponentExecutionOptions, ComponentExecutionResult } from './lib/component-runner.js';
|
|
4
4
|
export { AssertionHelpers } from './lib/assertion-helpers.js';
|
|
5
5
|
export { ComponentLinter, LintResult, Violation } from './lib/component-linter.js';
|
|
6
|
+
export { BaseLintRule } from './lib/lint-rule.js';
|
|
6
7
|
export { LibraryLintCache, CompiledLibraryRules, CompiledValidator } from './lib/library-lint-cache.js';
|
|
7
8
|
export { ComponentSpec } from '@memberjunction/interactive-component-types';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAC9G,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAC9G,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { BrowserManager } from './lib/browser-context.js';
|
|
|
4
4
|
export { ComponentRunner } from './lib/component-runner.js';
|
|
5
5
|
export { AssertionHelpers } from './lib/assertion-helpers.js';
|
|
6
6
|
export { ComponentLinter } from './lib/component-linter.js';
|
|
7
|
+
export { BaseLintRule } from './lib/lint-rule.js';
|
|
7
8
|
export { LibraryLintCache } from './lib/library-lint-cache.js';
|
|
8
9
|
export { ComponentSpec } from '@memberjunction/interactive-component-types';
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAsB,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAyB,MAAM,uBAAuB,CAAC;AAC9E,0EAA0E;AAC1E,OAAO,EAAE,eAAe,EAAuD,MAAM,wBAAwB,CAAC;AAC9G,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAyB,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAA2C,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAsB,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAyB,MAAM,uBAAuB,CAAC;AAC9E,0EAA0E;AAC1E,OAAO,EAAE,eAAe,EAAuD,MAAM,wBAAwB,CAAC;AAC9G,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAyB,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAA2C,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ComponentSpec } from '@memberjunction/interactive-component-types';
|
|
2
2
|
import type { UserInfo } from '@memberjunction/core';
|
|
3
3
|
import { ComponentExecutionOptions } from './component-runner.js';
|
|
4
|
+
import type { SQLParserDialect } from '@memberjunction/sql-dialect';
|
|
5
|
+
import './runtime-rules/index.js';
|
|
4
6
|
export interface LintResult {
|
|
5
7
|
success: boolean;
|
|
6
8
|
violations: Violation[];
|
|
@@ -27,25 +29,20 @@ export interface Violation {
|
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
export declare class ComponentLinter {
|
|
30
|
-
private static stylesAnalyzer;
|
|
31
|
-
private static getStylesAnalyzer;
|
|
32
|
-
private static containsReturn;
|
|
33
|
-
private static isVariableFromRunQueryOrView;
|
|
34
|
-
private static universalComponentRules;
|
|
35
32
|
static validateComponentSyntax(code: string, componentName: string): Promise<{
|
|
36
33
|
valid: boolean;
|
|
37
34
|
errors: string[];
|
|
38
35
|
}>;
|
|
39
|
-
static lintComponent(code: string, componentName: string, componentSpec?: ComponentSpec, isRootComponent?: boolean, contextUser?: UserInfo, debugMode?: boolean, options?: ComponentExecutionOptions): Promise<LintResult>;
|
|
40
|
-
private static validateDataRequirements;
|
|
41
|
-
private static getFunctionName;
|
|
42
|
-
private static deduplicateViolations;
|
|
43
36
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* @returns The same violations array with suggestions embedded
|
|
37
|
+
* The SQL dialect used for WHERE clause validation in semantic validators.
|
|
38
|
+
* Defaults to SQL Server. Set via the `sqlDialect` parameter on `lintComponent()`.
|
|
47
39
|
*/
|
|
48
|
-
private static
|
|
40
|
+
private static _sqlDialect;
|
|
41
|
+
/** Current SQL dialect used for WHERE clause parsing */
|
|
42
|
+
static get SqlDialect(): SQLParserDialect;
|
|
43
|
+
static lintComponent(code: string, componentName: string, componentSpec?: ComponentSpec, isRootComponent?: boolean, contextUser?: UserInfo, debugMode?: boolean, options?: ComponentExecutionOptions, sqlDialect?: SQLParserDialect): Promise<LintResult>;
|
|
44
|
+
private static validateDataRequirements;
|
|
45
|
+
private static deduplicateViolations;
|
|
49
46
|
private static generateSyntaxErrorSuggestions;
|
|
50
47
|
/**
|
|
51
48
|
* Apply library-specific lint rules based on ComponentLibrary LintRules field
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-linter.d.ts","sourceRoot":"","sources":["../../src/lib/component-linter.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAwD,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"component-linter.d.ts","sourceRoot":"","sources":["../../src/lib/component-linter.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAwD,MAAM,6CAA6C,CAAC;AAGlI,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAS/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,OAAO,iBAAiB,CAAC;AA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