Skip to content

Conversation

@nfischer
Copy link
Member

No change to logic. This refactors the exec-child.js script to move all of its main logic into a main() function. This function is only invoked if the script is executed, not when it is imported.

Importing the script is now a NOOP instead of throwing an exception. It's still not advisable to import the script, however this can be done if absolutely necessary to trick JavaScript bundlers which try to prune non-imported code files.

Partially related to issue #1160 and #1172.

@codecov
Copy link

codecov bot commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.38%. Comparing base (d9d7f4d) to head (014d8ff).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/exec-child.js 97.05% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1186      +/-   ##
==========================================
+ Coverage   97.28%   97.38%   +0.09%     
==========================================
  Files          36       36              
  Lines        1364     1452      +88     
==========================================
+ Hits         1327     1414      +87     
- Misses         37       38       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nfischer nfischer force-pushed the refactor-exec-child branch 2 times, most recently from d6deca2 to 2f78e2e Compare February 20, 2025 08:20
No change to logic. This refactors the exec-child.js script to move all
of its main logic into a main() function. This function is only invoked
if the script is executed, not when it is imported.

Importing the script is now a NOOP instead of throwing an exception.
It's still not advisable to import the script, however this can be done
if absolutely necessary to trick JavaScript bundlers which try to prune
non-imported code files.

Partially related to issue #1160 and #1172.
@nfischer nfischer force-pushed the refactor-exec-child branch from 2f78e2e to 014d8ff Compare February 20, 2025 08:25
@nfischer nfischer merged commit 5193084 into master Feb 20, 2025
19 of 20 checks passed
@nfischer nfischer added the exec Issues specific to the shell.exec() API label Feb 20, 2025
@nfischer nfischer deleted the refactor-exec-child branch February 20, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exec Issues specific to the shell.exec() API refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants