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

Implement stdin input with optional "-" as the file name. #3290

Merged
merged 2 commits into from Jan 4, 2020
Merged

Implement stdin input with optional "-" as the file name. #3290

merged 2 commits into from Jan 4, 2020

Conversation

kzc
Copy link
Contributor

@kzc kzc commented Dec 19, 2019

Set default output format to "es" to save CLI typing for the most common case.

Closes #1440
Closes #3276

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

#1440
#3276

Description

Implement stdin input with optional "-" as the file name.

Set default output format to "es" to save CLI typing for the most common case.

@codecov
Copy link

codecov bot commented Dec 19, 2019

Codecov Report

Merging #3290 into master will increase coverage by <.01%.
The diff coverage is 89.74%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3290      +/-   ##
==========================================
+ Coverage   93.12%   93.13%   +<.01%     
==========================================
  Files         170      171       +1     
  Lines        5966     6003      +37     
  Branches     1781     1792      +11     
==========================================
+ Hits         5556     5591      +35     
  Misses        219      219              
- Partials      191      193       +2
Impacted Files Coverage Δ
cli/run/index.ts 87.5% <100%> (+0.7%) ⬆️
src/utils/defaultPlugin.ts 94.11% <100%> (+0.11%) ⬆️
src/utils/mergeOptions.ts 91.95% <100%> (+1.47%) ⬆️
src/utils/stdin.ts 86.2% <86.2%> (ø)
src/ast/nodes/TaggedTemplateExpression.ts 60% <0%> (-3.64%) ⬇️
src/Graph.ts 92.94% <0%> (-0.05%) ⬇️
src/ast/nodes/ExportAllDeclaration.ts 100% <0%> (ø) ⬆️
src/ast/nodes/Property.ts 92.3% <0%> (ø) ⬆️
src/Module.ts 97.3% <0%> (ø) ⬆️
src/ast/variables/LocalVariable.ts 89.01% <0%> (ø) ⬆️
... and 15 more

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 7158c06...e90b090. Read the comment docs.

@kzc
Copy link
Contributor Author

kzc commented Dec 19, 2019

@lukastaegert Everything passing except for code coverage. Please add additional tests if you like.

@lukastaegert
Copy link
Member

Thanks a lot. Just a note, it will take a while until I can work fully through this.

Set default output format to "es" to save CLI typing for the most common case.

closes #1440
closes #3276
@kzc
Copy link
Contributor Author

kzc commented Dec 27, 2019

Test coverage was improved, but was unable to get 100% patch coverage. For whatever reason I couldn't simulate a stdin read error on Node within CircleCI. The same test worked locally on all Node versions. That particular test was commented out in the PR. I don't plan to spend any more time on it.

@kzc
Copy link
Contributor Author

kzc commented Dec 27, 2019

Just so there's no confusion, this PR works fine. That simulated stdin read error test is just a nice to have. It's not clear to me whether Node actually generates stdin read errors in any circumstance.

@lukastaegert lukastaegert self-requested a review December 28, 2019 09:12
* Only allow '-' to use stdin with the JS API
* Use locally installed shx
* Add test for stdin read error
@lukastaegert
Copy link
Member

Moving this to a local branch as there are still some changes I want to add

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.

Input from string/input stream Feature: accept stdin
2 participants