@modern-js/create 1.4.5 → 1.5.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/js/node/main.js +46 -53
- package/package.json +5 -6
package/dist/js/node/main.js
CHANGED
|
@@ -39547,50 +39547,6 @@ try {
|
|
|
39547
39547
|
} catch (er) {}
|
|
39548
39548
|
|
|
39549
39549
|
|
|
39550
|
-
/***/ }),
|
|
39551
|
-
|
|
39552
|
-
/***/ 82552:
|
|
39553
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
39554
|
-
|
|
39555
|
-
"use strict";
|
|
39556
|
-
|
|
39557
|
-
|
|
39558
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
39559
|
-
value: true
|
|
39560
|
-
}));
|
|
39561
|
-
exports.I18CLILanguageDetector = void 0;
|
|
39562
|
-
|
|
39563
|
-
class I18CLILanguageDetector {
|
|
39564
|
-
formatShellLocale(rawLC) {
|
|
39565
|
-
if (!rawLC) {
|
|
39566
|
-
return '';
|
|
39567
|
-
} // Get array of available languages
|
|
39568
|
-
|
|
39569
|
-
|
|
39570
|
-
const LCs = rawLC.split(':');
|
|
39571
|
-
const LC = LCs[0] // Get `en_US` part from `en_US.UTF-8`
|
|
39572
|
-
.split('.')[0] // Slice en_US to en
|
|
39573
|
-
.split('_')[0] // slice en-US to en
|
|
39574
|
-
.split('-')[0];
|
|
39575
|
-
|
|
39576
|
-
if (LC === 'C') {
|
|
39577
|
-
return '';
|
|
39578
|
-
}
|
|
39579
|
-
|
|
39580
|
-
return LC;
|
|
39581
|
-
}
|
|
39582
|
-
|
|
39583
|
-
detect() {
|
|
39584
|
-
var _ref, _ref2, _ref3, _process$env$LC_ALL;
|
|
39585
|
-
|
|
39586
|
-
const shellLocale = (_ref = (_ref2 = (_ref3 = (_process$env$LC_ALL = process.env.LC_ALL) !== null && _process$env$LC_ALL !== void 0 ? _process$env$LC_ALL : process.env.LC_MESSAGES) !== null && _ref3 !== void 0 ? _ref3 : process.env.LANG) !== null && _ref2 !== void 0 ? _ref2 : process.env.LANGUAGE) !== null && _ref !== void 0 ? _ref : Intl.DateTimeFormat().resolvedOptions().locale;
|
|
39587
|
-
return this.formatShellLocale(shellLocale);
|
|
39588
|
-
}
|
|
39589
|
-
|
|
39590
|
-
}
|
|
39591
|
-
|
|
39592
|
-
exports.I18CLILanguageDetector = I18CLILanguageDetector;
|
|
39593
|
-
|
|
39594
39550
|
/***/ }),
|
|
39595
39551
|
|
|
39596
39552
|
/***/ 44360:
|
|
@@ -39676,6 +39632,50 @@ exports.I18n = I18n;
|
|
|
39676
39632
|
|
|
39677
39633
|
/***/ }),
|
|
39678
39634
|
|
|
39635
|
+
/***/ 17382:
|
|
39636
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
39637
|
+
|
|
39638
|
+
"use strict";
|
|
39639
|
+
|
|
39640
|
+
|
|
39641
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
39642
|
+
value: true
|
|
39643
|
+
}));
|
|
39644
|
+
exports.I18CLILanguageDetector = void 0;
|
|
39645
|
+
|
|
39646
|
+
class I18CLILanguageDetector {
|
|
39647
|
+
formatShellLocale(rawLC) {
|
|
39648
|
+
if (!rawLC) {
|
|
39649
|
+
return '';
|
|
39650
|
+
} // Get array of available languages
|
|
39651
|
+
|
|
39652
|
+
|
|
39653
|
+
const LCs = rawLC.split(':');
|
|
39654
|
+
const LC = LCs[0] // Get `en_US` part from `en_US.UTF-8`
|
|
39655
|
+
.split('.')[0] // Slice en_US to en
|
|
39656
|
+
.split('_')[0] // slice en-US to en
|
|
39657
|
+
.split('-')[0];
|
|
39658
|
+
|
|
39659
|
+
if (LC === 'C') {
|
|
39660
|
+
return '';
|
|
39661
|
+
}
|
|
39662
|
+
|
|
39663
|
+
return LC;
|
|
39664
|
+
}
|
|
39665
|
+
|
|
39666
|
+
detect() {
|
|
39667
|
+
var _ref, _ref2, _ref3, _process$env$LC_ALL;
|
|
39668
|
+
|
|
39669
|
+
const shellLocale = (_ref = (_ref2 = (_ref3 = (_process$env$LC_ALL = process.env.LC_ALL) !== null && _process$env$LC_ALL !== void 0 ? _process$env$LC_ALL : process.env.LC_MESSAGES) !== null && _ref3 !== void 0 ? _ref3 : process.env.LANG) !== null && _ref2 !== void 0 ? _ref2 : process.env.LANGUAGE) !== null && _ref !== void 0 ? _ref : Intl.DateTimeFormat().resolvedOptions().locale;
|
|
39670
|
+
return this.formatShellLocale(shellLocale);
|
|
39671
|
+
}
|
|
39672
|
+
|
|
39673
|
+
}
|
|
39674
|
+
|
|
39675
|
+
exports.I18CLILanguageDetector = I18CLILanguageDetector;
|
|
39676
|
+
|
|
39677
|
+
/***/ }),
|
|
39678
|
+
|
|
39679
39679
|
/***/ 45561:
|
|
39680
39680
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
39681
39681
|
|
|
@@ -39997,12 +39997,12 @@ var _path = _interopRequireDefault(__webpack_require__(71017));
|
|
|
39997
39997
|
|
|
39998
39998
|
var _utils = __webpack_require__(40468);
|
|
39999
39999
|
|
|
40000
|
-
var
|
|
40000
|
+
var _languageDetector = __webpack_require__(17382);
|
|
40001
40001
|
|
|
40002
40002
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40003
40003
|
|
|
40004
40004
|
function getLocaleLanguage() {
|
|
40005
|
-
const detector = new
|
|
40005
|
+
const detector = new _languageDetector.I18CLILanguageDetector();
|
|
40006
40006
|
return detector.detect();
|
|
40007
40007
|
}
|
|
40008
40008
|
|
|
@@ -40987,7 +40987,6 @@ exports.INTERNAL_PLUGINS = {
|
|
|
40987
40987
|
server: '@modern-js/plugin-nest/server',
|
|
40988
40988
|
},
|
|
40989
40989
|
'@modern-js/plugin-unbundle': { cli: '@modern-js/plugin-unbundle' },
|
|
40990
|
-
'@modern-js/plugin-server-build': { cli: '@modern-js/plugin-server-build' },
|
|
40991
40990
|
'@modern-js/plugin-server': {
|
|
40992
40991
|
cli: '@modern-js/plugin-server/cli',
|
|
40993
40992
|
server: '@modern-js/plugin-server/server',
|
|
@@ -41117,12 +41116,6 @@ exports.PLUGIN_SCHEMAS = {
|
|
|
41117
41116
|
},
|
|
41118
41117
|
},
|
|
41119
41118
|
],
|
|
41120
|
-
'@modern-js/plugin-ssr': [
|
|
41121
|
-
{
|
|
41122
|
-
target: 'runtime.ssr',
|
|
41123
|
-
schema: { type: ['boolean', 'object'] },
|
|
41124
|
-
},
|
|
41125
|
-
],
|
|
41126
41119
|
'@modern-js/plugin-state': [
|
|
41127
41120
|
{
|
|
41128
41121
|
target: 'runtime.state',
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.5.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/main.js",
|
|
@@ -39,11 +39,10 @@
|
|
|
39
39
|
"@modern-js/codesmith": "^1.3.0",
|
|
40
40
|
"@modern-js/codesmith-tools": "^1.2.1",
|
|
41
41
|
"@scripts/build": "0.0.0",
|
|
42
|
-
"@modern-js/
|
|
43
|
-
"@modern-js/
|
|
44
|
-
"@modern-js/
|
|
45
|
-
"@modern-js/
|
|
46
|
-
"@modern-js/utils": "1.7.9",
|
|
42
|
+
"@modern-js/generator-plugin-plugin": "1.2.4",
|
|
43
|
+
"@modern-js/plugin-i18n": "1.3.0",
|
|
44
|
+
"@modern-js/repo-generator": "1.4.5",
|
|
45
|
+
"@modern-js/utils": "1.7.12",
|
|
47
46
|
"@types/jest": "^27",
|
|
48
47
|
"@types/node": "^14",
|
|
49
48
|
"@types/react": "^17",
|