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: cleanup create script #1193

Merged
merged 7 commits into from
Nov 13, 2021

Conversation

raphinesse
Copy link
Contributor

Motivation and Context

This takes the changes from the first four commits of #1191 and adds a few further simplifications in the affected code areas.

I pulled this out to reduce the scope of said PR and since I already reviewed this part of the changes.

Description

From #1191:

  • Remove exported updateSubprojectHelp
  • Remove exported update_cordova_subproject
  • Renamed internal function update_cordova_subproject to updateCordovaSubproject
    • Refactored internal function updateCordovaSubproject to take in two static arguments:
      • projectXcodePath which is the path to project's xcodeproj
      • cordovaLibXcodePath which is the path to the CordovaLib's xcodeproj. (Note: it maybe a symbolic link when --link flag is added when installing platform)
    • Improved comments
    • Removed excessive supportive internal methods
      • AbsParentPath
      • AbsProjectPath
      • relpath
      • updateSubprojectHelp

New:

  • Cleanup copyJsAndCordovaLib

Testing

npm t

@raphinesse
Copy link
Contributor Author

I would actually argue that this change is not actually breaking, since I would not consider the removed module exports public API.

@codecov-commenter
Copy link

codecov-commenter commented Nov 13, 2021

Codecov Report

Merging #1193 (0087bcc) into master (6396343) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1193   +/-   ##
=======================================
  Coverage   75.15%   75.15%           
=======================================
  Files          13       13           
  Lines        1658     1658           
=======================================
  Hits         1246     1246           
  Misses        412      412           

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 6396343...0087bcc. Read the comment docs.

@raphinesse raphinesse changed the title refactor!: cleanup create script refactor: cleanup create script Nov 13, 2021
@raphinesse raphinesse merged commit 335dc2f into apache:master Nov 13, 2021
@raphinesse raphinesse deleted the refactor-create-pt1 branch November 13, 2021 16:15
@erisu erisu added this to the 7.0.0 milestone Nov 16, 2021
gazben pushed a commit to apicore-engineering/cordova-ios that referenced this pull request Aug 26, 2022
* refactor!(create): make helper functions module-private

- remove update_cordova_subproject export
- remove updateSubprojectHelp export

* refactor(create): cleanup, condense & rename update_cordova_subproject

* refactor(create): cleanup copyJsAndCordovaLib

* refactor(create): drop unused param of copyJsAndCordovaLib

* refactor(create): use loop to copy files in copyJsAndCordovaLib

* refactor(create): delete obsolete ensureDirSync in copyJsAndCordovaLib

fs-extra's copySync creates any missing destination directories

* refactor(create): simplify deletion logic in copyJsAndCordovaLib

fs-extra's removeSync removes anything and nothing w/out throwing

Co-authored-by: Erisu <erisu@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants