Comparing version 8.1.8 to 8.1.9-dev.c38363f
@@ -6,13 +6,6 @@ import { type StdioOptions, type IOType, spawn, spawnSync } from 'node:child_process'; | ||
import { type RequestInfo, type RequestInit, type TSpawnStore } from './vendor-core.js'; | ||
import { type Duration, noop, quote } from './util.js'; | ||
export interface Shell { | ||
(pieces: TemplateStringsArray, ...args: any[]): ProcessPromise; | ||
(opts: Partial<Options>): Shell; | ||
sync: { | ||
(pieces: TemplateStringsArray, ...args: any[]): ProcessOutput; | ||
(opts: Partial<Options>): Shell; | ||
}; | ||
} | ||
import { type Duration, quote } from './util.js'; | ||
declare const CWD: unique symbol; | ||
declare const SYNC: unique symbol; | ||
export declare function within<R>(callback: () => R): R; | ||
export interface Options { | ||
@@ -45,8 +38,15 @@ [CWD]: string; | ||
killSignal?: NodeJS.Signals; | ||
halt?: boolean; | ||
} | ||
export declare function syncProcessCwd(flag?: boolean): void; | ||
export declare const defaults: Options; | ||
export declare function usePowerShell(): void; | ||
export declare function usePwsh(): void; | ||
export declare function useBash(): void; | ||
export interface Shell<S = false, R = S extends true ? ProcessOutput : ProcessPromise> { | ||
(pieces: TemplateStringsArray, ...args: any[]): R; | ||
<O extends Partial<Options> = Partial<Options>, R = O extends { | ||
sync: true; | ||
} ? Shell<true> : Shell>(opts: O): R; | ||
sync: { | ||
(pieces: TemplateStringsArray, ...args: any[]): ProcessOutput; | ||
(opts: Partial<Omit<Options, 'sync'>>): Shell<true>; | ||
}; | ||
} | ||
export declare const $: Shell & Options; | ||
@@ -57,4 +57,2 @@ type Resolve = (out: ProcessOutput) => void; | ||
private _from; | ||
private _resolve; | ||
private _reject; | ||
private _snapshot; | ||
@@ -66,12 +64,21 @@ private _stdio?; | ||
private _timeout?; | ||
private _timeoutSignal; | ||
private _timeoutSignal?; | ||
private _timeoutId?; | ||
private _resolved; | ||
private _halted; | ||
private _halted?; | ||
private _piped; | ||
private _zurk; | ||
private _output; | ||
_prerun: typeof noop; | ||
_postrun: typeof noop; | ||
private _reject; | ||
private _resolve; | ||
_bind(cmd: string, from: string, resolve: Resolve, reject: Resolve, options: Options): void; | ||
run(): ProcessPromise; | ||
pipe(dest: Writable | ProcessPromise | TemplateStringsArray, ...args: any[]): ProcessPromise; | ||
abort(reason?: string): void; | ||
kill(signal?: NodeJS.Signals | undefined): Promise<void>; | ||
/** | ||
* @deprecated Use $({halt: true})`cmd` instead. | ||
*/ | ||
halt(): this; | ||
get pid(): number | undefined; | ||
get cmd(): string; | ||
@@ -83,2 +90,9 @@ get child(): import("child_process").ChildProcess | undefined; | ||
get exitCode(): Promise<number | null>; | ||
get signal(): AbortSignal | undefined; | ||
get output(): ProcessOutput | null; | ||
stdio(stdin: IOType, stdout?: IOType, stderr?: IOType): ProcessPromise; | ||
nothrow(): ProcessPromise; | ||
quiet(v?: boolean): ProcessPromise; | ||
verbose(v?: boolean): ProcessPromise; | ||
timeout(d: Duration, signal?: NodeJS.Signals | undefined): ProcessPromise; | ||
json<T = any>(): Promise<T>; | ||
@@ -89,19 +103,8 @@ text(encoding?: Encoding): Promise<string>; | ||
blob(type?: string): Promise<Blob>; | ||
then<R = ProcessOutput, E = ProcessOutput>(onfulfilled?: ((value: ProcessOutput) => PromiseLike<R> | R) | undefined | null, onrejected?: ((reason: ProcessOutput) => PromiseLike<E> | E) | undefined | null): Promise<R | E>; | ||
catch<T = ProcessOutput>(onrejected?: ((reason: ProcessOutput) => PromiseLike<T> | T) | undefined | null): Promise<ProcessOutput | T>; | ||
pipe(dest: Writable | ProcessPromise | TemplateStringsArray, ...args: any[]): ProcessPromise; | ||
abort(reason?: string): void; | ||
get signal(): AbortSignal | undefined; | ||
kill(signal?: NodeJS.Signals | undefined): Promise<void>; | ||
stdio(stdin: IOType, stdout?: IOType, stderr?: IOType): ProcessPromise; | ||
nothrow(): ProcessPromise; | ||
quiet(v?: boolean): ProcessPromise; | ||
verbose(v?: boolean): ProcessPromise; | ||
isHalted(): boolean; | ||
isQuiet(): boolean; | ||
isVerbose(): boolean; | ||
isNothrow(): boolean; | ||
timeout(d: Duration, signal?: NodeJS.Signals | undefined): ProcessPromise; | ||
halt(): ProcessPromise; | ||
isHalted(): boolean; | ||
get output(): ProcessOutput | null; | ||
then<R = ProcessOutput, E = ProcessOutput>(onfulfilled?: ((value: ProcessOutput) => PromiseLike<R> | R) | undefined | null, onrejected?: ((reason: ProcessOutput) => PromiseLike<E> | E) | undefined | null): Promise<R | E>; | ||
catch<T = ProcessOutput>(onrejected?: ((reason: ProcessOutput) => PromiseLike<T> | T) | undefined | null): Promise<ProcessOutput | T>; | ||
} | ||
@@ -145,3 +148,6 @@ type GettersRecord<T extends Record<any, any>> = { | ||
} | ||
export declare function within<R>(callback: () => R): R; | ||
export declare function usePowerShell(): void; | ||
export declare function usePwsh(): void; | ||
export declare function useBash(): void; | ||
export declare function syncProcessCwd(flag?: boolean): void; | ||
export declare function cd(dir: string | ProcessOutput): void; | ||
@@ -148,0 +154,0 @@ export declare function kill(pid: number, signal?: NodeJS.Signals | undefined): Promise<void>; |
@@ -5,3 +5,3 @@ import { type Duration } from './util.js'; | ||
export * as os from 'node:os'; | ||
export declare let argv: minimist.ParsedArgs; | ||
export declare const argv: minimist.ParsedArgs; | ||
export declare function updateArgv(args: string[]): void; | ||
@@ -8,0 +8,0 @@ export declare function sleep(duration: Duration): Promise<unknown>; |
@@ -0,1 +1,2 @@ | ||
export { isStringLiteral } from './vendor-core.js'; | ||
export declare function tempdir(prefix?: string): string; | ||
@@ -6,3 +7,2 @@ export declare function tempfile(name?: string, data?: string | Buffer): string; | ||
export declare function isString(obj: any): obj is string; | ||
export declare const isStringLiteral: (pieces: any, ...rest: any[]) => pieces is TemplateStringsArray; | ||
export declare function preferLocalBin(env: NodeJS.ProcessEnv, ...dirs: (string | undefined)[]): { | ||
@@ -9,0 +9,0 @@ [x: string]: string | undefined; |
@@ -7,4 +7,5 @@ // Generated by dts-bundle-generator v9.5.1 | ||
import EventEmitter from 'node:events'; | ||
import { Readable, Stream, Writable } from 'node:stream'; | ||
import { Readable, Stream, Transform, Writable } from 'node:stream'; | ||
export declare const isStringLiteral: (pieces: any, ...rest: any[]) => pieces is TemplateStringsArray; | ||
type TQuote = (input: string) => string; | ||
@@ -85,2 +86,5 @@ export declare const buildCmd: (quote: TQuote, pieces: TemplateStringsArray, args: any[], subs?: TSubstitute) => string | Promise<string>; | ||
} | ||
export declare class VoidStream extends Transform { | ||
_transform(chunk: any, _: string, cb: (err?: Error) => void): void; | ||
} | ||
export declare const exec: (ctx: TSpawnCtx) => TSpawnCtxNormalized; | ||
@@ -325,3 +329,3 @@ type ColorSupportLevel = 0 | 1 | 2 | 3; | ||
declare const _default: { | ||
kill: (pid: string | number, opts?: string | number | TPsKillOptions | TPsNext | undefined, next?: TPsNext | undefined) => Promise<void>; | ||
kill: (pid: string | number, opts?: TPsNext | TPsKillOptions | TPsKillOptions["signal"], next?: TPsNext) => Promise<void>; | ||
lookup: { | ||
@@ -333,6 +337,6 @@ (query?: TPsLookupQuery, cb?: TPsLookupCallback): Promise<TPsLookupEntry[]>; | ||
tree: { | ||
(opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback | undefined): Promise<TPsLookupEntry[]>; | ||
sync: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback | undefined) => TPsLookupEntry[]; | ||
(opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback): Promise<TPsLookupEntry[]>; | ||
sync: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback) => TPsLookupEntry[]; | ||
}; | ||
treeSync: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback | undefined) => TPsLookupEntry[]; | ||
treeSync: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback) => TPsLookupEntry[]; | ||
}; | ||
@@ -339,0 +343,0 @@ export type RequestInfo = Parameters<typeof globalThis.fetch>[0]; |
"use strict"; | ||
import { require } from './deno.js' | ||
const { | ||
VoidStream, | ||
buildCmd, | ||
chalk, | ||
exec, | ||
isStringLiteral, | ||
ps, | ||
@@ -11,5 +13,7 @@ which | ||
export { | ||
VoidStream, | ||
buildCmd, | ||
chalk, | ||
exec, | ||
isStringLiteral, | ||
ps, | ||
@@ -16,0 +20,0 @@ which |
"use strict"; | ||
import { require } from './deno.js' | ||
const { | ||
VoidStream, | ||
buildCmd, | ||
chalk, | ||
exec, | ||
isStringLiteral, | ||
ps, | ||
@@ -58,5 +60,7 @@ which, | ||
export { | ||
VoidStream, | ||
buildCmd, | ||
chalk, | ||
exec, | ||
isStringLiteral, | ||
ps, | ||
@@ -63,0 +67,0 @@ which, |
{ | ||
"name": "zx", | ||
"version": "8.1.8", | ||
"version": "8.1.9-dev.c38363f", | ||
"description": "A tool for writing better scripts", | ||
@@ -79,2 +79,3 @@ "type": "module", | ||
"test:size": "size-limit", | ||
"test:smoke:strip-types": "node --experimental-strip-types test/smoke/ts.test.ts", | ||
"test:smoke:tsx": "tsx test/smoke/ts.test.ts", | ||
@@ -95,3 +96,3 @@ "test:smoke:tsc": "cd test/smoke && mkdir -p node_modules && ln -s ../../../ ./node_modules/zx; ../../node_modules/typescript/bin/tsc -v && ../../node_modules/typescript/bin/tsc --esModuleInterop --module node16 --rootDir . --outdir ./temp ts.test.ts && node ./temp/ts.test.js", | ||
"devDependencies": { | ||
"@size-limit/file": "^11.1.5", | ||
"@size-limit/file": "^11.1.6", | ||
"@types/fs-extra": "^11.0.4", | ||
@@ -102,3 +103,3 @@ "@types/minimist": "^1.2.5", | ||
"@webpod/ingrid": "^0.0.0-beta.3", | ||
"@webpod/ps": "^0.0.0-beta.7", | ||
"@webpod/ps": "^0.0.0-beta.10", | ||
"c8": "^10.1.2", | ||
@@ -109,4 +110,4 @@ "chalk": "^5.3.0", | ||
"dts-bundle-generator": "^9.5.1", | ||
"esbuild": "^0.23.1", | ||
"esbuild-node-externals": "^1.14.0", | ||
"esbuild": "^0.24.0", | ||
"esbuild-node-externals": "^1.15.0", | ||
"esbuild-plugin-entry-chunks": "^0.1.15", | ||
@@ -125,10 +126,10 @@ "esbuild-plugin-extract-helpers": "^0.0.6", | ||
"prettier": "^3.3.3", | ||
"size-limit": "^11.1.5", | ||
"size-limit": "^11.1.6", | ||
"ts-node": "^10.9.2", | ||
"tsd": "^0.31.2", | ||
"tsx": "^4.19.1", | ||
"typescript": "^5.6.2", | ||
"which": "^4.0.0", | ||
"tsx": "^4.19.2", | ||
"typescript": "^5.6.3", | ||
"which": "^5.0.0", | ||
"yaml": "^2.5.1", | ||
"zurk": "^0.3.4" | ||
"zurk": "^0.6.0" | ||
}, | ||
@@ -135,0 +136,0 @@ "publishConfig": { |
@@ -8,3 +8,3 @@ <h1><img src="https://google.github.io/zx/img/logo.svg" alt="Zx logo" height="32" valign="middle"> zx</h1> | ||
let branch = await $`git branch --show-current` | ||
const branch = await $`git branch --show-current` | ||
await $`dep deploy --branch=${branch}` | ||
@@ -18,3 +18,3 @@ | ||
let name = 'foo bar' | ||
const name = 'foo bar' | ||
await $`mkdir /tmp/${name}` | ||
@@ -21,0 +21,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
850243
24044
1