graphql-config
Advanced tools
Comparing version 1.0.0-rc.2 to 1.0.0-rc.3
@@ -0,1 +1,3 @@ | ||
export declare const GRAPHQL_CONFIG_NAME = ".graphqlconfig"; | ||
export declare const GRAPHQL_CONFIG_YAML_NAME = ".graphqlconfig.yaml"; | ||
export declare function findGraphQLConfigFile(filePath: string): string; |
@@ -6,4 +6,4 @@ "use strict"; | ||
var errors_1 = require("./errors"); | ||
var GRAPHQL_CONFIG_NAME = '.graphqlconfig'; | ||
var GRAPHQL_CONFIG_YAML_NAME = '.graphqlconfig.yaml'; | ||
exports.GRAPHQL_CONFIG_NAME = '.graphqlconfig'; | ||
exports.GRAPHQL_CONFIG_YAML_NAME = '.graphqlconfig.yaml'; | ||
function isRootDir(path) { | ||
@@ -14,4 +14,4 @@ return path_1.dirname(path) === path; | ||
filePath = path_1.resolve(filePath); | ||
if (filePath.endsWith(GRAPHQL_CONFIG_NAME) || | ||
filePath.endsWith(GRAPHQL_CONFIG_YAML_NAME)) { | ||
if (filePath.endsWith(exports.GRAPHQL_CONFIG_NAME) || | ||
filePath.endsWith(exports.GRAPHQL_CONFIG_YAML_NAME)) { | ||
return filePath; | ||
@@ -21,3 +21,3 @@ } | ||
while (!isRootDir(currentDir)) { | ||
var configPath = path_1.join(currentDir, GRAPHQL_CONFIG_NAME); | ||
var configPath = path_1.join(currentDir, exports.GRAPHQL_CONFIG_NAME); | ||
if (fs_1.existsSync(configPath)) { | ||
@@ -31,5 +31,5 @@ return configPath; | ||
} | ||
throw new errors_1.ConfigNotFoundError("'" + GRAPHQL_CONFIG_NAME + " file is not available in the provided config " + | ||
throw new errors_1.ConfigNotFoundError("'" + exports.GRAPHQL_CONFIG_NAME + " file is not available in the provided config " + | ||
("directory: " + filePath + "\nPlease check the config directory path and try again.")); | ||
} | ||
exports.findGraphQLConfigFile = findGraphQLConfigFile; |
@@ -6,4 +6,4 @@ import { GraphQLConfigData } from './types'; | ||
configPath: string; | ||
configDir: string; | ||
constructor(config: GraphQLConfigData, configPath: string); | ||
readonly configDir: string; | ||
getProjectConfig(projectName?: string): GraphQLProjectConfig; | ||
@@ -10,0 +10,0 @@ getConfigForFile(filePath: string): GraphQLProjectConfig | null; |
@@ -11,4 +11,10 @@ "use strict"; | ||
this.configPath = configPath; | ||
this.configDir = path_1.dirname(configPath); | ||
} | ||
Object.defineProperty(GraphQLConfig.prototype, "configDir", { | ||
get: function () { | ||
return path_1.dirname(this.configPath); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
GraphQLConfig.prototype.getProjectConfig = function (projectName) { | ||
@@ -15,0 +21,0 @@ return new GraphQLProjectConfig_1.GraphQLProjectConfig(this.config, this.configPath, projectName); |
@@ -8,3 +8,2 @@ import { GraphQLSchema } from 'graphql'; | ||
projectName?: string; | ||
configDir: string; | ||
constructor(config: GraphQLConfigData, configPath: string, projectName?: string); | ||
@@ -16,2 +15,3 @@ resolveConfigPath(relativePath: string): string; | ||
getSchemaSDL(): string; | ||
readonly configDir: string; | ||
readonly schemaPath: string | null; | ||
@@ -18,0 +18,0 @@ readonly include: string[]; |
@@ -59,3 +59,2 @@ "use strict"; | ||
this.configPath = configPath; | ||
this.configDir = path_1.dirname(configPath); | ||
this.projectName = projectName; | ||
@@ -90,5 +89,12 @@ } | ||
}; | ||
Object.defineProperty(GraphQLProjectConfig.prototype, "schemaPath", { | ||
Object.defineProperty(GraphQLProjectConfig.prototype, "configDir", { | ||
// Getters | ||
get: function () { | ||
return path_1.dirname(this.configPath); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(GraphQLProjectConfig.prototype, "schemaPath", { | ||
get: function () { | ||
return this.config.schemaPath ? this.resolveConfigPath(this.config.schemaPath) : null; | ||
@@ -95,0 +101,0 @@ }, |
export { getGraphQLConfig, getGraphQLProjectConfig } from './getGraphQLConfig'; | ||
export { findGraphQLConfigFile } from './findGraphQLConfigFile'; | ||
export { GRAPHQL_CONFIG_NAME, GRAPHQL_CONFIG_YAML_NAME, findGraphQLConfigFile } from './findGraphQLConfigFile'; | ||
export { writeSchema, validateConfig } from './utils'; | ||
@@ -4,0 +4,0 @@ export * from './errors'; |
@@ -10,2 +10,4 @@ "use strict"; | ||
var findGraphQLConfigFile_1 = require("./findGraphQLConfigFile"); | ||
exports.GRAPHQL_CONFIG_NAME = findGraphQLConfigFile_1.GRAPHQL_CONFIG_NAME; | ||
exports.GRAPHQL_CONFIG_YAML_NAME = findGraphQLConfigFile_1.GRAPHQL_CONFIG_YAML_NAME; | ||
exports.findGraphQLConfigFile = findGraphQLConfigFile_1.findGraphQLConfigFile; | ||
@@ -12,0 +14,0 @@ var utils_1 = require("./utils"); |
{ | ||
"name": "graphql-config", | ||
"version": "1.0.0-rc.2", | ||
"version": "1.0.0-rc.3", | ||
"description": "The easiest way to configure your development environment with your GraphQL schema (supported by most tools, editors & IDEs)", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
62768
1210
2