@arktype/fs
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -1,89 +0,43 @@ | ||
import { execSync } from 'node:child_process'; | ||
export { rmSync } from 'node:fs'; | ||
type GetCallStackOptions = { | ||
offset?: number; | ||
}; | ||
declare const getCallStack: ({ offset }?: GetCallStackOptions) => string[]; | ||
type LinePosition = { | ||
line: number; | ||
char: number; | ||
}; | ||
type SourcePosition = LinePosition & { | ||
file: string; | ||
method: string; | ||
}; | ||
type CallerOfOptions = { | ||
formatPath?: FormatFilePathOptions; | ||
upStackBy?: number; | ||
skip?: (position: SourcePosition) => boolean; | ||
methodName?: string; | ||
}; | ||
type FormatFilePathOptions = { | ||
relative?: string | boolean; | ||
seperator?: string; | ||
}; | ||
declare const positionToString: (position: SourcePosition) => string; | ||
declare const formatFilePath: (original: string, { relative, seperator }: FormatFilePathOptions) => string; | ||
declare const caller: (options?: CallerOfOptions) => SourcePosition; | ||
declare const callsAgo: (num: number, options?: Omit<CallerOfOptions, "upStackBy">) => SourcePosition; | ||
declare const ensureDir: (path: string) => string; | ||
declare const readFile: (path: string) => string; | ||
declare const writeFile: (path: string, contents: string) => void; | ||
declare const readJson: (path: string) => any; | ||
declare const writeJson: (path: string, data: object) => void; | ||
declare const rmRf: (target: string) => void; | ||
declare const cpR: (from: string, to: string) => void; | ||
type JsonTransformer = (data: object) => object; | ||
declare const rewriteJson: (path: string, transform: JsonTransformer) => void; | ||
type WalkOptions = { | ||
ignoreDirsMatching?: RegExp; | ||
ignoreFilesMatching?: RegExp; | ||
excludeFiles?: boolean; | ||
excludeDirs?: boolean; | ||
exclude?: (path: string) => boolean; | ||
include?: (path: string) => boolean; | ||
}; | ||
declare const walkPaths: (dir: string, options?: WalkOptions) => string[]; | ||
/** Fetch the file and directory paths from a path, uri, or `import.meta.url` */ | ||
declare const filePath: (path: string) => string; | ||
declare const fileName: () => string; | ||
declare const dirName: () => string; | ||
declare const fromHere: (...joinWith: string[]) => string; | ||
declare const fromCwd: (...joinWith: string[]) => string; | ||
declare const fromHome: (...joinWith: string[]) => string; | ||
declare const fsRoot: string; | ||
declare const findPackageRoot: (fromDir?: string) => string; | ||
declare const fromPackageRoot: (...joinWith: string[]) => string; | ||
declare const readPackageJson: (startDir?: string) => any; | ||
declare const getSourceControlPaths: () => string[]; | ||
declare const tsFileMatcher: RegExp; | ||
declare const getSourceFilePaths: (dir?: string) => string[]; | ||
type SourceFileEntry = [path: string, contents: string]; | ||
declare const getSourceFileEntries: (dir?: string) => SourceFileEntry[]; | ||
type ReplacementDictionary = Record<string, { | ||
pattern: RegExp; | ||
replacement: `"${string}"`; | ||
}>; | ||
type Matchers = ReadonlyArray<Matcher>; | ||
type Matcher = { | ||
pattern: RegExp; | ||
replacement: string; | ||
}; | ||
/** | ||
* Given a directory and a set of {@link Matchers}, recursively walks | ||
* the directory and applies every set of changes in the dictionary | ||
* to all files except those matching `ignoreFilesMatching`. | ||
*/ | ||
declare const findReplaceAll: (matchDictionary: ReplacementDictionary, ignoreFilesMatching: RegExp) => (dirPath: string) => void; | ||
type ShellOptions = Parameters<typeof execSync>[1] & { | ||
env?: Record<string, unknown>; | ||
stdio?: "pipe" | "inherit"; | ||
returnOutput?: boolean; | ||
}; | ||
/** Run the cmd synchronously. Pass returnOutput if you need the result, otherwise it will go to terminal. */ | ||
declare const shell: (cmd: string, { returnOutput, env, ...otherOptions }?: ShellOptions) => string; | ||
export { CallerOfOptions, FormatFilePathOptions, GetCallStackOptions, JsonTransformer, LinePosition, Matcher, Matchers, ReplacementDictionary, ShellOptions, SourceFileEntry, SourcePosition, WalkOptions, caller, callsAgo, cpR, dirName, ensureDir, fileName, filePath, findPackageRoot, findReplaceAll, formatFilePath, fromCwd, fromHere, fromHome, fromPackageRoot, fsRoot, getCallStack, getSourceControlPaths, getSourceFileEntries, getSourceFilePaths, positionToString, readFile, readJson, readPackageJson, rewriteJson, rmRf, shell, tsFileMatcher, walkPaths, writeFile, writeJson }; | ||
export { GetCallStackOptions_alias_1 as GetCallStackOptions } from './_tsup-dts-rollup'; | ||
export { getCallStack_alias_1 as getCallStack } from './_tsup-dts-rollup'; | ||
export { LinePosition_alias_1 as LinePosition } from './_tsup-dts-rollup'; | ||
export { SourcePosition_alias_1 as SourcePosition } from './_tsup-dts-rollup'; | ||
export { CallerOfOptions_alias_1 as CallerOfOptions } from './_tsup-dts-rollup'; | ||
export { FormatFilePathOptions_alias_1 as FormatFilePathOptions } from './_tsup-dts-rollup'; | ||
export { positionToString_alias_1 as positionToString } from './_tsup-dts-rollup'; | ||
export { formatFilePath_alias_1 as formatFilePath } from './_tsup-dts-rollup'; | ||
export { caller_alias_1 as caller } from './_tsup-dts-rollup'; | ||
export { callsAgo_alias_1 as callsAgo } from './_tsup-dts-rollup'; | ||
export { rmSync_alias_1 as rmSync } from './_tsup-dts-rollup'; | ||
export { ensureDir_alias_1 as ensureDir } from './_tsup-dts-rollup'; | ||
export { readFile_alias_1 as readFile } from './_tsup-dts-rollup'; | ||
export { writeFile_alias_1 as writeFile } from './_tsup-dts-rollup'; | ||
export { readJson_alias_1 as readJson } from './_tsup-dts-rollup'; | ||
export { writeJson_alias_1 as writeJson } from './_tsup-dts-rollup'; | ||
export { rmRf_alias_1 as rmRf } from './_tsup-dts-rollup'; | ||
export { cpR_alias_1 as cpR } from './_tsup-dts-rollup'; | ||
export { JsonTransformer_alias_1 as JsonTransformer } from './_tsup-dts-rollup'; | ||
export { rewriteJson_alias_1 as rewriteJson } from './_tsup-dts-rollup'; | ||
export { WalkOptions_alias_1 as WalkOptions } from './_tsup-dts-rollup'; | ||
export { walkPaths_alias_1 as walkPaths } from './_tsup-dts-rollup'; | ||
export { filePath_alias_1 as filePath } from './_tsup-dts-rollup'; | ||
export { fileName_alias_1 as fileName } from './_tsup-dts-rollup'; | ||
export { dirName_alias_1 as dirName } from './_tsup-dts-rollup'; | ||
export { fromHere_alias_1 as fromHere } from './_tsup-dts-rollup'; | ||
export { fromCwd_alias_1 as fromCwd } from './_tsup-dts-rollup'; | ||
export { fromHome_alias_1 as fromHome } from './_tsup-dts-rollup'; | ||
export { fsRoot_alias_1 as fsRoot } from './_tsup-dts-rollup'; | ||
export { findPackageRoot_alias_1 as findPackageRoot } from './_tsup-dts-rollup'; | ||
export { fromPackageRoot_alias_1 as fromPackageRoot } from './_tsup-dts-rollup'; | ||
export { readPackageJson_alias_1 as readPackageJson } from './_tsup-dts-rollup'; | ||
export { getSourceControlPaths_alias_1 as getSourceControlPaths } from './_tsup-dts-rollup'; | ||
export { tsFileMatcher_alias_1 as tsFileMatcher } from './_tsup-dts-rollup'; | ||
export { getSourceFilePaths_alias_1 as getSourceFilePaths } from './_tsup-dts-rollup'; | ||
export { SourceFileEntry_alias_1 as SourceFileEntry } from './_tsup-dts-rollup'; | ||
export { getSourceFileEntries_alias_1 as getSourceFileEntries } from './_tsup-dts-rollup'; | ||
export { ReplacementDictionary_alias_1 as ReplacementDictionary } from './_tsup-dts-rollup'; | ||
export { Matchers_alias_1 as Matchers } from './_tsup-dts-rollup'; | ||
export { Matcher_alias_1 as Matcher } from './_tsup-dts-rollup'; | ||
export { findReplaceAll_alias_1 as findReplaceAll } from './_tsup-dts-rollup'; | ||
export { ShellOptions } from './_tsup-dts-rollup'; | ||
export { shell } from './_tsup-dts-rollup'; |
{ | ||
"name": "@arktype/fs", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"author": { | ||
@@ -10,6 +10,15 @@ "name": "David Blass", | ||
"type": "module", | ||
"main": "./dist/main.cjs", | ||
"types": "./dist/main.d.cts", | ||
"exports": { | ||
".": { | ||
"arktype-repo": "./main.js", | ||
"import": "./dist/main.js" | ||
"import": { | ||
"types": "./dist/main.d.ts", | ||
"default": "./dist/main.js" | ||
}, | ||
"default": { | ||
"types": "./dist/main.d.cts", | ||
"default": "./dist/main.cjs" | ||
} | ||
} | ||
@@ -21,4 +30,6 @@ }, | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"!__tests__", | ||
"**/*.ts" | ||
] | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
59559
12
1404
5
3