angular2-template-loader icon indicating copy to clipboard operation
angular2-template-loader copied to clipboard

Use typescript to parse source files

Open tmair opened this issue 7 years ago • 3 comments

Fixes #54

This pull request uses typescript to construct an AST and find the positions where the require()s should be placed. It should fix several issues and edge cases caused by the regexp approach.

All tests are passing and one new test (adding the possibility to use template literals) was added.

tmair avatar Jun 24 '17 10:06 tmair

Codecov Report

Merging #70 into master will increase coverage by 2.47%. The diff coverage is 98.78%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #70      +/-   ##
=========================================
+ Coverage   96.42%   98.9%   +2.47%     
=========================================
  Files           1       1              
  Lines          28      91      +63     
  Branches        5      24      +19     
=========================================
+ Hits           27      90      +63     
  Misses          1       1
Impacted Files Coverage Δ
index.js 98.9% <98.78%> (+2.47%) :arrow_up:

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 c2dc887...4ded269. Read the comment docs.

codecov-io avatar Jun 24 '17 10:06 codecov-io

@TheLarkInn I am planning on looking through the issues and see which of them are resolved by this PR. Some of the other PRs already define new tests for the edge cases they fix (based on the regexp approach). So I am planning on adding those tests to the spec as well, just to make sure that the AST approach really covers them

tmair avatar Jun 24 '17 11:06 tmair

This would resolve my issue where the regex fails on properly quoted JSON object keys.

crhairr avatar Jan 22 '18 18:01 crhairr