@graphql-tools/git-loader 7.2.2-alpha-33fb2950.0 → 7.2.2-alpha-420b7771.0

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 CHANGED
@@ -7,7 +7,7 @@ const micromatch_1 = tslib_1.__importDefault(require("micromatch"));
7
7
  const unixify_1 = tslib_1.__importDefault(require("unixify"));
8
8
  const load_git_js_1 = require("./load-git.js");
9
9
  const parse_js_1 = require("./parse.js");
10
- const graphql_1 = require("@graphql-tools/graphql");
10
+ const graphql_1 = require("graphql");
11
11
  const utils_1 = require("@graphql-tools/utils");
12
12
  const is_glob_1 = tslib_1.__importDefault(require("is-glob"));
13
13
  const process_1 = require("process");
package/esm/index.js CHANGED
@@ -3,7 +3,7 @@ import micromatch from 'micromatch';
3
3
  import unixify from 'unixify';
4
4
  import { loadFromGit, loadFromGitSync, readTreeAtRef, readTreeAtRefSync } from './load-git.js';
5
5
  import { parse as handleStuff } from './parse.js';
6
- import { parse } from '@graphql-tools/graphql';
6
+ import { parse } from 'graphql';
7
7
  import { asArray, AggregateError } from '@graphql-tools/utils';
8
8
  import isGlob from 'is-glob';
9
9
  import { env } from 'process';
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@graphql-tools/git-loader",
3
- "version": "7.2.2-alpha-33fb2950.0",
3
+ "version": "7.2.2-alpha-420b7771.0",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
+ "peerDependencies": {
7
+ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
8
+ },
6
9
  "dependencies": {
7
- "@graphql-tools/graphql-tag-pluck": "7.3.2-alpha-33fb2950.0",
8
- "@graphql-tools/utils": "8.9.1-alpha-33fb2950.0",
9
- "@graphql-tools/graphql": "0.1.0-alpha-33fb2950.0",
10
+ "@graphql-tools/graphql-tag-pluck": "7.3.2-alpha-420b7771.0",
11
+ "@graphql-tools/utils": "8.9.1-alpha-420b7771.0",
10
12
  "is-glob": "4.0.3",
11
13
  "micromatch": "^4.0.4",
12
14
  "tslib": "^2.4.0",
@@ -29,7 +31,7 @@
29
31
  "exports": {
30
32
  ".": {
31
33
  "require": {
32
- "types": "./typings/index.d.ts",
34
+ "types": "./typings/index.d.cts",
33
35
  "default": "./cjs/index.js"
34
36
  },
35
37
  "import": {
@@ -43,7 +45,7 @@
43
45
  },
44
46
  "./*": {
45
47
  "require": {
46
- "types": "./typings/*.d.ts",
48
+ "types": "./typings/*.d.cts",
47
49
  "default": "./cjs/*.js"
48
50
  },
49
51
  "import": {
@@ -0,0 +1,30 @@
1
+ import { GraphQLTagPluckOptions } from '@graphql-tools/graphql-tag-pluck';
2
+ import { BaseLoaderOptions, Loader, Source } from '@graphql-tools/utils';
3
+ /**
4
+ * Additional options for loading from git
5
+ */
6
+ export declare type GitLoaderOptions = BaseLoaderOptions & {
7
+ /**
8
+ * Additional options to pass to `graphql-tag-pluck`
9
+ */
10
+ pluckConfig?: GraphQLTagPluckOptions;
11
+ };
12
+ /**
13
+ * This loader loads a file from git.
14
+ *
15
+ * ```js
16
+ * const typeDefs = await loadTypedefs('git:someBranch:some/path/to/file.js', {
17
+ * loaders: [new GitLoader()],
18
+ * })
19
+ * ```
20
+ */
21
+ export declare class GitLoader implements Loader<GitLoaderOptions> {
22
+ canLoad(pointer: string): Promise<boolean>;
23
+ canLoadSync(pointer: string): boolean;
24
+ resolveGlobs(glob: string, ignores: string[]): Promise<Array<string>>;
25
+ resolveGlobsSync(glob: string, ignores: string[]): string[];
26
+ private handleSingularPointerAsync;
27
+ load(pointer: string, options: GitLoaderOptions): Promise<Source[]>;
28
+ private handleSingularPointerSync;
29
+ loadSync(pointer: string, options: GitLoaderOptions): Source[];
30
+ }
@@ -0,0 +1,23 @@
1
+ declare type PartialInput = {
2
+ ref: string;
3
+ };
4
+ declare type Input = PartialInput & {
5
+ path: string;
6
+ };
7
+ /**
8
+ * @internal
9
+ */
10
+ export declare function readTreeAtRef(ref: string): Promise<string[] | never>;
11
+ /**
12
+ * @internal
13
+ */
14
+ export declare function readTreeAtRefSync(ref: string): string[] | never;
15
+ /**
16
+ * @internal
17
+ */
18
+ export declare function loadFromGit(input: Input): Promise<string | never>;
19
+ /**
20
+ * @internal
21
+ */
22
+ export declare function loadFromGitSync(input: Input): string | never;
23
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Source, GraphQLParseOptions } from '@graphql-tools/utils';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare function parse<T extends GraphQLParseOptions>({ path, pointer, content, options, }: {
6
+ path: string;
7
+ pointer: string;
8
+ content: string;
9
+ options: T;
10
+ }): Source | void;