Skip to content

Commit

Permalink
Merge branch 'next' into feature/plugin-export
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen-jj authored Oct 31, 2022
2 parents 27b39dc + 6d740e5 commit 98555ec
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
1 change: 0 additions & 1 deletion packages/taro-cli/src/doctor/packageValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function pkgsNotInstalled (pkgs): ErrorLine[] {
function taroShouldUpdate (pkgs): ErrorLine[] {
// sort 是为了 UPDATE_PACKAGE_LIST 顺序改变也不影响单测结果
const list = UPDATE_PACKAGE_LIST
.filter(item => !(/nerv/.test(item)))
.sort()
.map(item => {
const taroPkg = pkgs.find(pkg => pkg.moduleName === item)
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-cli/src/presets/commands/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default (ctx: IPluginContext) => {
}

async function info (options, ctx) {
const npmPackages = ctx.helper.UPDATE_PACKAGE_LIST.concat(['react', 'react-native', 'nervjs', 'expo', 'taro-ui'])
const npmPackages = ctx.helper.UPDATE_PACKAGE_LIST.concat(['react', 'react-native', 'expo', 'taro-ui'])
const info = await envinfo.run(Object.assign({}, {
System: ['OS', 'Shell'],
Binaries: ['Node', 'Yarn', 'npm'],
Expand Down
14 changes: 2 additions & 12 deletions packages/taro-cli/src/presets/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,29 +100,19 @@ export default (ctx: IPluginContext) => {
const spinner = ora('正在获取最新版本信息...').start()

const version = await getTargetVersion()
// 获取 NervJS 版本
const nervJSVersion = `^${await getLatestVersion('nervjs')}`

spinner.stop()

const oldVersion = packageMap.dependencies['@tarojs/taro']
// 更新 @tarojs/* 版本和 NervJS 版本
Object.keys(packageMap.dependencies || {}).forEach((key) => {
if (UPDATE_PACKAGE_LIST.indexOf(key) !== -1) {
if (key.includes('nerv')) {
packageMap.dependencies[key] = nervJSVersion
} else {
packageMap.dependencies[key] = version
}
packageMap.dependencies[key] = version
}
})
Object.keys(packageMap.devDependencies || {}).forEach((key) => {
if (UPDATE_PACKAGE_LIST.indexOf(key) !== -1) {
if (key.includes('nerv')) {
packageMap.devDependencies[key] = nervJSVersion
} else {
packageMap.devDependencies[key] = version
}
packageMap.devDependencies[key] = version
}
})

Expand Down
2 changes: 0 additions & 2 deletions packages/taro-helper/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ export const UPDATE_PACKAGE_LIST = [
'@tarojs/plugin-mini-ci',
'@tarojs/webpack5-runner',
'@tarojs/webpack5-prebundle',
'nervjs',
'nerv-devtools'
]

export enum META_TYPE {
Expand Down

0 comments on commit 98555ec

Please sign in to comment.