Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove options.typescript support #73

Merged
merged 6 commits into from
Apr 21, 2018
Merged

fix: remove options.typescript support #73

merged 6 commits into from
Apr 21, 2018

Conversation

atian25
Copy link
Member

@atian25 atian25 commented Apr 4, 2018

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

@atian25 atian25 requested review from popomore and whxaxes April 4, 2018 13:40
@codecov
Copy link

codecov bot commented Apr 4, 2018

Codecov Report

Merging #73 into master will decrease coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #73      +/-   ##
==========================================
- Coverage   94.96%   94.88%   -0.08%     
==========================================
  Files          12       12              
  Lines         596      587       -9     
==========================================
- Hits          566      557       -9     
  Misses         30       30
Impacted Files Coverage Δ
lib/cluster.js 92.59% <ø> (ø) ⬆️
lib/format_options.js 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e94845...46d5e9a. Read the comment docs.

@@ -42,9 +42,9 @@ module.exports = function formatOptions(options) {

// typescript
if (!('typescript' in options)) {
Copy link
Member

Choose a reason for hiding this comment

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

我觉得这里可以改下,直接从 egg-bin 读取环境变量,不要传入 options 了

Copy link
Member Author

Choose a reason for hiding this comment

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

也行,也就是 egg-bin test/cov 那边已经分析好了这段逻辑了,这里直接读取 env,我改改

Copy link
Member Author

Choose a reason for hiding this comment

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

改了,再喵喵

}
}
}
options.typescript = String(process.env.EGG_TYPESCRIPT).toLowerCase() === 'true';
Copy link
Member

Choose a reason for hiding this comment

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

不需要 toLowerCase 了吧?会设置这个环境变量的就只有 egg-bin,egg-bin 就是设置成了 true ,没必要再做一层兼容的处理把?

}
}
}
options.typescript = String(process.env.EGG_TYPESCRIPT).toLowerCase() === 'true';
Copy link
Member

Choose a reason for hiding this comment

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

如果 egg-core 改成读 env 的话,这一整段应该都不需要了,因为已经不需要传递 options 了

Copy link
Member Author

Choose a reason for hiding this comment

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

你直接接管这个 PR

@atian25 atian25 changed the title fix: only read pkg when env undefined fix: remove options.typescript support Apr 20, 2018
@atian25
Copy link
Member Author

atian25 commented Apr 20, 2018

全部移除掉了,可以再看看

@atian25 atian25 mentioned this pull request Apr 20, 2018
4 tasks
@popomore
Copy link
Member

挂了?

@atian25
Copy link
Member Author

atian25 commented Apr 21, 2018

fixed

@atian25 atian25 merged commit 939c202 into master Apr 21, 2018
@atian25 atian25 deleted the fix-env-ts branch April 21, 2018 02:51
@atian25
Copy link
Member Author

atian25 commented Apr 21, 2018

3.17.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants