@dcloudio/uni-migration 2.0.0 → 2.0.1-32920211122002

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.
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  const path = require('path')
4
4
  const Program = require('commander')
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const path = require('path')
2
2
  const fs = require('fs-extra')
3
-
3
+ const uniI18n = require('@dcloudio/uni-cli-i18n')
4
4
  const validate = require('./validate')
5
5
 
6
6
  const patchVant = require('./vant')
@@ -13,7 +13,7 @@ module.exports = function migrate (input, out, options = {}) {
13
13
  options.platform = options.platform || 'mp-weixin'
14
14
  const migrater = migraters[options.platform]
15
15
  if (!migrater) {
16
- return console.error(`错误: 目前支持 ${Object.keys(migraters).join(',')} 转换`)
16
+ return console.error(uniI18n.__('migration.errorOnlySupportConvert', { 0: Object.keys(migraters).join(',') }))
17
17
  }
18
18
  input = path.resolve(input)
19
19
  out = path.resolve(out || input)
package/lib/validate.js CHANGED
@@ -1,13 +1,13 @@
1
1
  const fs = require('fs')
2
2
  const path = require('path')
3
-
3
+ const uniI18n = require('@dcloudio/uni-cli-i18n')
4
4
  const migraters = {
5
5
  'mp-weixin': require('./mp-weixin')
6
6
  }
7
7
 
8
8
  module.exports = function validate (input, out, options) {
9
9
  if (!fs.existsSync(input)) {
10
- return console.error(`错误: '${input}' 不存在`)
10
+ return console.error(uniI18n.__('migration.errorInputNotExists', { 0: input }))
11
11
  }
12
12
  Object.assign(options, migraters[options.platform].options)
13
13
  const templateExtname = options.extname.template
@@ -15,7 +15,7 @@ module.exports = function validate (input, out, options) {
15
15
  const stat = fs.lstatSync(input)
16
16
  if (stat.isFile()) {
17
17
  if (path.extname(input) !== templateExtname) {
18
- return console.error(`错误: 单文件转换需要传入 ${templateExtname.substr(1)} 文件地址`)
18
+ return console.error(uniI18n.__('migration.errorConvertRequireFileUrl', { 0: templateExtname.substr(1) }))
19
19
  }
20
20
  options.target = 'file'
21
21
  } else if (stat.isDirectory()) {
@@ -26,7 +26,7 @@ module.exports = function validate (input, out, options) {
26
26
  options.target = 'folder'
27
27
  }
28
28
  } else {
29
- return console.error(`错误: '${input}' 不支持转换`)
29
+ return console.error(uniI18n.__('migration.errorCannotConvert', { 0: input }))
30
30
  }
31
31
  return true
32
- }
32
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-migration",
3
- "version": "2.0.0",
3
+ "version": "2.0.1-32920211122002",
4
4
  "description": "uni-app migration",
5
5
  "main": "lib/index.js",
6
6
  "repository": {
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "author": "fxy060608",
22
22
  "license": "Apache-2.0",
23
- "gitHead": "b1bdfb4de3f518c1c0fbab242403ea05feced4e3",
23
+ "gitHead": "dc33ced4b2fff3063385d9eda8dd1f3539133a67",
24
24
  "dependencies": {
25
25
  "commander": "^4.0.1",
26
26
  "fs-extra": "^8.1.0",