apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

refactor: do not infer project root from script location #1202

Closed erisu closed 2 years ago

erisu commented 2 years ago

Motivation and Context

The goal of this PR is to eliminate all areas where our JS library expects to be located inside the project directory.

This is to prepare for a change that will keep the library in node_modules and not copy it to the platform project.

Description

Basically this passes the project root that has been passed to Api to all places that need it but do not yet have it.

This also extends the E2E tests to check that we do not have to require the Api from the platform project folder.

Testing

Checklist

raphinesse commented 2 years ago

The added test mentioned in the PR comment is not here, but that's OK. I take it that you just copied the text from my corresponding android PR? :grin:

codecov-commenter commented 2 years ago

Codecov Report

Merging #1202 (9c3fa18) into master (1dbf072) will decrease coverage by 0.06%. The diff coverage is 62.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1202      +/-   ##
==========================================
- Coverage   75.15%   75.09%   -0.07%     
==========================================
  Files          13       13              
  Lines        1658     1658              
==========================================
- Hits         1246     1245       -1     
- Misses        412      413       +1     
Impacted Files Coverage Δ
bin/templates/scripts/cordova/lib/run.js 21.97% <50.00%> (-1.10%) :arrow_down:
bin/templates/scripts/cordova/lib/build.js 44.44% <66.66%> (ø)
bin/templates/scripts/cordova/Api.js 70.58% <100.00%> (ø)

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 1dbf072...9c3fa18. Read the comment docs.