Skip to content

Commit 0e6f094

Browse files
authored
fix: Adding Node 6 support
Adding Node 6 support.
2 parents aee9e3d + 9b94a47 commit 0e6f094

4 files changed

Lines changed: 16 additions & 3466 deletions

File tree

package.json

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"name": "graphql-config",
33
"version": "0.0.0-semantic-release",
44
"description": "The easiest way to configure your development environment with your GraphQL schema (supported by most tools, editors & IDEs)",
5+
"engines": {
6+
"node": ">= 6.0.0"
7+
},
58
"main": "lib/index.js",
69
"types": "lib/index.d.ts",
710
"files": [
@@ -17,19 +20,6 @@
1720
"test-only": "npm run build && npm run copy-test-assets && ava --verbose lib/__tests__/**/*.js --serial",
1821
"test": "tslint src/**/*.ts && npm run test-only"
1922
},
20-
"ava": {
21-
"babel": "inherit",
22-
"require": [
23-
"babel-register",
24-
"babel-polyfill"
25-
]
26-
},
27-
"babel": {
28-
"presets": [
29-
"es2015",
30-
"stage-0"
31-
]
32-
},
3323
"repository": {
3424
"type": "git",
3525
"url": "https://github.com/graphcool/graphql-config.git"
@@ -51,9 +41,6 @@
5141
"@types/node": "8.5.7",
5242
"@types/node-fetch": "1.6.7",
5343
"ava": "0.24.0",
54-
"babel-polyfill": "6.26.0",
55-
"babel-preset-es2015": "6.24.1",
56-
"babel-preset-stage-0": "6.24.1",
5744
"cpx": "1.5.0",
5845
"rimraf": "2.6.2",
5946
"tslint": "5.8.0",
@@ -65,6 +52,7 @@
6552
"graphql-import": "^0.4.0",
6653
"graphql-request": "^1.4.0",
6754
"js-yaml": "^3.10.0",
55+
"lodash": "^4.17.4",
6856
"minimatch": "^3.0.4"
6957
}
7058
}

src/GraphQLConfig.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { resolve, dirname } from 'path'
22
import { validateConfig, writeConfig } from './utils'
3+
import { values } from 'lodash'
34

45
import {
56
GraphQLConfigData,
@@ -36,7 +37,7 @@ export class GraphQLConfig {
3637
return config.includesFile(filePath) ? config : undefined
3738
}
3839

39-
return Object.values(this.getProjects()).find(
40+
return values(this.getProjects()).find(
4041
project => project.includesFile(filePath)
4142
) || undefined
4243
}

src/__tests__/basic/getGraphQLConfig.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava'
2-
import { join } from 'path'
2+
import { join, resolve } from 'path'
33
import { printSchema } from 'graphql'
44
const schema = require('../schema.json')
55
import { getGraphQLConfig, GraphQLConfig } from '../../'
@@ -17,6 +17,15 @@ test('returns a correct name', t => {
1717
t.deepEqual(testWithSchemaConfig.projectName, 'testWithSchema')
1818
})
1919

20+
test('returns config for file', t => {
21+
const testWithSchemaConfig = config.getConfigForFile(resolve('./config/schema-a.graphql'))
22+
if (testWithSchemaConfig) {
23+
t.deepEqual(testWithSchemaConfig.projectName, 'testWithSchema')
24+
} else {
25+
t.fail()
26+
}
27+
})
28+
2029
test('returns a correct root dir', t => {
2130
t.deepEqual(config.configDir, CONFIG_DIR)
2231
})

0 commit comments

Comments
 (0)