@intlify/unplugin-vue-i18n 0.12.1 → 0.12.3
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/lib/index.cjs +14 -6
- package/messages.d.ts +3 -2
- package/package.json +4 -4
package/lib/index.cjs
CHANGED
|
@@ -15,6 +15,14 @@ const yaml = require('js-yaml');
|
|
|
15
15
|
const fs = require('fs');
|
|
16
16
|
const pc = require('picocolors');
|
|
17
17
|
|
|
18
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
19
|
+
|
|
20
|
+
const createDebug__default = /*#__PURE__*/_interopDefaultCompat(createDebug);
|
|
21
|
+
const fg__default = /*#__PURE__*/_interopDefaultCompat(fg);
|
|
22
|
+
const JSON5__default = /*#__PURE__*/_interopDefaultCompat(JSON5);
|
|
23
|
+
const yaml__default = /*#__PURE__*/_interopDefaultCompat(yaml);
|
|
24
|
+
const pc__default = /*#__PURE__*/_interopDefaultCompat(pc);
|
|
25
|
+
|
|
18
26
|
function parseVueRequest(id) {
|
|
19
27
|
const [filename, rawQuery] = id.split(`?`, 2);
|
|
20
28
|
const params = new URLSearchParams(rawQuery);
|
|
@@ -67,20 +75,20 @@ function convert(source, lang) {
|
|
|
67
75
|
switch (lang) {
|
|
68
76
|
case "yaml":
|
|
69
77
|
case "yml":
|
|
70
|
-
const data =
|
|
78
|
+
const data = yaml__default.load(source);
|
|
71
79
|
return JSON.stringify(data, void 0, " ");
|
|
72
80
|
case "json5":
|
|
73
|
-
return JSON.stringify(
|
|
81
|
+
return JSON.stringify(JSON5__default.parse(source));
|
|
74
82
|
default:
|
|
75
83
|
return source;
|
|
76
84
|
}
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
function warn(...args) {
|
|
80
|
-
console.warn(
|
|
88
|
+
console.warn(pc__default.yellow(pc__default.bold(`[unplugin-vue-i18n] `)), ...args);
|
|
81
89
|
}
|
|
82
90
|
function error(...args) {
|
|
83
|
-
console.error(
|
|
91
|
+
console.error(pc__default.red(pc__default.bold(`[unplugin-vue-i18n] `)), ...args);
|
|
84
92
|
}
|
|
85
93
|
async function getRaw(path) {
|
|
86
94
|
return fs.promises.readFile(path, { encoding: "utf-8" });
|
|
@@ -92,7 +100,7 @@ function raiseError(message) {
|
|
|
92
100
|
const INTLIFY_BUNDLE_IMPORT_ID = "@intlify/unplugin-vue-i18n/messages";
|
|
93
101
|
const INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID = "@intlify/vite-plugin-vue-i18n/messages";
|
|
94
102
|
const VIRTUAL_PREFIX = "\0";
|
|
95
|
-
const debug =
|
|
103
|
+
const debug = createDebug__default("unplugin-vue-i18n");
|
|
96
104
|
const installedPkg = bundleUtils.checkInstallPackage("@intlify/unplugin-vue-i18n", debug);
|
|
97
105
|
const installedVueI18nBridge = bundleUtils.checkVueI18nBridgeInstallPackage(debug);
|
|
98
106
|
const vueI18nVersion = bundleUtils.getVueI18nVersion(debug);
|
|
@@ -388,7 +396,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
388
396
|
let resourcePaths = [];
|
|
389
397
|
const includePaths = shared.isArray(include) ? include : [include];
|
|
390
398
|
for (const inc of includePaths) {
|
|
391
|
-
resourcePaths = [...resourcePaths, ...await
|
|
399
|
+
resourcePaths = [...resourcePaths, ...await fg__default(inc)];
|
|
392
400
|
}
|
|
393
401
|
resourcePaths = resourcePaths.filter(
|
|
394
402
|
(el, pos) => resourcePaths.indexOf(el) === pos
|
package/messages.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlify/unplugin-vue-i18n",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"description": "unplugin for Vue I18n",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@intlify/bundle-utils": "^7.0.
|
|
30
|
-
"@intlify/shared": "9.3.0-beta.
|
|
29
|
+
"@intlify/bundle-utils": "^7.0.2",
|
|
30
|
+
"@intlify/shared": "9.3.0-beta.24",
|
|
31
31
|
"@rollup/pluginutils": "^5.0.2",
|
|
32
32
|
"@vue/compiler-sfc": "^3.2.47",
|
|
33
33
|
"debug": "^4.3.3",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"unplugin": "^1.1.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"unbuild": "^1.1
|
|
43
|
+
"unbuild": "^1.2.1"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">= 14.16"
|