Skip to content

integrate CLI #1389

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

Merged
merged 8 commits into from
Apr 30, 2018
Merged

integrate CLI #1389

merged 8 commits into from
Apr 30, 2018

Conversation

Rich-Harris
Copy link
Member

fixes #1360

@Rich-Harris
Copy link
Member Author

This is failing because the CLI uses async/await. So we need to decide: do we

a) rewrite using regular promises
b) transpile, or
c) drop support for Node 6, seeing as it's no longer 'active LTS'

Transpiling wouldn't be that onerous I suppose, would just need to port it to TypeScript. Probably the lowest friction approach

@codecov-io
Copy link

codecov-io commented Apr 30, 2018

Codecov Report

Merging #1389 into master will increase coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1389      +/-   ##
==========================================
+ Coverage   91.19%   91.24%   +0.04%     
==========================================
  Files         122      122              
  Lines        4465     4465              
  Branches     1377     1377              
==========================================
+ Hits         4072     4074       +2     
+ Misses        156      154       -2     
  Partials      237      237
Impacted Files Coverage Δ
src/validate/js/propValidators/onrender.ts 100% <0%> (+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 d010aff...c9494d9. Read the comment docs.

@Conduitry
Copy link
Member

What does TypeScript compile async/await to? Having semi-legible transpiled code is nice, which in this case would mean hopefully generators (supported in Node 6) as opposed to impenetrable switch statements.

@Rich-Harris
Copy link
Member Author

It compiles surprisingly well, though it's still not what you'd call human-readable. Though I just looked again, and we're actually barely using async/await at all in the CLI, so I just rewrote it with normal promises for now.

@@ -0,0 +1,173 @@
/* src/Main.html generated by Svelte v2.3.0 */
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to do whatever string replacement we do in other tests here, so that this comment won't have to change each version?

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea — have done that

@Conduitry
Copy link
Member

I think you need to add a "bin" entry to package.json? And you can just point that right at the compiled index.ts.js - no need for a separate svelte file that requires that.

@Rich-Harris
Copy link
Member Author

D'oh, of course. I'm not sure you can just point it at the dist file though — I've had issues with permissions in the past where I needed to chmod u+x the file each time it was rebuilt.

@Rich-Harris Rich-Harris merged commit 4dcde4b into master Apr 30, 2018
@Rich-Harris Rich-Harris deleted the gh-1360 branch April 30, 2018 23:49
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.

Integrate CLI?
3 participants