@graphql-inspector/config
Advanced tools
Comparing version 1.30.4 to 2.0.0-rc.0
@@ -30,17 +30,25 @@ 'use strict'; | ||
// Right now everything is hardcoded for better UX but this may change in future. | ||
const availableCommands = [ | ||
'coverage', | ||
'diff', | ||
'docs', | ||
'introspect', | ||
'serve', | ||
'similar', | ||
'validate', | ||
]; | ||
const availableLoaders = [ | ||
'code', | ||
'git', | ||
'github', | ||
'graphql', | ||
'json', | ||
'url', | ||
]; | ||
function useConfig() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return { | ||
use: { | ||
loaders: ensureList(discoverLoaders(['code', 'git', 'github', 'graphql', 'json', 'url']), 'loaders'), | ||
commands: ensureList(discoverCommands([ | ||
'coverage', | ||
'diff', | ||
'docs', | ||
'introspect', | ||
'serve', | ||
'similar', | ||
'validate', | ||
]), 'commands'), | ||
}, | ||
loaders: ensureList(discoverLoaders(availableLoaders), 'loaders'), | ||
commands: ensureList(discoverCommands(availableCommands), 'commands'), | ||
}; | ||
@@ -50,12 +58,8 @@ }); | ||
function moduleExists(name) { | ||
var _a; | ||
try { | ||
require(name); | ||
require.resolve(name); | ||
return true; | ||
} | ||
catch (error) { | ||
if ((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes(`Cannot find module '${name}'`)) { | ||
return false; | ||
} | ||
throw error; | ||
return false; | ||
} | ||
@@ -79,3 +83,5 @@ } | ||
exports.availableCommands = availableCommands; | ||
exports.availableLoaders = availableLoaders; | ||
exports.useConfig = useConfig; | ||
//# sourceMappingURL=index.cjs.js.map |
export interface InspectorConfig { | ||
use: { | ||
loaders: string[]; | ||
commands: string[]; | ||
}; | ||
loaders: string[]; | ||
commands: string[]; | ||
} | ||
export declare const availableCommands: string[]; | ||
export declare const availableLoaders: string[]; | ||
export declare function useConfig(): Promise<InspectorConfig | never>; |
@@ -26,17 +26,25 @@ /*! ***************************************************************************** | ||
// Right now everything is hardcoded for better UX but this may change in future. | ||
const availableCommands = [ | ||
'coverage', | ||
'diff', | ||
'docs', | ||
'introspect', | ||
'serve', | ||
'similar', | ||
'validate', | ||
]; | ||
const availableLoaders = [ | ||
'code', | ||
'git', | ||
'github', | ||
'graphql', | ||
'json', | ||
'url', | ||
]; | ||
function useConfig() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return { | ||
use: { | ||
loaders: ensureList(discoverLoaders(['code', 'git', 'github', 'graphql', 'json', 'url']), 'loaders'), | ||
commands: ensureList(discoverCommands([ | ||
'coverage', | ||
'diff', | ||
'docs', | ||
'introspect', | ||
'serve', | ||
'similar', | ||
'validate', | ||
]), 'commands'), | ||
}, | ||
loaders: ensureList(discoverLoaders(availableLoaders), 'loaders'), | ||
commands: ensureList(discoverCommands(availableCommands), 'commands'), | ||
}; | ||
@@ -46,12 +54,8 @@ }); | ||
function moduleExists(name) { | ||
var _a; | ||
try { | ||
require(name); | ||
require.resolve(name); | ||
return true; | ||
} | ||
catch (error) { | ||
if ((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes(`Cannot find module '${name}'`)) { | ||
return false; | ||
} | ||
throw error; | ||
return false; | ||
} | ||
@@ -75,3 +79,3 @@ } | ||
export { useConfig }; | ||
export { availableCommands, availableLoaders, useConfig }; | ||
//# sourceMappingURL=index.esm.js.map |
{ | ||
"name": "@graphql-inspector/config", | ||
"version": "1.30.4", | ||
"version": "2.0.0-rc.0", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "graphql": "^0.13.0 || ^14.0.0 || ^15.0.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
157
35680
2