@verbaly/vite 0.80.0 → 0.82.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 (2) hide show
  1. package/dist/index.js +2 -21
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { APP_ID, LOCALE_IMPORT, LOCALE_MODULE_PREFIX, MessageRegistry, RESOLVED_VIRTUAL_ID, SOURCE_FILE_RE, createDevReporter, createSourceFilter, extractProject, formatCliError, isTransformTarget, loadCatalogs, loadConfig, loadVirtualModule, outdatedTranslations, reportOutsideInclude, resolveVirtualId, runBuildGate, shippedCatalogs, syncCatalogs, syncProject, transformSource, writeBuildTypes, writeDts } from "@verbaly/compiler";
1
+ import { APP_ID, LOCALE_IMPORT, LOCALE_MODULE_PREFIX, MessageRegistry, RESOLVED_VIRTUAL_ID, SOURCE_FILE_RE, createDevReporter, createSourceFilter, extractProject, formatCliError, isTransformTarget, loadCatalogs, loadConfig, loadVirtualModule, reportOutsideInclude, resolveVirtualId, runBuildGate, shippedCatalogs, syncCatalogs, syncProject, transformSource, writeBuildTypes, writeDts } from "@verbaly/compiler";
2
2
  import { readFileSync } from "node:fs";
3
3
  // src/index.ts
4
4
  function safeRead(file) {
@@ -19,7 +19,6 @@ function verbaly(options = {}) {
19
19
  let writeTimer;
20
20
  let included;
21
21
  let reporter;
22
- let stateBroken = false;
23
22
  let scan;
24
23
  let writing = Promise.resolve();
25
24
  let registry = new MessageRegistry();
@@ -38,25 +37,7 @@ function verbaly(options = {}) {
38
37
  }
39
38
  function report(result, catalogEdit) {
40
39
  reporter ??= createDevReporter(cfg.root);
41
- const replaced = [];
42
- const code = [];
43
- const lock = [];
44
- for (const finding of result.findings) if (finding.kind === "collision" || finding.kind === "renamed") code.push(finding);
45
- else if (finding.kind === "lock") lock.push(finding);
46
- else if (finding.kind === "replaced" && catalogEdit) replaced.push({
47
- ...finding,
48
- edited: true
49
- });
50
- reporter.report("replaced", replaced);
51
- reporter.report("code", code);
52
- reporter.report("lock", lock);
53
- const outdated = result.state ? outdatedTranslations(cfg, result.catalogs, result.state.fingerprints) : [];
54
- reporter.report("outdated", outdated.map((entry) => ({
55
- kind: "outdated",
56
- ...entry
57
- })));
58
- if (result.stateProblem && !stateBroken) console.warn(`[verbaly] ${result.stateProblem}, so drafts are not tracked`);
59
- stateBroken = Boolean(result.stateProblem);
40
+ reporter.sync(cfg, result, () => catalogEdit ? true : void 0);
60
41
  }
61
42
  async function writeBack(catalogEdit) {
62
43
  if (catalogEdit) cfg = await loadConfig(cfg.root, options, { plugin: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verbaly/vite",
3
- "version": "0.80.0",
3
+ "version": "0.82.0",
4
4
  "description": "Zero-config Vite plugin for Verbaly: extraction, codegen and HMR.",
5
5
  "keywords": [
6
6
  "i18n",
@@ -42,15 +42,15 @@
42
42
  "access": "public"
43
43
  },
44
44
  "dependencies": {
45
- "@verbaly/compiler": "0.80.0"
45
+ "@verbaly/compiler": "0.82.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "verbaly": "^0.80.0",
48
+ "verbaly": "^0.82.0",
49
49
  "vite": "^7.0.0 || ^8.0.0"
50
50
  },
51
51
  "devDependencies": {
52
- "verbaly": "^0.80.0",
53
- "vite": "^8.3.6"
52
+ "verbaly": "^0.82.0",
53
+ "vite": "^8.3.7"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "tsdown",