ztxkutils 2.10.66-14 → 2.10.66-16

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.
Files changed (82) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/{request-ba8abf99.js → request-588c90ec.js} +92 -18
  3. package/dist/{request-0cc024b1.js → request-dc69f021.js} +68 -13
  4. package/dist/request.js +1 -1
  5. package/package.json +1 -1
  6. package/zti18n-cli/bin/index.js +3 -3
  7. package/zti18n-cli/index.js +23 -23
  8. package/zti18n-cli/src/command/collect.js +351 -342
  9. package/zti18n-cli/src/command/convert.js +17 -17
  10. package/zti18n-cli/src/command/convert2.js +35 -35
  11. package/zti18n-cli/src/command/initFileConf.js +133 -133
  12. package/zti18n-cli/src/command/publish.js +24 -24
  13. package/zti18n-cli/src/conf/BaseConf.js +21 -21
  14. package/zti18n-cli/src/conf/FileConf.js +116 -116
  15. package/zti18n-cli/src/index.js +75 -75
  16. package/zti18n-cli/src/translate/google.js +6 -6
  17. package/zti18n-cli/src/utils/isChinese.js +3 -3
  18. package/zti18n-cli/src/utils/log.js +8 -8
  19. package/zti18n-cli/src/utils/mergeOptions.js +45 -45
  20. package/zti18n-cli/src/utils/reactOptions.js +73 -73
  21. package/zti18n-cli/src/utils/vueOptions.js +69 -69
  22. package/zti18n-core/index.js +1 -1
  23. package/zti18n-core/src/index.js +5 -5
  24. package/zti18n-core/src/plugin/reactIntlToReactIntlUniversal.js +224 -224
  25. package/zti18n-core/src/plugin/reactIntlUniversalToDi18n.js +64 -64
  26. package/zti18n-core/src/transform/defaultPkMap.js +79 -79
  27. package/zti18n-core/src/transform/transformHtml.js +271 -271
  28. package/zti18n-core/src/transform/transformJs.js +488 -488
  29. package/zti18n-core/src/transform/transformPug.js +272 -272
  30. package/zti18n-core/src/transform/transformReactIntlToReactIntlUniversal.js +96 -96
  31. package/zti18n-core/src/transform/transformReactIntlUniveralToDi18n.js +90 -90
  32. package/zti18n-core/src/transform/transformToDi18n.js +22 -22
  33. package/zti18n-core/src/transform/transformTs.js +41 -41
  34. package/zti18n-core/src/transform/transformVue.js +126 -126
  35. package/zti18n-core/src/transform/transformZeroToDi18n.js +105 -105
  36. package/zti18n-core/src/translate/google.js +6 -6
  37. package/zti18n-core/src/utils/constants.js +3 -3
  38. package/zti18n-core/src/utils/getIgnoreLines.js +14 -14
  39. package/zti18n-core/src/utils/isChinese.js +3 -3
  40. package/zti18n-core/src/utils/log.js +8 -8
  41. package/dist/authority-e6bde99f.js +0 -423
  42. package/dist/reqUrl-3792afcd.js +0 -82
  43. package/dist/reqUrl-787dd9e5.js +0 -82
  44. package/dist/request-ef290b9a.js +0 -2838
  45. package/dist/tools-09a4d620.js +0 -2445
  46. package/dist/tools-0ca888cd.js +0 -2473
  47. package/dist/validate-6e735536.js +0 -79
  48. package/dist/zti18n-cli/bin/index.d.ts +0 -2
  49. package/dist/zti18n-cli/index.d.ts +0 -1
  50. package/dist/zti18n-cli/src/command/collect.d.ts +0 -2
  51. package/dist/zti18n-cli/src/command/convert.d.ts +0 -2
  52. package/dist/zti18n-cli/src/command/convert2.d.ts +0 -2
  53. package/dist/zti18n-cli/src/command/initFileConf.d.ts +0 -2
  54. package/dist/zti18n-cli/src/command/publish.d.ts +0 -2
  55. package/dist/zti18n-cli/src/conf/BaseConf.d.ts +0 -8
  56. package/dist/zti18n-cli/src/conf/FileConf.d.ts +0 -6
  57. package/dist/zti18n-cli/src/index.d.ts +0 -1
  58. package/dist/zti18n-cli/src/translate/google.d.ts +0 -2
  59. package/dist/zti18n-cli/src/utils/isChinese.d.ts +0 -2
  60. package/dist/zti18n-cli/src/utils/log.d.ts +0 -4
  61. package/dist/zti18n-cli/src/utils/mergeOptions.d.ts +0 -24
  62. package/dist/zti18n-cli/src/utils/reactOptions.d.ts +0 -21
  63. package/dist/zti18n-cli/src/utils/vueOptions.d.ts +0 -17
  64. package/dist/zti18n-core/index.d.ts +0 -2
  65. package/dist/zti18n-core/src/index.d.ts +0 -8
  66. package/dist/zti18n-core/src/plugin/reactIntlToReactIntlUniversal.d.ts +0 -19
  67. package/dist/zti18n-core/src/plugin/reactIntlUniversalToDi18n.d.ts +0 -9
  68. package/dist/zti18n-core/src/transform/defaultPkMap.d.ts +0 -75
  69. package/dist/zti18n-core/src/transform/transformHtml.d.ts +0 -5
  70. package/dist/zti18n-core/src/transform/transformJs.d.ts +0 -5
  71. package/dist/zti18n-core/src/transform/transformPug.d.ts +0 -5
  72. package/dist/zti18n-core/src/transform/transformReactIntlToReactIntlUniversal.d.ts +0 -2
  73. package/dist/zti18n-core/src/transform/transformReactIntlUniveralToDi18n.d.ts +0 -2
  74. package/dist/zti18n-core/src/transform/transformToDi18n.d.ts +0 -5
  75. package/dist/zti18n-core/src/transform/transformTs.d.ts +0 -5
  76. package/dist/zti18n-core/src/transform/transformVue.d.ts +0 -5
  77. package/dist/zti18n-core/src/transform/transformZeroToDi18n.d.ts +0 -2
  78. package/dist/zti18n-core/src/translate/google.d.ts +0 -2
  79. package/dist/zti18n-core/src/utils/constants.d.ts +0 -3
  80. package/dist/zti18n-core/src/utils/getIgnoreLines.d.ts +0 -2
  81. package/dist/zti18n-core/src/utils/isChinese.d.ts +0 -2
  82. package/dist/zti18n-core/src/utils/log.d.ts +0 -4
@@ -1,126 +1,126 @@
1
- const compiler = require('vue-template-compiler');
2
- const transformJs = require('./transformJs');
3
- const transformPug = require('./transformPug');
4
- const transformHtml = require('./transformHtml');
5
-
6
- function openTag(sfcBlock) {
7
- const { type, lang, src, scoped, module, attrs } = sfcBlock;
8
-
9
- let tag = `<${type}`;
10
- if (lang) tag += ` lang="${lang}"`;
11
- if (src) tag += ` src="${src}"`;
12
- if (scoped) tag += ' scoped';
13
- if (module) {
14
- if (typeof module === 'string') tag += ` module="${module}"`;
15
- else tag += ' module';
16
- }
17
- for (let k in attrs) {
18
- if (!['type', 'lang', 'src', 'scoped', 'module'].includes(k)) {
19
- tag += ` ${k}="${attrs[k]}"`;
20
- }
21
- }
22
- tag += '>';
23
-
24
- return tag;
25
- }
26
-
27
- function closeTag(sfcBlock) {
28
- return '</' + sfcBlock.type + '>';
29
- }
30
-
31
- function combineVue(template, script, sytles, customBlocks) {
32
- return [template, script, ...sytles, ...customBlocks]
33
- .map((sfc) =>
34
- sfc ? `${openTag(sfc)}\n${sfc.content.trim()}\n${closeTag(sfc)}\n` : ''
35
- )
36
- .join('\n');
37
- }
38
-
39
- module.exports = function transformVue(source, localeInfo = {}, options = {}) {
40
- const { allTranslated = {}, allUpdated = {}, allUsedKeys = [] } = localeInfo;
41
-
42
- const {
43
- primaryRegx = /[\u4e00-\u9fa5]/,
44
- i18nObject = 'intl',
45
- i18nMethod = '$t',
46
- importCode = "import { intl } from 'di18n-vue';",
47
- babelPresets = [],
48
- babelPlugins = [],
49
- ignoreComponents = [],
50
- ignoreMethods = [],
51
- pkMap = {},
52
- } = options;
53
-
54
- const sfc = compiler.parseComponent(source, {
55
- pad: 'space',
56
- deindent: false,
57
- });
58
-
59
- const { template, script, styles, customBlocks } = sfc;
60
- let hasTouch = false;
61
-
62
- if (template) {
63
- const templateType = (template.lang || 'html').toLowerCase();
64
-
65
- // transform template
66
- if (['html', 'pug'].includes(templateType)) {
67
- const transform = templateType === 'html' ? transformHtml : transformPug;
68
-
69
- const ret = transform(
70
- template.content,
71
- {
72
- allTranslated,
73
- allUpdated,
74
- allUsedKeys,
75
- },
76
- {
77
- primaryRegx,
78
- i18nObject: '',
79
- i18nMethod,
80
- importCode: '',
81
- babelPresets,
82
- babelPlugins,
83
- ignoreComponents,
84
- ignoreMethods,
85
- pkMap,
86
- }
87
- );
88
-
89
- template.content = ret.source;
90
- hasTouch = ret.hasTouch;
91
- } else {
92
- console.warn(
93
- `Unsupport type: ${templateType}, so the template is ignored`
94
- );
95
- }
96
- }
97
-
98
- // transform script
99
- if (script) {
100
- const ret = transformJs(
101
- script.content,
102
- {
103
- allTranslated,
104
- allUpdated,
105
- allUsedKeys,
106
- },
107
- {
108
- primaryRegx,
109
- i18nObject,
110
- i18nMethod,
111
- importCode,
112
- babelPresets,
113
- babelPlugins,
114
- ignoreComponents,
115
- ignoreMethods,
116
- }
117
- );
118
-
119
- script.content = ret.source;
120
- hasTouch = hasTouch || ret.hasTouch;
121
- }
122
-
123
- const code = combineVue(template, script, styles, customBlocks);
124
-
125
- return { source: code, hasTouch };
126
- };
1
+ const compiler = require('vue-template-compiler');
2
+ const transformJs = require('./transformJs');
3
+ const transformPug = require('./transformPug');
4
+ const transformHtml = require('./transformHtml');
5
+
6
+ function openTag(sfcBlock) {
7
+ const { type, lang, src, scoped, module, attrs } = sfcBlock;
8
+
9
+ let tag = `<${type}`;
10
+ if (lang) tag += ` lang="${lang}"`;
11
+ if (src) tag += ` src="${src}"`;
12
+ if (scoped) tag += ' scoped';
13
+ if (module) {
14
+ if (typeof module === 'string') tag += ` module="${module}"`;
15
+ else tag += ' module';
16
+ }
17
+ for (let k in attrs) {
18
+ if (!['type', 'lang', 'src', 'scoped', 'module'].includes(k)) {
19
+ tag += ` ${k}="${attrs[k]}"`;
20
+ }
21
+ }
22
+ tag += '>';
23
+
24
+ return tag;
25
+ }
26
+
27
+ function closeTag(sfcBlock) {
28
+ return '</' + sfcBlock.type + '>';
29
+ }
30
+
31
+ function combineVue(template, script, sytles, customBlocks) {
32
+ return [template, script, ...sytles, ...customBlocks]
33
+ .map((sfc) =>
34
+ sfc ? `${openTag(sfc)}\n${sfc.content.trim()}\n${closeTag(sfc)}\n` : ''
35
+ )
36
+ .join('\n');
37
+ }
38
+
39
+ module.exports = function transformVue(source, localeInfo = {}, options = {}) {
40
+ const { allTranslated = {}, allUpdated = {}, allUsedKeys = [] } = localeInfo;
41
+
42
+ const {
43
+ primaryRegx = /[\u4e00-\u9fa5]/,
44
+ i18nObject = 'intl',
45
+ i18nMethod = '$t',
46
+ importCode = "import { intl } from 'di18n-vue';",
47
+ babelPresets = [],
48
+ babelPlugins = [],
49
+ ignoreComponents = [],
50
+ ignoreMethods = [],
51
+ pkMap = {},
52
+ } = options;
53
+
54
+ const sfc = compiler.parseComponent(source, {
55
+ pad: 'space',
56
+ deindent: false,
57
+ });
58
+
59
+ const { template, script, styles, customBlocks } = sfc;
60
+ let hasTouch = false;
61
+
62
+ if (template) {
63
+ const templateType = (template.lang || 'html').toLowerCase();
64
+
65
+ // transform template
66
+ if (['html', 'pug'].includes(templateType)) {
67
+ const transform = templateType === 'html' ? transformHtml : transformPug;
68
+
69
+ const ret = transform(
70
+ template.content,
71
+ {
72
+ allTranslated,
73
+ allUpdated,
74
+ allUsedKeys,
75
+ },
76
+ {
77
+ primaryRegx,
78
+ i18nObject: '',
79
+ i18nMethod,
80
+ importCode: '',
81
+ babelPresets,
82
+ babelPlugins,
83
+ ignoreComponents,
84
+ ignoreMethods,
85
+ pkMap,
86
+ }
87
+ );
88
+
89
+ template.content = ret.source;
90
+ hasTouch = ret.hasTouch;
91
+ } else {
92
+ console.warn(
93
+ `Unsupport type: ${templateType}, so the template is ignored`
94
+ );
95
+ }
96
+ }
97
+
98
+ // transform script
99
+ if (script) {
100
+ const ret = transformJs(
101
+ script.content,
102
+ {
103
+ allTranslated,
104
+ allUpdated,
105
+ allUsedKeys,
106
+ },
107
+ {
108
+ primaryRegx,
109
+ i18nObject,
110
+ i18nMethod,
111
+ importCode,
112
+ babelPresets,
113
+ babelPlugins,
114
+ ignoreComponents,
115
+ ignoreMethods,
116
+ }
117
+ );
118
+
119
+ script.content = ret.source;
120
+ hasTouch = hasTouch || ret.hasTouch;
121
+ }
122
+
123
+ const code = combineVue(template, script, styles, customBlocks);
124
+
125
+ return { source: code, hasTouch };
126
+ };
@@ -1,105 +1,105 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const prettier = require('prettier');
4
- const transformTs = require('./transformTs');
5
- const transformJs = require('./transformJs');
6
- const transformVue = require('./transformVue');
7
- const log = require('../utils/log');
8
-
9
- function transformReact(
10
- codeFileInfo,
11
- allTranslatedWord,
12
- updatedTranslatedWord,
13
- keysInUse,
14
- option
15
- ) {
16
- const { filePath, currentEntry, currentOutput } = codeFileInfo;
17
- const sourceCode = fs.readFileSync(filePath, 'utf8');
18
- const isTSX = ['.ts', '.tsx'].includes(path.extname(filePath));
19
-
20
- const transform = isTSX ? transformTs : transformJs;
21
-
22
- const { source, hasTouch } = transform(
23
- sourceCode,
24
- {
25
- allTranslated: allTranslatedWord,
26
- allUpdated: updatedTranslatedWord,
27
- allUsedKeys: keysInUse,
28
- },
29
- option
30
- );
31
-
32
- if (!option.extractOnly && hasTouch) {
33
- let code = source;
34
- if (option.prettier) {
35
- const parser = isTSX ? 'typescript' : 'babel';
36
- code = prettier.format(source, { ...option.prettier, parser });
37
- }
38
-
39
- const target = currentOutput
40
- ? filePath.replace(currentEntry, currentOutput)
41
- : filePath;
42
- fs.writeFileSync(target, code, { encoding: 'utf-8' });
43
- }
44
- }
45
-
46
- function transformVueAdapter(
47
- codeFileInfo,
48
- allTranslatedWord,
49
- updatedTranslatedWord,
50
- keysInUse,
51
- option
52
- ) {
53
- const { filePath, currentEntry, currentOutput } = codeFileInfo;
54
- const sourceCode = fs.readFileSync(filePath, 'utf8');
55
-
56
- const { source, hasTouch } = transformVue(
57
- sourceCode,
58
- {
59
- allTranslated: allTranslatedWord,
60
- allUpdated: updatedTranslatedWord,
61
- allUsedKeys: keysInUse,
62
- },
63
- option
64
- );
65
-
66
- if (!option.extractOnly && hasTouch) {
67
- let code = source;
68
- if (option.prettier) {
69
- const parser = 'vue';
70
- code = prettier.format(source, { ...option.prettier, parser });
71
- }
72
-
73
- const target = currentOutput
74
- ? filePath.replace(currentEntry, currentOutput)
75
- : filePath;
76
- fs.writeFileSync(target, code, { encoding: 'utf-8' });
77
- }
78
- }
79
-
80
- /**
81
- * 转换 react 和 普通 js 文件
82
- * @param {object} codeFileInfo 源码文件信息
83
- * @param {object} allTranslatedWord 现有的中文资源
84
- * @param {object} updatedTranslatedWord 在远端做过中文文案修改的 key/value
85
- * @param {array} keysInUse 使用中的key
86
- * @param {object} option 透传过来的 di18n 配置
87
- */
88
- module.exports = function transformZeroToDi18n(
89
- codeFileInfo,
90
- allTranslatedWord,
91
- updatedTranslatedWord,
92
- keysInUse,
93
- option
94
- ) {
95
- const { ext } = codeFileInfo;
96
- const doTransform = ext === '.vue' ? transformVueAdapter : transformReact;
97
- log.info(codeFileInfo.filePath);
98
- doTransform(
99
- codeFileInfo,
100
- allTranslatedWord,
101
- updatedTranslatedWord,
102
- keysInUse,
103
- option
104
- );
105
- };
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const prettier = require('prettier');
4
+ const transformTs = require('./transformTs');
5
+ const transformJs = require('./transformJs');
6
+ const transformVue = require('./transformVue');
7
+ const log = require('../utils/log');
8
+
9
+ function transformReact(
10
+ codeFileInfo,
11
+ allTranslatedWord,
12
+ updatedTranslatedWord,
13
+ keysInUse,
14
+ option
15
+ ) {
16
+ const { filePath, currentEntry, currentOutput, noImport } = codeFileInfo;
17
+ const sourceCode = fs.readFileSync(filePath, 'utf8');
18
+ const isTSX = ['.ts', '.tsx'].includes(path.extname(filePath));
19
+
20
+ const transform = isTSX ? transformTs : transformJs;
21
+
22
+ const { source, hasTouch } = transform(
23
+ sourceCode,
24
+ {
25
+ allTranslated: allTranslatedWord,
26
+ allUpdated: updatedTranslatedWord,
27
+ allUsedKeys: keysInUse,
28
+ },
29
+ option
30
+ );
31
+
32
+ if (!option.extractOnly && hasTouch && !noImport) {
33
+ let code = source;
34
+ if (option.prettier) {
35
+ const parser = isTSX ? 'typescript' : 'babel';
36
+ code = prettier.format(source, { ...option.prettier, parser });
37
+ }
38
+
39
+ const target = currentOutput
40
+ ? filePath.replace(currentEntry, currentOutput)
41
+ : filePath;
42
+ fs.writeFileSync(target, code, { encoding: 'utf-8' });
43
+ }
44
+ }
45
+
46
+ function transformVueAdapter(
47
+ codeFileInfo,
48
+ allTranslatedWord,
49
+ updatedTranslatedWord,
50
+ keysInUse,
51
+ option
52
+ ) {
53
+ const { filePath, currentEntry, currentOutput } = codeFileInfo;
54
+ const sourceCode = fs.readFileSync(filePath, 'utf8');
55
+
56
+ const { source, hasTouch } = transformVue(
57
+ sourceCode,
58
+ {
59
+ allTranslated: allTranslatedWord,
60
+ allUpdated: updatedTranslatedWord,
61
+ allUsedKeys: keysInUse,
62
+ },
63
+ option
64
+ );
65
+
66
+ if (!option.extractOnly && hasTouch) {
67
+ let code = source;
68
+ if (option.prettier) {
69
+ const parser = 'vue';
70
+ code = prettier.format(source, { ...option.prettier, parser });
71
+ }
72
+
73
+ const target = currentOutput
74
+ ? filePath.replace(currentEntry, currentOutput)
75
+ : filePath;
76
+ fs.writeFileSync(target, code, { encoding: 'utf-8' });
77
+ }
78
+ }
79
+
80
+ /**
81
+ * 转换 react 和 普通 js 文件
82
+ * @param {object} codeFileInfo 源码文件信息
83
+ * @param {object} allTranslatedWord 现有的中文资源
84
+ * @param {object} updatedTranslatedWord 在远端做过中文文案修改的 key/value
85
+ * @param {array} keysInUse 使用中的key
86
+ * @param {object} option 透传过来的 di18n 配置
87
+ */
88
+ module.exports = function transformZeroToDi18n(
89
+ codeFileInfo,
90
+ allTranslatedWord,
91
+ updatedTranslatedWord,
92
+ keysInUse,
93
+ option
94
+ ) {
95
+ const { ext } = codeFileInfo;
96
+ const doTransform = ext === '.vue' ? transformVueAdapter : transformReact;
97
+ log.info(codeFileInfo.filePath);
98
+ doTransform(
99
+ codeFileInfo,
100
+ allTranslatedWord,
101
+ updatedTranslatedWord,
102
+ keysInUse,
103
+ option
104
+ );
105
+ };
@@ -1,6 +1,6 @@
1
- // https://github.com/matheuss/google-translate-api/issues/79#issuecomment-427841889
2
- const googleTranslate = require('@vitalets/google-translate-api');
3
-
4
- module.exports = function translateByGoogle(text, targetLang) {
5
- return googleTranslate(text, { client: 'gtx', to: targetLang });
6
- };
1
+ // https://github.com/matheuss/google-translate-api/issues/79#issuecomment-427841889
2
+ const googleTranslate = require('@vitalets/google-translate-api');
3
+
4
+ module.exports = function translateByGoogle(text, targetLang) {
5
+ return googleTranslate(text, { client: 'gtx', to: targetLang });
6
+ };
@@ -1,3 +1,3 @@
1
- exports.REACT_JS = 'js';
2
- exports.REACT_TS = 'ts';
3
- exports.VUE = 'vue';
1
+ exports.REACT_JS = 'js';
2
+ exports.REACT_TS = 'ts';
3
+ exports.VUE = 'vue';
@@ -1,14 +1,14 @@
1
- module.exports = function getIgnoreLines(tpl) {
2
- // 仅支持 // di18n-disable 和 // di18n-enable 注释指令
3
- const ignores = [];
4
- let ignoring = false;
5
-
6
- const lines = tpl.split(/\n|\r\n/g);
7
- for (let i = 0; i < lines.length; i++) {
8
- if (lines[i].includes('di18n-disable')) ignoring = true;
9
- if (lines[i].includes('di18n-enable')) ignoring = false;
10
- if (ignoring) ignores.push(i + 1);
11
- }
12
-
13
- return ignores;
14
- };
1
+ module.exports = function getIgnoreLines(tpl) {
2
+ // 仅支持 // di18n-disable 和 // di18n-enable 注释指令
3
+ const ignores = [];
4
+ let ignoring = false;
5
+
6
+ const lines = tpl.split(/\n|\r\n/g);
7
+ for (let i = 0; i < lines.length; i++) {
8
+ if (lines[i].includes('di18n-disable')) ignoring = true;
9
+ if (lines[i].includes('di18n-enable')) ignoring = false;
10
+ if (ignoring) ignores.push(i + 1);
11
+ }
12
+
13
+ return ignores;
14
+ };
@@ -1,3 +1,3 @@
1
- module.exports = function isChinese(text) {
2
- return /[\u4e00-\u9fa5]/.test(text);
3
- };
1
+ module.exports = function isChinese(text) {
2
+ return /[\u4e00-\u9fa5]/.test(text);
3
+ };
@@ -1,8 +1,8 @@
1
- const chalk = require('chalk');
2
-
3
- module.exports = {
4
- info: (msg) => console.log(chalk.cyan(msg)),
5
- warning: (msg) => console.log(chalk.yellow(msg)),
6
- success: (msg) => console.log(chalk.green(msg)),
7
- error: (msg) => console.log(chalk.red(msg)),
8
- };
1
+ const chalk = require('chalk');
2
+
3
+ module.exports = {
4
+ info: (msg) => console.log(chalk.cyan(msg)),
5
+ warning: (msg) => console.log(chalk.yellow(msg)),
6
+ success: (msg) => console.log(chalk.green(msg)),
7
+ error: (msg) => console.log(chalk.red(msg)),
8
+ };