From 930cf29d157d17faf907be2a4eecc1fbdf5699b2 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 26 Oct 2022 10:39:40 +0800 Subject: [PATCH] Share `fast-glob` module between core and CLI (#13725) --- src/cli/expand-patterns.js | 2 +- src/cli/prettier-internal.js | 1 + src/index.js | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cli/expand-patterns.js b/src/cli/expand-patterns.js index b406d422c..0dd821ae7 100644 --- a/src/cli/expand-patterns.js +++ b/src/cli/expand-patterns.js @@ -1,6 +1,6 @@ import path from "node:path"; -import fastGlob from "fast-glob"; import { statSafe } from "./utils.js"; +import { fastGlob } from "./prettier-internal.js"; /** @typedef {import('./context').Context} Context */ diff --git a/src/cli/prettier-internal.js b/src/cli/prettier-internal.js index 0986a2d1d..00299e033 100644 --- a/src/cli/prettier-internal.js +++ b/src/cli/prettier-internal.js @@ -8,4 +8,5 @@ export const { normalizeOptions, getSupportInfoWithoutPlugins, vnopts, + fastGlob, } = sharedWithCli; diff --git a/src/index.js b/src/index.js index 119349d63..80d6298e8 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,5 @@ import vnopts from "vnopts"; +import fastGlob from "fast-glob"; import core from "./main/core.js"; import { getSupportInfo as getSupportInfoWithoutPlugins } from "./main/support.js"; import getFileInfoWithoutPlugins from "./common/get-file-info.js"; @@ -81,6 +82,7 @@ const sharedWithCli = { normalizeOptions, getSupportInfoWithoutPlugins, vnopts, + fastGlob, utils: { arrayify, isNonEmptyArray,