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: remove shelljs dependency #842

Merged
merged 7 commits into from
Jan 29, 2020

Conversation

breautek
Copy link
Contributor

@breautek breautek commented Oct 13, 2019

Platforms affected

Android

Motivation and Context

Replaces shelljs with favour for native fs APIs, or apis from fs-extra
Fixes #781

Description

All shelljs code has been removed and replaced. In some cases, which package was used as a replacement.

Testing

npm test passes. Manual testing has been done on linux by using cordova platform add <my git fork>

Windows has not been tested. Test are pending.
Mac has has also not been tested. I don't have easy access to a mac machine, so assistance here would help me.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@breautek breautek added this to the 9.0.0 milestone Oct 18, 2019
@erisu erisu force-pushed the migrate-shelljs-to-fsextra branch 6 times, most recently from 04fafc4 to 60502f2 Compare January 27, 2020 14:07
@codecov-io
Copy link

codecov-io commented Jan 27, 2020

Codecov Report

Merging #842 into master will decrease coverage by 0.32%.
The diff coverage is 57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #842      +/-   ##
==========================================
- Coverage   66.27%   65.94%   -0.33%     
==========================================
  Files          19       21       +2     
  Lines        1853     1850       -3     
==========================================
- Hits         1228     1220       -8     
- Misses        625      630       +5
Impacted Files Coverage Δ
bin/templates/cordova/lib/build.js 31.61% <0%> (+1.96%) ⬆️
bin/templates/cordova/lib/emulator.js 89.83% <100%> (+0.37%) ⬆️
bin/templates/cordova/lib/prepare.js 34.53% <14.28%> (-0.12%) ⬇️
bin/templates/cordova/lib/utils.js 17.85% <17.85%> (ø)
bin/templates/cordova/lib/check_reqs.js 51.2% <25%> (-2.3%) ⬇️
...n/templates/cordova/lib/builders/ProjectBuilder.js 71.97% <39.53%> (+4.54%) ⬆️
bin/lib/utils.js 75% <75%> (ø)
bin/templates/cordova/lib/pluginHandlers.js 87.33% <88.23%> (+1.52%) ⬆️
bin/lib/create.js 93.87% <96.42%> (+1.33%) ⬆️
... and 1 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 dee1e77...afa1741. Read the comment docs.

@erisu erisu changed the title WIP: ShellJS refactoring refactor: remove shelljs dependency Jan 28, 2020
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.

I added some code refactor, cleanup, and removed additional references to shelljs that was missed.

I also ran manual tests on macOS and Windows. Tests covers:

  • cordova platform add
  • cordova platform
  • cordova requirements
  • cordova prepare android
  • cordova build android
  • cordova build android (w/ keystore)
  • cordova run android (not tested on Windows)
  • cordova clean android
  • cordova platform rm android

@erisu erisu marked this pull request as ready for review January 28, 2020 16:56
@breautek
Copy link
Contributor Author

Erisu finished this for me and I've tested it on linux. npm test runs fine, and did some manual testing running prepare, run, build, plugin commands and deploying an app to an actual device. All appears to be good 👍

@erisu erisu merged commit 3712619 into apache:master Jan 29, 2020
raphinesse added a commit to raphinesse/cordova-android that referenced this pull request Oct 5, 2020
The pattern contained an additional plus that slipped in during the
refactoring done in apache#842. See [the diff][1] for details.

[1]: apache@09e8248#diff-26c51bfaa44eff1e46fd61ec3225ec13L640-R650
raphinesse added a commit that referenced this pull request Oct 6, 2020
The pattern contained an additional plus that slipped in during the
refactoring done in #842. See [the diff][1] for details.

[1]: 09e8248#diff-26c51bfaa44eff1e46fd61ec3225ec13L640-R650
raphinesse added a commit to raphinesse/cordova-android that referenced this pull request Oct 20, 2020
… Windows

This changes the implementation to be closer to what it was before apache#842
with everything being in one place.
raphinesse added a commit that referenced this pull request Nov 19, 2020
…ows (#1102)

* test(check_reqs): test default Java location detection on Windows

* refactor(check_reqs): use glob for default Java location detection on Windows

This changes the implementation to be closer to what it was before #842
with everything being in one place.

* fix: remove always-taken if statement

* feat: take both Program Files variants from env

* refactor(check_reqs): cosmetic changes
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.

[MAJOR] Migrate from shelljs to fs-extra
3 participants