@intlify/bundle-utils 3.2.0 → 3.3.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/lib/deps.d.ts +6 -0
- package/lib/deps.js +64 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +6 -3
- package/package.json +1 -1
- package/CHANGELOG.md +0 -138
package/lib/deps.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare type InstalledPackage = 'vue-i18n' | 'petite-vue-i18n';
|
|
2
|
+
export declare function checkInstallPackage(pkg: string, debug: Function): InstalledPackage;
|
|
3
|
+
export declare function checkVueI18nBridgeInstallPackage(debug: Function): boolean;
|
|
4
|
+
export declare function isInstalledVue2(debug: Function): boolean;
|
|
5
|
+
export declare function isInstalledVue3(debug: Function): boolean;
|
|
6
|
+
export declare function loadModule(moduleName: string, debug: Function): any;
|
package/lib/deps.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadModule = exports.isInstalledVue3 = exports.isInstalledVue2 = exports.checkVueI18nBridgeInstallPackage = exports.checkInstallPackage = void 0;
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
5
|
+
function checkInstallPackage(pkg, debug) {
|
|
6
|
+
let installedVueI18n = false;
|
|
7
|
+
try {
|
|
8
|
+
debug(`vue-i18n load path: ${require.resolve('vue-i18n')}`);
|
|
9
|
+
installedVueI18n = true;
|
|
10
|
+
}
|
|
11
|
+
catch (e) {
|
|
12
|
+
debug(`cannot find 'vue-i18n'`, e);
|
|
13
|
+
}
|
|
14
|
+
let installedPetiteVueI18n = false;
|
|
15
|
+
try {
|
|
16
|
+
debug(`petite-vue-i18n load path: ${require.resolve('petite-vue-i18n')}`);
|
|
17
|
+
installedPetiteVueI18n = true;
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
debug(`cannot find 'petite-vue-i18n'`, e);
|
|
21
|
+
}
|
|
22
|
+
if (installedVueI18n) {
|
|
23
|
+
return 'vue-i18n';
|
|
24
|
+
}
|
|
25
|
+
if (installedPetiteVueI18n) {
|
|
26
|
+
return 'petite-vue-i18n';
|
|
27
|
+
}
|
|
28
|
+
throw new Error(`${pkg} requires 'vue-i18n' or 'petite-vue-i18n' to be present in the dependency tree.`);
|
|
29
|
+
}
|
|
30
|
+
exports.checkInstallPackage = checkInstallPackage;
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
32
|
+
function checkVueI18nBridgeInstallPackage(debug) {
|
|
33
|
+
let ret = false;
|
|
34
|
+
try {
|
|
35
|
+
debug(`vue-i18n-bridge load path: ${require.resolve('vue-i18n-bridge')}`);
|
|
36
|
+
ret = true;
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
debug(`cannot find 'vue-i18n-bridge'`, e);
|
|
40
|
+
}
|
|
41
|
+
return ret;
|
|
42
|
+
}
|
|
43
|
+
exports.checkVueI18nBridgeInstallPackage = checkVueI18nBridgeInstallPackage;
|
|
44
|
+
function isInstalledVue2(debug) {
|
|
45
|
+
const vue = loadModule('vue', debug);
|
|
46
|
+
return vue != null && vue.version != null && vue.version.startsWith('2.');
|
|
47
|
+
}
|
|
48
|
+
exports.isInstalledVue2 = isInstalledVue2;
|
|
49
|
+
function isInstalledVue3(debug) {
|
|
50
|
+
const vue = loadModule('vue', debug);
|
|
51
|
+
return vue != null && vue.version != null && vue.version.startsWith('3.');
|
|
52
|
+
}
|
|
53
|
+
exports.isInstalledVue3 = isInstalledVue3;
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
+
function loadModule(moduleName, debug) {
|
|
56
|
+
try {
|
|
57
|
+
return require(moduleName);
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
debug(`cannot load '${moduleName}'`, e);
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.loadModule = loadModule;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { CodeGenOptions, CodeGenResult, DevEnv } from './codegen';
|
|
2
2
|
export { generate as generateJSON } from './json';
|
|
3
3
|
export { generate as generateYAML } from './yaml';
|
|
4
|
-
export { checkInstallPackage, InstalledPackage } from './
|
|
4
|
+
export { isInstalledVue2, isInstalledVue3, checkInstallPackage, checkVueI18nBridgeInstallPackage, InstalledPackage } from './deps';
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkInstallPackage = exports.generateYAML = exports.generateJSON = void 0;
|
|
3
|
+
exports.checkVueI18nBridgeInstallPackage = exports.checkInstallPackage = exports.isInstalledVue3 = exports.isInstalledVue2 = exports.generateYAML = exports.generateJSON = void 0;
|
|
4
4
|
var json_1 = require("./json");
|
|
5
5
|
Object.defineProperty(exports, "generateJSON", { enumerable: true, get: function () { return json_1.generate; } });
|
|
6
6
|
var yaml_1 = require("./yaml");
|
|
7
7
|
Object.defineProperty(exports, "generateYAML", { enumerable: true, get: function () { return yaml_1.generate; } });
|
|
8
|
-
var
|
|
9
|
-
Object.defineProperty(exports, "
|
|
8
|
+
var deps_1 = require("./deps");
|
|
9
|
+
Object.defineProperty(exports, "isInstalledVue2", { enumerable: true, get: function () { return deps_1.isInstalledVue2; } });
|
|
10
|
+
Object.defineProperty(exports, "isInstalledVue3", { enumerable: true, get: function () { return deps_1.isInstalledVue3; } });
|
|
11
|
+
Object.defineProperty(exports, "checkInstallPackage", { enumerable: true, get: function () { return deps_1.checkInstallPackage; } });
|
|
12
|
+
Object.defineProperty(exports, "checkVueI18nBridgeInstallPackage", { enumerable: true, get: function () { return deps_1.checkVueI18nBridgeInstallPackage; } });
|
package/package.json
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
## @intlify/bundle-utils@3.2.0 (2022-09-27)
|
|
3
|
-
|
|
4
|
-
#### :star: Features
|
|
5
|
-
* [#185](https://github.com/intlify/bundle-tools/pull/185) feat: add vue-i18n-bridge install checking ([@kazupon](https://github.com/kazupon))
|
|
6
|
-
|
|
7
|
-
#### Committers: 1
|
|
8
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## @intlify/bundle-utils@3.1.2 (2022-09-19)
|
|
12
|
-
|
|
13
|
-
#### :zap: Improvement Features
|
|
14
|
-
* [#178](https://github.com/intlify/bundle-tools/pull/178) fix(bundle-utils): improve compile error handling ([@kazupon](https://github.com/kazupon))
|
|
15
|
-
|
|
16
|
-
#### Committers: 1
|
|
17
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## @intlify/bundle-utils@3.1.1 (2022-09-19)
|
|
21
|
-
|
|
22
|
-
#### :bug: Bug Fixes
|
|
23
|
-
* [#177](https://github.com/intlify/bundle-tools/pull/177) fix(bundle-utils): fix wrong error callbacking and error handling improvement ([@kazupon](https://github.com/kazupon))
|
|
24
|
-
|
|
25
|
-
#### Committers: 1
|
|
26
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## @intlify/bundle-utils@3.1.0 (2022-05-06)
|
|
30
|
-
|
|
31
|
-
#### :zap: Improvement Features
|
|
32
|
-
* [#116](https://github.com/intlify/bundle-tools/pull/116) improvement(bundle-utils): support ESM exporting on bridge ([@kazupon](https://github.com/kazupon))
|
|
33
|
-
|
|
34
|
-
#### Committers: 1
|
|
35
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## @intlify/bundle-utils@3.0.0 (2022-04-05)
|
|
39
|
-
|
|
40
|
-
#### :star: Features
|
|
41
|
-
* [#101](https://github.com/intlify/bundle-tools/pull/101) feat(bundle-utils): pinned intlify related module next version ([@kazupon](https://github.com/kazupon))
|
|
42
|
-
|
|
43
|
-
#### Committers: 1
|
|
44
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
## @intlify/bundle-utils@2.2.2 (2022-04-05)
|
|
48
|
-
|
|
49
|
-
#### :zap: Improvement Features
|
|
50
|
-
* [#100](https://github.com/intlify/bundle-tools/pull/100) fix(bundle-utils): pinned latest stable version ([@kazupon](https://github.com/kazupon))
|
|
51
|
-
|
|
52
|
-
#### Committers: 1
|
|
53
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
## @intlify/bundle-utils@2.2.1 (2022-03-22)
|
|
57
|
-
|
|
58
|
-
#### :bug: Bug Fixes
|
|
59
|
-
* [#98](https://github.com/intlify/bundle-tools/pull/98) fix(bundle-utils): fix nested array code generation ([@kazupon](https://github.com/kazupon))
|
|
60
|
-
|
|
61
|
-
#### Committers: 1
|
|
62
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
## @intlify/bundle-utils@2.2.1 (2022-03-22)
|
|
66
|
-
|
|
67
|
-
#### :bug: Bug Fixes
|
|
68
|
-
* [#98](https://github.com/intlify/bundle-tools/pull/98) fix(bundle-utils): fix nested array code generation ([@kazupon](https://github.com/kazupon))
|
|
69
|
-
|
|
70
|
-
#### Committers: 1
|
|
71
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
## @intlify/bundle-utils@2.2.0 (2021-12-16)
|
|
75
|
-
|
|
76
|
-
#### :zap: Improvement Features
|
|
77
|
-
* [#75](https://github.com/intlify/bundle-tools/pull/75) Add vue-class-components support via loader option ([@SniperJoe](https://github.com/SniperJoe))
|
|
78
|
-
|
|
79
|
-
#### Committers: 1
|
|
80
|
-
- [@SniperJoe](https://github.com/SniperJoe)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
## @intlify/bundle-utils@2.1.0 (2021-11-10)
|
|
84
|
-
|
|
85
|
-
#### :zap: Improvement Features
|
|
86
|
-
* [#67](https://github.com/intlify/bundle-tools/pull/67) fix: add vite and vue-i18n as peerDependencies ([@AlexandreBonaventure](https://github.com/AlexandreBonaventure))
|
|
87
|
-
|
|
88
|
-
#### Committers: 1
|
|
89
|
-
- Alexandre Bonaventure Geissmann ([@AlexandreBonaventure](https://github.com/AlexandreBonaventure))
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
## @intlify/bundle-utils@2.0.0 (2021-10-24)
|
|
93
|
-
|
|
94
|
-
#### :star: Features
|
|
95
|
-
* [#60](https://github.com/intlify/bundle-tools/pull/60) feat: change to intlify beta related deps ([@kazupon](https://github.com/kazupon))
|
|
96
|
-
|
|
97
|
-
#### Committers: 1
|
|
98
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
## @intlify/bundle-utils@1.0.0 (2021-10-24)
|
|
102
|
-
|
|
103
|
-
#### :star: Features
|
|
104
|
-
* [#56](https://github.com/intlify/bundle-tools/pull/56) feat: bump to major version ([@kazupon](https://github.com/kazupon))
|
|
105
|
-
|
|
106
|
-
#### Committers: 1
|
|
107
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
## @intlify/bundle-utils@0.3.0 (2021-09-29)
|
|
111
|
-
|
|
112
|
-
#### :star: Features
|
|
113
|
-
* [#47](https://github.com/intlify/bundle-tools/pull/47) feat: support vue i18n bridge ([@kazupon](https://github.com/kazupon))
|
|
114
|
-
|
|
115
|
-
#### Committers: 1
|
|
116
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
## @intlify/bundle-utils@0.2.0 (2021-07-26)
|
|
120
|
-
|
|
121
|
-
#### :star: Features
|
|
122
|
-
* [#36](https://github.com/intlify/bundle-tools/pull/36) add install package checking ([@kazupon](https://github.com/kazupon))
|
|
123
|
-
|
|
124
|
-
#### Committers: 1
|
|
125
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
## @intlify/bundle-utils@0.1.0 (2021-07-12)
|
|
129
|
-
|
|
130
|
-
#### :star: Features
|
|
131
|
-
* [#26](https://github.com/intlify/bundle-tools/pull/26) feat: bundle-utils basic implementation ([@kazupon](https://github.com/kazupon))
|
|
132
|
-
|
|
133
|
-
#### Committers: 1
|
|
134
|
-
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
135
|
-
|
|
136
|
-
## v0.0.0 (2021-07-13)
|
|
137
|
-
|
|
138
|
-
:tada: Initial release.
|