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

chore(deps): update dependency zx to v8 #124

Merged
merged 1 commit into from
Apr 20, 2024
Merged

chore(deps): update dependency zx to v8 #124

merged 1 commit into from
Apr 20, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 20, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
zx ^7.1.1 -> ^8.0.0 age adoption passing confidence

Release Notes

google/zx (zx)

v8.0.0

Compare Source

We are thrilled to announce the release of zx v8.0.0! 🎉

With this release, we have introduced a lot of new features, improvements, and bug fixes.
We have also made some breaking changes, so please read the following release notes carefully.

🚀 New Shiny Features

Squashed deps: we use esbuild with custom plugins to forge js bundles and dts-bundle-generator for typings 2acb0f, #​722

More safety, more stability and significantly reduced installation time. Zx now is ~20x smaller.

npx zx@8.0.0
npm install zx@8.0.0

Options presets are here. To implement this, we have also completely refactored the zx core, and now it's available as a separate package – zurk\ aeec7a, #​733, #​600

const $$ = $({quiet: true})
await $$`echo foo`

$({nothrow: true})`exit 1`

We have introduced $.sync() API\ 1f8c8b, #​738, #​681, 1d8aa9, #​739

import {$} from 'zx'

const { output } = $.sync`echo foo` // foo

You can also override the internal API to implement pools, test mocking, etc.

$.spawnSync = () => {} // defaults to `child_process.spawnSync`

The input option is now available to pass data to the command.\ b38972, #​736

const p1 = $({ input: 'foo' })`cat`
const p2 = $({ input: Readable.from('bar') })`cat`
const p3 = $({ input: Buffer.from('baz') })`cat`
const p4 = $({ input: p3 })`cat`
const p5 = $({ input: await p3 })`cat`

AbortController has been introduced to abort the command execution. It's available via the ac option.\ fa4a7b, #​734, #​527

const ac = new AbortController()
const p = $({ ac })`sleep 9999`

setTimeout(() => ac.abort(), 100)

If not specified, the default instance will be used. Abortion trigger is also available via PromiseResponse:

const p = $`sleep 9999`
setTimeout(() => p.abort(), 100)

kill method is exposed now. To terminate any (not only zx starter) process:

import { kill } from 'zx'

await kill(123)
await kill(123, 'SIGKILL')

Btw, we have replaced ps-tree with @​webpod/ps & @​webpod/ingrid, and exposed ps util:

import {ps} from 'zx'

const children = await ps.tree(123)
/**
 [
 {pid: 124, ppid: 123},
 {pid: 125, ppid: 123}
 ]
 */
const children2 = await ps.tree({pid: 123, recursive: true})
/**
 [
 {pid: 124, ppid: 123},
 {pid: 125, ppid: 123},

 {pid: 126, ppid: 124},
 {pid: 127, ppid: 124},
 {pid: 128, ppid: 124},

 {pid: 129, ppid: 125},
 {pid: 130, ppid: 125},
 ]
 */

Introduced $.postfix option. It's like a $.prefix, but for the end of the command. fb9554, #​756, #​536

import {$} from 'zx'

$.postfix = '; exit $LastExitCode' // for PowerShell compatibility

minimist API exposed\ #​661

import { minimist } from 'zx'

const argv = minimist(process.argv.slice(2), {})

Fixed npm package name pattern on --install mode 956dcc, #​659, #​660, #​663

import '@​qux/pkg'       // valid
import '@​qux/pkg/entry' // was invalid before and valid now
⚠️ Breaking changes

We've tried our best to avoid them, but it was necessary.

  1. $.verbose is set to false by default, but errors are still printed to stderr. Set $.quiet = true to suppress all output.\ cafb90, #​745, #​569

    $.verbose = true // everything works like in v7
    
    $.quiet = true // to completely turn off logging
  2. ssh API was dropped. Install webpod package instead.\ 8925a1, #​750

    // import {ssh} from 'zx' ↓
    import {ssh} from 'webpod'
    
    const remote = ssh('user@host')
    await remote`echo foo`
  3. zx is not looking for powershell anymore, on Windows by default. If you still need it, use the usePowerShell helper:\ 24dcf3, #​757

    import { usePowerShell, useBash } from 'zx'
    
    usePowerShell() // to enable powershell
    useBash()       // switch to bash, the default
  4. Process cwd synchronization between $ invocations is disabled by default. This functionality is provided via an async hook and can now be controlled directly.\ d79a63, #​765

    import { syncProcessCwd } from 'zx'
    
    syncProcessCwd() // restores legacy v7 behavior
🧰 Other Improvements

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

Copy link

coderabbitai bot commented Apr 20, 2024

Important

Auto Review Skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@limonte limonte merged commit c904372 into main Apr 20, 2024
2 checks passed
@renovate renovate bot deleted the renovate/zx-8.x branch April 20, 2024 06:59
@limonte
Copy link
Member

limonte commented Jul 8, 2024

🎉 This PR is included in version 5.0.17 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant