@intlify/unplugin-vue-i18n 0.8.0 → 0.8.2

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
@@ -228,7 +228,7 @@ If you want type definition of `@intlify/unplugin-vue-i18n/messages`, add `unplu
228
228
 
229
229
  ## 📦 Automatic bundling
230
230
  ### For Vue I18n
231
- As noted [here](https://vue-i18n.intlify.dev/installation.html#explanation-of-different-builds), NPM provides many different builds of Vue I18n.
231
+ As noted [here](https://vue-i18n.intlify.dev/guide/installation.html#explanation-of-different-builds), NPM provides many different builds of Vue I18n.
232
232
 
233
233
  This plugin will automatically select and bundle Vue I18n build according to the following behavior:
234
234
 
package/lib/index.cjs CHANGED
@@ -15,14 +15,6 @@ const yaml = require('js-yaml');
15
15
  const fs = require('fs');
16
16
  const pc = require('picocolors');
17
17
 
18
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
19
-
20
- const createDebug__default = /*#__PURE__*/_interopDefaultLegacy(createDebug);
21
- const fg__default = /*#__PURE__*/_interopDefaultLegacy(fg);
22
- const JSON5__default = /*#__PURE__*/_interopDefaultLegacy(JSON5);
23
- const yaml__default = /*#__PURE__*/_interopDefaultLegacy(yaml);
24
- const pc__default = /*#__PURE__*/_interopDefaultLegacy(pc);
25
-
26
18
  function parseVueRequest(id) {
27
19
  const [filename, rawQuery] = id.split(`?`, 2);
28
20
  const params = new URLSearchParams(rawQuery);
@@ -75,20 +67,20 @@ function convert(source, lang) {
75
67
  switch (lang) {
76
68
  case "yaml":
77
69
  case "yml":
78
- const data = yaml__default.load(source);
70
+ const data = yaml.load(source);
79
71
  return JSON.stringify(data, void 0, " ");
80
72
  case "json5":
81
- return JSON.stringify(JSON5__default.parse(source));
73
+ return JSON.stringify(JSON5.parse(source));
82
74
  default:
83
75
  return source;
84
76
  }
85
77
  }
86
78
 
87
79
  function warn(...args) {
88
- console.warn(pc__default.yellow(pc__default.bold(`[unplugin-vue-i18n] `)), ...args);
80
+ console.warn(pc.yellow(pc.bold(`[unplugin-vue-i18n] `)), ...args);
89
81
  }
90
82
  function error(...args) {
91
- console.error(pc__default.red(pc__default.bold(`[unplugin-vue-i18n] `)), ...args);
83
+ console.error(pc.red(pc.bold(`[unplugin-vue-i18n] `)), ...args);
92
84
  }
93
85
  async function getRaw(path) {
94
86
  return fs.promises.readFile(path, { encoding: "utf-8" });
@@ -100,7 +92,7 @@ function raiseError(message) {
100
92
  const INTLIFY_BUNDLE_IMPORT_ID = "@intlify/unplugin-vue-i18n/messages";
101
93
  const INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID = "@intlify/vite-plugin-vue-i18n/messages";
102
94
  const VIRTUAL_PREFIX = "\0";
103
- const debug = createDebug__default("unplugin-vue-i18n");
95
+ const debug = createDebug("unplugin-vue-i18n");
104
96
  const installedPkg = bundleUtils.checkInstallPackage("@intlify/unplugin-vue-i18n", debug);
105
97
  const installedVueI18nBridge = bundleUtils.checkVueI18nBridgeInstallPackage(debug);
106
98
  const vueI18nVersion = bundleUtils.getVueI18nVersion(debug);
@@ -317,7 +309,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
317
309
  let resourcePaths = [];
318
310
  const includePaths = shared.isArray(include) ? include : [include];
319
311
  for (const inc of includePaths) {
320
- resourcePaths = [...resourcePaths, ...await fg__default(inc)];
312
+ resourcePaths = [...resourcePaths, ...await fg(inc)];
321
313
  }
322
314
  resourcePaths = resourcePaths.filter(
323
315
  (el, pos) => resourcePaths.indexOf(el) === pos
@@ -385,11 +377,6 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
385
377
  code: generatedCode,
386
378
  map: sourceMap ? map : { mappings: "" }
387
379
  };
388
- } else {
389
- return {
390
- code,
391
- map: { mappings: "", version: "3", sources: [] }
392
- };
393
380
  }
394
381
  } else {
395
382
  if (isCustomBlock(query)) {
@@ -592,5 +579,5 @@ function asVirtualId(id, framework = "vite") {
592
579
  return framework === "vite" ? VIRTUAL_PREFIX + id : id;
593
580
  }
594
581
 
595
- exports["default"] = unplugin;
582
+ exports.default = unplugin;
596
583
  exports.unplugin = unplugin;
package/lib/index.mjs CHANGED
@@ -373,11 +373,6 @@ const unplugin = createUnplugin((options = {}, meta) => {
373
373
  code: generatedCode,
374
374
  map: sourceMap ? map : { mappings: "" }
375
375
  };
376
- } else {
377
- return {
378
- code,
379
- map: { mappings: "", version: "3", sources: [] }
380
- };
381
376
  }
382
377
  } else {
383
378
  if (isCustomBlock(query)) {
package/lib/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare type SFCLangFormat = 'json' | 'json5' | 'yml' | 'yaml';
1
+ type SFCLangFormat = 'json' | 'json5' | 'yml' | 'yaml';
2
2
  interface PluginOptions {
3
3
  include?: string | string[];
4
4
  runtimeOnly?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlify/unplugin-vue-i18n",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "unplugin for Vue I18n",
5
5
  "author": {
6
6
  "name": "kazuya kawaguchi",
@@ -26,7 +26,7 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "@intlify/bundle-utils": "^3.4.0",
29
+ "@intlify/bundle-utils": "^4.0.0",
30
30
  "@intlify/shared": "next",
31
31
  "@rollup/pluginutils": "^4.2.0",
32
32
  "@vue/compiler-sfc": "^3.2.45",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "mlly": "^1.0.0",
44
- "unbuild": "^0.8.11"
44
+ "unbuild": "^1.0.2"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">= 14.16"