Comparing version 8.2.4 to 8.3.0-dev.504a960
#!/usr/bin/env node | ||
import { minimist } from './index.js'; | ||
export declare function printUsage(): void; | ||
export declare const argv: minimist.ParsedArgs; | ||
export declare const argv: import("minimist").ParsedArgs; | ||
export declare function main(): Promise<void>; | ||
@@ -13,4 +12,3 @@ export declare function runScript(script: string, ext?: string): Promise<void>; | ||
export declare function transformMarkdown(buf: Buffer): string; | ||
export declare function getVersion(): string; | ||
export declare function isMain(metaurl?: string, scriptpath?: string): boolean; | ||
export declare function normalizeExt(ext?: string): string | undefined; |
@@ -6,4 +6,4 @@ #!/usr/bin/env node | ||
const { | ||
startRepl, | ||
argv, | ||
getVersion, | ||
importPath, | ||
@@ -22,4 +22,4 @@ injectGlobalRequire, | ||
export { | ||
startRepl, | ||
argv, | ||
getVersion, | ||
importPath, | ||
@@ -26,0 +26,0 @@ injectGlobalRequire, |
@@ -1,7 +0,8 @@ | ||
import { type StdioOptions, type IOType, spawn, spawnSync } from 'node:child_process'; | ||
import { type StdioOptions, type IOType, spawn, spawnSync, type ChildProcess } from 'node:child_process'; | ||
import { type Encoding } from 'node:crypto'; | ||
import { type Readable, type Writable } from 'node:stream'; | ||
import { inspect } from 'node:util'; | ||
import { type RequestInfo, type RequestInit, type TSpawnStore } from './vendor-core.js'; | ||
import { type Duration, quote } from './util.js'; | ||
import { type TSpawnStore } from './vendor-core.js'; | ||
import { type Duration, log, quote } from './util.js'; | ||
export { log, type LogEntry } from './util.js'; | ||
declare const CWD: unique symbol; | ||
@@ -23,3 +24,3 @@ declare const SYNC: unique symbol; | ||
env: NodeJS.ProcessEnv; | ||
shell: string | boolean; | ||
shell: string | true; | ||
nothrow: boolean; | ||
@@ -53,2 +54,7 @@ prefix: string; | ||
type Resolve = (out: ProcessOutput) => void; | ||
type PipeMethod = { | ||
(dest: TemplateStringsArray, ...args: any[]): ProcessPromise; | ||
<D extends Writable>(dest: D): D & PromiseLike<ProcessOutput & D>; | ||
<D extends ProcessPromise>(dest: D): D; | ||
}; | ||
export declare class ProcessPromise extends Promise<ProcessOutput> { | ||
@@ -78,5 +84,7 @@ private _command; | ||
run(): ProcessPromise; | ||
pipe(dest: TemplateStringsArray, ...args: any[]): ProcessPromise; | ||
pipe<D extends Writable>(dest: D): D & PromiseLike<ProcessOutput & D>; | ||
pipe<D extends ProcessPromise>(dest: D): D; | ||
pipe: PipeMethod & { | ||
stdout: PipeMethod; | ||
stderr: PipeMethod; | ||
}; | ||
private _pipe; | ||
abort(reason?: string): void; | ||
@@ -90,3 +98,3 @@ kill(signal?: NodeJS.Signals | undefined): Promise<void>; | ||
get cmd(): string; | ||
get child(): import("child_process").ChildProcess | undefined; | ||
get child(): ChildProcess | undefined; | ||
get stdin(): Writable; | ||
@@ -114,2 +122,3 @@ get stdout(): Readable; | ||
catch<T = ProcessOutput>(onrejected?: ((reason: ProcessOutput) => PromiseLike<T> | T) | undefined | null): Promise<ProcessOutput | T>; | ||
[Symbol.asyncIterator](): AsyncGenerator<string, void, unknown>; | ||
private writable; | ||
@@ -147,3 +156,3 @@ private emit; | ||
buffer(): Buffer; | ||
blob(type?: string): import("buffer").Blob; | ||
blob(type?: string): Blob; | ||
text(encoding?: Encoding): string; | ||
@@ -157,4 +166,4 @@ lines(): string[]; | ||
get duration(): number; | ||
static getExitMessage(code: number | null, signal: NodeJS.Signals | null, stderr: string, from: string): string; | ||
static getErrorMessage(err: NodeJS.ErrnoException, from: string): string; | ||
static getExitMessage: (code: number | null, signal: NodeJS.Signals | null, stderr: string, from: string) => string; | ||
static getErrorMessage: (err: NodeJS.ErrnoException, from: string) => string; | ||
[inspect.custom](): string; | ||
@@ -168,25 +177,2 @@ } | ||
export declare function kill(pid: number, signal?: NodeJS.Signals | undefined): Promise<void>; | ||
export type LogEntry = { | ||
verbose?: boolean; | ||
} & ({ | ||
kind: 'cmd'; | ||
cmd: string; | ||
} | { | ||
kind: 'stdout' | 'stderr'; | ||
data: Buffer; | ||
} | { | ||
kind: 'cd'; | ||
dir: string; | ||
} | { | ||
kind: 'fetch'; | ||
url: RequestInfo; | ||
init?: RequestInit; | ||
} | { | ||
kind: 'retry'; | ||
error: string; | ||
} | { | ||
kind: 'custom'; | ||
data: any; | ||
}); | ||
export declare function log(entry: LogEntry): void; | ||
export {}; | ||
export declare function resolveDefaults(defs: Options, prefix?: string, env?: NodeJS.ProcessEnv): Options; |
@@ -12,2 +12,3 @@ "use strict"; | ||
log, | ||
resolveDefaults, | ||
syncProcessCwd, | ||
@@ -27,2 +28,3 @@ useBash, | ||
log, | ||
resolveDefaults, | ||
syncProcessCwd, | ||
@@ -29,0 +31,0 @@ useBash, |
@@ -1,2 +0,8 @@ | ||
export declare function installDeps(dependencies: Record<string, string>, prefix?: string): Promise<void>; | ||
/** | ||
* Install npm dependencies | ||
* @param dependencies object of dependencies | ||
* @param prefix path to the directory where npm should install the dependencies | ||
* @param registry custom npm registry URL when installing dependencies | ||
*/ | ||
export declare function installDeps(dependencies: Record<string, string>, prefix?: string, registry?: string): Promise<void>; | ||
export declare function parseDeps(content: Buffer): Record<string, string>; |
@@ -5,5 +5,10 @@ import { type Duration } from './util.js'; | ||
export * as os from 'node:os'; | ||
type ArgvOpts = minimist.Opts & { | ||
camelCase?: boolean; | ||
parseBoolean?: boolean; | ||
}; | ||
export declare const parseArgv: (args?: string[], opts?: ArgvOpts) => minimist.ParsedArgs; | ||
export declare function updateArgv(args?: string[], opts?: ArgvOpts): void; | ||
export declare const argv: minimist.ParsedArgs; | ||
export declare function updateArgv(args: string[]): void; | ||
export declare function sleep(duration: Duration): Promise<unknown>; | ||
export declare function sleep(duration: Duration): Promise<void>; | ||
export declare function fetch(url: RequestInfo, init?: RequestInit): Promise<Response>; | ||
@@ -10,0 +15,0 @@ export declare function echo(...args: any[]): void; |
@@ -10,2 +10,3 @@ "use strict"; | ||
os, | ||
parseArgv, | ||
path, | ||
@@ -25,2 +26,3 @@ question, | ||
os, | ||
parseArgv, | ||
path, | ||
@@ -27,0 +29,0 @@ question, |
@@ -5,2 +5,4 @@ import { ProcessPromise } from './core.js'; | ||
export { minimist, chalk, fs, which, YAML, ps, glob, glob as globby, } from './vendor.js'; | ||
export declare const VERSION: any; | ||
export declare const version: any; | ||
export { type Duration, quote, quotePowerShell, tempdir, tempdir as tmpdir, tempfile, tempfile as tmpfile, } from './util.js'; | ||
@@ -7,0 +9,0 @@ /** |
@@ -5,2 +5,3 @@ "use strict"; | ||
const { | ||
VERSION, | ||
YAML, | ||
@@ -21,2 +22,3 @@ chalk, | ||
tmpfile, | ||
version, | ||
which, | ||
@@ -30,2 +32,3 @@ $, | ||
log, | ||
resolveDefaults, | ||
syncProcessCwd, | ||
@@ -41,2 +44,3 @@ useBash, | ||
os, | ||
parseArgv, | ||
path, | ||
@@ -51,2 +55,3 @@ question, | ||
export { | ||
VERSION, | ||
YAML, | ||
@@ -67,2 +72,3 @@ chalk, | ||
tmpfile, | ||
version, | ||
which, | ||
@@ -76,2 +82,3 @@ $, | ||
log, | ||
resolveDefaults, | ||
syncProcessCwd, | ||
@@ -87,2 +94,3 @@ useBash, | ||
os, | ||
parseArgv, | ||
path, | ||
@@ -89,0 +97,0 @@ question, |
@@ -0,1 +1,2 @@ | ||
import { type RequestInfo, type RequestInit } from './vendor-core.js'; | ||
export { isStringLiteral } from './vendor-core.js'; | ||
@@ -5,2 +6,3 @@ export declare function tempdir(prefix?: string): string; | ||
export declare function noop(): void; | ||
export declare function identity<T>(v: T): T; | ||
export declare function randomId(): string; | ||
@@ -14,10 +16,35 @@ export declare function isString(obj: any): obj is string; | ||
export declare function quotePowerShell(arg: string): string; | ||
export declare function exitCodeInfo(exitCode: number | null): string | undefined; | ||
export declare function errnoMessage(errno?: number): string; | ||
export type Duration = number | `${number}m` | `${number}s` | `${number}ms`; | ||
export declare function parseDuration(d: Duration): number; | ||
export type LogEntry = { | ||
verbose?: boolean; | ||
} & ({ | ||
kind: 'cmd'; | ||
cmd: string; | ||
} | { | ||
kind: 'stdout' | 'stderr'; | ||
data: Buffer; | ||
} | { | ||
kind: 'cd'; | ||
dir: string; | ||
} | { | ||
kind: 'fetch'; | ||
url: RequestInfo; | ||
init?: RequestInit; | ||
} | { | ||
kind: 'retry'; | ||
attempt: number; | ||
total: number; | ||
delay: number; | ||
exception: unknown; | ||
error?: string; | ||
} | { | ||
kind: 'custom'; | ||
data: any; | ||
}); | ||
export declare function log(entry: LogEntry): void; | ||
export declare function formatCmd(cmd?: string): string; | ||
export declare function getCallerLocation(err?: Error): string; | ||
export declare function getCallerLocationFromString(stackString?: string): string; | ||
export declare const once: <T extends (...args: any[]) => any>(fn: T) => (...args: Parameters<T>) => ReturnType<T>; | ||
export declare const proxyOverride: <T extends object>(origin: T, ...fallbacks: any) => T; | ||
export declare const toCamelCase: (str: string) => string; | ||
export declare const parseBool: (v: string) => boolean | string; |
@@ -5,11 +5,10 @@ "use strict"; | ||
const { | ||
errnoMessage, | ||
exitCodeInfo, | ||
formatCmd, | ||
getCallerLocation, | ||
getCallerLocationFromString, | ||
identity, | ||
isString, | ||
isStringLiteral, | ||
log, | ||
noop, | ||
once, | ||
parseBool, | ||
parseDuration, | ||
@@ -22,14 +21,14 @@ preferLocalBin, | ||
tempdir, | ||
tempfile | ||
tempfile, | ||
toCamelCase | ||
} = __module__ | ||
export { | ||
errnoMessage, | ||
exitCodeInfo, | ||
formatCmd, | ||
getCallerLocation, | ||
getCallerLocationFromString, | ||
identity, | ||
isString, | ||
isStringLiteral, | ||
log, | ||
noop, | ||
once, | ||
parseBool, | ||
parseDuration, | ||
@@ -42,4 +41,5 @@ preferLocalBin, | ||
tempdir, | ||
tempfile | ||
tempfile, | ||
toCamelCase | ||
} | ||
@@ -71,3 +71,3 @@ // Generated by dts-bundle-generator v9.5.1 | ||
signal: AbortController["signal"]; | ||
shell: string | true | undefined; | ||
shell: string | boolean | undefined; | ||
spawn: typeof cp.spawn; | ||
@@ -85,2 +85,3 @@ spawnSync: typeof cp.spawnSync; | ||
run: (cb: () => void, ctx: TSpawnCtxNormalized) => void; | ||
stack: string; | ||
} | ||
@@ -87,0 +88,0 @@ export declare class VoidStream extends Transform { |
{ | ||
"name": "zx", | ||
"version": "8.2.4", | ||
"version": "8.3.0-dev.504a960", | ||
"description": "A tool for writing better scripts", | ||
@@ -62,29 +62,2 @@ "type": "module", | ||
}, | ||
"scripts": { | ||
"fmt": "prettier --write .", | ||
"fmt:check": "prettier --check .", | ||
"build": "npm run build:js && npm run build:dts", | ||
"build:js": "node scripts/build-js.mjs --format=cjs --hybrid --entry=src/*.ts && npm run build:vendor", | ||
"build:vendor": "node scripts/build-js.mjs --format=cjs --entry=src/vendor-*.ts --bundle=all", | ||
"build:dts": "tsc --project tsconfig.prod.json && node scripts/build-dts.mjs", | ||
"pretest": "npm run build", | ||
"test": "npm run test:size && npm run fmt:check && npm run test:unit && npm run test:types && npm run test:license", | ||
"test:it": "node ./test/it/build.test.js", | ||
"test:unit": "node ./test/all.test.js", | ||
"test:coverage": "c8 -x build/deno.js -x build/vendor-extra.cjs -x build/vendor-core.cjs -x build/esblib.cjs -x 'test/**' -x scripts --check-coverage npm run test:unit", | ||
"test:circular": "madge --circular src/*", | ||
"test:types": "tsd", | ||
"test:license": "node ./test/extra.test.js", | ||
"test:audit": "npm audit fix", | ||
"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", | ||
"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", | ||
"test:smoke:ts-node": "node --loader ts-node/esm test/smoke/ts.test.ts", | ||
"test:smoke:bun": "bun test ./test/smoke/bun.test.js && bun ./test/smoke/node.test.mjs", | ||
"test:smoke:win32": "node ./test/smoke/win32.test.js", | ||
"test:smoke:cjs": "node ./test/smoke/node.test.cjs", | ||
"test:smoke:mjs": "node ./test/smoke/node.test.mjs", | ||
"test:smoke:deno": "deno test ./test/smoke/deno.test.js --allow-read --allow-sys --allow-env --allow-run" | ||
}, | ||
"optionalDependencies": { | ||
@@ -94,38 +67,2 @@ "@types/fs-extra": ">=11", | ||
}, | ||
"devDependencies": { | ||
"@size-limit/file": "^11.1.6", | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/minimist": "^1.2.5", | ||
"@types/node": ">=20.11.30", | ||
"@types/which": "^3.0.4", | ||
"@webpod/ingrid": "^0.0.0-beta.3", | ||
"@webpod/ps": "^0.0.0-beta.11", | ||
"c8": "^10.1.2", | ||
"chalk": "^5.3.0", | ||
"create-require": "^1.1.1", | ||
"depseek": "^0.4.1", | ||
"dts-bundle-generator": "^9.5.1", | ||
"esbuild": "^0.24.0", | ||
"esbuild-node-externals": "^1.15.0", | ||
"esbuild-plugin-entry-chunks": "^0.1.15", | ||
"esbuild-plugin-extract-helpers": "^0.0.6", | ||
"esbuild-plugin-hybrid-export": "^0.3.1", | ||
"esbuild-plugin-resolve": "^2.0.0", | ||
"esbuild-plugin-transform-hook": "^0.1.1", | ||
"esbuild-plugin-utils": "^0.1.0", | ||
"fs-extra": "^11.2.0", | ||
"globby": "^14.0.2", | ||
"madge": "^8.0.0", | ||
"minimist": "^1.2.8", | ||
"node-fetch-native": "^1.6.4", | ||
"prettier": "^3.3.3", | ||
"size-limit": "^11.1.6", | ||
"ts-node": "^10.9.2", | ||
"tsd": "^0.31.2", | ||
"tsx": "^4.19.2", | ||
"typescript": "^5.6.3", | ||
"which": "^5.0.0", | ||
"yaml": "^2.5.1", | ||
"zurk": "^0.6.2" | ||
}, | ||
"publishConfig": { | ||
@@ -148,8 +85,2 @@ "registry": "https://wombat-dressing-room.appspot.com" | ||
], | ||
"prettier": { | ||
"semi": false, | ||
"singleQuote": true, | ||
"endOfLine": "lf", | ||
"trailingComma": "es5" | ||
}, | ||
"repository": { | ||
@@ -162,2 +93,2 @@ "type": "git", | ||
"license": "Apache-2.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
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
855621
0
24296
36
1
35