@graphql-tools/graphql-file-loader
Advanced tools
Comparing version 8.0.12-alpha-20250114135744-c6fae34620a5bfac6d31e5210fcdc9667cf4cac1 to 8.0.12-alpha-20250116122450-7e52267bb240c285f4942b856fa84aa701f76417
@@ -9,2 +9,3 @@ "use strict"; | ||
const globby_1 = tslib_1.__importDefault(require("globby")); | ||
const unixify_1 = tslib_1.__importDefault(require("unixify")); | ||
const import_1 = require("@graphql-tools/import"); | ||
@@ -14,2 +15,9 @@ const utils_1 = require("@graphql-tools/utils"); | ||
const FILE_EXTENSIONS = ['.gql', '.gqls', '.graphql', '.graphqls']; | ||
function unixifyWithDriverLetter(path) { | ||
if (path.match(/^[A-Z]:\\/)) { | ||
const driveLetter = path[0].toLowerCase(); | ||
return `${driveLetter}:${(0, unixify_1.default)(path)}`; | ||
} | ||
return (0, unixify_1.default)(path); | ||
} | ||
function isGraphQLImportFile(rawSDL) { | ||
@@ -77,3 +85,3 @@ const trimmedRawSDL = rawSDL.trim(); | ||
const ignores = (0, utils_1.asArray)(options.ignore || []); | ||
const globs = [glob, ...ignores.map(v => buildIgnoreGlob(v))]; | ||
const globs = [unixifyWithDriverLetter(glob), ...ignores.map(v => buildIgnoreGlob(unixifyWithDriverLetter(v)))]; | ||
return globs; | ||
@@ -80,0 +88,0 @@ } |
@@ -5,2 +5,3 @@ import { existsSync, promises as fsPromises, readFileSync } from 'fs'; | ||
import globby from 'globby'; | ||
import unixify from 'unixify'; | ||
import { processImport } from '@graphql-tools/import'; | ||
@@ -10,2 +11,9 @@ import { asArray, isValidPath, parseGraphQLSDL, } from '@graphql-tools/utils'; | ||
const FILE_EXTENSIONS = ['.gql', '.gqls', '.graphql', '.graphqls']; | ||
function unixifyWithDriverLetter(path) { | ||
if (path.match(/^[A-Z]:\\/)) { | ||
const driveLetter = path[0].toLowerCase(); | ||
return `${driveLetter}:${unixify(path)}`; | ||
} | ||
return unixify(path); | ||
} | ||
function isGraphQLImportFile(rawSDL) { | ||
@@ -73,3 +81,3 @@ const trimmedRawSDL = rawSDL.trim(); | ||
const ignores = asArray(options.ignore || []); | ||
const globs = [glob, ...ignores.map(v => buildIgnoreGlob(v))]; | ||
const globs = [unixifyWithDriverLetter(glob), ...ignores.map(v => buildIgnoreGlob(unixifyWithDriverLetter(v)))]; | ||
return globs; | ||
@@ -76,0 +84,0 @@ } |
{ | ||
"name": "@graphql-tools/graphql-file-loader", | ||
"version": "8.0.12-alpha-20250114135744-c6fae34620a5bfac6d31e5210fcdc9667cf4cac1", | ||
"version": "8.0.12-alpha-20250116122450-7e52267bb240c285f4942b856fa84aa701f76417", | ||
"description": "A set of utils for faster development of GraphQL tools", | ||
@@ -13,3 +13,4 @@ "sideEffects": false, | ||
"globby": "^11.0.3", | ||
"tslib": "^2.4.0" | ||
"tslib": "^2.4.0", | ||
"unixify": "^1.0.0" | ||
}, | ||
@@ -16,0 +17,0 @@ "repository": { |
18155
391
6
+ Addedunixify@^1.0.0
+ Addednormalize-path@2.1.1(transitive)
+ Addedremove-trailing-separator@1.1.0(transitive)
+ Addedunixify@1.0.0(transitive)