Skip to content

fix(factory): Fix deprecated glob import that prevents using from code after glob upgrade #1981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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