@graphql-tools/import 7.0.6 → 7.0.7
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/cjs/index.js +5 -6
- package/package.json +2 -2
package/cjs/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.processImport = processImport;
|
|
4
|
+
exports.extractDependencies = extractDependencies;
|
|
5
|
+
exports.processImports = processImports;
|
|
6
|
+
exports.extractImportLines = extractImportLines;
|
|
7
|
+
exports.parseImportLine = parseImportLine;
|
|
4
8
|
const tslib_1 = require("tslib");
|
|
5
9
|
const fs_1 = require("fs");
|
|
6
10
|
const path_1 = require("path");
|
|
@@ -49,7 +53,6 @@ function processImport(filePath, cwd = (0, process_1.cwd)(), predefinedImports =
|
|
|
49
53
|
definitions: [],
|
|
50
54
|
};
|
|
51
55
|
}
|
|
52
|
-
exports.processImport = processImport;
|
|
53
56
|
function visitFile(filePath, cwd, visitedFiles, predefinedImports) {
|
|
54
57
|
if (!(0, path_1.isAbsolute)(filePath) && !(filePath in predefinedImports)) {
|
|
55
58
|
filePath = resolveFilePath(cwd, filePath);
|
|
@@ -165,7 +168,6 @@ function extractDependencies(filePath, fileContents) {
|
|
|
165
168
|
dependenciesByDefinitionName,
|
|
166
169
|
};
|
|
167
170
|
}
|
|
168
|
-
exports.extractDependencies = extractDependencies;
|
|
169
171
|
function visitDefinition(definition, definitionsByName, dependenciesByDefinitionName) {
|
|
170
172
|
// TODO: handle queries without names
|
|
171
173
|
if ('name' in definition || definition.kind === graphql_1.Kind.SCHEMA_DEFINITION) {
|
|
@@ -331,7 +333,6 @@ function processImports(importLines, filePath, visitedFiles, predefinedImports)
|
|
|
331
333
|
}
|
|
332
334
|
return { allImportedDefinitionsMap, potentialTransitiveDefinitionsMap };
|
|
333
335
|
}
|
|
334
|
-
exports.processImports = processImports;
|
|
335
336
|
/**
|
|
336
337
|
* Splits the contents of a GraphQL file into lines that are imports
|
|
337
338
|
* and other lines which define the actual GraphQL document.
|
|
@@ -350,7 +351,6 @@ function extractImportLines(fileContent) {
|
|
|
350
351
|
}
|
|
351
352
|
return { importLines, otherLines };
|
|
352
353
|
}
|
|
353
|
-
exports.extractImportLines = extractImportLines;
|
|
354
354
|
/**
|
|
355
355
|
* Parses an import line, returning a list of entities imported and the file
|
|
356
356
|
* from which they are imported.
|
|
@@ -385,7 +385,6 @@ function parseImportLine(importLine) {
|
|
|
385
385
|
# import [Type].[Field] from [File]
|
|
386
386
|
`);
|
|
387
387
|
}
|
|
388
|
-
exports.parseImportLine = parseImportLine;
|
|
389
388
|
function resolveFilePath(filePath, importFrom) {
|
|
390
389
|
const dirName = (0, path_1.dirname)(filePath);
|
|
391
390
|
try {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/import",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.7",
|
|
4
4
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-tools/utils": "^10.6.
|
|
10
|
+
"@graphql-tools/utils": "^10.6.3",
|
|
11
11
|
"resolve-from": "5.0.0",
|
|
12
12
|
"tslib": "^2.4.0"
|
|
13
13
|
},
|