-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I use the resolveTsPaths function instead of the CLI. Unfortunately, it does not log anything or provide a way to know how many import paths were changed. It would be nice if this function could return the changes array, so I can add a console log myself in the toolchain.
https://github.com/benyap/resolve-tspaths/blob/main/src/index.ts#L20-L38
import type { Change } from "~/types";
...
export async function resolveTsPaths(
options: ResolveTsPathOptions = {},
): Promise<Change[]> { // Change return type
const {
project = "tsconfig.json",
src = "src",
ext = DEFAULT_EXTENSIONS,
out,
} = options;
const tsConfig = loadTSConfig(project);
const programPaths = resolvePaths({ project, src, out }, tsConfig);
const aliases = computeAliases(
programPaths.basePath,
tsConfig?.options?.paths ?? {},
);
const files = getFilesToProcess(programPaths.outPath, ext);
const changes = generateChanges(files, aliases, programPaths);
applyChanges(changes);
return changes; // Add this return
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request