修正因v1.0.4版本新增的是否显示日志选项,在tmodjs初始化过程中产生的bug #129
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix:
1、tmod在实例化过程中,获取package.json中依赖tmodjs版本号时的容错逻辑有判断遗漏,假如在dependencies中没有tmodjs的依赖,但是有其他第三方模块的依赖,而devDependencies中有tmodjs,但是没有对其进行容错处理,导致后续的replace出现can't read property 'tmodjs' of undefined的错误,也给第三方工具的集成造成不便。
2、v1.0.4新增"verbose": true选项,选择是否显示日志,产生的bug,主要是当tmod在获取配置信息时,这个时候tmodjs内部的options属性并未初始化,而获取配置信息出错时,调用打印日志的前提是判断this.options.verbose为真时才打印,此时this.options是没有初始化的,那么这就尴尬了,直接就出现'verbose' of undefined',使用者连为何错误都不知道。
虽然项目停更了,如果作者觉得合理,希望作者能合并这个请求。