Skip to content

Commit

Permalink
fix(cli): 修改云开发模板创建相关问题
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjinjin0731 committed Mar 19, 2019
1 parent 04657c1 commit 8e234d8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/taro-cli/templates/wxcloud/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = function (creater, params, helper, cb) {
})
creater.template(template, path.join(clientDirName, 'indexhtml'), path.join(projectClientPath, 'index.html'))
if (typescript) {
creater.template(template, path.join(clientDirName, 'appjs'), path.join(projectClientPath, 'app.tsx'), {
creater.template(template, path.join(clientDirName, 'appjs'), path.join(sourceDir, 'app.tsx'), {
css: currentStyleExt,
typescript: true
})
Expand Down Expand Up @@ -98,7 +98,7 @@ module.exports = function (creater, params, helper, cb) {
css: currentStyleExt,
typescript: true
})
creater.template(template, path.join(clientDirName, 'components', 'login', 'index'), path.join(sourceDir, 'components', 'login', 'index.tsx'), {
creater.template(template, path.join(clientDirName, 'components', 'login', 'index'), path.join(sourceDir, 'components', 'login', 'index.weapp.tsx'), {
css: currentStyleExt,
typescript: true
})
Expand Down Expand Up @@ -126,15 +126,17 @@ module.exports = function (creater, params, helper, cb) {
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建源码目录: ${projectName}/${clientDirName}/${src}`)}`)
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建页面目录: ${projectName}/${clientDirName}/${src}/pages`)}`)
if (typescript) {
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建页面 TS 文件: ${projectName}/${clientDirName}/${src}/pages/index/index.weapp.tsx`)}`)
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建页面 TS 文件: ${projectName}/${clientDirName}/${src}/pages/index/index.tsx`)}`)
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建页面目录: ${projectName}/${clientDirName}/${src}/components/login/index.weapp.tsx`)}`)
} else {
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建页面 JS 文件: ${projectName}/${clientDirName}/${src}/pages/index/index.weapp.js`)}`)
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建页面 JS 文件: ${projectName}/${clientDirName}/${src}/pages/index/index.js`)}`)
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建页面目录: ${projectName}/${clientDirName}/${src}/components/login/index.weapp.js`)}`)
}
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建页面 ${currentStyleExt.toLocaleUpperCase()} 文件: ${projectName}/${clientDirName}/${src}/pages/index/${pageCSSName}`)}`)
if (typescript) {
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建文件: ${projectName}/${clientDirName}/${src}/app.weapp.tsx`)}`)
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建文件: ${projectName}/${clientDirName}/${src}/app.tsx`)}`)
} else {
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建文件: ${projectName}/${clientDirName}/${src}/app.weapp.js`)}`)
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建文件: ${projectName}/${clientDirName}/${src}/app.js`)}`)
}
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建文件: ${projectName}/${clientDirName}/${src}/${appCSSName}`)}`)
console.log(`${chalk.green('✔ ')}${chalk.grey(`创建文件: ${projectName}/${clientDirName}/${src}/index.html`)}`)
Expand Down

1 comment on commit 8e234d8

@flxxyz
Copy link
Contributor

@flxxyz flxxyz commented on 8e234d8 Apr 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

今天刚发现这个bug,使用ts创建云开发模板出错,发现项目client有个app.tsx,看了下源码准备pull request的
version: v1.2.20

Please sign in to comment.