mtong-tools
Advanced tools
+0
-1
@@ -25,3 +25,2 @@ #!/usr/bin/env node | ||
| .action((name, options) => { | ||
| console.log(options, '-------------dddd') | ||
| require('./create')(name, options) | ||
@@ -28,0 +27,0 @@ }) |
+14
-1
@@ -25,6 +25,11 @@ const {error} = require('../utils') | ||
| const data = {}, keys = sheet[0].map(item => item.toLocaleLowerCase()); | ||
| const enumMap = {} | ||
| for (let i = 1; i < keys.length; i++) { | ||
| if (keys[i]) data[keys[i]] = { | ||
| const key = keys[i] | ||
| if (key) data[key] = { | ||
| message: {} | ||
| } | ||
| const enumKey = key.toLocaleLowerCase() | ||
| enumMap[enumKey] = key | ||
| } | ||
@@ -52,2 +57,10 @@ for (let i = 1; i < sheet.length; i++) { | ||
| }) | ||
| let str = suffix === 'ts' ? 'export default enum I18nMessageType {\n' : 'export default {\n' | ||
| Object.entries(enumMap).forEach(([key, value]) => { | ||
| str += ` ${key} = '${value}',\n` | ||
| }) | ||
| str += `}` | ||
| const file = Path.join(outPath, `index.${suffix}`) | ||
| fs.outputFileSync(file, str) | ||
| } | ||
@@ -54,0 +67,0 @@ console.log(`多语言生成成功:${chalk.blue(file)}-${chalk.yellow(outPath)}`) |
+1
-1
| { | ||
| "name": "mtong-tools", | ||
| "version": "1.0.7", | ||
| "version": "2.0.1", | ||
| "description": "mt cli", | ||
@@ -5,0 +5,0 @@ "bin": { |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
413
2.48%15798
-0.42%