@verbaly/compiler 0.52.0 → 0.54.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/README.md +14 -10
- package/dist/cli.js +195 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +15 -2
- package/dist/index.js +700 -684
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import MagicString from "magic-string";
|
|
|
3
3
|
//#region src/catalog.d.ts
|
|
4
4
|
type Catalog = Record<string, string>;
|
|
5
5
|
type Catalogs = Record<string, Catalog>;
|
|
6
|
+
export declare function readCatalog(cfg: ResolvedConfig, locale: string): Catalog;
|
|
6
7
|
export declare function loadCatalogs(cfg: ResolvedConfig): Catalogs;
|
|
7
8
|
export declare function writeCatalog(cfg: ResolvedConfig, locale: string, catalog: Catalog): string;
|
|
8
9
|
export declare function needsIcu(catalogs: Catalogs): boolean;
|
|
@@ -113,6 +114,7 @@ interface ResolvedConfig {
|
|
|
113
114
|
bundle: BundleConfig;
|
|
114
115
|
}
|
|
115
116
|
export declare function resolveConfig(config?: VerbalyConfig): ResolvedConfig;
|
|
117
|
+
export declare function targetLocales(cfg: ResolvedConfig, override?: string[]): string[];
|
|
116
118
|
export declare function loadConfig(root: string, overrides?: VerbalyConfig): Promise<ResolvedConfig>;
|
|
117
119
|
//#endregion
|
|
118
120
|
//#region src/analyze.d.ts
|
|
@@ -176,7 +178,7 @@ export declare function clientCatalogs(cfg: ResolvedConfig, catalogs: Catalogs):
|
|
|
176
178
|
//#endregion
|
|
177
179
|
//#region src/extract.d.ts
|
|
178
180
|
export declare function extractProject(cfg: ResolvedConfig): Promise<MessageRegistry>;
|
|
179
|
-
export declare function collectOrigins(cfg: ResolvedConfig): Promise<Record<string, string[]>>;
|
|
181
|
+
export declare function collectOrigins(cfg: ResolvedConfig, reuse?: MessageRegistry): Promise<Record<string, string[]>>;
|
|
180
182
|
interface SyncResult {
|
|
181
183
|
added: Record<string, string[]>;
|
|
182
184
|
}
|
|
@@ -228,6 +230,12 @@ export declare function runBuildGate(cfg: ResolvedConfig, registry: MessageRegis
|
|
|
228
230
|
//#endregion
|
|
229
231
|
//#region src/validate.d.ts
|
|
230
232
|
type IssueSeverity = 'error' | 'warning';
|
|
233
|
+
interface StructureIssue {
|
|
234
|
+
severity: IssueSeverity;
|
|
235
|
+
message: string;
|
|
236
|
+
}
|
|
237
|
+
export declare function validateMessage(message: string, locale?: string): StructureIssue[];
|
|
238
|
+
export declare function validatePair(source: string, translated: string): StructureIssue[];
|
|
231
239
|
//#endregion
|
|
232
240
|
//#region src/check.d.ts
|
|
233
241
|
interface MissingEntry {
|
|
@@ -256,10 +264,12 @@ export declare function formatCheckResult(result: CheckResult, root?: string): s
|
|
|
256
264
|
export declare function formatCheckWarnings(result: CheckResult): string;
|
|
257
265
|
//#endregion
|
|
258
266
|
//#region src/drafts.d.ts
|
|
267
|
+
export declare const DRAFTS_FILE = ".verbaly-drafts.json";
|
|
259
268
|
type Drafts = Record<string, string[]>;
|
|
260
269
|
export declare function loadDrafts(cfg: ResolvedConfig): Drafts;
|
|
261
270
|
export declare function saveDrafts(cfg: ResolvedConfig, drafts: Drafts): void;
|
|
262
271
|
export declare function markDrafts(drafts: Drafts, locale: string, keys: string[]): void;
|
|
272
|
+
export declare function clearDrafts(drafts: Drafts, locale: string, keys?: string[]): void;
|
|
263
273
|
export declare function effectiveDrafts(drafts: Drafts, catalogs: Catalogs): Drafts;
|
|
264
274
|
//#endregion
|
|
265
275
|
//#region src/status.d.ts
|
|
@@ -281,6 +291,9 @@ export declare function formatStatusResult(result: StatusResult): string;
|
|
|
281
291
|
//#region src/text.d.ts
|
|
282
292
|
export declare function counted(count: number, noun: string, many?: string): string;
|
|
283
293
|
//#endregion
|
|
294
|
+
//#region src/run.d.ts
|
|
295
|
+
export declare function formatCliError(error: unknown): string;
|
|
296
|
+
//#endregion
|
|
284
297
|
//#region src/doctor.d.ts
|
|
285
298
|
interface DoctorEntry {
|
|
286
299
|
level: 'ok' | 'warn' | 'error';
|
|
@@ -367,5 +380,5 @@ interface RenderSiteResult {
|
|
|
367
380
|
export declare function renderSite(cfg: ResolvedConfig, options?: RenderSiteOptions): Promise<RenderSiteResult>;
|
|
368
381
|
export declare function formatRenderWarnings(result: RenderSiteResult, sourceLocale: string): string[];
|
|
369
382
|
//#endregion
|
|
370
|
-
export type { BrokenEntry, BundleConfig, Catalog, Catalogs, CheckResult, DoctorEntry, DoctorResult, Drafts, DtsOptions, GlossaryEntry, Host, InitOptions, InitResult, IssueSeverity, LocaleStatus, MissingEntry, PluginOptions, RedirectConfig, RenderConfig, RenderSiteOptions, RenderSiteResult, ResolvedConfig, RuntimeModuleOptions, StatusResult, SyncResult, TransformResult, TranslateConfig, TranslateFailure, TranslateOptions, TranslateProgress, TranslateProvider, TranslateRequest, TranslateResult, UnknownEntry, VerbalyConfig, WrapBlocked, WrapEntry, WrapOptions, WrapResult, WrapSkip };
|
|
383
|
+
export type { BrokenEntry, BundleConfig, Catalog, Catalogs, CheckResult, DoctorEntry, DoctorResult, Drafts, DtsOptions, GlossaryEntry, Host, InitOptions, InitResult, IssueSeverity, LocaleStatus, MissingEntry, PluginOptions, RedirectConfig, RenderConfig, RenderSiteOptions, RenderSiteResult, ResolvedConfig, RuntimeModuleOptions, StatusResult, StructureIssue, SyncResult, TransformResult, TranslateConfig, TranslateFailure, TranslateOptions, TranslateProgress, TranslateProvider, TranslateRequest, TranslateResult, UnknownEntry, VerbalyConfig, WrapBlocked, WrapEntry, WrapOptions, WrapResult, WrapSkip };
|
|
371
384
|
//# sourceMappingURL=index.d.ts.map
|