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.3.0 #104

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 18, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
zx (source) 8.0.1 -> 8.3.0 age adoption passing confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

google/zx (zx)

v8.3.0: – Pipes of Steel

Compare Source

A few weeks ago zx took a part in OSS Library Night 🎉
Many thanks to the organizers and contributors who have boosted the project with their pull requests!

Today we are releasing the zx with a huge bunch of new features and improvements.

Features

API
  • Implemented [Symbol.asyncIterator] API for ProcessPromise #​984 #​998 #​1000
    Now you can iterate over the process output using for await loop from any point of the process execution.
const process = $`sleep 0.1; echo Chunk1; sleep 0.1; echo Chunk2; sleep 0.2; echo Chunk3; sleep 0.1; echo Chunk4;`
const chunks = []

await new Promise((resolve) => setTimeout(resolve, 250))
for await (const chunk of process) {
  chunks.push(chunk)
}

chunks.length //  4
chunks[0]     // 'Chunk1'
chunks[3]     // 'Chunk4'
  • zx version is available via JS API #​986
import { version } from 'zx'
const [major] = (version || '').split('.').map(Number)
if (major < 6)
  throw new Error('zx >= 6 is required')
Pipes
  • Enabled stream picking for pipe() #​1023
const p = $`echo foo >&2; echo bar`
const o1 = (await p.pipe.stderr`cat`).toString()
const o2 = (await p.pipe.stdout`cat`).toString()

assert.equal(o1, 'foo\n')  // <- piped from stderr
assert.equal(o2, 'bar\n')  // <- stdout
  • Added signal handling on piping #​992
const ac = new AbortController()
const { signal } = ac
const p = $({ signal, nothrow: true })`echo test`.pipe`sleep 999`
setTimeout(() => ac.abort(), 50)

try {
  await p
} catch ({ message }) {
  message // The operation was aborted
}
  • Added direct piping to file shortcut #​1001
// before
await $`echo "Hello, stdout!"`.pipe(fs.createWriteStream('/tmp/output.txt'))

// after
await $`echo "Hello, stdout!"`.pipe('/tmp/output.txt')
CLI
  • Provided $.defaults setting via ZX_-prefixed environment variables #​988 #​998
ZX_VERBOSE=true ZX_SHELL='/bin/bash' zx script.mjs
zx --env=/path/to/some.env script
  • Landed installation registry customization #​994
zx --insrall --registry=https://registry.yarnpkg.com script.mjs

Fixes

Docs

Chores

Merry Christmas! 🎄🎅🎁

v8.2.4: – Leaky Faucet

Compare Source

  • Fixed bun async_hooks compatibility #​959

v8.2.3: – Golden Wrench

Compare Source

This release continues the work on pipe API enhancements:

const { stdout } = await $({ halt: true })`echo "hello"`
 .pipe`awk '{print $1" world"}'`
 .pipe`tr '[a-z]' '[A-Z]'`
 .run()

stdout // 'HELLO WORLD'
  • Let $ be piped directly from streams #​953
const getUpperCaseTransform = () =>
  new Transform({
    transform(chunk, encoding, callback) {
      callback(null, String(chunk).toUpperCase())
    },
  })

// $ > stream (promisified) > $ 
const o1 = await $`echo "hello"`
  .pipe(getUpperCaseTransform())
  .pipe($`cat`)

o1.stdout //  'HELLO\n'

// stream > $
const file = tempfile()
await fs.writeFile(file, 'test')
const o2 = await fs
  .createReadStream(file)
  .pipe(getUpperCaseTransform())
  .pipe($`cat`)

o2.stdout //  'TEST'
const file = tempfile()
const fileStream = fs.createWriteStream(file)
const p = $`echo "hello"`
  .pipe(getUpperCaseTransform())
  .pipe(fileStream)
const o = await p

p instanceof WriteStream             // true
o instanceof WriteStream             // true
o.stdout                             // 'hello\n'
o.exitCode;                          // 0
(await fs.readFile(file)).toString() // 'HELLO\n'

We've also slightly tweaked up dist contents for better compatibility with bundlers #​957

v8.2.2

Compare Source

What's Changed

Full Changelog: google/zx@8.2.1...8.2.2

v8.2.1

Compare Source

  • #​936 fixes endless streams piping
  • #​930 enables custom extensions support

v8.2.0

Compare Source

Pipes supercharge today! 🚀

Features

  • Delayed piping. You can fill dependent streams at any time during the origin process lifecycle (even when finished) without losing data. #​914
const result = $`echo 1; sleep 1; echo 2; sleep 1; echo 3`
const piped1 = result.pipe`cat`
let piped2

setTimeout(() => {
  piped2 = result.pipe`cat`
}, 1500)

await piped1
assert.equal((await piped1).toString(), '1\n2\n3\n')
assert.equal((await piped2).toString(), '1\n2\n3\n')
const file = tempfile()
const fileStream = fs.createWriteStream(file)
const p = $`echo "hello"`
  .pipe(
    new Transform({
      transform(chunk, encoding, callback) {
        callback(null, String(chunk).toUpperCase())
      },
    })
  )
  .pipe(fileStream)

p instanceof WriteStream             // true
await p === fileStream               // true
(await fs.readFile(file)).toString() // 'HELLO\n'

Chore

v8.1.9

Compare Source

Today's release is a minor update that includes:

Enhancements

  • We have replaced ProcessOutput fields with lazy getters to reduce mem consumption #​903, #​908
  • Reduced ReDos risks for codeblock patterns #​906
  • Kept argv reference on update #​916
  • Strengthened Shell interface to properly handle sync mode #​915:
expectType<ProcessPromise>($`cmd`)
expectType<ProcessPromise>($({ sync: false })`cmd`)
expectType<ProcessOutput>($({ sync: true })`cmd`)
expectType<ProcessOutput>($.sync`cmd`)

Fixes

v8.1.8

Compare Source

  • Apply the proper TeplateStringArray detection #​904, #​905
  • PromiseProcess got lazy getters to optimize mem usage #​903

v8.1.7

Compare Source

Step by step on the road to improvements

Fixes

Finally, we've fixed the issue with piped process rejection #​640 #​899:

const p1 = $`exit 1`.pipe($`echo hello`)
try {
  await p1
} catch (e) {
  assert.equal(e.exitCode, 1)
}

const p2 = await $({ nothrow: true })`echo hello && exit 1`.pipe($`cat`)
assert.equal(p2.exitCode, 0)
assert.equal(p2.stdout.trim(), 'hello')

Enhancements

Added cmd display to ProcessPromise #​891:

const foo = 'bar'
const p = $`echo ${foo}`

p.cmd // 'echo bar'

and duration field to ProcessOutput #​892:

const p = $`sleep 1`.nothrow()
const o = await p

o.duration // ~1000 (in ms)

Enabled zurk-like pipe string literals #​900:

const p = await $`echo foo`.pipe`cat`
p.stdout.trim() // 'foo'

v8.1.6

Compare Source

Improvements & Fixes
  • The $.preferLocal option now also accepts a directory #​886, #​887.
$.preferLocal = true             // injects node_modules/.bin to the $PATH
$.preferLocal = '/foo/bar'       // attaches /foo/bar to the $PATH
$.preferLocal = ['/bar', '/baz'] // now the $PATH includes both /bar and /baz

Why not just $.env['PATH'] = 'extra:' + '$.env['PATH']?
Well, the API internally does the same, but also handles the win paths peculiarities.

  • Provided $.killSignal option for the symmetry with the $.timeoutSignal. You can override the default termination flow #​885:
$.killSignal = 'SIGKILL'

const p = $({nothrow: true})`sleep 10000`
setTimeout(p.kill, 100)
  
(await p).signal // SIGKILL
  • $ opt presets became chainable #​883:
const $$ = $({ nothrow: true })
assert.equal((await $$`exit 1`).exitCode, 1)

const $$$ = $$({ sync: true }) // Both {nothrow: true, sync: true} are applied
assert.equal($$$`exit 2`.exitCode, 2)
  • Enhanced the internal Duration parser #​884:
const p = $({timeout: '1mss'})`sleep 999` // raises an error now
  • Abortion signal listeners are now removed after the process completes #​881, #​889, zurk#12, zurk#13.
  • Extended integration tests matrix, added nodejs-nightly builds and TS dev snapshots #​888

v8.1.5

Compare Source

We've rolled out a new release!

Fixes

  • Added the minimist typings to the dts bundle. #​872 brings the fix.
  • Re-enabled the YAML extra
    API. #​870 #​879

Chores

  • Clarified cd(), within() and syncProcessCwd() interactions. #​878
  • Included mention of the cwd option in the documentation. #​868
  • Test enhancements. #​877 #​880

v8.1.4

Compare Source

We continue optimizing bundles and CI/CD pipelines.

  • Update @​webpod/ps to v0.0.0-beta.7 to sync internal zurk version. #​855
  • Split vendor chunk to reduce the zx/core entry size. #​856
  • Add bundle size check. #​857
  • Refactor the testing flow, remove duplicated tasks. #​861
  • Add missing types for the global defaults. #​864
  • Omit redundant YAML API extras. #​866

Which gives us: 897 kB → 829 kB (-7.58%)

v8.1.3

Compare Source

Nothing special today. We just keep improving the implementation.

Features

import {$} from 'zx'
  • zx/cli exports its inners to allow more advanced usage.
    Imagine, your own CLI tool that uses zx as a base:
    #​828
#!/usr/bin/env node

import './index.mjs'
import {main} from 'zx/cli'

main()
  • Provide intermediate store configuration for fine-grained control of memory usage.
    #​650, #​849
const getFixedSizeArray = (size) => {
  const arr = []
  return new Proxy(arr, {
    get: (target, prop) =>
      prop === 'push' && arr.length >= size
        ? () => {}
        : target[prop],
  })
}
const store = {
  stdout: getFixedSizeArray(1),
  stderr: getFixedSizeArray(1),
  stdall: getFixedSizeArray(0),
}

const p = await $({ store })`echo foo`

p.stdout.trim() //  'foo'
p.toString()    // ''
  • Introduced sync methods for ps:
    #​840
import { ps } from 'zx'

const list1 = await ps()
const list2 = await tree()

// new methods
const list3 = ps.sync()
const list4 = tree.sync()

Chore

v8.1.2

Compare Source

Every new zx version is better than previous one. What have we here?

Features

  • Added ProcessPromise.verbose() to enhance debugging experience.
    #​820, #​710
const p = $`echo foo`
p.quiet()        // enable silent mode
p.quiet(false)   // then disable
p.verbose()      // enable verbose/debug mode
p.verbose(false) // and turn it off

await p
  • Aligned ProcessPromise.isSmth() API:
    #​823
const p = $`echo foo`

p.isHalted()
p.isVerbose()
p.isQuiet()
p.isNothrow()

Bug Fixes

  • fix: apply EOL ensurer to the last chunk only #​825
  • fix(cli): return exit code 1 on incorrect inputs #​826
  • fix: set cjs bundle as legacy main entrypoint #​827

Chore

v8.1.1

Compare Source

This release brings a pinch of sugar and minor fixes.

Features
  • Introduced $.preferLocal option to prefer node_modules/.bin located binaries over globally system installed ones.
    #​798
$.preferLocal = true

await $`c8 npm test`

await $({ preferLocal: true })`eslint .`
const p = $`echo 'foo\nbar'`

await p.text()        // foo\n\bar\n
await p.text('hex')   //  666f6f0a0861720a
await p.buffer()      //  Buffer.from('foo\n\bar\n')
await p.lines()       // ['foo', 'bar']
await $`echo '{"foo": "bar"}'`.json() // {foo: 'bar'}
  • ProcessPromise now exposes its signal reference.
    #​816
const p = $`sleep 999`
const {signal} = p

const res = fetch('https://example.com', {signal})

setTimeout(() => p.abort('reason'), 1000)
Fixes
  • CLI flag --quiet is mapped to $.quiet option. #​813
  • Module conditional exports are properly sorted now. #​812
  • A newline character is appended to the output of ProcessPromise if it's missing. #​810

v8.1.0

Compare Source

This new release is a big deal. It brings significant improvements in reliability and compatibility.

New features

Added usePwsh() helper to switch to PowerShell v7+ #​790

import {usePwsh, useBash} from 'zx'

usePwsh()
$.shell // 'pwsh'

useBash()
$.shell // 'bash'

timeout is now configurable $ opts #​796

import {$} from 'zx'

await $({ timeout: 100 })`sleep 999`

$.timeout = 1000            // Sets default timeout for all commands
$.timeoutSignal = 'SIGKILL' // Sets signal to send on timeout

await $`sleep 999`

Added --cwd option for CLI #​804

zx --cwd=/some/path script.js

Introduced tmpdir and tmpfile helpers #​803

import {tmpdir, tmpfile} from 'zx'

t1 = tmpdir()          // /os/based/tmp/zx-1ra1iofojgg/
t2 = tmpdir('foo')     // /os/based/tmp/zx-1ra1iofojgg/foo/

f1 = tmpfile()         // /os/based/tmp/zx-1ra1iofojgg
f2 = tmpfile('f.txt')  // /os/based/tmp/zx-1ra1iofojgg/foo.txt
f3 = tmpfile('f.txt', 'string or buffer')
  • Support CRLF for markdown script #​788
  • Added help digest for man #​806
  • Added compatibility with Deno 1.x. → zx seems to be working with Deno 1.x.

v8.0.2

Compare Source

In this release:

  • Added configurable detached option (#​782)
  • Fixed pkg typings entries for tsd tests (#​780)

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 was generated by Mend Renovate. View the repository job log.

Copy link

socket-security bot commented Apr 18, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] environment, filesystem, network, shell, unsafe 0 857 kB google-wombot

🚮 Removed packages: npm/[email protected]

View full report↗︎

@DerekNonGeneric DerekNonGeneric force-pushed the main branch 2 times, most recently from e79f45f to 2f404ba Compare May 6, 2024 03:24
@renovate renovate bot force-pushed the renovate/zx-8.x branch from daeb711 to 0e1f8b6 Compare May 13, 2024 22:51
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.0.2 chore(deps): update dependency zx to v8.1.0 May 13, 2024
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.1.0 chore(deps): update dependency zx to v8.1.1 May 23, 2024
@renovate renovate bot force-pushed the renovate/zx-8.x branch 2 times, most recently from 8f7a418 to 816f657 Compare May 27, 2024 16:59
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.1.1 chore(deps): update dependency zx to v8.1.2 May 27, 2024
@renovate renovate bot force-pushed the renovate/zx-8.x branch from 816f657 to 5edfc58 Compare June 19, 2024 21:32
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.1.2 chore(deps): update dependency zx to v8.1.3 Jun 19, 2024
@renovate renovate bot force-pushed the renovate/zx-8.x branch from 5edfc58 to 74b297a Compare July 4, 2024 10:56
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.1.3 chore(deps): update dependency zx to v8.1.4 Jul 4, 2024
@renovate renovate bot force-pushed the renovate/zx-8.x branch from 74b297a to 5e0dbfc Compare August 28, 2024 21:24
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.1.4 chore(deps): update dependency zx to v8.1.5 Aug 28, 2024
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.1.5 chore(deps): update dependency zx to v8.1.6 Sep 11, 2024
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.1.6 chore(deps): update dependency zx to v8.1.7 Sep 17, 2024
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.1.7 chore(deps): update dependency zx to v8.1.8 Sep 19, 2024
@renovate renovate bot force-pushed the renovate/zx-8.x branch from 0027949 to d98cbd8 Compare October 6, 2024 22:57
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.1.8 chore(deps): update dependency zx to v8.1.9 Oct 6, 2024
@renovate renovate bot force-pushed the renovate/zx-8.x branch from d98cbd8 to fff713f Compare October 31, 2024 20:35
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.1.9 chore(deps): update dependency zx to v8.2.0 Oct 31, 2024
Copy link

sweep-ai bot commented Oct 31, 2024

Hey @renovate[bot], here is an example of how you can ask me to improve this pull request:

@Sweep Add unit tests for the new `$.preferLocal` option to verify it correctly prefers node_modules/.bin binaries over system binaries

📖 For more information on how to use Sweep, please read our documentation.

@renovate renovate bot changed the title chore(deps): update dependency zx to v8.2.0 chore(deps): update dependency zx to v8.2.1 Nov 9, 2024
@renovate renovate bot force-pushed the renovate/zx-8.x branch 2 times, most recently from 7ce595c to 863eca4 Compare November 12, 2024 18:29
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.2.1 chore(deps): update dependency zx to v8.2.2 Nov 12, 2024
@renovate renovate bot force-pushed the renovate/zx-8.x branch from 863eca4 to 8dbcc46 Compare November 28, 2024 16:56
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.2.2 chore(deps): update dependency zx to v8.2.3 Nov 28, 2024
@renovate renovate bot force-pushed the renovate/zx-8.x branch from 8dbcc46 to 083d93e Compare November 28, 2024 22:44
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.2.3 chore(deps): update dependency zx to v8.2.4 Nov 28, 2024
@renovate renovate bot force-pushed the renovate/zx-8.x branch from 083d93e to 852c749 Compare December 24, 2024 09:33
@renovate renovate bot changed the title chore(deps): update dependency zx to v8.2.4 chore(deps): update dependency zx to v8.3.0 Dec 24, 2024
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.

0 participants