@verbaly/vite 0.76.0 → 0.77.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
@@ -40,7 +40,7 @@ export default { sourceLocale: 'en', locales: ['en', 'es', 'pt'] };
40
40
  import { t, setLocale } from 'virtual:verbaly';
41
41
  ```
42
42
 
43
- - **Live extraction** with debounced catalog writes + HMR, from `.js/.ts/.jsx/.tsx` and `.svelte`/`.vue` files (script and markup). Every write starts from the files on disk, so a checkout or an `extract` run in another terminal is never undone with an older text, and a catalog saved half-typed is reported in one line while the server keeps running. The terminal says what `next dev` says, once each: a hand edit of a text your code owns, a key with two texts, a `t` under another name, a translation older than its source.
43
+ - **Live extraction** with debounced catalog writes + HMR, from `.js/.ts/.jsx/.tsx` and `.svelte`/`.vue` files (script and markup). Every write starts from the files on disk, so a checkout or an `extract` run in another terminal is never undone with an older text, and a catalog saved half-typed is reported in one line while the server keeps running. The terminal says what `next dev` says, once each: a hand edit of a text your code owns, a key with two texts, a `t` under another name, a translation older than its source. To keep the dev server from writing your translation files, pass `liveExtraction: false`: new texts still render from memory, as in a build, and `npx verbaly extract` writes them when you choose.
44
44
  - **Typed keys**: the types go to `src/verbaly.d.ts` (the root when there is no `src/`), the folder the Vite and SvelteKit templates' `tsconfig` includes, so `tsc -b` sees them with nothing to configure. `npx verbaly typegen` writes them on a fresh clone.
45
45
  - **Per-locale code-splitting**: `setLocale` lazy-loads only what's used.
46
46
  - **Build report**: every `vite build` says what `verbaly check` would fail on (broken translations first, then missing ones and keys no catalog has) and goes on, since a text never stops a deploy; `verbaly check` is the gate for CI. `failOnMissing: true` stops the build instead.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { PluginOptions, VerbalyConfig } from "@verbaly/compiler";
2
2
  import { Plugin } from "vite";
3
- //#region src/index.d.ts
4
3
  export type ViteVerbalyOptions = PluginOptions;
5
4
  export default function verbaly(options?: ViteVerbalyOptions): Plugin;
6
- //#endregion
7
5
  export type { VerbalyConfig };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { LOCALE_MODULE_PREFIX, MessageRegistry, RESOLVED_VIRTUAL_ID, SOURCE_FILE_RE, createDevReporter, createSourceFilter, extractProject, formatCliError, isTransformTarget, loadCatalogs, loadConfig, loadVirtualModule, outdatedTranslations, reportOutsideInclude, resolveVirtualId, runBuildGate, syncCatalogs, syncProject, transformSource, writeDts } from "@verbaly/compiler";
2
2
  import { readFileSync } from "node:fs";
3
- //#region src/index.ts
3
+ // src/index.ts
4
4
  function safeRead(file) {
5
5
  try {
6
6
  return readFileSync(file, "utf8");
@@ -64,9 +64,11 @@ function verbaly(options = {}) {
64
64
  registry,
65
65
  catalogs: loadCatalogs(cfg),
66
66
  confirm: true,
67
- write: "changed"
67
+ write: "changed",
68
+ dryRun: options.liveExtraction === false
68
69
  });
69
70
  catalogs = result.catalogs;
71
+ if (options.liveExtraction === false) flushDts();
70
72
  for (const [locale, serialized] of Object.entries(result.written)) selfWrites.set(locale, serialized);
71
73
  report(result, catalogEdit);
72
74
  invalidateVirtual();
@@ -157,5 +159,4 @@ function verbaly(options = {}) {
157
159
  }
158
160
  };
159
161
  }
160
- //#endregion
161
162
  export { verbaly as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verbaly/vite",
3
- "version": "0.76.0",
3
+ "version": "0.77.0",
4
4
  "description": "Zero-config Vite plugin for Verbaly: extraction, codegen and HMR.",
5
5
  "keywords": [
6
6
  "i18n",
@@ -18,6 +18,10 @@
18
18
  "bugs": {
19
19
  "url": "https://github.com/AronSoto/verbaly/issues"
20
20
  },
21
+ "funding": {
22
+ "type": "github",
23
+ "url": "https://github.com/sponsors/AronSoto"
24
+ },
21
25
  "type": "module",
22
26
  "types": "./dist/index.d.ts",
23
27
  "exports": {
@@ -38,14 +42,14 @@
38
42
  "access": "public"
39
43
  },
40
44
  "dependencies": {
41
- "@verbaly/compiler": "0.76.0"
45
+ "@verbaly/compiler": "0.77.0"
42
46
  },
43
47
  "peerDependencies": {
44
- "verbaly": "^0.76.0",
48
+ "verbaly": "^0.77.0",
45
49
  "vite": "^7.0.0 || ^8.0.0"
46
50
  },
47
51
  "devDependencies": {
48
- "verbaly": "^0.76.0",
52
+ "verbaly": "^0.77.0",
49
53
  "vite": "^8.3.5"
50
54
  },
51
55
  "scripts": {