@verbaly/vite 0.82.0 → 0.83.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
@@ -6,6 +6,10 @@
6
6
 
7
7
  <p align="center">
8
8
  <a href="https://www.npmjs.com/package/@verbaly/vite"><img src="https://img.shields.io/npm/v/@verbaly/vite?logo=npm&color=cb3837" alt="npm version" /></a>
9
+ <a href="https://verbaly-web.vercel.app/docs/frameworks/vite"><img src="https://img.shields.io/npm/dependency-version/@verbaly/vite/peer/vite?logo=vite&logoColor=646CFF&label=Vite&color=1B1C2E" alt="supported Vite versions" /></a>
10
+ <a href="https://github.com/AronSoto/verbaly/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/AronSoto/verbaly/ci.yml?logo=github&label=CI" alt="CI" /></a>
11
+ <a href="https://scorecard.dev/viewer/?uri=github.com/AronSoto/verbaly"><img src="https://api.scorecard.dev/projects/github.com/AronSoto/verbaly/badge" alt="OpenSSF Scorecard" /></a>
12
+ <a href="https://www.npmjs.com/package/@verbaly/vite#provenance"><img src="https://img.shields.io/badge/provenance-SLSA%20v1-3fb950?logo=npm" alt="published with npm provenance" /></a>
9
13
  <a href="https://github.com/AronSoto/verbaly/blob/develop/LICENSE"><img src="https://img.shields.io/npm/l/@verbaly/vite?color=blue" alt="MIT" /></a>
10
14
  </p>
11
15
 
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
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
+ import { dirname, resolve } from "node:path";
3
4
  // src/index.ts
4
5
  function safeRead(file) {
5
6
  try {
@@ -78,7 +79,7 @@ function verbaly(options = {}) {
78
79
  server = devServer;
79
80
  devServer.watcher.add(cfg.dir);
80
81
  const onCatalogFile = (file) => {
81
- if (!file.startsWith(cfg.dir) || !file.endsWith(".json")) return;
82
+ if (resolve(dirname(file)) !== resolve(cfg.dir) || !file.endsWith(".json")) return;
82
83
  const locale = file.split(/[\\/]/).pop().slice(0, -5);
83
84
  if (locale.startsWith(".")) return;
84
85
  const expected = selfWrites.get(locale);
@@ -126,7 +127,7 @@ function verbaly(options = {}) {
126
127
  const { messages, result } = transformSource(code, id, registry, scan);
127
128
  const found = Object.entries(messages);
128
129
  if (!isBuild && found.length > 0) {
129
- const source = catalogs[cfg.sourceLocale] ??= {};
130
+ const source = catalogs[cfg.sourceLocale] ??= Object.create(null);
130
131
  let changed = false;
131
132
  for (const [key, message] of found) if (source[key] !== message) {
132
133
  source[key] = message;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verbaly/vite",
3
- "version": "0.82.0",
3
+ "version": "0.83.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.82.0"
45
+ "@verbaly/compiler": "0.83.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "verbaly": "^0.82.0",
48
+ "verbaly": "^0.83.0",
49
49
  "vite": "^7.0.0 || ^8.0.0"
50
50
  },
51
51
  "devDependencies": {
52
- "verbaly": "^0.82.0",
53
- "vite": "^8.3.7"
52
+ "verbaly": "^0.83.0",
53
+ "vite": "^8.3.8"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "tsdown",