@verbaly/unplugin 0.66.0 → 0.68.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 +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MessageRegistry, RESOLVED_VIRTUAL_ID, createSourceFilter, isTransformTarget, loadCatalogs, loadConfig, loadVirtualModule, resolveVirtualId, runBuildGate, transformSource } from "@verbaly/compiler";
|
|
1
|
+
import { MessageRegistry, RESOLVED_VIRTUAL_ID, createSourceFilter, extractProject, isTransformTarget, loadCatalogs, loadConfig, loadVirtualModule, resolveVirtualId, runBuildGate, syncCatalogs, transformSource } from "@verbaly/compiler";
|
|
2
2
|
import { createUnplugin } from "unplugin";
|
|
3
3
|
//#region src/index.ts
|
|
4
4
|
const factory = (options = {}) => {
|
|
@@ -10,6 +10,7 @@ const factory = (options = {}) => {
|
|
|
10
10
|
cfg = await loadConfig(options.root ?? process.cwd(), options);
|
|
11
11
|
catalogs = loadCatalogs(cfg);
|
|
12
12
|
included = createSourceFilter(cfg);
|
|
13
|
+
syncCatalogs(cfg, catalogs, await extractProject(cfg));
|
|
13
14
|
})();
|
|
14
15
|
return {
|
|
15
16
|
name: "verbaly",
|
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 isTransformTarget,\n loadCatalogs,\n loadConfig,\n loadVirtualModule,\n resolveVirtualId,\n runBuildGate,\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 })();\n\n return {\n name: 'verbaly',\n enforce: 'pre',\n\n async buildStart() {\n await ready;\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":";;;
|
|
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 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\n return {\n name: 'verbaly',\n enforce: 'pre',\n\n async buildStart() {\n await ready;\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":";;;AAuBA,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,OAAO;EACL,MAAM;EACN,SAAS;EAET,MAAM,aAAa;GACjB,MAAM;EACR;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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verbaly/unplugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.68.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",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@verbaly/compiler": "0.
|
|
45
|
+
"@verbaly/compiler": "0.68.0",
|
|
46
46
|
"unplugin": "^3.4.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"verbaly": "^0.
|
|
49
|
+
"verbaly": "^0.68.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"verbaly": "^0.
|
|
52
|
+
"verbaly": "^0.68.0"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "tsdown",
|