@verbaly/compiler 0.52.0 → 0.53.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 CHANGED
@@ -246,21 +246,23 @@ The package exports two layers, and **nothing else is public**. Anything you can
246
246
 
247
247
  `VerbalyConfig` · `ResolvedConfig` · `RenderConfig` · `RedirectConfig` · `BundleConfig` · `TranslateConfig` · `GlossaryEntry` · `TranslateProvider` · `TranslateRequest` · `TranslateResult` · `TranslateOptions` · `TranslateProgress` · `TranslateFailure`
248
248
 
249
- **Building an integration.** This is exactly what `@verbaly/vite`, `@verbaly/unplugin`, `@verbaly/next`, `@verbaly/astro`, `@verbaly/nuxt` and `@verbaly/mcp` consume, so a third one has everything they have:
249
+ **Building an integration.** This is exactly what `@verbaly/vite`, `@verbaly/unplugin`, `@verbaly/next`, `@verbaly/astro`, `@verbaly/nuxt`, `@verbaly/mcp` and `@verbaly/studio` consume, so a third one has everything they have:
250
250
 
251
251
  | Area | Exports |
252
252
  | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
253
- | Config & catalogs | `loadConfig` `resolveConfig` `loadCatalogs` `writeCatalog` `clientCatalogs` `needsIcu` `needsRelative` · types `Catalog` `Catalogs` |
253
+ | Setup | `init` · types `Host` `InitOptions` `InitResult` |
254
+ | Config & catalogs | `loadConfig` `resolveConfig` `targetLocales` `loadCatalogs` `readCatalog` `writeCatalog` `clientCatalogs` `needsIcu` `needsRelative` · types `Catalog` `Catalogs` |
254
255
  | Extraction | `extractProject` `collectOrigins` `syncCatalogs` `pruneCatalogs` `MessageRegistry` `stableKey` · type `SyncResult` |
255
- | Codegen | `generateDts` `writeDts` `generateRuntimeModule` `generateLocaleModule` · type `RuntimeModuleOptions` |
256
+ | Codegen | `generateDts` `writeDts` `generateRuntimeModule` `generateLocaleModule` · types `DtsOptions` `RuntimeModuleOptions` |
256
257
  | Bundler plumbing | `transformSource` `transformCode` `runBuildGate` `createSourceFilter` `isTransformTarget` `resolveVirtualId` `loadVirtualModule` `RESOLVED_VIRTUAL_ID` `LOCALE_MODULE_PREFIX` `SOURCE_FILE_RE` · types `PluginOptions` `TransformResult` |
257
- | The gate | `check` `formatCheckResult` `formatCheckWarnings` · types `CheckResult` `MissingEntry` `UnknownEntry` `BrokenEntry` `IssueSeverity` |
258
+ | The gate | `check` `validateMessage` `validatePair` `formatCheckResult` `formatCheckWarnings` · types `CheckResult` `MissingEntry` `UnknownEntry` `BrokenEntry` `StructureIssue` `IssueSeverity` |
258
259
  | Coverage | `status` `formatStatusResult` `counted` · types `StatusResult` `LocaleStatus` |
259
- | Draft review | `loadDrafts` `saveDrafts` `markDrafts` `effectiveDrafts` · type `Drafts` |
260
+ | Draft review | `loadDrafts` `saveDrafts` `markDrafts` `clearDrafts` `effectiveDrafts` `DRAFTS_FILE` · type `Drafts` |
260
261
  | Translation | `translateCatalogs` `resolveProvider` `formatTranslateFailures` |
261
262
  | Diagnosis | `doctor` `formatDoctorEntry` · types `DoctorResult` `DoctorEntry` |
262
- | Onboarding | `wrapProject` · types `WrapResult` `WrapEntry` `WrapSkip` `WrapOptions` |
263
- | Static rendering | `renderSite` `formatRenderWarnings` · types `RenderSiteOptions` `RenderSiteResult` |
263
+ | Onboarding | `wrapProject` · types `WrapResult` `WrapEntry` `WrapSkip` `WrapBlocked` `WrapOptions` |
264
+ | Static rendering | `renderSite` `formatRenderWarnings` · types `RenderSiteOptions` `RenderSiteResult` |
265
+ | Error output | `formatCliError` |
264
266
 
265
267
  A minimal plugin is `loadConfig` + `loadCatalogs` once, then `transformSource` per file and `runBuildGate` at the end:
266
268
 
package/dist/cli.js CHANGED
@@ -520,7 +520,7 @@ function validatePair(source, translated) {
520
520
  const newParams = surplus(paramNames(translated), paramNames(source));
521
521
  if (lostParams.length > 0) issues.push({
522
522
  severity: "error",
523
- message: `${list(lostParams.map((name) => `{${name}}`))} ${lostParams.length > 1 ? "are" : "is"} missing, so ${lostParams.length > 1 ? "their values" : "its value"} never reaches the text`
523
+ message: `${list(lostParams.map((name) => `{${name}}`))} ${lostParams.length > 1 ? "are" : "is"} missing, so ${lostParams.length > 1 ? "their values never reach" : "its value never reaches"} the text`
524
524
  });
525
525
  if (newParams.length > 0) issues.push({
526
526
  severity: "error",
@@ -1448,8 +1448,8 @@ async function extractProject(cfg) {
1448
1448
  for (const file of files) registry.update(file, analyzeFile(readFileSync(file, "utf8"), file));
1449
1449
  return registry;
1450
1450
  }
1451
- async function collectOrigins(cfg) {
1452
- const registry = await extractProject(cfg);
1451
+ async function collectOrigins(cfg, reuse) {
1452
+ const registry = reuse ?? await extractProject(cfg);
1453
1453
  const origins = {};
1454
1454
  for (const [key, files] of registry.origins()) origins[key] = files.map((file) => relative(cfg.root, file).replaceAll("\\", "/"));
1455
1455
  return origins;