Skip to content

Commit c6002c5

Browse files
committed
chore(deps): switch to tinyglobby
1 parent 447406f commit c6002c5

File tree

12 files changed

+114
-39
lines changed

12 files changed

+114
-39
lines changed

package-lock.json

Lines changed: 81 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"eslint-plugin-import": "2.32.0",
7474
"eslint-plugin-n": "17.21.3",
7575
"eslint-plugin-promise": "7.2.1",
76-
"globby": "11.1.0",
76+
"eslint-plugin-standard": "5.0.0",
7777
"graphql": "16.11.0",
7878
"graphql-yoga": "5.15.2",
7979
"husky": "9.1.7",
@@ -83,6 +83,7 @@
8383
"prettier": "3.6.2",
8484
"prettier-plugin-tailwindcss": "0.6.14",
8585
"rimraf": "6.0.1",
86+
"tinyglobby": "0.2.15",
8687
"ts-jest": "29.4.1",
8788
"tsx": "4.20.5",
8889
"typedoc": "0.25.13",

packages/load-files/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
5252
},
5353
"dependencies": {
54-
"globby": "11.1.0",
54+
"tinyglobby": "^0.2.13",
5555
"tslib": "^2.4.0",
5656
"unixify": "^1.0.0"
5757
},

packages/load-files/src/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { promises as fsPromises, readFileSync, statSync } from 'fs';
22
import { createRequire } from 'module';
33
import { extname, join } from 'path';
44
import { cwd } from 'process';
5-
import globby, { GlobbyOptions, sync as globbySync } from 'globby';
65
import { DocumentNode, parse } from 'graphql';
6+
import { GlobOptions, globSync, glob as tinyglobby } from 'tinyglobby';
77
import unixify from 'unixify';
88

99
const { readFile, stat } = fsPromises;
@@ -63,8 +63,8 @@ async function isDirectory(path: string) {
6363
}
6464
}
6565

66-
function scanForFilesSync(globStr: string | string[], globOptions: GlobbyOptions = {}): string[] {
67-
return globbySync(globStr, { absolute: true, ...globOptions });
66+
function scanForFilesSync(globStr: string | string[], globOptions: GlobOptions = {}): string[] {
67+
return globSync(globStr, { absolute: true, ...globOptions });
6868
}
6969

7070
function formatExtension(extension: string): string {
@@ -98,8 +98,8 @@ export interface LoadFilesOptions {
9898
useRequire?: boolean;
9999
// An alternative to `require` to use if `require` would be used to load a file
100100
requireMethod?: any;
101-
// Additional options to pass to globby
102-
globOptions?: GlobbyOptions;
101+
// Additional options to pass to tinyglobby
102+
globOptions?: GlobOptions;
103103
// Named exports to extract from each file. Defaults to ['typeDefs', 'schema']
104104
exportNames?: string[];
105105
// Load files from nested directories. Set to `false` to only search the top-level directory.
@@ -183,9 +183,9 @@ export function loadFilesSync<T = any>(
183183

184184
async function scanForFiles(
185185
globStr: string | string[],
186-
globOptions: GlobbyOptions = {},
186+
globOptions: GlobOptions = {},
187187
): Promise<string[]> {
188-
return globby(globStr, { absolute: true, ...globOptions });
188+
return tinyglobby(globStr, { absolute: true, ...globOptions });
189189
}
190190

191191
const checkExtension = (

packages/load/tests/loaders/documents/documents-from-glob.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { loadDocuments, loadDocumentsSync, NoTypeDefinitionsFound } from '@graph
66
import { runTests } from '../../../../testing/utils.js';
77
import '../../../../testing/to-be-similar-string';
88
import { readFileSync } from 'fs';
9-
import globby from 'globby';
9+
import { globSync } from 'tinyglobby';
1010
import { removeLoc } from '@graphql-tools/optimize';
1111

1212
describe('documentsFromGlob', () => {
@@ -20,7 +20,7 @@ describe('documentsFromGlob', () => {
2020
loaders: [new GraphQLFileLoader()],
2121
});
2222
expect(result).toHaveLength(1);
23-
const expectedFiles = globby.sync(glob);
23+
const expectedFiles = globSync(glob);
2424
for (const expectedFileName of expectedFiles) {
2525
const fileNameResult = result?.find(({ location }) => location === expectedFileName);
2626
if (fileNameResult) {
@@ -38,7 +38,7 @@ describe('documentsFromGlob', () => {
3838
loaders: [new GraphQLFileLoader()],
3939
});
4040
expect(result).toHaveLength(2);
41-
const expectedFiles = globby.sync(glob);
41+
const expectedFiles = globSync(glob);
4242
for (const expectedFileName of expectedFiles) {
4343
const fileNameResult = result?.find(({ location }) => location === expectedFileName);
4444
if (fileNameResult) {

packages/loaders/code-file/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"dependencies": {
5454
"@graphql-tools/graphql-tag-pluck": "8.3.21",
5555
"@graphql-tools/utils": "^10.9.1",
56-
"globby": "^11.0.3",
56+
"tinyglobby": "^0.2.15",
5757
"tslib": "^2.4.0",
5858
"unixify": "^1.0.0"
5959
},

packages/loaders/code-file/src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { existsSync, promises as fsPromises, readFileSync } from 'fs';
22
import { createRequire } from 'module';
33
import { isAbsolute, resolve } from 'path';
44
import { cwd, env } from 'process';
5-
import type { GlobbyOptions } from 'globby';
6-
import globby from 'globby';
75
import { DocumentNode, GraphQLSchema, isSchema, parse } from 'graphql';
6+
import type { GlobOptions } from 'tinyglobby';
7+
import { globSync, glob as tinyglobby } from 'tinyglobby';
88
import unixify from 'unixify';
99
import {
1010
gqlPluckFromCodeString,
@@ -59,7 +59,7 @@ const FILE_EXTENSIONS = [
5959
'.gjs',
6060
];
6161

62-
function createGlobbyOptions(options: CodeFileLoaderOptions): GlobbyOptions {
62+
function createGlobbyOptions(options: CodeFileLoaderOptions): GlobOptions {
6363
return { absolute: true, ...options, ignore: [] };
6464
}
6565

@@ -138,13 +138,13 @@ export class CodeFileLoader implements Loader<CodeFileLoaderOptions> {
138138
async resolveGlobs(glob: string, options: CodeFileLoaderOptions) {
139139
options = this.getMergedOptions(options);
140140
const globs = this._buildGlobs(glob, options);
141-
return globby(globs, createGlobbyOptions(options));
141+
return tinyglobby(globs, createGlobbyOptions(options));
142142
}
143143

144144
resolveGlobsSync(glob: string, options: CodeFileLoaderOptions) {
145145
options = this.getMergedOptions(options);
146146
const globs = this._buildGlobs(glob, options);
147-
return globby.sync(globs, createGlobbyOptions(options));
147+
return globSync(globs, createGlobbyOptions(options));
148148
}
149149

150150
async load(pointer: string, options: CodeFileLoaderOptions): Promise<Source[]> {

packages/loaders/graphql-file/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"dependencies": {
5454
"@graphql-tools/import": "7.1.1",
5555
"@graphql-tools/utils": "^10.9.1",
56-
"globby": "^11.0.3",
56+
"tinyglobby": "^0.2.15",
5757
"tslib": "^2.4.0",
5858
"unixify": "^1.0.0"
5959
},

packages/loaders/graphql-file/src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { existsSync, promises as fsPromises, readFileSync } from 'fs';
22
import { isAbsolute, resolve } from 'path';
33
import { env, cwd as processCwd } from 'process';
4-
import type { GlobbyOptions } from 'globby';
5-
import globby from 'globby';
4+
import type { GlobOptions } from 'tinyglobby';
5+
import { globSync, glob as tinyglobby } from 'tinyglobby';
66
import unixify from 'unixify';
77
import { PathAliases, processImport } from '@graphql-tools/import';
88
import {
@@ -46,7 +46,7 @@ function isGraphQLImportFile(rawSDL: string) {
4646
return trimmedRawSDL.startsWith('# import') || trimmedRawSDL.startsWith('#import');
4747
}
4848

49-
function createGlobbyOptions(options: GraphQLFileLoaderOptions): GlobbyOptions {
49+
function createGlobbyOptions(options: GraphQLFileLoaderOptions): GlobOptions {
5050
return { absolute: true, ...options, ignore: [] };
5151
}
5252

@@ -124,7 +124,7 @@ export class GraphQLFileLoader implements Loader<GraphQLFileLoaderOptions> {
124124
)
125125
return [glob]; // bypass globby when no glob character, can be loaded, no ignores and source not requested. Fixes problem with pkg and passes ci tests
126126
const globs = this._buildGlobs(glob, options);
127-
const result = await globby(globs, createGlobbyOptions(options));
127+
const result = await tinyglobby(globs, createGlobbyOptions(options));
128128
return result;
129129
}
130130

@@ -137,7 +137,7 @@ export class GraphQLFileLoader implements Loader<GraphQLFileLoaderOptions> {
137137
)
138138
return [glob]; // bypass globby when no glob character, can be loaded, no ignores and source not requested. Fixes problem with pkg and passes ci tests
139139
const globs = this._buildGlobs(glob, options);
140-
const result = globby.sync(globs, createGlobbyOptions(options));
140+
const result = globSync(globs, createGlobbyOptions(options));
141141
return result;
142142
}
143143

packages/loaders/json-file/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
},
5353
"dependencies": {
5454
"@graphql-tools/utils": "^10.9.1",
55-
"globby": "^11.0.3",
55+
"tinyglobby": "^0.2.13",
5656
"tslib": "^2.4.0",
5757
"unixify": "^1.0.0"
5858
},

0 commit comments

Comments
 (0)