Skip to content

Commit

Permalink
fix(factory): Fix deprecated glob import that prevents using from cod…
Browse files Browse the repository at this point in the history
…e after glob upgrade (#1981)
  • Loading branch information
gallayl authored Jun 4, 2024
1 parent a177f84 commit 3b85daf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions factory/program.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as glob from "glob";
import * as path from "node:path";
import normalize from "normalize-path";
import ts from "typescript";
import type { CompletedConfig, Config } from "../src/Config.js";
import { BuildError } from "../src/Error/Errors.js";
import { globSync } from "glob";

function loadTsConfigFile(configFile: string) {
const raw = ts.sys.readFile(configFile);
Expand Down Expand Up @@ -64,7 +64,7 @@ function getTsConfig(config: Config) {

export function createProgram(config: CompletedConfig): ts.Program {
const rootNamesFromPath = config.path
? glob.sync(normalize(path.resolve(config.path))).map((rootName) => normalize(rootName))
? globSync(normalize(path.resolve(config.path))).map((rootName) => normalize(rootName))
: [];
const tsconfig = getTsConfig(config);
const rootNames = rootNamesFromPath.length ? rootNamesFromPath : tsconfig.fileNames;
Expand Down

0 comments on commit 3b85daf

Please sign in to comment.