@usefragments/core 1.8.0 → 1.9.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/dist/{chunk-UUREQ4HD.js → chunk-DGHZQTLH.js} +7 -1
- package/dist/{chunk-UUREQ4HD.js.map → chunk-DGHZQTLH.js.map} +1 -1
- package/dist/codes/index.d.ts +1 -1
- package/dist/codes/index.js +1 -1
- package/dist/{index-Cxk3SOQP.d.ts → index-_sxhUNqx.d.ts} +102 -12
- package/dist/index.d.ts +140 -132
- package/dist/index.js +23 -1
- package/dist/index.js.map +1 -1
- package/dist/registry.d.ts +18 -18
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.js +1 -1
- package/package.json +1 -1
- package/src/rules/finding.ts +22 -0
- package/src/rules/jsx-preferred-import-path.ts +18 -0
- package/src/rules/rules.test.ts +114 -0
- package/src/schemas/index.ts +6 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { GOVERNANCE_TELEMETRY_FIELDS, GOVERNANCE_TELEMETRY_SOURCE_DISCLOSURE, GOVERNANCE_TELEMETRY_TOP_LEVEL_FIELDS, GovernanceTelemetryCarriage, GovernanceTelemetryField, GovernanceTelemetryTopLevelField } from './governance-telemetry.js';
|
|
2
|
-
import { F as Finding, A as AgentFormat, E as EvidenceGrade, a as FindingFix } from './index-
|
|
3
|
-
export { b as AGENT_FORMAT_SCHEMA_VERSION, c as AgentErrorEnvelope, d as AgentOutput, G as CanonicalGovernanceVerdict, e as EVIDENCE_ORDER, f as FindingReplaceClassTokenFix, g as FindingReplaceComponentFix, h as FindingReplaceImportFix, i as FindingReplacePropValueFix, j as FindingReplaceStyleValueFix, k as Fix, l as GovernanceVerdictMetadata, I as InspectClaim, m as InspectClaimTier, S as SuppressionDirective, V as ValidatorResult, n as Violation, o as agentErrorEnvelopeSchema, p as agentFormatSchema, q as agentIntegritySchema, r as agentOutputSchema, s as canBlock, t as factEvidenceSchema, u as factLocationSchema, v as findingFixSchema, w as findingReplaceClassTokenFixSchema, x as findingReplaceComponentFixSchema, y as findingReplaceImportFixSchema, z as findingReplacePropValueFixSchema, B as findingReplaceStyleValueFixSchema, C as findingSchema, D as fixSchema, H as governanceVerdictMetadataSchema, J as governanceVerdictSchema, K as normalizeFinding, L as normalizeSeverity, M as normalizeViolation, N as suppressionDirectiveSchema, O as validatorResultSchema, P as violationSchema } from './index-
|
|
2
|
+
import { F as Finding, A as AgentFormat, E as EvidenceGrade, a as FindingFix } from './index-_sxhUNqx.js';
|
|
3
|
+
export { b as AGENT_FORMAT_SCHEMA_VERSION, c as AgentErrorEnvelope, d as AgentOutput, G as CanonicalGovernanceVerdict, e as EVIDENCE_ORDER, f as FindingReplaceClassTokenFix, g as FindingReplaceComponentFix, h as FindingReplaceImportFix, i as FindingReplacePropValueFix, j as FindingReplaceStyleValueFix, k as Fix, l as GovernanceVerdictMetadata, I as InspectClaim, m as InspectClaimTier, S as SuppressionDirective, V as ValidatorResult, n as Violation, o as agentErrorEnvelopeSchema, p as agentFormatSchema, q as agentIntegritySchema, r as agentOutputSchema, s as canBlock, t as factEvidenceSchema, u as factLocationSchema, v as findingFixSchema, w as findingReplaceClassTokenFixSchema, x as findingReplaceComponentFixSchema, y as findingReplaceImportFixSchema, z as findingReplacePropValueFixSchema, B as findingReplaceStyleValueFixSchema, C as findingSchema, D as fixSchema, H as governanceVerdictMetadataSchema, J as governanceVerdictSchema, K as normalizeFinding, L as normalizeSeverity, M as normalizeViolation, N as suppressionDirectiveSchema, O as validatorResultSchema, P as violationSchema } from './index-_sxhUNqx.js';
|
|
4
4
|
import { Severity } from './severity.js';
|
|
5
5
|
export { SEVERITIES, SEVERITY_RANK, SEVERITY_WEIGHTS, SeverityLevel, compareSeverity, maxSeverity, severityLevel, severitySchema, sortBySeverity } from './severity.js';
|
|
6
6
|
export { BridgeViolationInput, CODES, CodeCategory, CodeLifecycle, EXPLAIN_URL_BASE, FuiCode, bridgeSourceViolation, bridgeSourceViolations, byCode, byRuleId, explainUrlForCode } from './codes/index.js';
|
|
@@ -2224,7 +2224,7 @@ declare const bundleManifestComponentEntrySchema: z.ZodObject<{
|
|
|
2224
2224
|
name: string;
|
|
2225
2225
|
}[];
|
|
2226
2226
|
file: string;
|
|
2227
|
-
tier: "
|
|
2227
|
+
tier: "composition" | "core";
|
|
2228
2228
|
description: string;
|
|
2229
2229
|
publicSlug: string | null;
|
|
2230
2230
|
propCount: number;
|
|
@@ -2245,7 +2245,7 @@ declare const bundleManifestComponentEntrySchema: z.ZodObject<{
|
|
|
2245
2245
|
name: string;
|
|
2246
2246
|
}[];
|
|
2247
2247
|
file: string;
|
|
2248
|
-
tier: "
|
|
2248
|
+
tier: "composition" | "core";
|
|
2249
2249
|
description: string;
|
|
2250
2250
|
publicSlug: string | null;
|
|
2251
2251
|
propCount: number;
|
|
@@ -2354,7 +2354,7 @@ declare const bundleManifestSchema: z.ZodObject<{
|
|
|
2354
2354
|
name: string;
|
|
2355
2355
|
}[];
|
|
2356
2356
|
file: string;
|
|
2357
|
-
tier: "
|
|
2357
|
+
tier: "composition" | "core";
|
|
2358
2358
|
description: string;
|
|
2359
2359
|
publicSlug: string | null;
|
|
2360
2360
|
propCount: number;
|
|
@@ -2375,7 +2375,7 @@ declare const bundleManifestSchema: z.ZodObject<{
|
|
|
2375
2375
|
name: string;
|
|
2376
2376
|
}[];
|
|
2377
2377
|
file: string;
|
|
2378
|
-
tier: "
|
|
2378
|
+
tier: "composition" | "core";
|
|
2379
2379
|
description: string;
|
|
2380
2380
|
publicSlug: string | null;
|
|
2381
2381
|
propCount: number;
|
|
@@ -2398,7 +2398,7 @@ declare const bundleManifestSchema: z.ZodObject<{
|
|
|
2398
2398
|
name: string;
|
|
2399
2399
|
}[];
|
|
2400
2400
|
file: string;
|
|
2401
|
-
tier: "
|
|
2401
|
+
tier: "composition" | "core";
|
|
2402
2402
|
description: string;
|
|
2403
2403
|
publicSlug: string | null;
|
|
2404
2404
|
propCount: number;
|
|
@@ -2444,7 +2444,7 @@ declare const bundleManifestSchema: z.ZodObject<{
|
|
|
2444
2444
|
name: string;
|
|
2445
2445
|
}[];
|
|
2446
2446
|
file: string;
|
|
2447
|
-
tier: "
|
|
2447
|
+
tier: "composition" | "core";
|
|
2448
2448
|
description: string;
|
|
2449
2449
|
publicSlug: string | null;
|
|
2450
2450
|
propCount: number;
|
|
@@ -2552,6 +2552,7 @@ declare const bundleTokenFileSchema: z.ZodObject<{
|
|
|
2552
2552
|
description?: string | undefined;
|
|
2553
2553
|
}>, "many">;
|
|
2554
2554
|
}, "strip", z.ZodTypeAny, {
|
|
2555
|
+
schemaVersion: 1;
|
|
2555
2556
|
flat: {
|
|
2556
2557
|
value: string;
|
|
2557
2558
|
path: string[];
|
|
@@ -2560,7 +2561,6 @@ declare const bundleTokenFileSchema: z.ZodObject<{
|
|
|
2560
2561
|
type?: string | undefined;
|
|
2561
2562
|
description?: string | undefined;
|
|
2562
2563
|
}[];
|
|
2563
|
-
schemaVersion: 1;
|
|
2564
2564
|
catalogRevision: string;
|
|
2565
2565
|
catalogUpdatedAt: string;
|
|
2566
2566
|
categories: Record<string, {
|
|
@@ -2575,6 +2575,7 @@ declare const bundleTokenFileSchema: z.ZodObject<{
|
|
|
2575
2575
|
count: number;
|
|
2576
2576
|
}>;
|
|
2577
2577
|
}, {
|
|
2578
|
+
schemaVersion: 1;
|
|
2578
2579
|
flat: {
|
|
2579
2580
|
value: string;
|
|
2580
2581
|
path: string[];
|
|
@@ -2583,7 +2584,6 @@ declare const bundleTokenFileSchema: z.ZodObject<{
|
|
|
2583
2584
|
type?: string | undefined;
|
|
2584
2585
|
description?: string | undefined;
|
|
2585
2586
|
}[];
|
|
2586
|
-
schemaVersion: 1;
|
|
2587
2587
|
catalogRevision: string;
|
|
2588
2588
|
catalogUpdatedAt: string;
|
|
2589
2589
|
categories: Record<string, {
|
|
@@ -2637,8 +2637,8 @@ declare const bundleComponentShardSchema: z.ZodObject<{
|
|
|
2637
2637
|
parentComponentName: z.ZodOptional<z.ZodString>;
|
|
2638
2638
|
parentComponentKey: z.ZodOptional<z.ZodString>;
|
|
2639
2639
|
}, "strip", z.ZodTypeAny, {
|
|
2640
|
-
status: string;
|
|
2641
2640
|
source: "design-system";
|
|
2641
|
+
status: string;
|
|
2642
2642
|
props: Record<string, unknown>;
|
|
2643
2643
|
category: string;
|
|
2644
2644
|
name: string;
|
|
@@ -2648,7 +2648,7 @@ declare const bundleComponentShardSchema: z.ZodObject<{
|
|
|
2648
2648
|
componentId: string;
|
|
2649
2649
|
name: string;
|
|
2650
2650
|
}[];
|
|
2651
|
-
tier: "
|
|
2651
|
+
tier: "composition" | "core";
|
|
2652
2652
|
description: string;
|
|
2653
2653
|
publicSlug: string | null;
|
|
2654
2654
|
relations: Record<string, unknown>[];
|
|
@@ -2663,8 +2663,8 @@ declare const bundleComponentShardSchema: z.ZodObject<{
|
|
|
2663
2663
|
parentComponentName?: string | undefined;
|
|
2664
2664
|
parentComponentKey?: string | undefined;
|
|
2665
2665
|
}, {
|
|
2666
|
-
status: string;
|
|
2667
2666
|
source: "design-system";
|
|
2667
|
+
status: string;
|
|
2668
2668
|
props: Record<string, unknown>;
|
|
2669
2669
|
category: string;
|
|
2670
2670
|
name: string;
|
|
@@ -2674,7 +2674,7 @@ declare const bundleComponentShardSchema: z.ZodObject<{
|
|
|
2674
2674
|
componentId: string;
|
|
2675
2675
|
name: string;
|
|
2676
2676
|
}[];
|
|
2677
|
-
tier: "
|
|
2677
|
+
tier: "composition" | "core";
|
|
2678
2678
|
description: string;
|
|
2679
2679
|
publicSlug: string | null;
|
|
2680
2680
|
relations: Record<string, unknown>[];
|
|
@@ -2694,8 +2694,8 @@ declare const bundleComponentShardSchema: z.ZodObject<{
|
|
|
2694
2694
|
componentId: string;
|
|
2695
2695
|
file: string;
|
|
2696
2696
|
component: {
|
|
2697
|
-
status: string;
|
|
2698
2697
|
source: "design-system";
|
|
2698
|
+
status: string;
|
|
2699
2699
|
props: Record<string, unknown>;
|
|
2700
2700
|
category: string;
|
|
2701
2701
|
name: string;
|
|
@@ -2705,7 +2705,7 @@ declare const bundleComponentShardSchema: z.ZodObject<{
|
|
|
2705
2705
|
componentId: string;
|
|
2706
2706
|
name: string;
|
|
2707
2707
|
}[];
|
|
2708
|
-
tier: "
|
|
2708
|
+
tier: "composition" | "core";
|
|
2709
2709
|
description: string;
|
|
2710
2710
|
publicSlug: string | null;
|
|
2711
2711
|
relations: Record<string, unknown>[];
|
|
@@ -2727,8 +2727,8 @@ declare const bundleComponentShardSchema: z.ZodObject<{
|
|
|
2727
2727
|
componentId: string;
|
|
2728
2728
|
file: string;
|
|
2729
2729
|
component: {
|
|
2730
|
-
status: string;
|
|
2731
2730
|
source: "design-system";
|
|
2731
|
+
status: string;
|
|
2732
2732
|
props: Record<string, unknown>;
|
|
2733
2733
|
category: string;
|
|
2734
2734
|
name: string;
|
|
@@ -2738,7 +2738,7 @@ declare const bundleComponentShardSchema: z.ZodObject<{
|
|
|
2738
2738
|
componentId: string;
|
|
2739
2739
|
name: string;
|
|
2740
2740
|
}[];
|
|
2741
|
-
tier: "
|
|
2741
|
+
tier: "composition" | "core";
|
|
2742
2742
|
description: string;
|
|
2743
2743
|
publicSlug: string | null;
|
|
2744
2744
|
relations: Record<string, unknown>[];
|
|
@@ -7659,6 +7659,60 @@ declare const fragmentsConfigSchema: z.ZodObject<{
|
|
|
7659
7659
|
}[] | undefined;
|
|
7660
7660
|
}>>;
|
|
7661
7661
|
}, "strip", z.ZodTypeAny, {
|
|
7662
|
+
components?: string[] | undefined;
|
|
7663
|
+
screenshots?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
7664
|
+
topology?: {
|
|
7665
|
+
version: number;
|
|
7666
|
+
areas: {
|
|
7667
|
+
name: string;
|
|
7668
|
+
criticality: "high" | "medium" | "low" | "revenue" | "regulated";
|
|
7669
|
+
owners: string[];
|
|
7670
|
+
id: string;
|
|
7671
|
+
files: string[];
|
|
7672
|
+
routes?: string[] | undefined;
|
|
7673
|
+
priority?: number | undefined;
|
|
7674
|
+
}[];
|
|
7675
|
+
base?: "app" | "repo" | undefined;
|
|
7676
|
+
} | undefined;
|
|
7677
|
+
tokens?: z.objectOutputType<{
|
|
7678
|
+
include: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
7679
|
+
sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7680
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
7681
|
+
format: z.ZodOptional<z.ZodEnum<["auto", "css", "scss", "dtcg", "tailwind"]>>;
|
|
7682
|
+
}, "strip", z.ZodTypeAny, {
|
|
7683
|
+
path: string;
|
|
7684
|
+
format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined;
|
|
7685
|
+
}, {
|
|
7686
|
+
path: string;
|
|
7687
|
+
format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined;
|
|
7688
|
+
}>, "many">>;
|
|
7689
|
+
packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7690
|
+
aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7691
|
+
upstream: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7692
|
+
packageName: z.ZodString;
|
|
7693
|
+
version: z.ZodOptional<z.ZodString>;
|
|
7694
|
+
digest: z.ZodOptional<z.ZodString>;
|
|
7695
|
+
}, "strip", z.ZodTypeAny, {
|
|
7696
|
+
packageName: string;
|
|
7697
|
+
version?: string | undefined;
|
|
7698
|
+
digest?: string | undefined;
|
|
7699
|
+
}, {
|
|
7700
|
+
packageName: string;
|
|
7701
|
+
version?: string | undefined;
|
|
7702
|
+
digest?: string | undefined;
|
|
7703
|
+
}>, "many">>;
|
|
7704
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
7705
|
+
themeSelectors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7706
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
7707
|
+
format: z.ZodOptional<z.ZodEnum<["auto", "css", "scss", "dtcg", "tailwind"]>>;
|
|
7708
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
7709
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
7710
|
+
performance?: "strict" | "relaxed" | "standard" | {
|
|
7711
|
+
preset?: "strict" | "relaxed" | "standard" | undefined;
|
|
7712
|
+
budgets?: {
|
|
7713
|
+
bundleSize?: number | undefined;
|
|
7714
|
+
} | undefined;
|
|
7715
|
+
} | undefined;
|
|
7662
7716
|
govern?: {
|
|
7663
7717
|
components?: Record<string, {
|
|
7664
7718
|
rules: ({
|
|
@@ -7887,60 +7941,6 @@ declare const fragmentsConfigSchema: z.ZodObject<{
|
|
|
7887
7941
|
failOnInert: z.ZodOptional<z.ZodBoolean>;
|
|
7888
7942
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
7889
7943
|
} | undefined;
|
|
7890
|
-
components?: string[] | undefined;
|
|
7891
|
-
screenshots?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
7892
|
-
topology?: {
|
|
7893
|
-
version: number;
|
|
7894
|
-
areas: {
|
|
7895
|
-
name: string;
|
|
7896
|
-
criticality: "high" | "medium" | "low" | "revenue" | "regulated";
|
|
7897
|
-
owners: string[];
|
|
7898
|
-
id: string;
|
|
7899
|
-
files: string[];
|
|
7900
|
-
routes?: string[] | undefined;
|
|
7901
|
-
priority?: number | undefined;
|
|
7902
|
-
}[];
|
|
7903
|
-
base?: "app" | "repo" | undefined;
|
|
7904
|
-
} | undefined;
|
|
7905
|
-
tokens?: z.objectOutputType<{
|
|
7906
|
-
include: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
7907
|
-
sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7908
|
-
path: z.ZodEffects<z.ZodString, string, string>;
|
|
7909
|
-
format: z.ZodOptional<z.ZodEnum<["auto", "css", "scss", "dtcg", "tailwind"]>>;
|
|
7910
|
-
}, "strip", z.ZodTypeAny, {
|
|
7911
|
-
path: string;
|
|
7912
|
-
format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined;
|
|
7913
|
-
}, {
|
|
7914
|
-
path: string;
|
|
7915
|
-
format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined;
|
|
7916
|
-
}>, "many">>;
|
|
7917
|
-
packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7918
|
-
aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7919
|
-
upstream: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7920
|
-
packageName: z.ZodString;
|
|
7921
|
-
version: z.ZodOptional<z.ZodString>;
|
|
7922
|
-
digest: z.ZodOptional<z.ZodString>;
|
|
7923
|
-
}, "strip", z.ZodTypeAny, {
|
|
7924
|
-
packageName: string;
|
|
7925
|
-
version?: string | undefined;
|
|
7926
|
-
digest?: string | undefined;
|
|
7927
|
-
}, {
|
|
7928
|
-
packageName: string;
|
|
7929
|
-
version?: string | undefined;
|
|
7930
|
-
digest?: string | undefined;
|
|
7931
|
-
}>, "many">>;
|
|
7932
|
-
exclude: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
7933
|
-
themeSelectors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7934
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
7935
|
-
format: z.ZodOptional<z.ZodEnum<["auto", "css", "scss", "dtcg", "tailwind"]>>;
|
|
7936
|
-
namespace: z.ZodOptional<z.ZodString>;
|
|
7937
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
7938
|
-
performance?: "strict" | "relaxed" | "standard" | {
|
|
7939
|
-
preset?: "strict" | "relaxed" | "standard" | undefined;
|
|
7940
|
-
budgets?: {
|
|
7941
|
-
bundleSize?: number | undefined;
|
|
7942
|
-
} | undefined;
|
|
7943
|
-
} | undefined;
|
|
7944
7944
|
exclude?: string[] | undefined;
|
|
7945
7945
|
include?: string[] | undefined;
|
|
7946
7946
|
registry?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -7994,6 +7994,60 @@ declare const fragmentsConfigSchema: z.ZodObject<{
|
|
|
7994
7994
|
}[] | undefined;
|
|
7995
7995
|
} | undefined;
|
|
7996
7996
|
}, {
|
|
7997
|
+
components?: string[] | undefined;
|
|
7998
|
+
screenshots?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
7999
|
+
topology?: {
|
|
8000
|
+
version: number;
|
|
8001
|
+
areas: {
|
|
8002
|
+
name: string;
|
|
8003
|
+
criticality: "high" | "medium" | "low" | "revenue" | "regulated";
|
|
8004
|
+
owners: string[];
|
|
8005
|
+
id: string;
|
|
8006
|
+
files: string[];
|
|
8007
|
+
routes?: string[] | undefined;
|
|
8008
|
+
priority?: number | undefined;
|
|
8009
|
+
}[];
|
|
8010
|
+
base?: "app" | "repo" | undefined;
|
|
8011
|
+
} | undefined;
|
|
8012
|
+
tokens?: z.objectInputType<{
|
|
8013
|
+
include: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
8014
|
+
sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8015
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
8016
|
+
format: z.ZodOptional<z.ZodEnum<["auto", "css", "scss", "dtcg", "tailwind"]>>;
|
|
8017
|
+
}, "strip", z.ZodTypeAny, {
|
|
8018
|
+
path: string;
|
|
8019
|
+
format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined;
|
|
8020
|
+
}, {
|
|
8021
|
+
path: string;
|
|
8022
|
+
format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined;
|
|
8023
|
+
}>, "many">>;
|
|
8024
|
+
packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8025
|
+
aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8026
|
+
upstream: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8027
|
+
packageName: z.ZodString;
|
|
8028
|
+
version: z.ZodOptional<z.ZodString>;
|
|
8029
|
+
digest: z.ZodOptional<z.ZodString>;
|
|
8030
|
+
}, "strip", z.ZodTypeAny, {
|
|
8031
|
+
packageName: string;
|
|
8032
|
+
version?: string | undefined;
|
|
8033
|
+
digest?: string | undefined;
|
|
8034
|
+
}, {
|
|
8035
|
+
packageName: string;
|
|
8036
|
+
version?: string | undefined;
|
|
8037
|
+
digest?: string | undefined;
|
|
8038
|
+
}>, "many">>;
|
|
8039
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
8040
|
+
themeSelectors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8041
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
8042
|
+
format: z.ZodOptional<z.ZodEnum<["auto", "css", "scss", "dtcg", "tailwind"]>>;
|
|
8043
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
8044
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
8045
|
+
performance?: "strict" | "relaxed" | "standard" | {
|
|
8046
|
+
preset?: "strict" | "relaxed" | "standard" | undefined;
|
|
8047
|
+
budgets?: {
|
|
8048
|
+
bundleSize?: number | undefined;
|
|
8049
|
+
} | undefined;
|
|
8050
|
+
} | undefined;
|
|
7997
8051
|
govern?: {
|
|
7998
8052
|
components?: Record<string, {
|
|
7999
8053
|
rules: ({
|
|
@@ -8222,60 +8276,6 @@ declare const fragmentsConfigSchema: z.ZodObject<{
|
|
|
8222
8276
|
failOnInert: z.ZodOptional<z.ZodBoolean>;
|
|
8223
8277
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
8224
8278
|
} | undefined;
|
|
8225
|
-
components?: string[] | undefined;
|
|
8226
|
-
screenshots?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
8227
|
-
topology?: {
|
|
8228
|
-
version: number;
|
|
8229
|
-
areas: {
|
|
8230
|
-
name: string;
|
|
8231
|
-
criticality: "high" | "medium" | "low" | "revenue" | "regulated";
|
|
8232
|
-
owners: string[];
|
|
8233
|
-
id: string;
|
|
8234
|
-
files: string[];
|
|
8235
|
-
routes?: string[] | undefined;
|
|
8236
|
-
priority?: number | undefined;
|
|
8237
|
-
}[];
|
|
8238
|
-
base?: "app" | "repo" | undefined;
|
|
8239
|
-
} | undefined;
|
|
8240
|
-
tokens?: z.objectInputType<{
|
|
8241
|
-
include: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
8242
|
-
sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8243
|
-
path: z.ZodEffects<z.ZodString, string, string>;
|
|
8244
|
-
format: z.ZodOptional<z.ZodEnum<["auto", "css", "scss", "dtcg", "tailwind"]>>;
|
|
8245
|
-
}, "strip", z.ZodTypeAny, {
|
|
8246
|
-
path: string;
|
|
8247
|
-
format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined;
|
|
8248
|
-
}, {
|
|
8249
|
-
path: string;
|
|
8250
|
-
format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined;
|
|
8251
|
-
}>, "many">>;
|
|
8252
|
-
packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8253
|
-
aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8254
|
-
upstream: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8255
|
-
packageName: z.ZodString;
|
|
8256
|
-
version: z.ZodOptional<z.ZodString>;
|
|
8257
|
-
digest: z.ZodOptional<z.ZodString>;
|
|
8258
|
-
}, "strip", z.ZodTypeAny, {
|
|
8259
|
-
packageName: string;
|
|
8260
|
-
version?: string | undefined;
|
|
8261
|
-
digest?: string | undefined;
|
|
8262
|
-
}, {
|
|
8263
|
-
packageName: string;
|
|
8264
|
-
version?: string | undefined;
|
|
8265
|
-
digest?: string | undefined;
|
|
8266
|
-
}>, "many">>;
|
|
8267
|
-
exclude: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
8268
|
-
themeSelectors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8269
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
8270
|
-
format: z.ZodOptional<z.ZodEnum<["auto", "css", "scss", "dtcg", "tailwind"]>>;
|
|
8271
|
-
namespace: z.ZodOptional<z.ZodString>;
|
|
8272
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
8273
|
-
performance?: "strict" | "relaxed" | "standard" | {
|
|
8274
|
-
preset?: "strict" | "relaxed" | "standard" | undefined;
|
|
8275
|
-
budgets?: {
|
|
8276
|
-
bundleSize?: number | undefined;
|
|
8277
|
-
} | undefined;
|
|
8278
|
-
} | undefined;
|
|
8279
8279
|
exclude?: string[] | undefined;
|
|
8280
8280
|
include?: string[] | undefined;
|
|
8281
8281
|
registry?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -9756,7 +9756,6 @@ declare const governedFragmentDefinitionSchema: z.ZodObject<{
|
|
|
9756
9756
|
guidelines?: string[] | undefined;
|
|
9757
9757
|
accessibility?: string[] | undefined;
|
|
9758
9758
|
};
|
|
9759
|
-
govern?: ((...args: unknown[]) => unknown) | undefined;
|
|
9760
9759
|
composition?: {
|
|
9761
9760
|
pattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined;
|
|
9762
9761
|
subComponents?: string[] | undefined;
|
|
@@ -9772,6 +9771,7 @@ declare const governedFragmentDefinitionSchema: z.ZodObject<{
|
|
|
9772
9771
|
constraints?: string[] | undefined;
|
|
9773
9772
|
typeDetails?: Record<string, unknown> | undefined;
|
|
9774
9773
|
}> | undefined;
|
|
9774
|
+
govern?: ((...args: unknown[]) => unknown) | undefined;
|
|
9775
9775
|
contract?: {
|
|
9776
9776
|
composition?: {
|
|
9777
9777
|
rule: {
|
|
@@ -9902,7 +9902,6 @@ declare const governedFragmentDefinitionSchema: z.ZodObject<{
|
|
|
9902
9902
|
guidelines?: string[] | undefined;
|
|
9903
9903
|
accessibility?: string[] | undefined;
|
|
9904
9904
|
};
|
|
9905
|
-
govern?: ((...args: unknown[]) => unknown) | undefined;
|
|
9906
9905
|
composition?: {
|
|
9907
9906
|
pattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined;
|
|
9908
9907
|
subComponents?: string[] | undefined;
|
|
@@ -9918,6 +9917,7 @@ declare const governedFragmentDefinitionSchema: z.ZodObject<{
|
|
|
9918
9917
|
constraints?: string[] | undefined;
|
|
9919
9918
|
typeDetails?: Record<string, unknown> | undefined;
|
|
9920
9919
|
}> | undefined;
|
|
9920
|
+
govern?: ((...args: unknown[]) => unknown) | undefined;
|
|
9921
9921
|
contract?: {
|
|
9922
9922
|
composition?: {
|
|
9923
9923
|
rule: {
|
|
@@ -11360,6 +11360,8 @@ declare const componentContractSchema: z.ZodObject<{
|
|
|
11360
11360
|
};
|
|
11361
11361
|
propsSummary: string[];
|
|
11362
11362
|
$schema: string;
|
|
11363
|
+
status?: "experimental" | "stable" | "deprecated" | "beta" | undefined;
|
|
11364
|
+
tokens?: string[] | undefined;
|
|
11363
11365
|
preview?: {
|
|
11364
11366
|
css?: string[] | undefined;
|
|
11365
11367
|
theme?: "light" | "dark" | undefined;
|
|
@@ -11367,8 +11369,6 @@ declare const componentContractSchema: z.ZodObject<{
|
|
|
11367
11369
|
wrapperModule?: string | undefined;
|
|
11368
11370
|
wrapperExport?: string | undefined;
|
|
11369
11371
|
} | undefined;
|
|
11370
|
-
status?: "experimental" | "stable" | "deprecated" | "beta" | undefined;
|
|
11371
|
-
tokens?: string[] | undefined;
|
|
11372
11372
|
contract?: {
|
|
11373
11373
|
compoundChildren?: Record<string, {
|
|
11374
11374
|
required?: boolean | undefined;
|
|
@@ -11446,6 +11446,8 @@ declare const componentContractSchema: z.ZodObject<{
|
|
|
11446
11446
|
};
|
|
11447
11447
|
propsSummary: string[];
|
|
11448
11448
|
$schema: string;
|
|
11449
|
+
status?: "experimental" | "stable" | "deprecated" | "beta" | undefined;
|
|
11450
|
+
tokens?: string[] | undefined;
|
|
11449
11451
|
preview?: {
|
|
11450
11452
|
css?: string[] | undefined;
|
|
11451
11453
|
theme?: "light" | "dark" | undefined;
|
|
@@ -11453,8 +11455,6 @@ declare const componentContractSchema: z.ZodObject<{
|
|
|
11453
11455
|
wrapperModule?: string | undefined;
|
|
11454
11456
|
wrapperExport?: string | undefined;
|
|
11455
11457
|
} | undefined;
|
|
11456
|
-
status?: "experimental" | "stable" | "deprecated" | "beta" | undefined;
|
|
11457
|
-
tokens?: string[] | undefined;
|
|
11458
11458
|
contract?: {
|
|
11459
11459
|
compoundChildren?: Record<string, {
|
|
11460
11460
|
required?: boolean | undefined;
|
|
@@ -11682,6 +11682,14 @@ interface MakeFindingInput {
|
|
|
11682
11682
|
evidence: FactEvidence[];
|
|
11683
11683
|
evidenceGrade?: EvidenceGrade;
|
|
11684
11684
|
fingerprintIdentity: Record<string, unknown>;
|
|
11685
|
+
/**
|
|
11686
|
+
* Legacy identity tuple from before a fingerprint migration. When present,
|
|
11687
|
+
* the finding also carries `previousFingerprint` (the legacy hash) so
|
|
11688
|
+
* baseline classification can match records keyed on the old hash during
|
|
11689
|
+
* the grace window. Position keys are permitted here — legacy identities
|
|
11690
|
+
* are reproduced verbatim, contract violations included.
|
|
11691
|
+
*/
|
|
11692
|
+
previousFingerprintIdentity?: Record<string, unknown>;
|
|
11685
11693
|
fix?: FindingFix;
|
|
11686
11694
|
attributes?: Record<string, unknown>;
|
|
11687
11695
|
}
|
package/dist/index.js
CHANGED
|
@@ -159,7 +159,7 @@ import {
|
|
|
159
159
|
suppressionDirectiveSchema,
|
|
160
160
|
validatorResultSchema,
|
|
161
161
|
violationSchema
|
|
162
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-DGHZQTLH.js";
|
|
163
163
|
import {
|
|
164
164
|
OWNED_PACKAGE_IDENTITY_EPOCH,
|
|
165
165
|
OWNED_PACKAGE_IDENTITY_SOURCE_SHA256,
|
|
@@ -4682,13 +4682,21 @@ function isAriaHidden(props) {
|
|
|
4682
4682
|
}
|
|
4683
4683
|
|
|
4684
4684
|
// src/rules/finding.ts
|
|
4685
|
+
var POSITION_IDENTITY_KEYS = ["line", "column", "endLine", "endColumn", "offset", "location"];
|
|
4685
4686
|
function makeFinding(input) {
|
|
4686
4687
|
if (input.evidence.length === 0) {
|
|
4687
4688
|
throw new Error(`makeFinding(${input.ruleId}): findings must carry at least one evidence fact`);
|
|
4688
4689
|
}
|
|
4690
|
+
const positionKeys = POSITION_IDENTITY_KEYS.filter((key) => key in input.fingerprintIdentity);
|
|
4691
|
+
if (positionKeys.length > 0) {
|
|
4692
|
+
throw new Error(
|
|
4693
|
+
`makeFinding(${input.ruleId}): fingerprintIdentity must not contain position keys (${positionKeys.join(", ")}) \u2014 fingerprints hash what's wrong, never where it sits. Use a source-order occurrence index for repeats of the same identity.`
|
|
4694
|
+
);
|
|
4695
|
+
}
|
|
4689
4696
|
const fingerprint = hash64Hex(
|
|
4690
4697
|
canonicalJson({ ruleId: input.ruleId, ...input.fingerprintIdentity })
|
|
4691
4698
|
);
|
|
4699
|
+
const previousFingerprint = input.previousFingerprintIdentity ? hash64Hex(canonicalJson({ ruleId: input.ruleId, ...input.previousFingerprintIdentity })) : void 0;
|
|
4692
4700
|
const code = byRuleId.get(input.ruleId);
|
|
4693
4701
|
return normalizeFinding({
|
|
4694
4702
|
ruleId: input.ruleId,
|
|
@@ -4698,6 +4706,7 @@ function makeFinding(input) {
|
|
|
4698
4706
|
helpUrl: code?.explainUrl,
|
|
4699
4707
|
message: input.message,
|
|
4700
4708
|
fingerprint,
|
|
4709
|
+
...previousFingerprint !== void 0 ? { previousFingerprint } : {},
|
|
4701
4710
|
location: input.location,
|
|
4702
4711
|
evidence: input.evidence,
|
|
4703
4712
|
evidenceGrade: input.evidenceGrade ?? "source_backed",
|
|
@@ -6746,6 +6755,7 @@ function ruleJsxPreferredImportPath(ix) {
|
|
|
6746
6755
|
if (policies.length === 0) return [];
|
|
6747
6756
|
const findings = [];
|
|
6748
6757
|
const seen = /* @__PURE__ */ new Set();
|
|
6758
|
+
const occurrences = /* @__PURE__ */ new Map();
|
|
6749
6759
|
for (const usage of ix.byKind("usage_import")) {
|
|
6750
6760
|
const bridgeGoverned = policies.some((policy) => bridgeGovernsUnderlyingImport(policy, usage));
|
|
6751
6761
|
const matches = policies.filter((policy) => {
|
|
@@ -6766,6 +6776,9 @@ function ruleJsxPreferredImportPath(ix) {
|
|
|
6766
6776
|
const key = `${policy.id}\0${usage.file}\0${usage.source}\0${usage.location.line}\0${usage.location.column}\0${importedIdentity}`;
|
|
6767
6777
|
if (seen.has(key)) continue;
|
|
6768
6778
|
seen.add(key);
|
|
6779
|
+
const identityKey = `${usage.file}\0${usage.source}\0${policy.to}\0${importedIdentity}`;
|
|
6780
|
+
const occurrence = occurrences.get(identityKey) ?? 0;
|
|
6781
|
+
occurrences.set(identityKey, occurrence + 1);
|
|
6769
6782
|
findings.push(
|
|
6770
6783
|
makeFinding({
|
|
6771
6784
|
ruleId: RULE_ID8,
|
|
@@ -6775,6 +6788,15 @@ function ruleJsxPreferredImportPath(ix) {
|
|
|
6775
6788
|
location: usage.location,
|
|
6776
6789
|
evidence: ix.evidence([usage.id, policy.id]),
|
|
6777
6790
|
fingerprintIdentity: {
|
|
6791
|
+
file: usage.file,
|
|
6792
|
+
from: usage.source,
|
|
6793
|
+
to: policy.to,
|
|
6794
|
+
imported: policy.imported,
|
|
6795
|
+
occurrence
|
|
6796
|
+
},
|
|
6797
|
+
// Grace window (baseline v1 → v2): the pre-migration hash keyed on
|
|
6798
|
+
// line/column. Drop with the v1 dual-match after one release.
|
|
6799
|
+
previousFingerprintIdentity: {
|
|
6778
6800
|
file: usage.file,
|
|
6779
6801
|
from: usage.source,
|
|
6780
6802
|
to: policy.to,
|