@graphql-tools/graphql-file-loader 7.0.0-alpha-fa9b61b3.0 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es5/index.d.ts +1 -0
- package/es5/index.js +11 -7
- package/es5/index.mjs +11 -7
- package/es5/package.json +2 -2
- package/index.d.ts +1 -0
- package/index.js +10 -6
- package/index.mjs +10 -6
- package/package.json +2 -2
package/es5/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export interface GraphQLFileLoaderOptions extends BaseLoaderOptions {
|
|
|
34
34
|
export declare class GraphQLFileLoader implements Loader<GraphQLFileLoaderOptions> {
|
|
35
35
|
canLoad(pointer: string, options: GraphQLFileLoaderOptions): Promise<boolean>;
|
|
36
36
|
canLoadSync(pointer: string, options: GraphQLFileLoaderOptions): boolean;
|
|
37
|
+
private _buildGlobs;
|
|
37
38
|
resolveGlobs(glob: string, options: GraphQLFileLoaderOptions): Promise<string[]>;
|
|
38
39
|
resolveGlobsSync(glob: string, options: GraphQLFileLoaderOptions): string[];
|
|
39
40
|
load(pointer: string, options: GraphQLFileLoaderOptions): Promise<Source[]>;
|
package/es5/index.js
CHANGED
|
@@ -22,6 +22,7 @@ function isGraphQLImportFile(rawSDL) {
|
|
|
22
22
|
function createGlobbyOptions(options) {
|
|
23
23
|
return tslib.__assign(tslib.__assign({ absolute: true }, options), { ignore: [] });
|
|
24
24
|
}
|
|
25
|
+
var buildIgnoreGlob = function (path) { return "!" + path; };
|
|
25
26
|
/**
|
|
26
27
|
* This loader loads documents and type definitions from `.graphql` files.
|
|
27
28
|
*
|
|
@@ -81,15 +82,19 @@ var GraphQLFileLoader = /** @class */ (function () {
|
|
|
81
82
|
}
|
|
82
83
|
return false;
|
|
83
84
|
};
|
|
85
|
+
GraphQLFileLoader.prototype._buildGlobs = function (glob, options) {
|
|
86
|
+
var ignores = utils.asArray(options.ignore || []);
|
|
87
|
+
var globs = tslib.__spreadArray([unixify(glob)], tslib.__read(ignores.map(function (v) { return buildIgnoreGlob(unixify(v)); })));
|
|
88
|
+
return globs;
|
|
89
|
+
};
|
|
84
90
|
GraphQLFileLoader.prototype.resolveGlobs = function (glob, options) {
|
|
85
91
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
86
|
-
var
|
|
92
|
+
var globs, result;
|
|
87
93
|
return tslib.__generator(this, function (_a) {
|
|
88
94
|
switch (_a.label) {
|
|
89
95
|
case 0:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return [4 /*yield*/, globby(target, createGlobbyOptions(options))];
|
|
96
|
+
globs = this._buildGlobs(glob, options);
|
|
97
|
+
return [4 /*yield*/, globby(globs, createGlobbyOptions(options))];
|
|
93
98
|
case 1:
|
|
94
99
|
result = _a.sent();
|
|
95
100
|
return [2 /*return*/, result];
|
|
@@ -98,9 +103,8 @@ var GraphQLFileLoader = /** @class */ (function () {
|
|
|
98
103
|
});
|
|
99
104
|
};
|
|
100
105
|
GraphQLFileLoader.prototype.resolveGlobsSync = function (glob, options) {
|
|
101
|
-
var
|
|
102
|
-
var
|
|
103
|
-
var result = globby.sync(target, createGlobbyOptions(options));
|
|
106
|
+
var globs = this._buildGlobs(glob, options);
|
|
107
|
+
var result = globby.sync(globs, createGlobbyOptions(options));
|
|
104
108
|
return result;
|
|
105
109
|
};
|
|
106
110
|
GraphQLFileLoader.prototype.load = function (pointer, options) {
|
package/es5/index.mjs
CHANGED
|
@@ -16,6 +16,7 @@ function isGraphQLImportFile(rawSDL) {
|
|
|
16
16
|
function createGlobbyOptions(options) {
|
|
17
17
|
return __assign(__assign({ absolute: true }, options), { ignore: [] });
|
|
18
18
|
}
|
|
19
|
+
var buildIgnoreGlob = function (path) { return "!" + path; };
|
|
19
20
|
/**
|
|
20
21
|
* This loader loads documents and type definitions from `.graphql` files.
|
|
21
22
|
*
|
|
@@ -75,15 +76,19 @@ var GraphQLFileLoader = /** @class */ (function () {
|
|
|
75
76
|
}
|
|
76
77
|
return false;
|
|
77
78
|
};
|
|
79
|
+
GraphQLFileLoader.prototype._buildGlobs = function (glob, options) {
|
|
80
|
+
var ignores = asArray(options.ignore || []);
|
|
81
|
+
var globs = __spreadArray([unixify(glob)], __read(ignores.map(function (v) { return buildIgnoreGlob(unixify(v)); })));
|
|
82
|
+
return globs;
|
|
83
|
+
};
|
|
78
84
|
GraphQLFileLoader.prototype.resolveGlobs = function (glob, options) {
|
|
79
85
|
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
-
var
|
|
86
|
+
var globs, result;
|
|
81
87
|
return __generator(this, function (_a) {
|
|
82
88
|
switch (_a.label) {
|
|
83
89
|
case 0:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return [4 /*yield*/, globby(target, createGlobbyOptions(options))];
|
|
90
|
+
globs = this._buildGlobs(glob, options);
|
|
91
|
+
return [4 /*yield*/, globby(globs, createGlobbyOptions(options))];
|
|
87
92
|
case 1:
|
|
88
93
|
result = _a.sent();
|
|
89
94
|
return [2 /*return*/, result];
|
|
@@ -92,9 +97,8 @@ var GraphQLFileLoader = /** @class */ (function () {
|
|
|
92
97
|
});
|
|
93
98
|
};
|
|
94
99
|
GraphQLFileLoader.prototype.resolveGlobsSync = function (glob, options) {
|
|
95
|
-
var
|
|
96
|
-
var
|
|
97
|
-
var result = globby.sync(target, createGlobbyOptions(options));
|
|
100
|
+
var globs = this._buildGlobs(glob, options);
|
|
101
|
+
var result = globby.sync(globs, createGlobbyOptions(options));
|
|
98
102
|
return result;
|
|
99
103
|
};
|
|
100
104
|
GraphQLFileLoader.prototype.load = function (pointer, options) {
|
package/es5/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/graphql-file-loader/es5",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@graphql-tools/import": "^6.2.6",
|
|
11
|
-
"@graphql-tools/utils": "8.0.
|
|
11
|
+
"@graphql-tools/utils": "8.0.2",
|
|
12
12
|
"globby": "^11.0.3",
|
|
13
13
|
"is-glob": "^4.0.1",
|
|
14
14
|
"tslib": "~2.3.0",
|
package/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export interface GraphQLFileLoaderOptions extends BaseLoaderOptions {
|
|
|
34
34
|
export declare class GraphQLFileLoader implements Loader<GraphQLFileLoaderOptions> {
|
|
35
35
|
canLoad(pointer: string, options: GraphQLFileLoaderOptions): Promise<boolean>;
|
|
36
36
|
canLoadSync(pointer: string, options: GraphQLFileLoaderOptions): boolean;
|
|
37
|
+
private _buildGlobs;
|
|
37
38
|
resolveGlobs(glob: string, options: GraphQLFileLoaderOptions): Promise<string[]>;
|
|
38
39
|
resolveGlobsSync(glob: string, options: GraphQLFileLoaderOptions): string[];
|
|
39
40
|
load(pointer: string, options: GraphQLFileLoaderOptions): Promise<Source[]>;
|
package/index.js
CHANGED
|
@@ -21,6 +21,7 @@ function isGraphQLImportFile(rawSDL) {
|
|
|
21
21
|
function createGlobbyOptions(options) {
|
|
22
22
|
return { absolute: true, ...options, ignore: [] };
|
|
23
23
|
}
|
|
24
|
+
const buildIgnoreGlob = (path) => `!${path}`;
|
|
24
25
|
/**
|
|
25
26
|
* This loader loads documents and type definitions from `.graphql` files.
|
|
26
27
|
*
|
|
@@ -69,16 +70,19 @@ class GraphQLFileLoader {
|
|
|
69
70
|
}
|
|
70
71
|
return false;
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
+
_buildGlobs(glob, options) {
|
|
73
74
|
const ignores = utils.asArray(options.ignore || []);
|
|
74
|
-
const
|
|
75
|
-
|
|
75
|
+
const globs = [unixify(glob), ...ignores.map(v => buildIgnoreGlob(unixify(v)))];
|
|
76
|
+
return globs;
|
|
77
|
+
}
|
|
78
|
+
async resolveGlobs(glob, options) {
|
|
79
|
+
const globs = this._buildGlobs(glob, options);
|
|
80
|
+
const result = await globby(globs, createGlobbyOptions(options));
|
|
76
81
|
return result;
|
|
77
82
|
}
|
|
78
83
|
resolveGlobsSync(glob, options) {
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
const result = globby.sync(target, createGlobbyOptions(options));
|
|
84
|
+
const globs = this._buildGlobs(glob, options);
|
|
85
|
+
const result = globby.sync(globs, createGlobbyOptions(options));
|
|
82
86
|
return result;
|
|
83
87
|
}
|
|
84
88
|
async load(pointer, options) {
|
package/index.mjs
CHANGED
|
@@ -15,6 +15,7 @@ function isGraphQLImportFile(rawSDL) {
|
|
|
15
15
|
function createGlobbyOptions(options) {
|
|
16
16
|
return { absolute: true, ...options, ignore: [] };
|
|
17
17
|
}
|
|
18
|
+
const buildIgnoreGlob = (path) => `!${path}`;
|
|
18
19
|
/**
|
|
19
20
|
* This loader loads documents and type definitions from `.graphql` files.
|
|
20
21
|
*
|
|
@@ -63,16 +64,19 @@ class GraphQLFileLoader {
|
|
|
63
64
|
}
|
|
64
65
|
return false;
|
|
65
66
|
}
|
|
66
|
-
|
|
67
|
+
_buildGlobs(glob, options) {
|
|
67
68
|
const ignores = asArray(options.ignore || []);
|
|
68
|
-
const
|
|
69
|
-
|
|
69
|
+
const globs = [unixify(glob), ...ignores.map(v => buildIgnoreGlob(unixify(v)))];
|
|
70
|
+
return globs;
|
|
71
|
+
}
|
|
72
|
+
async resolveGlobs(glob, options) {
|
|
73
|
+
const globs = this._buildGlobs(glob, options);
|
|
74
|
+
const result = await globby(globs, createGlobbyOptions(options));
|
|
70
75
|
return result;
|
|
71
76
|
}
|
|
72
77
|
resolveGlobsSync(glob, options) {
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
const result = globby.sync(target, createGlobbyOptions(options));
|
|
78
|
+
const globs = this._buildGlobs(glob, options);
|
|
79
|
+
const result = globby.sync(globs, createGlobbyOptions(options));
|
|
76
80
|
return result;
|
|
77
81
|
}
|
|
78
82
|
async load(pointer, options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/graphql-file-loader",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@graphql-tools/import": "^6.2.6",
|
|
11
|
-
"@graphql-tools/utils": "8.0.
|
|
11
|
+
"@graphql-tools/utils": "8.0.2",
|
|
12
12
|
"globby": "^11.0.3",
|
|
13
13
|
"is-glob": "^4.0.1",
|
|
14
14
|
"tslib": "~2.3.0",
|