@verbaly/unplugin 0.70.0 → 0.72.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/dist/index.js CHANGED
@@ -5,12 +5,14 @@ const factory = (options = {}) => {
5
5
  let cfg;
6
6
  let catalogs;
7
7
  let included;
8
+ let scan;
8
9
  const registry = new MessageRegistry();
9
10
  const ready = (async () => {
10
11
  cfg = await loadConfig(options.root ?? process.cwd(), options);
11
12
  catalogs = loadCatalogs(cfg);
12
13
  included = createSourceFilter(cfg);
13
- syncCatalogs(cfg, catalogs, await extractProject(cfg));
14
+ scan = await extractProject(cfg, { keepSource: true });
15
+ syncCatalogs(cfg, catalogs, scan);
14
16
  })();
15
17
  ready.catch(() => {});
16
18
  return {
@@ -34,9 +36,10 @@ const factory = (options = {}) => {
34
36
  },
35
37
  transform(code, id) {
36
38
  if (!included(id)) return null;
37
- return transformSource(code, id, registry).result;
39
+ return transformSource(code, id, registry, scan).result;
38
40
  },
39
41
  buildEnd() {
42
+ scan = void 0;
40
43
  runBuildGate(cfg, registry, options.failOnMissing);
41
44
  }
42
45
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n MessageRegistry,\n RESOLVED_VIRTUAL_ID,\n createSourceFilter,\n extractProject,\n isTransformTarget,\n loadCatalogs,\n loadConfig,\n loadVirtualModule,\n reportOutsideInclude,\n resolveVirtualId,\n runBuildGate,\n syncCatalogs,\n transformSource,\n type Catalogs,\n type PluginOptions,\n type ResolvedConfig,\n} from '@verbaly/compiler';\nimport { createUnplugin, type UnpluginFactory, type UnpluginInstance } from 'unplugin';\n\n// the shared bundler-plugin options (config + failOnMissing), named for this plugin\nexport type UnpluginVerbalyOptions = PluginOptions;\n\n// build-focused: virtual modules + transform + gate.\nconst factory: UnpluginFactory<UnpluginVerbalyOptions | undefined> = (options = {}) => {\n let cfg: ResolvedConfig;\n let catalogs: Catalogs;\n let included: (id: string) => boolean;\n const registry = new MessageRegistry();\n const ready = (async () => {\n cfg = await loadConfig(options.root ?? process.cwd(), options);\n catalogs = loadCatalogs(cfg);\n included = createSourceFilter(cfg);\n // the code's text ships: a text it owns that was edited in the catalog never reaches the bundle\n syncCatalogs(cfg, catalogs, await extractProject(cfg));\n })();\n // buildStart awaits it and reports the failure; unwatched till then, a rejection ends the process\n ready.catch(() => {});\n\n return {\n name: 'verbaly',\n enforce: 'pre',\n\n async buildStart() {\n await ready;\n // a file outside include writes a t`…` that no build translates: said once, at the start\n await reportOutsideInclude(cfg);\n },\n\n resolveId(id) {\n return resolveVirtualId(id) ?? null;\n },\n\n loadInclude(id) {\n return id.startsWith(RESOLVED_VIRTUAL_ID);\n },\n\n load(id) {\n return loadVirtualModule(id, cfg, catalogs) ?? null;\n },\n\n transformInclude(id) {\n return isTransformTarget(id);\n },\n\n transform(code, id) {\n if (!included(id)) return null;\n return transformSource(code, id, registry).result;\n },\n\n buildEnd() {\n runBuildGate(cfg, registry, options.failOnMissing);\n },\n };\n};\n\nexport const verbaly: UnpluginInstance<UnpluginVerbalyOptions | undefined> =\n createUnplugin(factory);\n\nexport default verbaly;\n\nexport type { VerbalyConfig } from '@verbaly/compiler';\n"],"mappings":";;;AAwBA,MAAM,WAAgE,UAAU,CAAC,MAAM;CACrF,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM,WAAW,IAAI,gBAAgB;CACrC,MAAM,SAAS,YAAY;EACzB,MAAM,MAAM,WAAW,QAAQ,QAAQ,QAAQ,IAAI,GAAG,OAAO;EAC7D,WAAW,aAAa,GAAG;EAC3B,WAAW,mBAAmB,GAAG;EAEjC,aAAa,KAAK,UAAU,MAAM,eAAe,GAAG,CAAC;CACvD,EAAA,CAAG;CAEH,MAAM,YAAY,CAAC,CAAC;CAEpB,OAAO;EACL,MAAM;EACN,SAAS;EAET,MAAM,aAAa;GACjB,MAAM;GAEN,MAAM,qBAAqB,GAAG;EAChC;EAEA,UAAU,IAAI;GACZ,OAAO,iBAAiB,EAAE,KAAK;EACjC;EAEA,YAAY,IAAI;GACd,OAAO,GAAG,WAAW,mBAAmB;EAC1C;EAEA,KAAK,IAAI;GACP,OAAO,kBAAkB,IAAI,KAAK,QAAQ,KAAK;EACjD;EAEA,iBAAiB,IAAI;GACnB,OAAO,kBAAkB,EAAE;EAC7B;EAEA,UAAU,MAAM,IAAI;GAClB,IAAI,CAAC,SAAS,EAAE,GAAG,OAAO;GAC1B,OAAO,gBAAgB,MAAM,IAAI,QAAQ,CAAC,CAAC;EAC7C;EAEA,WAAW;GACT,aAAa,KAAK,UAAU,QAAQ,aAAa;EACnD;CACF;AACF;AAEA,MAAa,UACX,eAAe,OAAO"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n MessageRegistry,\n RESOLVED_VIRTUAL_ID,\n createSourceFilter,\n extractProject,\n isTransformTarget,\n loadCatalogs,\n loadConfig,\n loadVirtualModule,\n reportOutsideInclude,\n resolveVirtualId,\n runBuildGate,\n syncCatalogs,\n transformSource,\n type Catalogs,\n type PluginOptions,\n type ResolvedConfig,\n} from '@verbaly/compiler';\nimport { createUnplugin, type UnpluginFactory, type UnpluginInstance } from 'unplugin';\n\n// the shared bundler-plugin options (config + failOnMissing), named for this plugin\nexport type UnpluginVerbalyOptions = PluginOptions;\n\n// build-focused: virtual modules + transform + gate.\nconst factory: UnpluginFactory<UnpluginVerbalyOptions | undefined> = (options = {}) => {\n let cfg: ResolvedConfig;\n let catalogs: Catalogs;\n let included: (id: string) => boolean;\n // the first build's scan: each file it read unchanged reaches transform already parsed\n let scan: MessageRegistry | undefined;\n const registry = new MessageRegistry();\n const ready = (async () => {\n cfg = await loadConfig(options.root ?? process.cwd(), options);\n catalogs = loadCatalogs(cfg);\n included = createSourceFilter(cfg);\n scan = await extractProject(cfg, { keepSource: true });\n // the code's text ships: a text it owns that was edited in the catalog never reaches the bundle\n syncCatalogs(cfg, catalogs, scan);\n })();\n // buildStart awaits it and reports the failure; unwatched till then, a rejection ends the process\n ready.catch(() => {});\n\n return {\n name: 'verbaly',\n enforce: 'pre',\n\n async buildStart() {\n await ready;\n // a file outside include writes a t`…` that no build translates: said once, at the start\n await reportOutsideInclude(cfg);\n },\n\n resolveId(id) {\n return resolveVirtualId(id) ?? null;\n },\n\n loadInclude(id) {\n return id.startsWith(RESOLVED_VIRTUAL_ID);\n },\n\n load(id) {\n return loadVirtualModule(id, cfg, catalogs) ?? null;\n },\n\n transformInclude(id) {\n return isTransformTarget(id);\n },\n\n transform(code, id) {\n if (!included(id)) return null;\n return transformSource(code, id, registry, scan).result;\n },\n\n buildEnd() {\n // a watch rebuild parses what changed: the scan only ever describes the first build\n scan = undefined;\n runBuildGate(cfg, registry, options.failOnMissing);\n },\n };\n};\n\nexport const verbaly: UnpluginInstance<UnpluginVerbalyOptions | undefined> =\n createUnplugin(factory);\n\nexport default verbaly;\n\nexport type { VerbalyConfig } from '@verbaly/compiler';\n"],"mappings":";;;AAwBA,MAAM,WAAgE,UAAU,CAAC,MAAM;CACrF,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,IAAI;CACJ,MAAM,WAAW,IAAI,gBAAgB;CACrC,MAAM,SAAS,YAAY;EACzB,MAAM,MAAM,WAAW,QAAQ,QAAQ,QAAQ,IAAI,GAAG,OAAO;EAC7D,WAAW,aAAa,GAAG;EAC3B,WAAW,mBAAmB,GAAG;EACjC,OAAO,MAAM,eAAe,KAAK,EAAE,YAAY,KAAK,CAAC;EAErD,aAAa,KAAK,UAAU,IAAI;CAClC,EAAA,CAAG;CAEH,MAAM,YAAY,CAAC,CAAC;CAEpB,OAAO;EACL,MAAM;EACN,SAAS;EAET,MAAM,aAAa;GACjB,MAAM;GAEN,MAAM,qBAAqB,GAAG;EAChC;EAEA,UAAU,IAAI;GACZ,OAAO,iBAAiB,EAAE,KAAK;EACjC;EAEA,YAAY,IAAI;GACd,OAAO,GAAG,WAAW,mBAAmB;EAC1C;EAEA,KAAK,IAAI;GACP,OAAO,kBAAkB,IAAI,KAAK,QAAQ,KAAK;EACjD;EAEA,iBAAiB,IAAI;GACnB,OAAO,kBAAkB,EAAE;EAC7B;EAEA,UAAU,MAAM,IAAI;GAClB,IAAI,CAAC,SAAS,EAAE,GAAG,OAAO;GAC1B,OAAO,gBAAgB,MAAM,IAAI,UAAU,IAAI,CAAC,CAAC;EACnD;EAEA,WAAW;GAET,OAAO,KAAA;GACP,aAAa,KAAK,UAAU,QAAQ,aAAa;EACnD;CACF;AACF;AAEA,MAAa,UACX,eAAe,OAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verbaly/unplugin",
3
- "version": "0.70.0",
3
+ "version": "0.72.0",
4
4
  "description": "Verbaly for webpack, Rollup, esbuild and Rspack: extraction, virtual modules and build gate via unplugin.",
5
5
  "keywords": [
6
6
  "i18n",
@@ -36,20 +36,20 @@
36
36
  ],
37
37
  "sideEffects": false,
38
38
  "engines": {
39
- "node": ">=20"
39
+ "node": ">=22.12"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
44
  "dependencies": {
45
- "@verbaly/compiler": "0.70.0",
45
+ "@verbaly/compiler": "0.72.0",
46
46
  "unplugin": "^3.4.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "verbaly": "^0.70.0"
49
+ "verbaly": "^0.72.0"
50
50
  },
51
51
  "devDependencies": {
52
- "verbaly": "^0.70.0"
52
+ "verbaly": "^0.72.0"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "tsdown",