-
Notifications
You must be signed in to change notification settings - Fork 53
chore(deps): remove execa direct dependency #4854
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
Conversation
Bumps [execa](https://github.com/sindresorhus/execa) from 4.1.0 to 8.0.1. - [Release notes](https://github.com/sindresorhus/execa/releases) - [Commits](sindresorhus/execa@v4.1.0...v8.0.1) --- updated-dependencies: - dependency-name: execa dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
61384de
to
d2307fd
Compare
A newer version of execa exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged. |
🦋 Changeset detectedLatest commit: 3c56f93 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
fork/module-to-cdn/cache.js
Outdated
import('execa').then(({default: execaModule}) => { | ||
execa = execaModule; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont' see any default in it 🤔
> import('execa').then(mod => console.log(mod))
Promise {
<pending>,
[Symbol(async_id_symbol)]: 2448,
[Symbol(trigger_async_id_symbol)]: 2440
}
> [Module: null prototype] {
'$': [Function: $] { sync: [Function (anonymous)] },
execa: [Function: execa],
execaCommand: [Function: execaCommand],
execaCommandSync: [Function: execaCommandSync],
execaNode: [Function: execaNode],
execaSync: [Function: execaSync]
}
> import('execa').then(mod => console.log(mod.execa))
Promise {
<pending>,
[Symbol(async_id_symbol)]: 2527,
[Symbol(trigger_async_id_symbol)]: 2519
}
> [Function: execa]
Storybook for this PR deployed on this github page |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not work, need to run module-to-cdn test:cron command
@@ -124,7 +123,8 @@ | |||
ensureCacheFolderExists(); | |||
|
|||
if (!CACHE_NPM[moduleName]) { | |||
const info = JSON.parse(execa.sync('npm', ['info', '--json', `${moduleName}`]).stdout); | |||
const stdout = child.execSync(`npm info --json ${moduleName}`, {encoding: 'utf8'}); |
Check warning
Code scanning / CodeQL
Unsafe shell command constructed from library input Medium
library input
shell command
This string concatenation which depends on
library input
shell command
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 days ago
To fix this issue, we should avoid passing untrusted input directly to the shell. Instead of using child.execSync
with a string command, we should use child.execFileSync
, which takes the command and its arguments as separate parameters, bypassing the shell and preventing command injection. Specifically, we should replace child.execSync(`npm info --json ${moduleName}`, {encoding: 'utf8'})
with child.execFileSync('npm', ['info', '--json', moduleName], {encoding: 'utf8'})
. This change should be made in the getModuleInfo
function in fork/module-to-cdn/cache.js. No additional imports are needed, as child_process
is already imported as child
.
-
Copy modified line R126
@@ -125,3 +125,3 @@ | ||
if (!CACHE_NPM[moduleName]) { | ||
const stdout = child.execSync(`npm info --json ${moduleName}`, {encoding: 'utf8'}); | ||
const stdout = child.execFileSync('npm', ['info', '--json', moduleName], {encoding: 'utf8'}); | ||
const info = JSON.parse(stdout); |
Bumps execa from 4.1.0 to 8.0.1.
Release notes
Sourced from execa's releases.
... (truncated)
Commits
f4b8b3a
8.0.189c69fe
Support{encoding: 'buffer'}
(#572)e7dee28
8.0.088ee3bd
Upgradeget-stream
(#571)f31fbdb
Fix documentation typo (#568)468fbe1
Upgradesignal-exit
to v4 (#570)65992b4
Require Node.js 16 (#569)db58085
7.2.0f57fdec
Addcwd
error property (#565)a228eda
Meta tweaksYou can trigger a rebase of this PR by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)