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

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

Merged
merged 5 commits into from Jul 13, 2021

Conversation

raphinesse
Copy link
Contributor

@raphinesse raphinesse commented Jul 7, 2021

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

  • Updated tests pass
  • Manually built default app with updated platform

@codecov-commenter
Copy link

codecov-commenter commented Jul 9, 2021

Codecov Report

Merging #1265 (0f33ee5) into master (70a1eff) will increase coverage by 2.14%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1265      +/-   ##
==========================================
+ Coverage   71.15%   73.30%   +2.14%     
==========================================
  Files          21       21              
  Lines        1650     1648       -2     
==========================================
+ Hits         1174     1208      +34     
+ Misses        476      440      -36     
Impacted Files Coverage Δ
bin/templates/cordova/Api.js 50.61% <50.00%> (ø)
bin/lib/create.js 94.59% <100.00%> (ø)
...n/templates/cordova/lib/builders/ProjectBuilder.js 72.90% <100.00%> (+1.93%) ⬆️
bin/templates/cordova/lib/check_reqs.js 70.37% <100.00%> (-0.22%) ⬇️
bin/templates/cordova/lib/run.js 93.10% <100.00%> (+0.51%) ⬆️
bin/templates/cordova/lib/target.js 91.66% <100.00%> (-0.40%) ⬇️
bin/templates/cordova/lib/pluginHandlers.js 90.06% <0.00%> (+2.64%) ⬆️
bin/templates/cordova/lib/AndroidProject.js 61.11% <0.00%> (+32.22%) ⬆️

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 70a1eff...0f33ee5. Read the comment docs.

- Renames the file with the only existing E2E test
- Makes existing test use the API instance returned by
  `Api.createPlatform`
- Adds another test that ensures we can still require the API from
  `platformProjectPath/cordova/Api.js`
@raphinesse raphinesse marked this pull request as ready for review July 12, 2021 08:39
Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

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

LGTM

@raphinesse raphinesse merged commit 1f0ea17 into apache:master Jul 13, 2021
@raphinesse raphinesse deleted the dirname-neq-project branch July 13, 2021 06:51
wedgberto pushed a commit to wedgberto/cordova-android that referenced this pull request May 17, 2022
* fix(Api): do not infer project root from script location

* fix(builders): do not infer project root from script location

* fix(target): do not infer project root from script location

* test(e2e): cleanup and extend E2E tests

- Renames the file with the only existing E2E test
- Makes existing test use the API instance returned by
  `Api.createPlatform`
- Adds another test that ensures we can still require the API from
  `platformProjectPath/cordova/Api.js`

* fix(check_reqs): do not infer project root from script location
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.

None yet

3 participants