@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.
- package/LICENSE +21 -0
- package/README.md +165 -0
- package/dist/adapters-gp1lXp0T.d.ts +12 -0
- package/dist/capabilities-x74cD2Hu.d.ts +48 -0
- package/dist/cleanup.d.ts +64 -0
- package/dist/cleanup.js +3999 -0
- package/dist/config.d.ts +201 -0
- package/dist/config.js +2865 -0
- package/dist/coreContext-DMaWLvmB.d.ts +388 -0
- package/dist/fs-BUYD8ZhA.d.ts +20 -0
- package/dist/generate.d.ts +487 -0
- package/dist/generate.js +9389 -0
- package/dist/humanEmit-ygNlYX-S.d.ts +79 -0
- package/dist/index-BQuLEQ9b.d.ts +7 -0
- package/dist/index-B_ow_Xvr.d.ts +97 -0
- package/dist/index-BgG01AKL.d.ts +287 -0
- package/dist/index-CIzZl4W8.d.ts +124 -0
- package/dist/index-Csm1w7XD.d.ts +58 -0
- package/dist/index-DLwTogCo.d.ts +43 -0
- package/dist/index-DVT26v11.d.ts +61 -0
- package/dist/index-DdjljwMj.d.ts +39 -0
- package/dist/index-DeIw-cZd.d.ts +52 -0
- package/dist/index-X50E1FIX.d.ts +50 -0
- package/dist/index.d.ts +9180 -0
- package/dist/index.js +21888 -0
- package/dist/init.d.ts +86 -0
- package/dist/init.js +848 -0
- package/dist/listWindow-XEFxQZi1.d.ts +30 -0
- package/dist/localeTargetCodes-BBIQjauw.d.ts +11 -0
- package/dist/locales.d.ts +39 -0
- package/dist/locales.js +2288 -0
- package/dist/missing-BVCvgUC8.d.ts +10 -0
- package/dist/missing.d.ts +85 -0
- package/dist/missing.js +5892 -0
- package/dist/modeResolve-cGVaY5Hh.d.ts +25 -0
- package/dist/path-Bfn3SAts.d.ts +11 -0
- package/dist/profile-BwOP9WKh.d.ts +9 -0
- package/dist/providers-0uMEfT6q.d.ts +82 -0
- package/dist/prune-c6hKZCv_.d.ts +33 -0
- package/dist/quality.d.ts +36 -0
- package/dist/quality.js +3868 -0
- package/dist/report-D5-6bVFj.d.ts +8 -0
- package/dist/report-schema.d.ts +102 -0
- package/dist/report-schema.js +42 -0
- package/dist/resumeCandidates-xR13eEwt.d.ts +200 -0
- package/dist/root-2-kCaBvQ.d.ts +1110 -0
- package/dist/runtime/edge.d.ts +21 -0
- package/dist/runtime/edge.js +87 -0
- package/dist/runtime/helpers/sync.d.ts +16 -0
- package/dist/runtime/helpers/sync.js +117 -0
- package/dist/runtime/node.d.ts +24 -0
- package/dist/runtime/node.js +204 -0
- package/dist/runtime/web.d.ts +21 -0
- package/dist/runtime/web.js +84 -0
- package/dist/shared.d.ts +1177 -0
- package/dist/shared.js +4897 -0
- package/dist/sourceContext-1LQg3HiQ.d.ts +36 -0
- package/dist/sourceSurface-mDtwGo1E.d.ts +122 -0
- package/dist/sync.d.ts +86 -0
- package/dist/sync.js +4971 -0
- package/dist/syncSegment-Bx6He2Mu.d.ts +149 -0
- package/dist/targets-EmtKyr6F.d.ts +23 -0
- package/dist/template-CGM-_WLT.d.ts +139 -0
- package/dist/translate-CIHYp7wi.d.ts +77 -0
- package/dist/types/shared.d.ts +21 -0
- package/dist/types/shared.js +1 -0
- package/dist/types.d.ts +1345 -0
- package/dist/types.js +1 -0
- package/dist/validate.d.ts +126 -0
- package/dist/validate.js +3717 -0
- package/package.json +128 -0
package/dist/init.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { B as BuildInitConfigTemplateOptions, I as InitConfigFormat, R as RunInitHostInput, a as InitRunOptions, b as InitRunResult, c as InitPackageJsonSignals, d as InitFilesystemHost, e as InitTopologySignals, f as InitLocaleLayoutHint, g as InitPresetScore, h as InitPresetId, i as InitProjectSignals, j as InitDetectResult, k as InitPresetConfigFields } from './template-CGM-_WLT.js';
|
|
2
|
+
export { l as InitJsonPayload, m as InitScoreFactor } from './template-CGM-_WLT.js';
|
|
3
|
+
import './index-X50E1FIX.js';
|
|
4
|
+
import './fs-BUYD8ZhA.js';
|
|
5
|
+
import './path-Bfn3SAts.js';
|
|
6
|
+
|
|
7
|
+
/** Default import for **`defineConfig`** + **`I18nPruneConfig`** from core config surface. */
|
|
8
|
+
declare const DEFAULT_INIT_CONFIG_IMPORT_SPECIFIER = "i18nprune/core/config";
|
|
9
|
+
/** Starter config template used by \`init\` when writing a new config file. */
|
|
10
|
+
declare function buildInitConfigTemplate(importSpecifierOrOpts?: string | BuildInitConfigTemplateOptions): string;
|
|
11
|
+
declare function configFileNameForFormat(baseName: string, format: InitConfigFormat): string;
|
|
12
|
+
declare function defaultInitConfigFileName(baseName: string): string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Plan an **`init`** config scaffold from optional **`--auto`** / **`--preset`** inputs.
|
|
16
|
+
*
|
|
17
|
+
* @param host - Filesystem + path ports and **`projectRoot`** (absolute).
|
|
18
|
+
* @param opts - **`auto`**, **`preset`**, **`rich`**, and optional **`importSpecifier`**.
|
|
19
|
+
* @returns JSON payload for hosts, diagnostic **`issues`**, and an **`exitCode`** (`1` when auto-selection is blocked).
|
|
20
|
+
*
|
|
21
|
+
* @remarks **Pure** aside from host port reads — never writes files. Hosts own **`console.*`** and disk writes.
|
|
22
|
+
*/
|
|
23
|
+
declare function runInit(host: RunInitHostInput, opts?: InitRunOptions): InitRunResult;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Read **`package.json`** at **`projectRoot`** and return dependency maps.
|
|
27
|
+
*
|
|
28
|
+
* @returns **`null`** when the file is missing or JSON is invalid.
|
|
29
|
+
*/
|
|
30
|
+
declare function readInitPackageJson(host: InitFilesystemHost, projectRoot: string): InitPackageJsonSignals | null;
|
|
31
|
+
/** Whether **`name`** appears in **`dependencies`** or **`devDependencies`**. */
|
|
32
|
+
declare function initPackageDeclares(pkg: InitPackageJsonSignals | null, name: string): boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Collect lightweight directory / framework markers under **`projectRoot`**.
|
|
36
|
+
*
|
|
37
|
+
* @remarks Uses **`fs.exists`** / **`statKind`** only — no locale JSON parsing.
|
|
38
|
+
*/
|
|
39
|
+
declare function readInitTopologySignals(host: InitFilesystemHost, projectRoot: string): InitTopologySignals;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Infer `locales.mode` / `locales.structure` from on-disk JSON under **`localesDirectory`** (project-relative).
|
|
43
|
+
*
|
|
44
|
+
* @returns A hint only when every discovered segment agrees on one structure; otherwise `null`.
|
|
45
|
+
*/
|
|
46
|
+
declare function detectLocaleFilesystemLayout(host: InitFilesystemHost, projectRoot: string, localesDirectory: string): InitLocaleLayoutHint | null;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Score curated presets from **`InitProjectSignals`** using weighted, explainable factors.
|
|
50
|
+
*
|
|
51
|
+
* @remarks Pure — deterministic; callers handle ambiguity / host UX.
|
|
52
|
+
*/
|
|
53
|
+
declare function scoreInitPresets(signals: InitProjectSignals): InitPresetScore[];
|
|
54
|
+
/** Top preset id after **`scoreInitPresets`** (array sorted descending by score). */
|
|
55
|
+
declare function pickTopInitPreset(scores: InitPresetScore[]): InitPresetId;
|
|
56
|
+
/**
|
|
57
|
+
* Whether auto-selection should refuse to pick a single preset without host confirmation.
|
|
58
|
+
*
|
|
59
|
+
* @param scores — sorted descending (as returned by **`scoreInitPresets`**).
|
|
60
|
+
*/
|
|
61
|
+
declare function isInitAutoAmbiguous(scores: InitPresetScore[]): boolean;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Scan **`projectRoot`** for **`package.json`** markers and locale-directory topology, then score presets.
|
|
65
|
+
*
|
|
66
|
+
* @param host - Filesystem + path ports (**synchronous** ports required).
|
|
67
|
+
* @param projectRoot - Absolute project directory.
|
|
68
|
+
* @returns Structured signals plus preset scores (descending by **`score`**).
|
|
69
|
+
*
|
|
70
|
+
* @remarks No **`console.*`**, no **`process.*`** — uses host ports only.
|
|
71
|
+
*/
|
|
72
|
+
declare function detectInitProject(host: InitFilesystemHost, projectRoot: string): InitDetectResult;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Every shipped starter preset id (for validation, scoring order, and CLI prompts).
|
|
76
|
+
*
|
|
77
|
+
* @remarks **`generic` first** (neutral default); remaining ids are alphabetical for stable UX.
|
|
78
|
+
*/
|
|
79
|
+
declare const INIT_PRESET_IDS: readonly InitPresetId[];
|
|
80
|
+
declare function isInitPresetId(value: string): value is InitPresetId;
|
|
81
|
+
/** Comma-separated preset ids for machine / human hints (stable order). */
|
|
82
|
+
declare function formatInitPresetIdList(): string;
|
|
83
|
+
/** Resolved starter fields for **`buildInitConfigTemplate`**. */
|
|
84
|
+
declare function getInitPresetConfigFields(preset: InitPresetId): InitPresetConfigFields;
|
|
85
|
+
|
|
86
|
+
export { BuildInitConfigTemplateOptions, DEFAULT_INIT_CONFIG_IMPORT_SPECIFIER, INIT_PRESET_IDS, InitConfigFormat, InitDetectResult, InitFilesystemHost, InitLocaleLayoutHint, InitPackageJsonSignals, InitPresetConfigFields, InitPresetId, InitPresetScore, InitProjectSignals, InitRunOptions, InitRunResult, InitTopologySignals, RunInitHostInput, buildInitConfigTemplate, configFileNameForFormat, defaultInitConfigFileName, detectInitProject, detectLocaleFilesystemLayout, formatInitPresetIdList, getInitPresetConfigFields, initPackageDeclares, isInitAutoAmbiguous, isInitPresetId, pickTopInitPreset, readInitPackageJson, readInitTopologySignals, runInit, scoreInitPresets };
|