@@ -459,36 +459,36 @@ export default class Convertor {
459
459
}
460
460
} ,
461
461
462
- ClassExpression ( astPath ) {
463
- updateLogFileContent (
464
- `INFO [taro-cli-convertor] parseAst - 解析ClassExpression ${ getLineBreak ( ) } ${ astPath } ${ getLineBreak ( ) } `
465
- )
466
- const node = astPath . node
467
- if ( node . superClass ) {
468
- let isTaroComponent = false
469
- astPath . traverse ( {
470
- ClassMethod ( astPath ) {
471
- if ( astPath . get ( 'key' ) . isIdentifier ( { name : 'render' } ) ) {
472
- astPath . traverse ( {
473
- JSXElement ( ) {
474
- isTaroComponent = true
475
- } ,
476
- } )
477
- }
478
- } ,
479
- } )
480
- if ( isTaroComponent ) {
481
- if ( node . id === null ) {
482
- const parentNode = astPath . parentPath . node as t . VariableDeclarator
483
- if ( t . isVariableDeclarator ( astPath . parentPath ) ) {
484
- componentClassName = ( parentNode . id as t . Identifier ) . name
485
- }
486
- } else {
487
- componentClassName = node . id ! . name
488
- }
489
- }
490
- }
491
- } ,
462
+ // ClassExpression (astPath) {
463
+ // updateLogFileContent(
464
+ // `INFO [taro-cli-convertor] parseAst - 解析ClassExpression ${getLineBreak()}${astPath} ${getLineBreak()}`
465
+ // )
466
+ // const node = astPath.node
467
+ // if (node.superClass) {
468
+ // let isTaroComponent = false
469
+ // astPath.traverse({
470
+ // ClassMethod (astPath) {
471
+ // if (astPath.get('key').isIdentifier({ name: 'render' })) {
472
+ // astPath.traverse({
473
+ // JSXElement () {
474
+ // isTaroComponent = true
475
+ // },
476
+ // })
477
+ // }
478
+ // },
479
+ // })
480
+ // if (isTaroComponent) {
481
+ // if (node.id === null) {
482
+ // const parentNode = astPath.parentPath.node as t.VariableDeclarator
483
+ // if (t.isVariableDeclarator(astPath.parentPath)) {
484
+ // componentClassName = (parentNode.id as t.Identifier).name
485
+ // }
486
+ // } else {
487
+ // componentClassName = node.id!.name
488
+ // }
489
+ // }
490
+ // }
491
+ // },
492
492
ExportDefaultDeclaration ( astPath ) {
493
493
updateLogFileContent (
494
494
`INFO [taro-cli-convertor] parseAst - 解析ExportDefaultDeclaration ${ getLineBreak ( ) } ${ astPath } ${ getLineBreak ( ) } `
@@ -1628,18 +1628,18 @@ ${code}
1628
1628
}
1629
1629
1630
1630
// 判断三方库是否安装
1631
- isInNodeModule ( modulePath : string) {
1632
- const nodeModules = path . resolve ( this . root , 'node_modules' )
1633
- if ( ! fs . existsSync ( nodeModules ) ) {
1634
- return false
1635
- }
1636
- const modules = fs . readdirSync ( nodeModules )
1637
- const parts = modulePath . split ( '/' )
1638
- if ( modules . indexOf ( parts [ 0 ] ) === - 1 ) {
1639
- return false
1640
- }
1641
- return true
1642
- }
1631
+ // isInNodeModule (modulePath: string) {
1632
+ // const nodeModules = path.resolve(this.root, 'node_modules')
1633
+ // if (!fs.existsSync(nodeModules)) {
1634
+ // return false
1635
+ // }
1636
+ // const modules = fs.readdirSync(nodeModules)
1637
+ // const parts = modulePath.split('/')
1638
+ // if (modules.indexOf(parts[0]) === -1) {
1639
+ // return false
1640
+ // }
1641
+ // return true
1642
+ // }
1643
1643
1644
1644
traversePages ( root : string , pages : Set < string > ) {
1645
1645
pages . forEach ( ( page ) => {
0 commit comments