@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
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Default string **`missing`** writes for keys that appear in code but are absent from the target locale JSON
3
+ * when **`config.missing.placeholder`** is omitted. Override in config for a custom sentinel (or empty string).
4
+ * A non-empty default is distinct from an intentional empty UI string so tooling can **`grep`** scaffolded keys.
5
+ */
6
+ declare const DEFAULT_MISSING_LEAF_PLACEHOLDER: "__I18NPRUNE_MISSING__";
7
+ /** Keep locale target suggestions helpful without turning typo warnings into noisy catalog dumps. */
8
+ declare const MAX_MISSING_TARGET_SUGGESTIONS = 3;
9
+
10
+ export { DEFAULT_MISSING_LEAF_PLACEHOLDER as D, MAX_MISSING_TARGET_SUGGESTIONS as M };
@@ -0,0 +1,85 @@
1
+ export { D as DEFAULT_MISSING_LEAF_PLACEHOLDER, M as MAX_MISSING_TARGET_SUGGESTIONS } from './missing-BVCvgUC8.js';
2
+ import { C as CoreContext } from './coreContext-DMaWLvmB.js';
3
+ import { M as MissingHostHooks, a as MissingPlaceholderLeaf, b as MissingTargetPlan, c as MissingRunOptions, d as MissingRunResult, e as MissingWriteInput, f as MissingSegmentWrite, R as ResolveMissingPathsPlanInput } from './index-CIzZl4W8.js';
4
+ export { g as MissingJsonOutput, h as MissingJsonTarget, i as MissingPlaceholderLeafList, j as MissingSkippedTarget, k as MissingTargetKind, l as MissingTargetState } from './index-CIzZl4W8.js';
5
+ import './root-2-kCaBvQ.js';
6
+ import 'zod';
7
+ import './path-Bfn3SAts.js';
8
+ import './fs-BUYD8ZhA.js';
9
+ import './providers-0uMEfT6q.js';
10
+ import './capabilities-x74cD2Hu.js';
11
+ import './adapters-gp1lXp0T.js';
12
+ import './index-X50E1FIX.js';
13
+ import './index-BgG01AKL.js';
14
+
15
+ declare function emitMissingTargetWriteIntro(host: Pick<MissingHostHooks, 'emit' | 'runId'>, entry: MissingTargetPlan): void;
16
+ declare function emitMissingTargetActionMessage(host: Pick<MissingHostHooks, 'emit' | 'runId'>, entry: MissingTargetPlan, action: 'would_add' | 'will_add' | 'added' | 'declined', placeholder?: string, preview?: {
17
+ fullList: boolean;
18
+ top?: number;
19
+ }): void;
20
+ declare function emitMissingPathsPreview(host: Pick<MissingHostHooks, 'emit' | 'runId'>, input: {
21
+ paths: readonly string[];
22
+ fullList: boolean;
23
+ top?: number;
24
+ }): void;
25
+ declare function emitMissingPlaceholderLeavesPreview(host: Pick<MissingHostHooks, 'emit' | 'runId'>, input: {
26
+ leaves: readonly MissingPlaceholderLeaf[];
27
+ fullList: boolean;
28
+ top?: number;
29
+ }): void;
30
+ /** Write missing paths using per-segment planning (multi-segment layouts). */
31
+ declare function writeMissingPaths(ctx: CoreContext, input: MissingWriteInput): void;
32
+ declare function runMissing(ctx: CoreContext, opts: MissingRunOptions, host: MissingHostHooks): MissingRunResult;
33
+
34
+ declare function applyMissingPaths(input: {
35
+ localeJson: unknown;
36
+ paths: readonly string[];
37
+ placeholder: string;
38
+ }): unknown;
39
+
40
+ /**
41
+ * Group missing key paths into per-segment writes for one locale code.
42
+ * Skips paths already present in the target segment file on disk.
43
+ */
44
+ declare function createMissingWritePlan(ctx: CoreContext, localeCode: string, paths: readonly string[]): MissingSegmentWrite[];
45
+ /** Apply placeholder leaves and write every segment in the plan. */
46
+ declare function writeMissingWritePlan(ctx: CoreContext, plan: readonly MissingSegmentWrite[], placeholder: string): {
47
+ filesWritten: number;
48
+ pathsWritten: number;
49
+ };
50
+
51
+ /** Max length for **`config.missing.placeholder`**; longer values fall back to the default with a warning. */
52
+ declare const MISSING_LEAF_PLACEHOLDER_MAX_LEN = 256;
53
+ /**
54
+ * Resolve the leaf placeholder used by **`missing`** (and tooling that must grep the same sentinel).
55
+ * Empty / whitespace-only / overlong / non-string values fall back to **`DEFAULT_MISSING_LEAF_PLACEHOLDER`**
56
+ * and return human-readable **`warnings`** for the host to log once.
57
+ */
58
+ declare function resolveMissingLeafPlaceholder(raw: unknown): {
59
+ placeholder: string;
60
+ warnings: string[];
61
+ };
62
+
63
+ /**
64
+ * Parse the `missing` string array from an already-loaded validate `--json` report object.
65
+ * @param sourceLabel - appended to errors (e.g. file path) for actionable CLI messages.
66
+ */
67
+ declare function parseMissingArrayFromValidateReportJson(raw: unknown, sourceLabel?: string): string[];
68
+ /**
69
+ * From paths listed in a validate report: which to insert vs skipped because not in current scan.
70
+ */
71
+ declare function planMissingPathsFromReport(reportPaths: string[], usedLiteralKeys: ReadonlySet<string>, existingLeafPaths: ReadonlySet<string>): {
72
+ toAdd: string[];
73
+ skippedNotInScan: string[];
74
+ };
75
+
76
+ /**
77
+ * Pure planner for `missing`: compute key paths to add into a target locale JSON.
78
+ * If `reportMissingPaths` is provided, keep only entries still present in current scan.
79
+ */
80
+ declare function resolveMissingPathsPlan(input: ResolveMissingPathsPlanInput): {
81
+ toAdd: string[];
82
+ skippedNotInScan: string[];
83
+ };
84
+
85
+ export { MISSING_LEAF_PLACEHOLDER_MAX_LEN, MissingHostHooks, MissingPlaceholderLeaf, MissingRunOptions, MissingRunResult, MissingSegmentWrite, MissingTargetPlan, MissingWriteInput, ResolveMissingPathsPlanInput, applyMissingPaths, createMissingWritePlan, emitMissingPathsPreview, emitMissingPlaceholderLeavesPreview, emitMissingTargetActionMessage, emitMissingTargetWriteIntro, parseMissingArrayFromValidateReportJson, planMissingPathsFromReport, resolveMissingLeafPlaceholder, resolveMissingPathsPlan, runMissing, writeMissingPaths, writeMissingWritePlan };