Comparing version 8.1.1 to 8.1.2-dev.3931b9d
#!/usr/bin/env node | ||
export {}; | ||
import { minimist } from './index.js'; | ||
export declare function printUsage(): void; | ||
export declare const argv: minimist.ParsedArgs; | ||
export declare function main(): Promise<void>; | ||
export declare function runScript(script: string): Promise<void>; | ||
export declare function scriptFromStdin(): Promise<boolean>; | ||
export declare function scriptFromHttp(remote: string): Promise<void>; | ||
export declare function writeAndImport(script: string | Buffer, filepath: string, origin?: string): Promise<void>; | ||
export declare function importPath(filepath: string, origin?: string): Promise<void>; | ||
export declare function injectGlobalRequire(origin: string): void; | ||
export declare function transformMarkdown(buf: Buffer): string; | ||
export declare function getVersion(): string; | ||
export declare function isMain(metaurl?: string, scriptpath?: string): boolean; |
#!/usr/bin/env node | ||
"use strict"; | ||
import './deno.js' | ||
import { require } from './deno.js' | ||
const { | ||
} = await import('./cli.cjs') | ||
argv, | ||
getVersion, | ||
importPath, | ||
injectGlobalRequire, | ||
isMain, | ||
main, | ||
printUsage, | ||
runScript, | ||
scriptFromHttp, | ||
scriptFromStdin, | ||
transformMarkdown, | ||
writeAndImport | ||
} = require('./cli.cjs') | ||
export { | ||
argv, | ||
getVersion, | ||
importPath, | ||
injectGlobalRequire, | ||
isMain, | ||
main, | ||
printUsage, | ||
runScript, | ||
scriptFromHttp, | ||
scriptFromStdin, | ||
transformMarkdown, | ||
writeAndImport | ||
} | ||
@@ -5,3 +5,3 @@ import { spawn, spawnSync, StdioOptions, IOType } from 'node:child_process'; | ||
import { inspect } from 'node:util'; | ||
import { RequestInfo, RequestInit } from './vendor.js'; | ||
import { type RequestInfo, type RequestInit, type TSpawnStore } from './vendor.js'; | ||
import { Duration, noop, quote } from './util.js'; | ||
@@ -41,2 +41,3 @@ export interface Shell { | ||
spawnSync: typeof spawnSync; | ||
store?: TSpawnStore; | ||
log: typeof log; | ||
@@ -61,2 +62,3 @@ kill: typeof kill; | ||
private _quiet?; | ||
private _verbose?; | ||
private _timeout?; | ||
@@ -91,8 +93,10 @@ private _timeoutSignal; | ||
nothrow(): ProcessPromise; | ||
quiet(): ProcessPromise; | ||
quiet(v?: boolean): ProcessPromise; | ||
verbose(v?: boolean): ProcessPromise; | ||
isQuiet(): boolean; | ||
isVerbose(): boolean; | ||
isNothrow(): boolean; | ||
timeout(d: Duration, signal?: string): ProcessPromise; | ||
halt(): ProcessPromise; | ||
get isHalted(): boolean; | ||
isHalted(): boolean; | ||
get output(): ProcessOutput | null; | ||
@@ -126,8 +130,8 @@ } | ||
export type LogEntry = { | ||
verbose?: boolean; | ||
} & ({ | ||
kind: 'cmd'; | ||
verbose: boolean; | ||
cmd: string; | ||
} | { | ||
kind: 'stdout' | 'stderr'; | ||
verbose: boolean; | ||
data: Buffer; | ||
@@ -147,4 +151,4 @@ } | { | ||
data: any; | ||
}; | ||
}); | ||
export declare function log(entry: LogEntry): void; | ||
export {}; |
"use strict"; | ||
import './deno.js' | ||
import { require } from './deno.js' | ||
const { | ||
@@ -16,3 +16,3 @@ $, | ||
within | ||
} = await import('./core.cjs') | ||
} = require('./core.cjs') | ||
export { | ||
@@ -19,0 +19,0 @@ $, |
import { createRequire } from 'node:module' | ||
const require = createRequire(import.meta.url) | ||
const __filename = new URL(import.meta.url).pathname | ||
const __dirname = new URL('.', import.meta.url).pathname | ||
if (globalThis.Deno) { | ||
globalThis.require = createRequire(import.meta.url) | ||
globalThis.__filename = new URL(import.meta.url).pathname | ||
globalThis.__dirname = new URL('.', import.meta.url).pathname | ||
globalThis.require = require | ||
globalThis.__filename = __filename | ||
globalThis.__dirname = __dirname | ||
} | ||
export { require, __dirname, __filename } |
"use strict"; | ||
import './deno.js' | ||
import { require } from './deno.js' | ||
const { | ||
installDeps, | ||
parseDeps | ||
} = await import('./deps.cjs') | ||
} = require('./deps.cjs') | ||
export { | ||
@@ -8,0 +8,0 @@ installDeps, |
"use strict"; | ||
import './deno.js' | ||
import { require } from './deno.js' | ||
const { | ||
} = await import('./globals.cjs') | ||
} = require('./globals.cjs') | ||
export { | ||
@@ -7,0 +7,0 @@ |
"use strict"; | ||
import './deno.js' | ||
import { require } from './deno.js' | ||
const { | ||
@@ -16,3 +16,3 @@ argv, | ||
updateArgv | ||
} = await import('./goods.cjs') | ||
} = require('./goods.cjs') | ||
export { | ||
@@ -19,0 +19,0 @@ argv, |
"use strict"; | ||
import './deno.js' | ||
import { require } from './deno.js' | ||
const { | ||
@@ -44,3 +44,3 @@ YAML, | ||
updateArgv | ||
} = await import('./index.cjs') | ||
} = require('./index.cjs') | ||
export { | ||
@@ -47,0 +47,0 @@ YAML, |
"use strict"; | ||
import './deno.js' | ||
import { require } from './deno.js' | ||
const { | ||
startRepl | ||
} = await import('./repl.cjs') | ||
} = require('./repl.cjs') | ||
export { | ||
@@ -7,0 +7,0 @@ startRepl |
@@ -21,2 +21,1 @@ export declare function tempdir(prefix?: string): string; | ||
export declare function getCallerLocationFromString(stackString?: string): string; | ||
export declare function ensureEol(buffer: Buffer): Buffer; |
"use strict"; | ||
import './deno.js' | ||
import { require } from './deno.js' | ||
const { | ||
ensureEol, | ||
errnoMessage, | ||
@@ -21,5 +20,4 @@ exitCodeInfo, | ||
tempfile | ||
} = await import('./util.cjs') | ||
} = require('./util.cjs') | ||
export { | ||
ensureEol, | ||
errnoMessage, | ||
@@ -26,0 +24,0 @@ exitCodeInfo, |
@@ -321,2 +321,14 @@ // Generated by dts-bundle-generator v9.5.1 | ||
type TSpawnError = any; | ||
type TPushable<T = any> = { | ||
push(...args: T[]): number; | ||
}; | ||
type TJoinable = { | ||
join(sep?: string): string; | ||
}; | ||
type TSpawnStoreChunks = Iterable<string | Buffer> & TPushable<string | Buffer> & TJoinable; | ||
export type TSpawnStore = { | ||
stdout: TSpawnStoreChunks; | ||
stderr: TSpawnStoreChunks; | ||
stdall: TSpawnStoreChunks; | ||
}; | ||
type TSpawnResult = { | ||
@@ -367,2 +379,3 @@ stderr: string; | ||
spawnOpts: Record<string, any>; | ||
store: TSpawnStore; | ||
callback: (err: TSpawnError, result: TSpawnResult) => void; | ||
@@ -577,30 +590,18 @@ stdin: Readable; | ||
export declare const chalk: ChalkInstance; | ||
/** Finds all instances of a specified executable in the PATH environment variable */ | ||
export declare function which(cmd: string, options: which.Options & which.AsyncOptions & which.OptionsAll): Promise<string[]>; | ||
export declare function which(cmd: string, options?: which.Options & which.AsyncOptions & which.OptionsFirst): Promise<string>; | ||
type AppendNullIfNothrow<TOptions, TRet> = TOptions extends { | ||
nothrow: infer TVal; | ||
} ? TVal extends false ? TRet : TRet | null : TRet; | ||
type TransformToArrayIfAll<TOptions, TRet> = TOptions extends { | ||
all: infer TVal; | ||
} ? TVal extends true ? readonly TRet[] : TVal extends false ? TRet : readonly TRet[] | TRet : TRet; | ||
type ReturnType$1<TOptions> = AppendNullIfNothrow<TOptions, TransformToArrayIfAll<TOptions, string>>; | ||
type Exact<T, U extends T> = { | ||
[Key in keyof U]: Key extends keyof T ? U[Key] : never; | ||
}; | ||
export declare function which<TOptions extends which.Options>(cmd: string, options?: Exact<which.Options, TOptions>): Promise<ReturnType$1<Exact<which.Options, TOptions>>>; | ||
export declare namespace which { | ||
/** Finds all instances of a specified executable in the PATH environment variable */ | ||
function sync(cmd: string, options: Options & OptionsAll & OptionsNoThrow): readonly string[] | null; | ||
function sync(cmd: string, options: Options & OptionsFirst & OptionsNoThrow): string | null; | ||
function sync(cmd: string, options: Options & OptionsAll & OptionsThrow): readonly string[]; | ||
function sync(cmd: string, options?: Options & OptionsFirst & OptionsThrow): string; | ||
function sync(cmd: string, options: Options): string | readonly string[] | null; | ||
/** Options that ask for all matches. */ | ||
interface OptionsAll extends AsyncOptions { | ||
all: true; | ||
} | ||
/** Options that ask for the first match (the default behavior) */ | ||
interface OptionsFirst extends AsyncOptions { | ||
all?: false | undefined; | ||
} | ||
/** Options that ask to receive null instead of a thrown error */ | ||
interface OptionsNoThrow extends Options { | ||
nothrow: true; | ||
} | ||
/** Options that ask for a thrown error if executable is not found (the default behavior) */ | ||
interface OptionsThrow extends Options { | ||
nothrow?: false | undefined; | ||
} | ||
/** Options for which() async API */ | ||
interface AsyncOptions { | ||
function sync<TOptions extends Options>(cmd: string, options?: Exact<Options, TOptions>): ReturnType$1<Exact<Options, TOptions>>; | ||
/** Options for which() API */ | ||
interface Options { | ||
/** If true, return all matches, instead of just the first one. Note that this means the function returns an array of strings instead of a single string. */ | ||
@@ -612,5 +613,4 @@ all?: boolean | undefined; | ||
pathExt?: string | undefined; | ||
} | ||
/** Options for which() sync and async APIs */ | ||
interface Options extends AsyncOptions { | ||
/** Use instead of the platform's native path separator. */ | ||
delimiter?: string | undefined; | ||
/** If true, returns null when not found */ | ||
@@ -730,5 +730,13 @@ nothrow?: boolean | undefined; | ||
declare const _default: { | ||
lookup: (query?: TPsLookupQuery, cb?: TPsLookupCallback) => Promise<TPsLookupEntry[]>; | ||
kill: (pid: string | number, opts?: string | number | TPsKillOptions | TPsNext | undefined, next?: TPsNext | undefined) => Promise<void>; | ||
tree: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback) => Promise<TPsLookupEntry[]>; | ||
lookup: { | ||
(query?: TPsLookupQuery, cb?: TPsLookupCallback): Promise<TPsLookupEntry[]>; | ||
sync: (query?: TPsLookupQuery, cb?: TPsLookupCallback) => TPsLookupEntry[]; | ||
}; | ||
lookupSync: (query?: TPsLookupQuery, cb?: TPsLookupCallback) => TPsLookupEntry[]; | ||
tree: { | ||
(opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback | undefined): Promise<TPsLookupEntry[]>; | ||
sync: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback | undefined) => TPsLookupEntry[]; | ||
}; | ||
treeSync: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback | undefined) => TPsLookupEntry[]; | ||
}; | ||
@@ -735,0 +743,0 @@ export declare const createRequire: (filename: string | URL$1) => NodeRequire; |
"use strict"; | ||
import './deno.js' | ||
import { require } from './deno.js' | ||
const { | ||
@@ -18,3 +18,3 @@ YAML, | ||
which | ||
} = await import('./vendor.cjs') | ||
} = require('./vendor.cjs') | ||
export { | ||
@@ -21,0 +21,0 @@ YAML, |
{ | ||
"name": "zx", | ||
"version": "8.1.1", | ||
"version": "8.1.2-dev.3931b9d", | ||
"description": "A tool for writing better scripts", | ||
"type": "module", | ||
"main": "./build/index.js", | ||
"main": "./build/index.cjs", | ||
"types": "./build/index.d.ts", | ||
@@ -88,4 +88,4 @@ "typesVersions": { | ||
"optionalDependencies": { | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/node": ">=20.12.12" | ||
"@types/fs-extra": ">=11", | ||
"@types/node": ">=20" | ||
}, | ||
@@ -96,5 +96,5 @@ "devDependencies": { | ||
"@types/node": ">=20.11.30", | ||
"@types/which": "^3.0.3", | ||
"@types/which": "^3.0.4", | ||
"@webpod/ingrid": "^0.0.0-beta.3", | ||
"@webpod/ps": "^0.0.0-beta.3", | ||
"@webpod/ps": "^0.0.0-beta.6", | ||
"c8": "^9.1.0", | ||
@@ -105,9 +105,9 @@ "chalk": "^5.3.0", | ||
"dts-bundle-generator": "^9.5.1", | ||
"esbuild": "^0.21.3", | ||
"esbuild": "^0.21.5", | ||
"esbuild-node-externals": "^1.13.1", | ||
"esbuild-plugin-entry-chunks": "^0.1.14", | ||
"esbuild-plugin-extract-helpers": "^0.0.5", | ||
"esbuild-plugin-hybrid-export": "^0.2.3", | ||
"esbuild-plugin-transform-hook": "^0.1.0", | ||
"esbuild-plugin-utils": "^0.0.1", | ||
"esbuild-plugin-entry-chunks": "^0.1.15", | ||
"esbuild-plugin-extract-helpers": "^0.0.6", | ||
"esbuild-plugin-hybrid-export": "^0.2.4", | ||
"esbuild-plugin-transform-hook": "^0.1.1", | ||
"esbuild-plugin-utils": "^0.1.0", | ||
"fs-extra": "^11.2.0", | ||
@@ -118,12 +118,11 @@ "fx": "*", | ||
"minimist": "^1.2.8", | ||
"node-abort-controller": "^3.1.1", | ||
"node-fetch-native": "^1.6.4", | ||
"prettier": "^3.2.5", | ||
"prettier": "^3.3.2", | ||
"ts-node": "^10.9.2", | ||
"tsd": "^0.31.0", | ||
"tsx": "^4.10.5", | ||
"tsd": "^0.31.1", | ||
"tsx": "^4.15.6", | ||
"typescript": "^5.4.5", | ||
"which": "^4.0.0", | ||
"yaml": "^2.4.2", | ||
"zurk": "^0.1.4" | ||
"yaml": "^2.4.5", | ||
"zurk": "^0.3.0" | ||
}, | ||
@@ -130,0 +129,0 @@ "publishConfig": { |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
896624
32
24460
2
36