@i18nprune/core 0.1.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.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +165 -0
  3. package/dist/adapters-gp1lXp0T.d.ts +12 -0
  4. package/dist/capabilities-x74cD2Hu.d.ts +48 -0
  5. package/dist/cleanup.d.ts +64 -0
  6. package/dist/cleanup.js +3999 -0
  7. package/dist/config.d.ts +201 -0
  8. package/dist/config.js +2865 -0
  9. package/dist/coreContext-DMaWLvmB.d.ts +388 -0
  10. package/dist/fs-BUYD8ZhA.d.ts +20 -0
  11. package/dist/generate.d.ts +487 -0
  12. package/dist/generate.js +9389 -0
  13. package/dist/humanEmit-ygNlYX-S.d.ts +79 -0
  14. package/dist/index-BQuLEQ9b.d.ts +7 -0
  15. package/dist/index-B_ow_Xvr.d.ts +97 -0
  16. package/dist/index-BgG01AKL.d.ts +287 -0
  17. package/dist/index-CIzZl4W8.d.ts +124 -0
  18. package/dist/index-Csm1w7XD.d.ts +58 -0
  19. package/dist/index-DLwTogCo.d.ts +43 -0
  20. package/dist/index-DVT26v11.d.ts +61 -0
  21. package/dist/index-DdjljwMj.d.ts +39 -0
  22. package/dist/index-DeIw-cZd.d.ts +52 -0
  23. package/dist/index-X50E1FIX.d.ts +50 -0
  24. package/dist/index.d.ts +9180 -0
  25. package/dist/index.js +21888 -0
  26. package/dist/init.d.ts +86 -0
  27. package/dist/init.js +848 -0
  28. package/dist/listWindow-XEFxQZi1.d.ts +30 -0
  29. package/dist/localeTargetCodes-BBIQjauw.d.ts +11 -0
  30. package/dist/locales.d.ts +39 -0
  31. package/dist/locales.js +2288 -0
  32. package/dist/missing-BVCvgUC8.d.ts +10 -0
  33. package/dist/missing.d.ts +85 -0
  34. package/dist/missing.js +5892 -0
  35. package/dist/modeResolve-cGVaY5Hh.d.ts +25 -0
  36. package/dist/path-Bfn3SAts.d.ts +11 -0
  37. package/dist/profile-BwOP9WKh.d.ts +9 -0
  38. package/dist/providers-0uMEfT6q.d.ts +82 -0
  39. package/dist/prune-c6hKZCv_.d.ts +33 -0
  40. package/dist/quality.d.ts +36 -0
  41. package/dist/quality.js +3868 -0
  42. package/dist/report-D5-6bVFj.d.ts +8 -0
  43. package/dist/report-schema.d.ts +102 -0
  44. package/dist/report-schema.js +42 -0
  45. package/dist/resumeCandidates-xR13eEwt.d.ts +200 -0
  46. package/dist/root-2-kCaBvQ.d.ts +1110 -0
  47. package/dist/runtime/edge.d.ts +21 -0
  48. package/dist/runtime/edge.js +87 -0
  49. package/dist/runtime/helpers/sync.d.ts +16 -0
  50. package/dist/runtime/helpers/sync.js +117 -0
  51. package/dist/runtime/node.d.ts +24 -0
  52. package/dist/runtime/node.js +204 -0
  53. package/dist/runtime/web.d.ts +21 -0
  54. package/dist/runtime/web.js +84 -0
  55. package/dist/shared.d.ts +1177 -0
  56. package/dist/shared.js +4897 -0
  57. package/dist/sourceContext-1LQg3HiQ.d.ts +36 -0
  58. package/dist/sourceSurface-mDtwGo1E.d.ts +122 -0
  59. package/dist/sync.d.ts +86 -0
  60. package/dist/sync.js +4971 -0
  61. package/dist/syncSegment-Bx6He2Mu.d.ts +149 -0
  62. package/dist/targets-EmtKyr6F.d.ts +23 -0
  63. package/dist/template-CGM-_WLT.d.ts +139 -0
  64. package/dist/translate-CIHYp7wi.d.ts +77 -0
  65. package/dist/types/shared.d.ts +21 -0
  66. package/dist/types/shared.js +1 -0
  67. package/dist/types.d.ts +1345 -0
  68. package/dist/types.js +1 -0
  69. package/dist/validate.d.ts +126 -0
  70. package/dist/validate.js +3717 -0
  71. package/package.json +128 -0
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,126 @@
1
+ import { T as TranslationSurfaceLeaf, C as CoreContext } from './coreContext-DMaWLvmB.js';
2
+ import { D as DynamicKeySite } from './index-DdjljwMj.js';
3
+ import { K as KeyObservation } from './index-Csm1w7XD.js';
4
+ import { I as Issue } from './index-X50E1FIX.js';
5
+ import { R as RunEmitter } from './index-BgG01AKL.js';
6
+ import './root-2-kCaBvQ.js';
7
+ import 'zod';
8
+ import './path-Bfn3SAts.js';
9
+ import './fs-BUYD8ZhA.js';
10
+ import './providers-0uMEfT6q.js';
11
+ import './capabilities-x74cD2Hu.js';
12
+ import './adapters-gp1lXp0T.js';
13
+
14
+ /** Stable composite key for a locale leaf (`segmentRelativePath` + logical path). */
15
+ declare function encodeLocaleLeafIdentity(segmentRelativePath: string, logicalPath: string): string;
16
+ /** Logical paths present in at least one source segment (code keys are logical-path only). */
17
+ declare function logicalPathsFromSourceLeaves(leaves: ReadonlyArray<Pick<TranslationSurfaceLeaf, 'path'>>): Set<string>;
18
+ /**
19
+ * Literal keys in `resolvedKeys` with no matching logical path in `sourceLeaves`.
20
+ * Uses {@link logicalPathsFromSourceLeaves} (union across segments).
21
+ */
22
+ declare function computeMissingLiteralKeysFromLeaves(sourceLeaves: ReadonlyArray<Pick<TranslationSurfaceLeaf, 'path'>>, resolvedKeys: ReadonlySet<string>): string[];
23
+ /**
24
+ * Literal keys present in `resolvedKeys` but missing as string leaves in `localeJson`.
25
+ * Prefer {@link computeMissingLiteralKeysFromLeaves} when layout may span multiple source segments.
26
+ */
27
+ declare function computeMissingLiteralKeysFromResolvedKeys(localeJson: unknown, resolvedKeys: ReadonlySet<string>): string[];
28
+ /** Sort dotted paths shallow-first, then lexicographically (stable for CLI output). */
29
+ declare function compareDottedPathDepth(a: string, b: string): number;
30
+
31
+ /**
32
+ * JSON `data` payload for `validate` (same field meanings as CLI `ValidateJsonOutput`).
33
+ */
34
+ type ValidateScanPayload = {
35
+ missing: string[];
36
+ count: number;
37
+ dynamic: {
38
+ count: number;
39
+ };
40
+ keyObservations: {
41
+ count: number;
42
+ };
43
+ };
44
+ /**
45
+ * Build validate result data from scan outputs (pure — no filesystem).
46
+ */
47
+ declare function buildValidateScanPayload(input: {
48
+ sourceLocaleJson?: unknown;
49
+ /** Preferred for multi-segment layouts — merged source leaves across all segments. */
50
+ sourceLocaleLeaves?: ReadonlyArray<Pick<TranslationSurfaceLeaf, 'path'>>;
51
+ resolvedKeys: ReadonlySet<string>;
52
+ keyObservations: KeyObservation[];
53
+ dynamicSites: DynamicKeySite[];
54
+ }): ValidateScanPayload;
55
+
56
+ /** Build structured `issues[]` for validate envelopes from scan results. */
57
+ declare function buildValidateIssues(params: {
58
+ missingCount: number;
59
+ dynamicSiteCount: number;
60
+ sourceLocalePath?: string;
61
+ }): Issue[];
62
+
63
+ type BuildValidateHumanViewInput = {
64
+ missing: string[];
65
+ dynamicSites: DynamicKeySite[];
66
+ dynamicPreviewLimit?: number;
67
+ missingPreviewLimit?: number;
68
+ };
69
+ type ValidateHumanView = {
70
+ dynamicWarning?: string;
71
+ dynamicPreview: string[];
72
+ dynamicHiddenCount: number;
73
+ missingMessage: string;
74
+ missingPreview: string[];
75
+ missingHiddenCount: number;
76
+ };
77
+ /** Pure human-log view builder for validate command output. */
78
+ declare function buildValidateHumanView(input: BuildValidateHumanViewInput): ValidateHumanView;
79
+
80
+ type BuildValidateReportViewInput = {
81
+ missing: string[];
82
+ dynamicSites: DynamicKeySite[];
83
+ keyObservations: KeyObservation[];
84
+ listLimit: number;
85
+ };
86
+ type ValidateReportView = {
87
+ missingMessage: string;
88
+ dynamicMessage?: string;
89
+ keyObservationsMessage: string;
90
+ missingPreview: string[];
91
+ dynamicPreview: DynamicKeySite[];
92
+ keyObservationsPreview: KeyObservation[];
93
+ };
94
+ /** Pure report-view shaper for validate command summaries/previews. */
95
+ declare function buildValidateReportView(input: BuildValidateReportViewInput): ValidateReportView;
96
+
97
+ /** JSON `data` for `validate` (same fields as CLI `ValidateJsonOutput` / {@link ValidateScanPayload}). */
98
+ type ValidateJsonPayload = {
99
+ missing: string[];
100
+ count: number;
101
+ dynamic: {
102
+ count: number;
103
+ };
104
+ keyObservations: {
105
+ count: number;
106
+ };
107
+ };
108
+ type ValidateRunOptions = Record<string, never>;
109
+ type ValidateHostHooks = {
110
+ emit?: RunEmitter;
111
+ runId?: string;
112
+ };
113
+ type ValidateRunResult = {
114
+ payload: ValidateJsonPayload;
115
+ issues: Issue[];
116
+ fullDynamicSites: DynamicKeySite[];
117
+ fullKeyObservations: KeyObservation[];
118
+ };
119
+
120
+ /**
121
+ * Compare resolved literal keys from project analysis to string leaves in the source locale JSON.
122
+ * Uses {@link resolveProjectAnalysis} so caching matches other project ops (`quality`, `review`, …).
123
+ */
124
+ declare function runValidate(ctx: CoreContext, _opts: ValidateRunOptions, host: ValidateHostHooks): ValidateRunResult;
125
+
126
+ export { type BuildValidateHumanViewInput, type BuildValidateReportViewInput, type ValidateHostHooks, type ValidateHumanView, type ValidateJsonPayload, type ValidateReportView, type ValidateRunOptions, type ValidateRunResult, type ValidateScanPayload, buildValidateHumanView, buildValidateIssues, buildValidateReportView, buildValidateScanPayload, compareDottedPathDepth, computeMissingLiteralKeysFromLeaves, computeMissingLiteralKeysFromResolvedKeys, encodeLocaleLeafIdentity, logicalPathsFromSourceLeaves, runValidate };