@eddeee888/gcg-typescript-resolver-files 0.0.1 → 0.0.3
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/CHANGELOG.md +13 -0
- package/README.md +10 -10
- package/package.json +2 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +3 -4
- package/src/index.js.map +1 -1
- package/src/preset.d.ts +11 -0
- package/src/preset.js +76 -0
- package/src/preset.js.map +1 -0
- package/src/run/addExternalResolverImport.d.ts +7 -0
- package/src/run/addExternalResolverImport.js +99 -0
- package/src/run/addExternalResolverImport.js.map +1 -0
- package/src/run/addResolversMainFile.d.ts +2 -8
- package/src/run/addResolversMainFile.js +77 -20
- package/src/run/addResolversMainFile.js.map +1 -1
- package/src/run/fixExistingResolvers.d.ts +2 -2
- package/src/run/fixExistingResolvers.js +5 -5
- package/src/run/fixExistingResolvers.js.map +1 -1
- package/src/run/handleGraphQLObjectType.d.ts +1 -2
- package/src/run/handleGraphQLObjectType.js +10 -15
- package/src/run/handleGraphQLObjectType.js.map +1 -1
- package/src/run/handleGraphQLRootObjectTypeField.d.ts +2 -0
- package/src/run/handleGraphQLRootObjectTypeField.js +25 -0
- package/src/run/handleGraphQLRootObjectTypeField.js.map +1 -0
- package/src/run/handleGraphQLScalarType.d.ts +2 -0
- package/src/run/handleGraphQLScalarType.js +26 -0
- package/src/run/handleGraphQLScalarType.js.map +1 -0
- package/src/run/handleGraphQLUninionType.d.ts +1 -2
- package/src/run/handleGraphQLUninionType.js +10 -14
- package/src/run/handleGraphQLUninionType.js.map +1 -1
- package/src/run/run.d.ts +2 -2
- package/src/run/run.js +43 -29
- package/src/run/run.js.map +1 -1
- package/src/run/visitNamedType.d.ts +15 -0
- package/src/run/visitNamedType.js +102 -0
- package/src/run/visitNamedType.js.map +1 -0
- package/src/types.d.ts +43 -16
- package/src/utils.d.ts +3 -2
- package/src/utils.js +34 -12
- package/src/utils.js.map +1 -1
- package/src/plugin.d.ts +0 -18
- package/src/plugin.js +0 -64
- package/src/plugin.js.map +0 -1
- package/src/run/handleGraphQLRootObjectType.d.ts +0 -3
- package/src/run/handleGraphQLRootObjectType.js +0 -44
- package/src/run/handleGraphQLRootObjectType.js.map +0 -1
- package/src/run/parseLocation.d.ts +0 -7
- package/src/run/parseLocation.js +0 -37
- package/src/run/parseLocation.js.map +0 -1
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Location } from 'graphql';
|
|
2
|
-
import { RunConfig } from '../types';
|
|
3
|
-
export declare const parseLocation: ({ mode, sourcesMap, whitelistedModules, baseOutputDir, relativeTargetDir, }: RunConfig, location?: Location) => {
|
|
4
|
-
location: Location;
|
|
5
|
-
isInWhitelistedModule: boolean;
|
|
6
|
-
pathToLocation: string;
|
|
7
|
-
};
|
package/src/run/parseLocation.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseLocation = void 0;
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const parseLocation = ({ mode, sourcesMap, whitelistedModules, baseOutputDir, relativeTargetDir, }, location) => {
|
|
6
|
-
if (!location) {
|
|
7
|
-
throw new Error('Location is invalid');
|
|
8
|
-
}
|
|
9
|
-
// If mode is "merged", there's only one module:
|
|
10
|
-
// - always generate a.k.a it's always whitelisted
|
|
11
|
-
// - put them together at degsinated relativeTargetDir
|
|
12
|
-
if (mode === 'merged') {
|
|
13
|
-
return {
|
|
14
|
-
location,
|
|
15
|
-
isInWhitelistedModule: true,
|
|
16
|
-
pathToLocation: path.join(baseOutputDir, relativeTargetDir),
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
// 2. mode is "modules", each module is the folder containing the schema files
|
|
20
|
-
// This means one or multiple schema files can add up to one module
|
|
21
|
-
const sourceFilename = location.source.name;
|
|
22
|
-
const sourceFile = sourcesMap[sourceFilename];
|
|
23
|
-
if (!sourceFile) {
|
|
24
|
-
throw new Error(`Unable to find ${sourceFilename} in sourcesMap`);
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
location,
|
|
28
|
-
isInWhitelistedModule:
|
|
29
|
-
// whitelistedModules is empty a.k.a. all are whitelisted
|
|
30
|
-
whitelistedModules.length === 0
|
|
31
|
-
? true
|
|
32
|
-
: whitelistedModules.includes(sourceFile.moduleName),
|
|
33
|
-
pathToLocation: path.join(baseOutputDir, sourceFile.moduleName, relativeTargetDir),
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
exports.parseLocation = parseLocation;
|
|
37
|
-
//# sourceMappingURL=parseLocation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseLocation.js","sourceRoot":"","sources":["../../../../../packages/typescript-resolver-files/src/run/parseLocation.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAItB,MAAM,aAAa,GAAG,CAC3B,EACE,IAAI,EACJ,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,iBAAiB,GACP,EACZ,QAAmB,EAKnB,EAAE;IACF,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;KACxC;IAED,gDAAgD;IAChD,qDAAqD;IACrD,wDAAwD;IACxD,IAAI,IAAI,KAAK,QAAQ,EAAE;QACrB,OAAO;YACL,QAAQ;YACR,qBAAqB,EAAE,IAAI;YAC3B,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,iBAAiB,CAAC;SAC5D,CAAC;KACH;IAED,8EAA8E;IAC9E,mEAAmE;IACnE,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;IAC5C,MAAM,UAAU,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC9C,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,kBAAkB,cAAc,gBAAgB,CAAC,CAAC;KACnE;IAED,OAAO;QACL,QAAQ;QACR,qBAAqB;QACnB,yDAAyD;QACzD,kBAAkB,CAAC,MAAM,KAAK,CAAC;YAC7B,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC;QACxD,cAAc,EAAE,IAAI,CAAC,IAAI,CACvB,aAAa,EACb,UAAU,CAAC,UAAU,EACrB,iBAAiB,CAClB;KACF,CAAC;AACJ,CAAC,CAAC;AAlDW,QAAA,aAAa,iBAkDxB"}
|